Merge branch 'master' into fep
This commit is contained in:
5
LICENSE
5
LICENSE
@ -301,9 +301,8 @@ one line to give the program's name and an idea of what it does.
|
|||||||
Copyright (C) yyyy name of author
|
Copyright (C) yyyy name of author
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License version 2 as
|
||||||
the Free Software Foundation; either version 2 of the License, or (at
|
published by the Free Software Foundation.
|
||||||
your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but
|
This program is distributed in the hope that it will be useful, but
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
@ -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``
|
||||||
|
|||||||
@ -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::
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
1110
examples/USER/fep/C7inEthanol/fep01/log.insertion
Normal file
1110
examples/USER/fep/C7inEthanol/fep01/log.insertion
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
1110
examples/USER/fep/C7inEthanol/fep10/log.deletion
Normal file
1110
examples/USER/fep/C7inEthanol/fep10/log.deletion
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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:
|
else:
|
||||||
self.lib = CDLL(join(modpath,"liblammps_%s" % name + lib_ext),
|
libpath = join(modpath,"liblammps" + lib_ext)
|
||||||
RTLD_GLOBAL)
|
if not os.path.isfile(libpath):
|
||||||
except:
|
if name:
|
||||||
if not name:
|
libpath = "liblammps_%s" % name + lib_ext
|
||||||
self.lib = CDLL("liblammps" + lib_ext,RTLD_GLOBAL)
|
|
||||||
else:
|
else:
|
||||||
self.lib = CDLL("liblammps_%s" % name + lib_ext,RTLD_GLOBAL)
|
libpath = "liblammps" + lib_ext
|
||||||
|
self.lib = CDLL(libpath,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
|
||||||
|
|||||||
@ -371,6 +371,14 @@ void FixPour::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FixPour::setup_pre_exchange()
|
||||||
|
{
|
||||||
|
if (ninserted < ninsert) next_reneighbor = update->ntimestep + 1;
|
||||||
|
else next_reneighbor = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
perform particle insertion
|
perform particle insertion
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -292,6 +292,14 @@ void FixDeposit::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FixDeposit::setup_pre_exchange()
|
||||||
|
{
|
||||||
|
if (ninserted < ninsert) next_reneighbor = update->ntimestep+1;
|
||||||
|
else next_reneighbor = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
perform particle insertion
|
perform particle insertion
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
@ -833,7 +841,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;
|
||||||
|
|
||||||
@ -855,10 +863,10 @@ void FixDeposit::restart(char *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");
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -49,14 +49,19 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) {
|
|||||||
python->init();
|
python->init();
|
||||||
|
|
||||||
// add current directory to PYTHONPATH
|
// add current directory to PYTHONPATH
|
||||||
|
|
||||||
|
PyGILState_STATE gstate = PyGILState_Ensure();
|
||||||
PyObject *py_path = PySys_GetObject((char *)"path");
|
PyObject *py_path = PySys_GetObject((char *)"path");
|
||||||
PyList_Append(py_path, PY_STRING_FROM_STRING("."));
|
PyList_Append(py_path, PY_STRING_FROM_STRING("."));
|
||||||
|
|
||||||
// if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well
|
// if LAMMPS_POTENTIALS environment variable is set,
|
||||||
|
// add it to PYTHONPATH as well
|
||||||
|
|
||||||
const char *potentials_path = getenv("LAMMPS_POTENTIALS");
|
const char *potentials_path = getenv("LAMMPS_POTENTIALS");
|
||||||
if (potentials_path != nullptr) {
|
if (potentials_path != nullptr) {
|
||||||
PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path));
|
PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path));
|
||||||
}
|
}
|
||||||
|
PyGILState_Release(gstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -64,9 +64,15 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
try {
|
||||||
LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD);
|
LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD);
|
||||||
lammps->input->file();
|
lammps->input->file();
|
||||||
delete lammps;
|
delete lammps;
|
||||||
|
} catch(fmt::format_error &fe) {
|
||||||
|
fprintf(stderr,"fmt::format_error: %s\n", fe.what());
|
||||||
|
MPI_Abort(MPI_COMM_WORLD, 1);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
|||||||
@ -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));
|
||||||
@ -688,7 +691,7 @@ std::string utils::utf8_subst(const std::string &line)
|
|||||||
out += ' ', i += 2;
|
out += ' ', i += 2;
|
||||||
}
|
}
|
||||||
// UTF-8 4-byte character
|
// UTF-8 4-byte character
|
||||||
} else if ((in[i] & 0xe8U) == 0xf0U) {
|
} else if ((in[i] & 0xf8U) == 0xf0U) {
|
||||||
if ((i+3) < len) {
|
if ((i+3) < len) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user