From b41f3aadb4a3825ca7a575173bb39ce3d8093df4 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Wed, 8 Jan 2020 22:55:30 +0000 Subject: [PATCH] Code cleanup. Removed some dead code from throughout. --- include/openmc/eigenvalue.h | 8 -------- src/eigenvalue.cpp | 40 ------------------------------------- src/simulation.cpp | 3 +-- 3 files changed, 1 insertion(+), 50 deletions(-) diff --git a/include/openmc/eigenvalue.h b/include/openmc/eigenvalue.h index d29f404b9..0e2d2401d 100644 --- a/include/openmc/eigenvalue.h +++ b/include/openmc/eigenvalue.h @@ -42,14 +42,6 @@ void calculate_generation_keff(); //! generations. It also broadcasts the value from the master process. void calculate_average_keff(); -#ifdef _OPENMP -//! Join threadprivate fission banks into a single fission bank -//! -//! Note that this operation is necessarily sequential to preserve the order of -//! the bank when using varying numbers of threads. -void join_bank_from_threads(); -#endif - //! Calculates a minimum variance estimate of k-effective //! //! The minimum variance estimate is based on a linear combination of the diff --git a/src/eigenvalue.cpp b/src/eigenvalue.cpp index 32fd56fff..d958b33b8 100644 --- a/src/eigenvalue.cpp +++ b/src/eigenvalue.cpp @@ -20,10 +20,6 @@ #include "openmc/timer.h" #include "openmc/tallies/tally.h" -#ifdef _OPENMP -#include -#endif - #include // for min #include #include // for sqrt, abs, pow @@ -351,42 +347,6 @@ void calculate_average_keff() } } -/* -#ifdef _OPENMP -void join_bank_from_threads() -{ - int n_threads = omp_get_max_threads(); - - #pragma omp parallel - { - // Copy thread fission bank sites to one shared copy - #pragma omp for ordered schedule(static) - for (int i = 0; i < n_threads; ++i) { - #pragma omp ordered - { - std::copy( - simulation::fission_bank.cbegin(), - simulation::fission_bank.cend(), - std::back_inserter(simulation::master_fission_bank) - ); - } - } - - // Make sure all threads have made it to this point - #pragma omp barrier - - // Now copy the shared fission bank sites back to the master thread's copy. - if (omp_get_thread_num() == 0) { - simulation::fission_bank = simulation::master_fission_bank; - simulation::master_fission_bank.clear(); - } else { - simulation::fission_bank.clear(); - } - } -} -#endif -*/ - int openmc_get_keff(double* k_combined) { k_combined[0] = 0.0; diff --git a/src/simulation.cpp b/src/simulation.cpp index 6fc57f257..c750ed153 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -405,7 +405,6 @@ namespace simulation { int current_batch; int current_gen; -//int64_t current_work; bool initialized {false}; double keff {1.0}; double keff_std; @@ -574,7 +573,7 @@ void finalize_generation() global_tally_leakage = 0.0; if (settings::run_mode == RUN_MODE_EIGENVALUE) { - // We need to move all the stuff from the shared_fission_bank into the real one. + // Copy shared fission bank into regular bank for use in MPI synchronization for( int i = 0; i < simulation::shared_fission_bank_length; i++ ) simulation::fission_bank.push_back(simulation::shared_fission_bank[i]); simulation::shared_fission_bank_length = 0;