From 65aa4f9de41e3d26ed0327d5fedd50d3ee4f4792 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 29 Feb 2012 21:12:02 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7866 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/REPLICA/verlet_split.cpp | 29 +++++++++++++++++++++++++++++ src/REPLICA/verlet_split.h | 2 ++ src/fix_temp_rescale.cpp | 3 ++- src/replicate.cpp | 11 +++++++---- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index fe8ad48e27..d1f6eaef04 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -222,6 +222,32 @@ void VerletSplit::init() Verlet::init(); } +/* ---------------------------------------------------------------------- + setup before run + servant partition only sets up KSpace calculation +------------------------------------------------------------------------- */ + +void VerletSplit::setup() +{ + if (comm->me == 0 && screen) fprintf(screen,"Setting up run ...\n"); + + if (!master) force->kspace->setup(); + else Verlet::setup(); +} + +/* ---------------------------------------------------------------------- + setup without output + flag = 0 = just force calculation + flag = 1 = reneighbor and force calculation + servant partition only sets up KSpace calculation +------------------------------------------------------------------------- */ + +void VerletSplit::setup_minimal(int flag) +{ + if (!master) force->kspace->setup(); + else Verlet::setup_minimal(flag); +} + /* ---------------------------------------------------------------------- run for N steps master partition does everything but Kspace @@ -419,8 +445,11 @@ void VerletSplit::rk_setup() // KSpace procs need to acquire ghost atoms and map all their atoms // map_clear() call is in lieu of comm->exchange() which performs map_clear // borders() call acquires ghost atoms and maps them + // NOTE: don't atom coords need to be communicated here before borders() ?? + // could do this by calling r2k_comm() here and not again from run() if (tip4p_flag) { + //r2k_comm(); MPI_Gatherv(atom->type,n,MPI_INT,atom->type,qsize,qdisp,MPI_INT,0,block); MPI_Gatherv(atom->tag,n,MPI_INT,atom->tag,qsize,qdisp,MPI_INT,0,block); if (!master) { diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h index 2ad59a4d4d..2819bac619 100644 --- a/src/REPLICA/verlet_split.h +++ b/src/REPLICA/verlet_split.h @@ -29,6 +29,8 @@ class VerletSplit : public Verlet { VerletSplit(class LAMMPS *, int, char **); ~VerletSplit(); void init(); + void setup(); + void setup_minimal(int); void run(int); bigint memory_usage(); diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 0eb2a965d6..42b716fb18 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -169,7 +169,8 @@ int FixTempRescale::modify_param(int narg, char **arg) strcpy(id_temp,arg[1]); int icompute = modify->find_compute(id_temp); - if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID"); + if (icompute < 0) + error->all(FLERR,"Could not find fix_modify temperature ID"); temperature = modify->compute[icompute]; if (temperature->tempflag == 0) diff --git a/src/replicate.cpp b/src/replicate.cpp index 036c7ca101..d430be744d 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -57,13 +57,16 @@ void Replicate::command(int narg, char **arg) // error and warning checks - if (nx <= 0 || ny <= 0 || nz <= 0) error->all(FLERR,"Illegal replicate command"); + if (nx <= 0 || ny <= 0 || nz <= 0) + error->all(FLERR,"Illegal replicate command"); if (domain->dimension == 2 && nz != 1) error->all(FLERR,"Cannot replicate 2d simulation in z dimension"); if ((nx > 1 && domain->xperiodic == 0) || (ny > 1 && domain->yperiodic == 0) || - (nz > 1 && domain->zperiodic == 0)) - error->warning(FLERR,"Replicating in a non-periodic dimension"); + (nz > 1 && domain->zperiodic == 0)) { + if (comm->me == 0) + error->warning(FLERR,"Replicating in a non-periodic dimension"); + } if (atom->nextra_grow || atom->nextra_restart || atom->nextra_store) error->all(FLERR,"Cannot replicate with fixes that store atom quantities"); @@ -340,7 +343,7 @@ void Replicate::command(int narg, char **arg) } } } - } // end of proc loop + } // free communication buffer and old atom class