git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8361 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2012-06-20 19:20:12 +00:00
parent 4baf5cec99
commit b247eeb103

View File

@ -634,12 +634,12 @@ void PRD::share_event(int ireplica, int flag)
} }
if (flag == 0) fix_event->event_number--; if (flag == 0) fix_event->event_number--;
// dump snapshot of quenched coords // dump snapshot of quenched coords, only on replica 0
// must reneighbor and compute forces before dumping // must reneighbor and compute forces before dumping
// since replica 0 possibly has new state from another replica // since replica 0 possibly has new state from another replica
// addstep_compute_all insures eng/virial are calculated if needed // addstep_compute_all insures eng/virial are calculated if needed
if (output->ndump && universe->iworld == 0) { if (output->ndump && universe->iworld) {
timer->barrier_start(TIME_LOOP); timer->barrier_start(TIME_LOOP);
modify->addstep_compute_all(update->ntimestep); modify->addstep_compute_all(update->ntimestep);
update->integrate->setup_minimal(1); update->integrate->setup_minimal(1);
@ -690,9 +690,7 @@ void PRD::log_event()
communicate atom coords and image flags in ireplica to all other replicas communicate atom coords and image flags in ireplica to all other replicas
one proc per replica: one proc per replica:
direct overwrite via bcast direct overwrite via bcast
equal procs per replica and no replica reneighbored: else atoms could be stored in different order or on different procs:
direct overwrite via bcast
unequal procs per replica or reneighboring occurred:
collect to root proc of event replica collect to root proc of event replica
bcast to roots of other replicas bcast to roots of other replicas
bcast within each replica bcast within each replica
@ -705,19 +703,13 @@ void PRD::replicate(int ireplica)
int nprocs_universe = universe->nprocs; int nprocs_universe = universe->nprocs;
int i,m,flag,commflag; int i,m,flag,commflag;
int *counts = new int[nprocs]; if (nreplica == nprocs_universe) {
if (nreplica == nprocs_universe) commflag = 0;
else if (equal_size_replicas) {
flag = 0;
if (quench_reneighbor) flag = 1;
MPI_Allreduce(&flag,&commflag,1,MPI_INT,MPI_MAX,universe->uworld);
} else commflag = 1;
if (commflag == 0) {
MPI_Bcast(atom->image,atom->nlocal,MPI_INT,ireplica,comm_replica); MPI_Bcast(atom->image,atom->nlocal,MPI_INT,ireplica,comm_replica);
MPI_Bcast(atom->x[0],3*atom->nlocal,MPI_DOUBLE,ireplica,comm_replica); MPI_Bcast(atom->x[0],3*atom->nlocal,MPI_DOUBLE,ireplica,comm_replica);
} else { } else {
int *counts = new int[nprocs];
if (universe->iworld == ireplica) { if (universe->iworld == ireplica) {
MPI_Gather(&atom->nlocal,1,MPI_INT,counts,1,MPI_INT,0,world); MPI_Gather(&atom->nlocal,1,MPI_INT,counts,1,MPI_INT,0,world);
displacements[0] = 0; displacements[0] = 0;
@ -756,9 +748,9 @@ void PRD::replicate(int ireplica)
atom->image[m] = imageall[i]; atom->image[m] = imageall[i];
} }
} }
}
delete [] counts; delete [] counts;
}
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------