Moved current_work variable to particle object, and removed threadprivate tag from tally_derivs

This commit is contained in:
John Tramm 2019-12-11 21:58:19 +00:00
parent 70c9b7dd51
commit 1bb03f004a
9 changed files with 11 additions and 34 deletions

View file

@ -22,13 +22,6 @@ namespace simulation {
extern std::vector<Particle::Bank> source_bank;
extern std::vector<Particle::Bank> fission_bank;
//extern std::vector<Particle::Bank> secondary_bank;
#ifdef _OPENMP
extern std::vector<Particle::Bank> master_fission_bank;
#endif
//#pragma omp threadprivate(fission_bank, secondary_bank)
#pragma omp threadprivate(fission_bank)
} // namespace simulation

View file

@ -311,6 +311,8 @@ public:
// Secondary bank
std::vector<Particle::Bank> secondary_bank_;
int64_t current_work_; // current work index
};
} // namespace openmc

View file

@ -28,7 +28,6 @@ namespace simulation {
extern "C" int current_batch; //!< current batch
extern "C" int current_gen; //!< current fission generation
extern "C" int64_t current_work; //!< index in source back of current particle
extern "C" bool initialized; //!< has simulation been initialized?
extern "C" double keff; //!< average k over batches
extern "C" double keff_std; //!< standard deviation of average k
@ -53,7 +52,7 @@ extern std::vector<int64_t> work_index;
// Threadprivate variables
extern "C" bool trace; //!< flag to show debug information
#pragma omp threadprivate(current_work, trace)
#pragma omp threadprivate(trace)
} // namespace simulation

View file

@ -65,13 +65,13 @@ void zero_flux_derivs();
// Explicit vector template specialization declaration of threadprivate variable
// outside of the openmc namespace for the picky Intel compiler.
extern template class std::vector<openmc::TallyDerivative>;
//extern template class std::vector<openmc::TallyDerivative>;
namespace openmc {
namespace model {
extern std::vector<TallyDerivative> tally_derivs;
#pragma omp threadprivate(tally_derivs)
//#pragma omp threadprivate(tally_derivs)
extern std::unordered_map<int, int> tally_deriv_map;
} // namespace model