From 0bb2e004abdc1cf2d0ee651fea559bf2d9af1d6d Mon Sep 17 00:00:00 2001 From: julient31 Date: Mon, 29 Apr 2019 08:08:56 -0600 Subject: [PATCH] Commit JT 042919 - corrections Axel 1 --- src/SPIN/fix_neb_spin.cpp | 18 ++++++++++++------ src/SPIN/neb_spin.cpp | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 2a368d5dc9..a8cb0cd2ca 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -708,27 +708,33 @@ void FixNEBSpin::inter_replica_comm() // direct comm of x -> xprev and x -> xnext 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(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(sp[0],3*nlocal,MPI_DOUBLE,procnext,0,uworld); + } 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(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(sp[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld); + } 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(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(fm[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld); + } if (ireplica < nreplica-1) MPI_Wait(&request,MPI_STATUS_IGNORE); return; diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 366af20e3f..126cfb09e3 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -618,10 +618,12 @@ int NEBSpin::initial_rotation(double *spi, double *sploc, double fraction) kx = 0.0; ky = spiz; kz = -spiy; + knormsq = ky*ky + kz*kz; } else if (spix*spix + spiz*spiz != 0.0) { // spin not along [010] kx = -spiz; ky = 0.0; kz = spix; + knormsq = kx*kx + kz*kz; } else error->all(FLERR,"Incorrect initial rotation operation"); rot_flag = 1; }