From 9f018b9aa23889f2e5c22fcb36e4a902316318e7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 15 Jan 2020 17:40:51 -0500 Subject: [PATCH 01/18] make list of fixes have a multiple of 6 number of entries --- doc/src/Commands_fix.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 2a9350640a..335fa38d64 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -239,3 +239,8 @@ OPT. * :doc:`wall/region ` * :doc:`wall/region/ees ` * :doc:`wall/srd ` + * + * + * + * + * From cf80495a3d420e00d1b26ee72ca73c0251848e49 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jan 2020 12:15:42 -0500 Subject: [PATCH 02/18] change estimate for time to create an atom from 25ns to 1us --- src/create_atoms.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index c7df5ac264..85883a4e37 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -777,8 +777,8 @@ void CreateAtoms::add_lattice() const double * const * const basis = domain->lattice->basis; // rough estimate of total time used for create atoms. - // one inner loop takes about 25ns on a typical desktop CPU core in 2019 - double testimate = 2.5e-8/3600.0; // convert seconds to hours + // one inner loop iteration takes about 1us on a typical desktop CPU core in 2020 + double testimate = 1.0e-6/3600.0; // convert seconds to hours testimate *= static_cast(khi-klo+1); testimate *= static_cast(jhi-jlo+1); testimate *= static_cast(ihi-ilo+1); From 93a6d3a1fc09fab46914aa533af7dcbee5847ebc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jan 2020 16:35:05 -0500 Subject: [PATCH 03/18] print warning (once) if EAM embedding data is out of sync, error out, if embedding term is not available at all. --- src/MANYBODY/pair_eam.cpp | 11 +++++++++++ src/MANYBODY/pair_eam.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 5459a92b69..9afbe68332 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -27,6 +27,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" +#include "update.h" #include "utils.h" using namespace LAMMPS_NS; @@ -39,6 +40,7 @@ PairEAM::PairEAM(LAMMPS *lmp) : Pair(lmp) { restartinfo = 0; manybody_flag = 1; + embedstep = -1; nmax = 0; rho = NULL; @@ -246,6 +248,7 @@ void PairEAM::compute(int eflag, int vflag) // communicate derivative of embedding function comm->forward_comm_pair(this); + embedstep = update->ntimestep; // compute forces on each atom // loop over neighbors of my atoms @@ -808,6 +811,14 @@ double PairEAM::single(int i, int j, int itype, int jtype, double r,p,rhoip,rhojp,z2,z2p,recip,phi,phip,psip; double *coeff; + if (!numforce) + error->all(FLERR,"EAM embedding data required for this calculation is missing"); + + if ((comm->me == 0) && (embedstep != update->ntimestep)) { + error->warning(FLERR,"EAM embedding data not computed for this time step "); + embedstep = update->ntimestep; + } + if (numforce[i] > 0) { p = rho[i]*rdrho + 1.0; m = static_cast (p); diff --git a/src/MANYBODY/pair_eam.h b/src/MANYBODY/pair_eam.h index add33ab3f0..d98dba1e66 100644 --- a/src/MANYBODY/pair_eam.h +++ b/src/MANYBODY/pair_eam.h @@ -66,6 +66,7 @@ class PairEAM : public Pair { int nmax; // allocated size of per-atom arrays double cutforcesq; double **scale; + bigint embedstep; // timestep, the embedding term was computed // per-atom arrays From 070bb8c5cd4bae80638057c09c17032fa5392130 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jan 2020 16:46:37 -0500 Subject: [PATCH 04/18] change estimate for creating atoms after benchmarking a 440M atom system --- src/create_atoms.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 85883a4e37..868345e149 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -777,8 +777,9 @@ void CreateAtoms::add_lattice() const double * const * const basis = domain->lattice->basis; // rough estimate of total time used for create atoms. - // one inner loop iteration takes about 1us on a typical desktop CPU core in 2020 - double testimate = 1.0e-6/3600.0; // convert seconds to hours + // for a large number of atoms, one inner loop iteration + // takes about 25us on a typical desktop CPU core in 2020. + double testimate = 2.5e-5/3600.0; // convert seconds to hours testimate *= static_cast(khi-klo+1); testimate *= static_cast(jhi-jlo+1); testimate *= static_cast(ihi-ilo+1); From 79f9ede38ae91566a2d34c69757757abc56b426e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jan 2020 16:51:32 -0500 Subject: [PATCH 05/18] print warning when using pair_write on EAM pair style --- src/pair.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pair.cpp b/src/pair.cpp index 0cedc18620..7d34e4fd3f 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1664,6 +1664,8 @@ void Pair::write_file(int narg, char **arg) Pair *epair = force->pair_match("^eam",0); if (epair) epair->swap_eam(eamfp,&eamfp_hold); + if ((comm->me == 0) && (epair)) + error->warning(FLERR,"EAM pair style. Table will not include embedding term"); // if atom style defines charge, swap in dummy q vec From dd60bddc3385833386efcc9da61b276f451a772f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jan 2020 17:05:01 -0500 Subject: [PATCH 06/18] reset embedding step counter when init_style() is called --- src/GPU/pair_eam_alloy_gpu.cpp | 2 ++ src/GPU/pair_eam_fs_gpu.cpp | 2 ++ src/GPU/pair_eam_gpu.cpp | 2 ++ src/MANYBODY/pair_eam.cpp | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index e7503839f6..8fa6e64c36 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -189,6 +189,8 @@ void PairEAMAlloyGPU::init_style() fp_single = false; else fp_single = true; + + embedstep = -1; } /* ---------------------------------------------------------------------- */ diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index 6edfa69359..b04ec6d445 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -188,6 +188,8 @@ void PairEAMFSGPU::init_style() fp_single = false; else fp_single = true; + + embedstep = -1; } /* ---------------------------------------------------------------------- */ diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index fb851770f9..e1068677ff 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -191,6 +191,8 @@ void PairEAMGPU::init_style() fp_single = false; else fp_single = true; + + embedstep = -1; } /* ---------------------------------------------------------------------- */ diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 9afbe68332..d1b864d9e4 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -426,6 +426,7 @@ void PairEAM::init_style() array2spline(); neighbor->request(this,instance_me); + embedstep = -1; } /* ---------------------------------------------------------------------- @@ -927,6 +928,9 @@ void PairEAM::swap_eam(double *fp_caller, double **fp_caller_hold) double *tmp = fp; fp = fp_caller; *fp_caller_hold = tmp; + + // skip warning about out-of-sync timestep, since we already warn in the caller + embedstep = update->ntimestep; } /* ---------------------------------------------------------------------- */ From a53202bad2277ae4a02ec9a7c16fa9a9a342b419 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jan 2020 17:23:57 -0500 Subject: [PATCH 07/18] removing the time estimate code for create_atoms completely, as we'll have linear scaling soon. --- src/create_atoms.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 868345e149..64c791ea22 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -776,24 +776,6 @@ void CreateAtoms::add_lattice() const double * const * const basis = domain->lattice->basis; - // rough estimate of total time used for create atoms. - // for a large number of atoms, one inner loop iteration - // takes about 25us on a typical desktop CPU core in 2020. - double testimate = 2.5e-5/3600.0; // convert seconds to hours - testimate *= static_cast(khi-klo+1); - testimate *= static_cast(jhi-jlo+1); - testimate *= static_cast(ihi-ilo+1); - testimate *= static_cast(nbasis); - double maxestimate = 0.0; - MPI_Reduce(&testimate,&maxestimate,1,MPI_DOUBLE,MPI_MAX,0,world); - - if ((comm->me == 0) && (maxestimate > 0.01)) { - if (screen) fprintf(screen,"WARNING: create_atoms will take " - "approx. %.2f hours to complete\n",maxestimate); - if (logfile) fprintf(logfile,"WARNING: create_atoms will take " - "approx. %.2f hours to complete\n",maxestimate); - } - int i,j,k,m; for (k = klo; k <= khi; k++) { for (j = jlo; j <= jhi; j++) { From 33c846cd5e10db650547f3d597788426a5d228c8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jan 2020 09:48:07 -0500 Subject: [PATCH 08/18] guard converting thermo output from other output to the screen and do not crash fixes #1844 --- python/lammps.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/python/lammps.py b/python/lammps.py index e8fc240c75..2e597f9e18 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -1029,10 +1029,19 @@ def get_thermo_data(output): r = {'thermo' : thermo_data } runs.append(namedtuple('Run', list(r.keys()))(*list(r.values()))) elif in_run and len(columns) > 0: - values = [float(x) for x in line.split()] + items = line.split() + # Convert thermo output and store it. + # It must have the same number of columns and + # all of them must be convertable to floats. + # Otherwise we ignore the line + if len(items) == len(columns): + try: + values = [float(x) for x in items] + for i, col in enumerate(columns): + current_run[col].append(values[i]) + except ValueError: + pass - for i, col in enumerate(columns): - current_run[col].append(values[i]) return runs class PyLammps(object): From 998b60eabc5835cbdef032ba1f7c5f1188db8a3d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jan 2020 12:17:47 -0500 Subject: [PATCH 09/18] restore accidentally renamed keyword --- src/RIGID/fix_rigid.cpp | 2 +- src/RIGID/fix_rigid_small.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 101b94c2a4..9f6a1e5d46 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -541,7 +541,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : p_chain = force->inumeric(FLERR,arg[iarg+1]); iarg += 2; - } else if (strcmp(arg[iarg],"inpfile") == 0) { + } else if (strcmp(arg[iarg],"infile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command"); delete [] inpfile; int n = strlen(arg[iarg+1]) + 1; diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 33105418ff..0b2c2d967f 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -216,7 +216,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (seed <= 0) error->all(FLERR,"Illegal fix rigid/small command"); iarg += 5; - } else if (strcmp(arg[iarg],"inpfile") == 0) { + } else if (strcmp(arg[iarg],"infile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); delete [] inpfile; int n = strlen(arg[iarg+1]) + 1; From 0471d211a2463116c5fa070db0c9155bb2aa4d2e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 19 Jan 2020 13:33:16 -0500 Subject: [PATCH 10/18] remove dead code and silence compiler warnings --- src/USER-MISC/pair_mesocnt.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/USER-MISC/pair_mesocnt.cpp b/src/USER-MISC/pair_mesocnt.cpp index 5f47089d92..b073705dda 100644 --- a/src/USER-MISC/pair_mesocnt.cpp +++ b/src/USER-MISC/pair_mesocnt.cpp @@ -16,12 +16,14 @@ pak37@cam.ac.uk ------------------------------------------------------------------------- */ +#include "pair_mesocnt.h" + #include #include #include #include #include -#include "pair_mesocnt.h" + #include "atom.h" #include "comm.h" #include "force.h" @@ -125,11 +127,7 @@ void PairMesoCNT::compute(int eflag, int vflag) double **x = atom->x; double **f = atom->f; int **bondlist = neighbor->bondlist; - tagint *tag = atom->tag; - tagint *mol = atom->molecule; - int nlocal = atom->nlocal; int nbondlist = neighbor->nbondlist; - int newton_pair = force->newton_pair; // update bond neighbor list when necessary @@ -435,7 +433,7 @@ void PairMesoCNT::allocate() global settings ------------------------------------------------------------------------- */ -void PairMesoCNT::settings(int narg, char **arg) +void PairMesoCNT::settings(int narg, char ** /* arg */) { if (narg != 0) error->all(FLERR,"Illegal pair_style command"); } @@ -519,7 +517,7 @@ void PairMesoCNT::init_style() init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ -double PairMesoCNT::init_one(int i, int j) +double PairMesoCNT::init_one(int /* i */, int /* j */) { return cutoff; } @@ -730,7 +728,7 @@ void PairMesoCNT::sort(int *list, int size) { int i,j,temp1,temp2; tagint *tag = atom->tag; - for (int i = 1; i < size; i++) { + for (i = 1; i < size; i++) { j = i; temp1 = list[j-1]; temp2 = list[j]; @@ -1373,10 +1371,6 @@ double PairMesoCNT::dxspline(double x, double y, double xbar = x - xlo; double ybar = y - ylo; - double y0 = coeff[i][j][0][0] - + ybar*(coeff[i][j][0][1] - + ybar*(coeff[i][j][0][2] - + ybar*(coeff[i][j][0][3]))); double y1 = coeff[i][j][1][0] + ybar*(coeff[i][j][1][1] + ybar*(coeff[i][j][1][2] From 926096dc66755c7f1b16ae476d98eccca6a04fb0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 07:06:00 -0500 Subject: [PATCH 11/18] silence compiler warning --- src/fix_gravity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index d130717470..25435174d2 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -62,7 +62,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : mstyle = CONSTANT; } - int iarg; + int iarg=4; if (strcmp(arg[4],"chute") == 0) { if (narg < 6) error->all(FLERR,"Illegal fix gravity command"); From c19085dc0813667d20866a91add663fddc9d6a9c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 07:06:49 -0500 Subject: [PATCH 12/18] silence compiler warning --- src/fix_wall_reflect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index b17b68cd8d..032a11e328 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -213,7 +213,7 @@ void FixWallReflect::post_integrate() this method may be overwritten by a child class ------------------------------------------------------------------------- */ -void FixWallReflect::wall_particle(int m, int which, double coord) +void FixWallReflect::wall_particle(int /* m */, int which, double coord) { int i,dim,side; From 3ff49dfd59a97d06940b9fbe719d77415d070a27 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 07:12:12 -0500 Subject: [PATCH 13/18] avoid segfault when using per-particle masses --- src/USER-MISC/fix_wall_reflect_stochastic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index dc58580d80..18b501c2fc 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -198,9 +198,9 @@ FixWallReflectStochastic::~FixWallReflectStochastic() void FixWallReflectStochastic::wall_particle(int m, int which, double coord) { int i, dir, dim, side, sign; - double vsave,factor,timecol,difftest,theta; + double factor,timecol,difftest,theta; - double *rmass; + double *rmass atom->rmass; double *mass = atom->mass; // coord = current position of wall From 019e269ed915122fb0833afa7da731d133adec29 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 07:12:22 -0500 Subject: [PATCH 14/18] silence compiler warning --- src/USER-MISC/pair_e3b.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index aa19849baa..ae324e0a4a 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -539,7 +539,7 @@ void PairE3B::presetParam(const int flag,bool &repeatFlag,double &bondL) { bondL!=0.0 || rs!=0.0 || rc3!=0.0 || rc2!=0.0 ) error->all(FLERR,"Preset keyword will overwrite another keyword setting"); - double econv,lconv; + double econv=1.0,lconv=1.0; if (strcmp(update->unit_style,"real") == 0) { econv=1.0/4.184; lconv=1.0; From 0bed34807329660796439ee4e17dee8e67fb9216 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 07:17:39 -0500 Subject: [PATCH 15/18] fix typo --- src/USER-MISC/fix_wall_reflect_stochastic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index 18b501c2fc..bb6ffd7698 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -200,7 +200,7 @@ void FixWallReflectStochastic::wall_particle(int m, int which, double coord) int i, dir, dim, side, sign; double factor,timecol,difftest,theta; - double *rmass atom->rmass; + double *rmass = atom->rmass; double *mass = atom->mass; // coord = current position of wall From 946bd8f3c086378f168c2dd0807fe89bdd13b3c1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 16:23:26 -0500 Subject: [PATCH 16/18] print warning about adjusting the communication cutoff only during integrator or minimizer setup phase --- src/comm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/comm.cpp b/src/comm.cpp index 8c443f493d..f5b1c0246b 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -34,6 +34,7 @@ #include "accelerator_kokkos.h" #include "memory.h" #include "error.h" +#include "update.h" #ifdef _OPENMP #include @@ -688,7 +689,7 @@ double Comm::get_comm_cutoff() // print warning if neighborlist cutoff overrides user cutoff - if (me == 0) { + if ((me == 0) && (update->setupflag == 1)) { if ((cutghostuser > 0.0) && (maxcommcutoff > cutghostuser)) { char mesg[128]; snprintf(mesg,128,"Communication cutoff adjusted to %g",maxcommcutoff); From 3db920b8a67ac82eb28a04573af806b91ec45e70 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jan 2020 17:03:25 -0500 Subject: [PATCH 17/18] fix minor issues with docs --- doc/src/Commands_fix.rst | 1 - doc/src/pair_lj.rst | 2 +- doc/src/read_dump.rst | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index a5d9b344a3..c1c97b6e59 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -244,4 +244,3 @@ OPT. * * * - * diff --git a/doc/src/pair_lj.rst b/doc/src/pair_lj.rst index 3daba7e173..cfc56ecb5e 100644 --- a/doc/src/pair_lj.rst +++ b/doc/src/pair_lj.rst @@ -97,7 +97,7 @@ pair\_style lj/cut/tip4p/long command ===================================== pair\_style lj/cut/tip4p/long/gpu command -======================================== +========================================= pair\_style lj/cut/tip4p/long/omp command ========================================= diff --git a/doc/src/read_dump.rst b/doc/src/read_dump.rst index 66b3052bee..de81a98276 100644 --- a/doc/src/read_dump.rst +++ b/doc/src/read_dump.rst @@ -144,7 +144,7 @@ i.e. the current directory. The *adios* format supports reading data that was written by the :doc:`dump adios ` command. The entire dump is read in parallel across all the processes, dividing -the atoms evenly amongs the processes. The number of writers that +the atoms evenly among the processes. The number of writers that has written the dump file does not matter. Using the adios style for dump and read_dump is a convenient way to dump all atoms from *N* writers and read it back by *M* readers. If one is running two From 405eb63a5133b8772927a207b108100083ac638d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 21 Jan 2020 11:39:29 -0500 Subject: [PATCH 18/18] update sphinx extension to automatically pad lists to fill tables and avoid errors processing the documentation --- doc/src/Commands_all.rst | 12 +++++------- doc/src/Commands_bond.rst | 5 ----- doc/src/Commands_compute.rst | 4 +--- doc/src/Commands_fix.rst | 4 ---- doc/src/Commands_kspace.rst | 1 - doc/src/Commands_pair.rst | 1 - doc/src/_ext/table_from_list.py | 8 ++++++-- 7 files changed, 12 insertions(+), 23 deletions(-) diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index 1576b23714..6e87ffbad6 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -132,10 +132,8 @@ An alphabetic list of all general LAMMPS commands. * :doc:`units ` * :doc:`variable ` * :doc:`velocity ` - * :doc:`write\_coeff ` - * :doc:`write\_data ` - * :doc:`write\_dump ` - * :doc:`write\_restart ` - * - * - * + * :doc:`write_coeff ` + * :doc:`write_data ` + * :doc:`write_dump ` + * :doc:`write_restart ` + diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index 27ff2d19da..5412675ee4 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -47,7 +47,6 @@ OPT. * :doc:`oxrna2/fene ` * :doc:`quartic (o) ` * :doc:`table (o) ` - * .. _angle: @@ -89,7 +88,6 @@ OPT. * :doc:`quartic (o) ` * :doc:`sdk (o) ` * :doc:`table (o) ` - * .. _dihedral: @@ -127,8 +125,6 @@ OPT. * :doc:`spherical ` * :doc:`table (o) ` * :doc:`table/cut ` - * - * .. _improper: @@ -162,4 +158,3 @@ OPT. * :doc:`ring (o) ` * :doc:`sqdistharm ` * :doc:`umbrella (o) ` - * diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index 01943ac803..79f0e8d83f 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -163,6 +163,4 @@ KOKKOS, o = USER-OMP, t = OPT. * :doc:`vcm/chunk ` * :doc:`voronoi/atom ` * :doc:`xrd ` - * - * - * + diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index c1c97b6e59..0b6b892b9d 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -240,7 +240,3 @@ OPT. * :doc:`wall/region ` * :doc:`wall/region/ees ` * :doc:`wall/srd ` - * - * - * - * diff --git a/doc/src/Commands_kspace.rst b/doc/src/Commands_kspace.rst index 3a23520171..be953c5277 100644 --- a/doc/src/Commands_kspace.rst +++ b/doc/src/Commands_kspace.rst @@ -37,4 +37,3 @@ OPT. * :doc:`pppm/stagger ` * :doc:`pppm/tip4p (o) ` * :doc:`scafacos ` - * diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 1d4f832015..28f50bfd8e 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -257,4 +257,3 @@ OPT. * :doc:`yukawa (gko) ` * :doc:`yukawa/colloid (go) ` * :doc:`zbl (gko) ` - * diff --git a/doc/src/_ext/table_from_list.py b/doc/src/_ext/table_from_list.py index 715a3c2488..da82069d87 100644 --- a/doc/src/_ext/table_from_list.py +++ b/doc/src/_ext/table_from_list.py @@ -1,6 +1,6 @@ from docutils import nodes from sphinx.util.docutils import SphinxDirective -from docutils.nodes import Element, Node +from docutils.nodes import Element, Node, list_item from typing import Any, Dict, List from sphinx import addnodes from sphinx.util import logging @@ -26,8 +26,12 @@ class TableFromList(SphinxDirective): raise SphinxError('table_from_list content is not a list') fulllist = node.children[0] + # fill list with empty items to have a number of entries + # that is divisible by ncolumns if (len(fulllist) % ncolumns) != 0: - raise SphinxError('number of list elements not a multiple of column number') + missing = int(ncolumns - (len(fulllist) % ncolumns)) + for i in range(0,missing): + fulllist += list_item() table = nodes.table() tgroup = nodes.tgroup(cols=ncolumns)