Merge pull request #2637 from akohlmey/collected-small-changes

Collected small changes and fixes
This commit is contained in:
Axel Kohlmeyer
2021-03-05 13:22:18 -05:00
committed by GitHub
19 changed files with 2292 additions and 2277 deletions

View File

@ -26,7 +26,14 @@ find_package(Git)
# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed # by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "default install path" FORCE ) set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE)
endif()
# If enabled, no need to use LD_LIBRARY_PATH / DYLD_LIBRARY_PATH when installed
option(LAMMPS_INSTALL_RPATH "Set runtime path for shared libraries linked to LAMMPS binaries" OFF)
if (LAMMPS_INSTALL_RPATH)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
endif() endif()
# Cmake modules/macros are in a subdirectory to keep this file cleaner # Cmake modules/macros are in a subdirectory to keep this file cleaner

View File

@ -526,6 +526,20 @@ you want to copy files to is protected.
make # perform make after CMake command make # perform make after CMake command
make install # perform the installation into prefix make install # perform the installation into prefix
During the installation process CMake will by default remove any runtime
path settings for loading shared libraries. Because of this you may
have to set or modify the ``LD_LIBRARY_PATH`` (or ``DYLD_LIBRARY_PATH``)
environment variable, if you are installing LAMMPS into a non-system
location and/or are linking to libraries in a non-system location that
depend on such runtime path settings.
As an alternative you may set the CMake variable ``LAMMPS_INSTALL_RPATH``
to ``on`` and then the runtime paths for any linked shared libraries
and the library installation folder for the LAMMPS library will be
embedded and thus the requirement to set environment variables is avoided.
The ``off`` setting is usually preferred for packaged binaries or when
setting up environment modules, the ``on`` setting is more convenient
for installing software into a non-system or personal folder.
.. tab:: Traditional make .. tab:: Traditional make
There is no "install" option in the ``src/Makefile`` for LAMMPS. There is no "install" option in the ``src/Makefile`` for LAMMPS.

View File

@ -296,6 +296,8 @@ Some common CMake variables
- Description - Description
* - ``CMAKE_INSTALL_PREFIX`` * - ``CMAKE_INSTALL_PREFIX``
- root directory of install location for ``make install`` (default: ``$HOME/.local``) - root directory of install location for ``make install`` (default: ``$HOME/.local``)
* - ``LAMMPS_INSTALL_RPATH``
- set or remove runtime path setting from binaries for ``make install`` (default: ``off``)
* - ``CMAKE_BUILD_TYPE`` * - ``CMAKE_BUILD_TYPE``
- controls compilation options: - controls compilation options:
one of ``RelWithDebInfo`` (default), ``Release``, ``Debug``, ``MinSizeRel`` one of ``RelWithDebInfo`` (default), ``Release``, ``Debug``, ``MinSizeRel``

View File

@ -13,7 +13,7 @@ Syntax
* N = # of atom types to use in this simulation * N = # of atom types to use in this simulation
* region-ID = ID of region to use as simulation domain * region-ID = ID of region to use as simulation domain
* zero or more keyword/value pairs may be appended * zero or more keyword/value pairs may be appended
* keyword = *bond/types* or *angle/types* or *dihedral/types* or *improper/types* or *extra/bond/per/atom* or *extra/angle/per/atom* or *extra/dihedral/per/atom* or *extra/improper/per/atom* * keyword = *bond/types* or *angle/types* or *dihedral/types* or *improper/types* or *extra/bond/per/atom* or *extra/angle/per/atom* or *extra/dihedral/per/atom* or *extra/improper/per/atom* or *extra/special/per/atom*
.. parsed-literal:: .. parsed-literal::

View File

@ -26,7 +26,7 @@ Masses
7 12.0112 7 12.0112
8 1.00797 8 1.00797
Pair Coeffs # lj/class2/coul/long Pair Coeffs # hybrid
1 lj/class2/coul/long 0.054 4.01 1 lj/class2/coul/long 0.054 4.01
2 lj/class2/coul/long 0.054 4.01 2 lj/class2/coul/long 0.054 4.01

View File

@ -12,7 +12,7 @@ improper_style class2
pair_modify mix sixthpower tail yes pair_modify mix sixthpower tail yes
special_bonds lj/coul 0 0 1 special_bonds lj/coul 0 0 1
read_data data.init_conf_without_heptane read_data data.init_conf_with_heptane
pair_coeff 1 6 lj/class2/coul/long/soft 0.054 4.01 0.0 pair_coeff 1 6 lj/class2/coul/long/soft 0.054 4.01 0.0
pair_coeff 2 6 lj/class2/coul/long/soft 0.054 4.01 0.0 pair_coeff 2 6 lj/class2/coul/long/soft 0.054 4.01 0.0
@ -47,7 +47,7 @@ fix ADAPT all adapt/fep 10 &
atom charge 8 v_q3 & atom charge 8 v_q3 &
after yes after yes
thermo_style custom step spcpu temp press vol etotal pe v_lambda v_q1 v_q2 v_q3 thermo_style custom step temp press vol etotal pe v_lambda v_q1 v_q2 v_q3
thermo_modify line one thermo_modify line one
thermo 100 thermo 100

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ Masses
7 12.0112 7 12.0112
8 1.00797 8 1.00797
Pair Coeffs # lj/class2/coul/long Pair Coeffs # hybrid
1 lj/class2/coul/long 0.054 4.01 1 lj/class2/coul/long 0.054 4.01
2 lj/class2/coul/long 0.054 4.01 2 lj/class2/coul/long 0.054 4.01

View File

@ -47,7 +47,7 @@ fix ADAPT all adapt/fep 10 &
atom charge 8 v_q3 & atom charge 8 v_q3 &
after yes after yes
thermo_style custom step spcpu temp press vol etotal pe v_lambda v_q1 v_q2 v_q3 thermo_style custom step temp press vol etotal pe v_lambda v_q1 v_q2 v_q3
thermo_modify line one thermo_modify line one
thermo 100 thermo 100

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -121,18 +121,16 @@ class lammps(object):
lib_ext = ".so" lib_ext = ".so"
if not self.lib: if not self.lib:
try: if name:
if not name: libpath = join(modpath,"liblammps_%s" % name + lib_ext)
self.lib = CDLL(join(modpath,"liblammps" + lib_ext),RTLD_GLOBAL) else:
libpath = join(modpath,"liblammps" + lib_ext)
if not os.path.isfile(libpath):
if name:
libpath = "liblammps_%s" % name + lib_ext
else: else:
self.lib = CDLL(join(modpath,"liblammps_%s" % name + lib_ext), libpath = "liblammps" + lib_ext
RTLD_GLOBAL) self.lib = CDLL(libpath,RTLD_GLOBAL)
except:
if not name:
self.lib = CDLL("liblammps" + lib_ext,RTLD_GLOBAL)
else:
self.lib = CDLL("liblammps_%s" % name + lib_ext,RTLD_GLOBAL)
# declare all argument and return types for all library methods here. # declare all argument and return types for all library methods here.
# exceptions are where the arguments depend on certain conditions and # exceptions are where the arguments depend on certain conditions and

View File

@ -371,6 +371,13 @@ void FixPour::init()
} }
} }
/* ---------------------------------------------------------------------- */
void FixPour::setup_pre_exchange()
{
next_reneighbor = update->ntimestep + 1;
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
perform particle insertion perform particle insertion
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -30,6 +30,7 @@ class FixPour : public Fix {
~FixPour(); ~FixPour();
int setmask(); int setmask();
void init(); void init();
void setup_pre_exchange();
void pre_exchange(); void pre_exchange();
void reset_dt(); void reset_dt();
void *extract(const char *, int &); void *extract(const char *, int &);
@ -63,7 +64,8 @@ class FixPour : public Fix {
int me,nprocs; int me,nprocs;
int *recvcounts,*displs; int *recvcounts,*displs;
int nfreq,nfirst,ninserted,nper; int nfreq,ninserted,nper;
bigint nfirst;
double lo_current,hi_current; double lo_current,hi_current;
tagint maxtag_all,maxmol_all; tagint maxtag_all,maxmol_all;
class RanPark *random,*random2; class RanPark *random,*random2;

View File

@ -292,6 +292,13 @@ void FixDeposit::init()
} }
} }
/* ---------------------------------------------------------------------- */
void FixDeposit::setup_pre_exchange()
{
next_reneighbor = update->ntimestep+1;
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
perform particle insertion perform particle insertion
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -833,7 +840,7 @@ void FixDeposit::write_restart(FILE *fp)
double list[5]; double list[5];
list[n++] = random->state(); list[n++] = random->state();
list[n++] = ninserted; list[n++] = ninserted;
list[n++] = nfirst; list[n++] = ubuf(nfirst).d;
list[n++] = ubuf(next_reneighbor).d; list[n++] = ubuf(next_reneighbor).d;
list[n++] = ubuf(update->ntimestep).d; list[n++] = ubuf(update->ntimestep).d;
@ -853,12 +860,12 @@ void FixDeposit::restart(char *buf)
int n = 0; int n = 0;
double *list = (double *) buf; double *list = (double *) buf;
seed = static_cast<int> (list[n++]); seed = static_cast<int>(list[n++]);
ninserted = static_cast<int> (list[n++]); ninserted = static_cast<int>(list[n++]);
nfirst = static_cast<int> (list[n++]); nfirst = static_cast<bigint>(ubuf(list[n++]).i);
next_reneighbor = (bigint) ubuf(list[n++]).i; next_reneighbor = static_cast<bigint>(ubuf(list[n++]).i);
bigint ntimestep_restart = (bigint) ubuf(list[n++]).i; bigint ntimestep_restart = static_cast<bigint>(ubuf(list[n++]).i);
if (ntimestep_restart != update->ntimestep) if (ntimestep_restart != update->ntimestep)
error->all(FLERR,"Must not reset timestep when restarting this fix"); error->all(FLERR,"Must not reset timestep when restarting this fix");

View File

@ -30,6 +30,7 @@ class FixDeposit : public Fix {
~FixDeposit(); ~FixDeposit();
int setmask(); int setmask();
void init(); void init();
void setup_pre_exchange();
void pre_exchange(); void pre_exchange();
void write_restart(FILE *); void write_restart(FILE *);
void restart(char *); void restart(char *);
@ -54,7 +55,8 @@ class FixDeposit : public Fix {
class Fix *fixrigid,*fixshake; class Fix *fixrigid,*fixshake;
double oneradius; double oneradius;
int nfirst,ninserted; int ninserted;
bigint nfirst;
tagint maxtag_all,maxmol_all; tagint maxtag_all,maxmol_all;
class RanPark *random; class RanPark *random;

View File

@ -59,16 +59,19 @@ void ImbalanceTime::compute(double *weight)
// cost = CPU time for relevant timers since last invocation // cost = CPU time for relevant timers since last invocation
// localwt = weight assigned to each owned atom // localwt = weight assigned to each owned atom
// just return if no time yet tallied // just return if no time yet tallied
// we 0.1 seconds as a minimum time to avoid computation of bogus
// load balancing weights due to limited timer resolution/precision
double cost = -last; double cost = -last;
cost += timer->get_wall(Timer::PAIR); cost += timer->get_wall(Timer::PAIR);
cost += timer->get_wall(Timer::NEIGH); cost += timer->get_wall(Timer::NEIGH);
cost += timer->get_wall(Timer::BOND); cost += timer->get_wall(Timer::BOND);
cost += timer->get_wall(Timer::KSPACE); cost += timer->get_wall(Timer::KSPACE);
cost += 0.1;
double maxcost; double maxcost;
MPI_Allreduce(&cost,&maxcost,1,MPI_DOUBLE,MPI_MAX,world); MPI_Allreduce(&cost,&maxcost,1,MPI_DOUBLE,MPI_MAX,world);
if (maxcost <= 0.0) return; if (maxcost <= 0.1) return;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
double localwt = 0.0; double localwt = 0.0;

View File

@ -414,6 +414,9 @@ void utils::bounds(const char *file, int line, const std::string &str,
} }
if (error) { if (error) {
if ((nlo <= 0) || (nhi <=0))
error->all(file,line,fmt::format("Invalid range string: {}",str));
if (nlo < nmin) if (nlo < nmin)
error->all(file,line,fmt::format("Numeric index {} is out of bounds" error->all(file,line,fmt::format("Numeric index {} is out of bounds"
"({}-{})",nlo,nmin,nmax)); "({}-{})",nlo,nmin,nmax));