Code cleanup. Removed some dead code from throughout.

This commit is contained in:
John Tramm 2020-01-08 22:55:30 +00:00
parent 5e640f79ab
commit b41f3aadb4
3 changed files with 1 additions and 50 deletions

View file

@ -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

View file

@ -20,10 +20,6 @@
#include "openmc/timer.h"
#include "openmc/tallies/tally.h"
#ifdef _OPENMP
#include <omp.h>
#endif
#include <algorithm> // for min
#include <array>
#include <cmath> // 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;

View file

@ -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;