Fixed Bug in splitting up the number of calculations on each CPUs leading to deadlock.
This commit is contained in:
@@ -115,13 +115,13 @@ void Simulation::create_out_dir(std::string dirname) {
|
||||
|
||||
void Simulation::doit() {
|
||||
long int decays_this_cpu = numberTotalDecays/mpi_size;
|
||||
int overflow = numberTotalDecays/mpi_size;
|
||||
if (overflow < mpi_rank) { // Split overflows equaly to left over CPUs.
|
||||
decays_this_cpu += 1;
|
||||
}
|
||||
int num_cycles = decays_this_cpu/simulationStepWidth;
|
||||
int overflow = numberTotalDecays%mpi_size;
|
||||
|
||||
int num_cycles = decays_this_cpu/simulationStepWidth; // Must be same for all CPUs else deadlock!
|
||||
int num_remaining = decays_this_cpu%simulationStepWidth;
|
||||
|
||||
if (mpi_rank < overflow) { // Split overflows equaly to left over CPUs.
|
||||
num_remaining += 1;
|
||||
}
|
||||
std::cout <<mpi_rank<<": "<<decays_this_cpu<<"\n";
|
||||
for (int i = 0; i<(num_cycles-1); i++) {
|
||||
do_decays(simulationStepWidth);
|
||||
|
||||
Reference in New Issue
Block a user