Merge pull request #1113 from paulromano/timer-bugfix

Assortment of small bug fixes
This commit is contained in:
Sterling Harper 2018-11-05 12:37:32 -05:00 committed by GitHub
commit 008c8f80d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 69 additions and 65 deletions

View file

@ -13,19 +13,6 @@
namespace openmc {
//==============================================================================
// Global variables
//==============================================================================
extern "C" int32_t n_filters;
class FilterMatch;
extern std::vector<FilterMatch> filter_matches;
#pragma omp threadprivate(filter_matches)
class Filter;
extern std::vector<std::unique_ptr<Filter>> tally_filters;
//==============================================================================
//! Stores bins and weights for filtered tally events.
//==============================================================================
@ -37,6 +24,15 @@ public:
std::vector<double> weights_;
};
} // namespace openmc
// Without an explicit instantiation of vector<FilterMatch>, the Intel compiler
// will complain about the threadprivate directive on filter_matches. Note that
// this has to happen *outside* of the openmc namespace
template class std::vector<openmc::FilterMatch>;
namespace openmc {
//==============================================================================
//! Modifies tally score events.
//==============================================================================
@ -77,6 +73,17 @@ public:
int n_bins_;
};
//==============================================================================
// Global variables
//==============================================================================
extern "C" int32_t n_filters;
extern std::vector<FilterMatch> filter_matches;
#pragma omp threadprivate(filter_matches)
extern std::vector<std::unique_ptr<Filter>> tally_filters;
//==============================================================================
extern "C" void free_memory_tally_c();

View file

@ -31,7 +31,7 @@ public:
private:
bool running_ {false}; //!< is timer running?
std::chrono::time_point<clock> start_; //!< starting point for clock
double elapsed_; //!< elasped time in [s]
double elapsed_ {0.0}; //!< elasped time in [s]
};
//==============================================================================