bug fix for unbalanced cpu loads
This commit is contained in:
@@ -98,7 +98,25 @@ void Simulation::start() {
|
|||||||
int leftover_events = events_this_cpu;
|
int leftover_events = events_this_cpu;
|
||||||
|
|
||||||
int num_cpu_syncs = 0;
|
int num_cpu_syncs = 0;
|
||||||
while (leftover_events > 0) {
|
|
||||||
|
bool empty_loop = false;
|
||||||
|
if(total_simulated_events % MpiCommunication::mpiSize() != 0) {
|
||||||
|
if((events_this_cpu % event_stride == 0) &&
|
||||||
|
(total_simulated_events % MpiCommunication::mpiSize()
|
||||||
|
<= MpiCommunication::mpiRank())) {
|
||||||
|
DEBUG_LEVEL_3("empty loop");
|
||||||
|
empty_loop = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (leftover_events > 0 || empty_loop) {
|
||||||
|
// special case of unbalanced cpu load, with a part of the cpus having one cycle
|
||||||
|
// that has no events, while the rest of the cpus have a single event (questionable if needed)
|
||||||
|
if(leftover_events == 0 && empty_loop) {
|
||||||
|
DEBUG_LEVEL_3("empty loop looped");
|
||||||
|
empty_loop = false;
|
||||||
|
}
|
||||||
|
|
||||||
int events_of_cylcle = eventsOfCycle(event_stride, leftover_events);
|
int events_of_cylcle = eventsOfCycle(event_stride, leftover_events);
|
||||||
SIM_INFO("Leftover events on first cpu: " +
|
SIM_INFO("Leftover events on first cpu: " +
|
||||||
std::to_string(leftover_events));
|
std::to_string(leftover_events));
|
||||||
|
|||||||
Reference in New Issue
Block a user