Commit JT 042919

- corrections Axel 1
This commit is contained in:
julient31 2019-04-29 08:08:56 -06:00
parent 0fac0e18d1
commit 0bb2e004ab
2 changed files with 14 additions and 6 deletions

View File

@ -708,27 +708,33 @@ void FixNEBSpin::inter_replica_comm()
// direct comm of x -> xprev and x -> xnext // direct comm of x -> xprev and x -> xnext
if (cmode == SINGLE_PROC_DIRECT) { if (cmode == SINGLE_PROC_DIRECT) {
if (ireplica > 0) if (ireplica > 0) {
MPI_Irecv(xprev[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld,&request); MPI_Irecv(xprev[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld,&request);
MPI_Irecv(spprev[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld,&request); MPI_Irecv(spprev[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld,&request);
if (ireplica < nreplica-1) }
if (ireplica < nreplica-1) {
MPI_Send(x[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld); MPI_Send(x[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld);
MPI_Send(sp[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld); MPI_Send(sp[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld);
}
if (ireplica > 0) MPI_Wait(&request,MPI_STATUS_IGNORE); if (ireplica > 0) MPI_Wait(&request,MPI_STATUS_IGNORE);
if (ireplica < nreplica-1) if (ireplica < nreplica-1) {
MPI_Irecv(xnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request); MPI_Irecv(xnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request);
MPI_Irecv(spnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request); MPI_Irecv(spnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request);
if (ireplica > 0) }
if (ireplica > 0) {
MPI_Send(x[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld); MPI_Send(x[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld);
MPI_Send(sp[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld); MPI_Send(sp[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld);
}
if (ireplica < nreplica-1) MPI_Wait(&request,MPI_STATUS_IGNORE); if (ireplica < nreplica-1) MPI_Wait(&request,MPI_STATUS_IGNORE);
if (ireplica < nreplica-1) if (ireplica < nreplica-1) {
MPI_Irecv(fnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request); MPI_Irecv(fnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request);
MPI_Irecv(fmnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request); MPI_Irecv(fmnext[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld,&request);
if (ireplica > 0) }
if (ireplica > 0) {
MPI_Send(f[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld); MPI_Send(f[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld);
MPI_Send(fm[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld); MPI_Send(fm[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld);
}
if (ireplica < nreplica-1) MPI_Wait(&request,MPI_STATUS_IGNORE); if (ireplica < nreplica-1) MPI_Wait(&request,MPI_STATUS_IGNORE);
return; return;

View File

@ -618,10 +618,12 @@ int NEBSpin::initial_rotation(double *spi, double *sploc, double fraction)
kx = 0.0; kx = 0.0;
ky = spiz; ky = spiz;
kz = -spiy; kz = -spiy;
knormsq = ky*ky + kz*kz;
} else if (spix*spix + spiz*spiz != 0.0) { // spin not along [010] } else if (spix*spix + spiz*spiz != 0.0) { // spin not along [010]
kx = -spiz; kx = -spiz;
ky = 0.0; ky = 0.0;
kz = spix; kz = spix;
knormsq = kx*kx + kz*kz;
} else error->all(FLERR,"Incorrect initial rotation operation"); } else error->all(FLERR,"Incorrect initial rotation operation");
rot_flag = 1; rot_flag = 1;
} }