must use the "roots" communicator only on world->me == 0
Thanks to @joshuakempfert. See issue #4210
This commit is contained in:
@ -200,7 +200,7 @@ void NEB::run()
|
|||||||
if (me == 0)
|
if (me == 0)
|
||||||
color = 0;
|
color = 0;
|
||||||
else
|
else
|
||||||
color = 1;
|
color = MPI_UNDEFINED;
|
||||||
MPI_Comm_split(uworld, color, 0, &roots);
|
MPI_Comm_split(uworld, color, 0, &roots);
|
||||||
|
|
||||||
auto fixes = modify->get_fix_by_style("^neb$");
|
auto fixes = modify->get_fix_by_style("^neb$");
|
||||||
@ -610,17 +610,20 @@ void NEB::open(char *file)
|
|||||||
void NEB::print_status()
|
void NEB::print_status()
|
||||||
{
|
{
|
||||||
double fnorm2 = sqrt(update->minimize->fnorm_sqr());
|
double fnorm2 = sqrt(update->minimize->fnorm_sqr());
|
||||||
double fmaxreplica;
|
|
||||||
MPI_Allreduce(&fnorm2, &fmaxreplica, 1, MPI_DOUBLE, MPI_MAX, roots);
|
|
||||||
double fnorminf = update->minimize->fnorm_inf();
|
double fnorminf = update->minimize->fnorm_inf();
|
||||||
double fmaxatom;
|
double fmaxreplica = 0.0;
|
||||||
MPI_Allreduce(&fnorminf, &fmaxatom, 1, MPI_DOUBLE, MPI_MAX, roots);
|
double fmaxatom = 0.0;
|
||||||
|
|
||||||
if (print_mode == VERBOSE) {
|
if (me == 0) {
|
||||||
freplica = new double[nreplica];
|
MPI_Allreduce(&fnorm2, &fmaxreplica, 1, MPI_DOUBLE, MPI_MAX, roots);
|
||||||
MPI_Allgather(&fnorm2, 1, MPI_DOUBLE, &freplica[0], 1, MPI_DOUBLE, roots);
|
MPI_Allreduce(&fnorminf, &fmaxatom, 1, MPI_DOUBLE, MPI_MAX, roots);
|
||||||
fmaxatomInRepl = new double[nreplica];
|
|
||||||
MPI_Allgather(&fnorminf, 1, MPI_DOUBLE, &fmaxatomInRepl[0], 1, MPI_DOUBLE, roots);
|
if (print_mode == VERBOSE) {
|
||||||
|
freplica = new double[nreplica];
|
||||||
|
MPI_Allgather(&fnorm2, 1, MPI_DOUBLE, &freplica[0], 1, MPI_DOUBLE, roots);
|
||||||
|
fmaxatomInRepl = new double[nreplica];
|
||||||
|
MPI_Allgather(&fnorminf, 1, MPI_DOUBLE, &fmaxatomInRepl[0], 1, MPI_DOUBLE, roots);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double one[7];
|
double one[7];
|
||||||
@ -705,7 +708,7 @@ void NEB::print_status()
|
|||||||
fflush(universe->ulogfile);
|
fflush(universe->ulogfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (print_mode == VERBOSE) {
|
if ((me == 0) && (print_mode == VERBOSE)) {
|
||||||
delete[] freplica;
|
delete[] freplica;
|
||||||
delete[] fmaxatomInRepl;
|
delete[] fmaxatomInRepl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user