Merge pull request #2407 from akohlmey/collected-small-fixes

Collected small changes and bugfixes for the next patch release
This commit is contained in:
Axel Kohlmeyer 2020-10-06 20:17:45 -04:00 committed by GitHub
commit bf4773c3f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 124 additions and 44 deletions

View File

@ -628,10 +628,10 @@ if(BUILD_TOOLS)
target_link_libraries(chain.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
install(TARGETS chain.x DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
message(WARNING "No suitable Fortran compiler found, skipping building 'chain.x'")
message(WARNING "No suitable Fortran compiler found, skipping build of 'chain.x'")
endif()
else()
message(WARNING "CMake build doesn't support fortran, skipping building 'chain.x'")
message(WARNING "CMake build doesn't support fortran, skipping build of 'chain.x'")
endif()
enable_language(C)

View File

@ -2,9 +2,9 @@
# an existing package selection without losing any other settings
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MESSAGE MOLECULE
MPIIO MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN
SRD VORONOI
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MESSAGE MLIAP
MOLECULE MPIIO MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK
SNAP SPIN SRD VORONOI
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD

View File

@ -4,9 +4,9 @@
# with just a working C++ compiler and an MPI library.
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MESSAGE MOLECULE
MPIIO MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN
SRD VORONOI
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MESSAGE MLIAP
MOLECULE MPIIO MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK
SNAP SPIN SRD VORONOI
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD

View File

@ -498,9 +498,16 @@ regular LAMMPS commands:
help (or ?) print a brief help message
history display the current command history list
clear_history wipe out the current command history list
pwd print current working directory
cd <directory> change current working directory (same as pwd if no directory)
\|<command> execute <command> as a shell command and return to the command prompt
exit exit the LAMMPS shell cleanly (unlike the "quit" command)
Please note that some known shell operations are implemented in the
LAMMPS :doc:`shell command <shell>` in a platform neutral fashion,
while using the '\|' character will always pass the following text
to the operating system's shell command.
Compilation
===========

View File

@ -140,12 +140,12 @@ clarity, you must enclose the entire expression in quotes.
An expression is built out of numbers (which start with a digit or
period or minus sign) or strings (which start with a letter and can
contain alphanumeric characters or underscores):
contain alphanumeric characters, underscores, or forward slashes):
.. parsed-literal::
0.2, 100, 1.0e20, -15.4, etc
InP, myString, a123, ab_23_cd, etc
0.2, 100, 1.0e20, -15.4, ...
InP, myString, a123, ab_23_cd, lj/cut, ...
and Boolean operators:

View File

@ -229,7 +229,7 @@ void FixNEBSpin::init()
if (atom->nmax > maxlocal) reallocate();
if (MULTI_PROC && counts == nullptr) {
if (cmode == MULTI_PROC && counts == nullptr) {
memory->create(xsendall,ntotal,3,"neb:xsendall");
memory->create(xrecvall,ntotal,3,"neb:xrecvall");
memory->create(fsendall,ntotal,3,"neb:fsendall");

View File

@ -172,7 +172,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr)
}
catch(LAMMPSException &e) {
fmt::print(stderr, "LAMMPS Exception: {}", e.message);
*ptr = nullptr;
if (ptr) *ptr = nullptr;
}
#else
lmp = new LAMMPS(argc, argv, comm);
@ -1270,10 +1270,8 @@ to then decide how to cast the (void*) pointer and access the data.
* \return integer constant encoding the data type of the property
* or -1 if not found. */
int lammps_extract_global_datatype(void *handle, const char *name)
int lammps_extract_global_datatype(void *, const char *name)
{
LAMMPS *lmp = (LAMMPS *) handle;
if (strcmp(name,"units") == 0) return LAMMPS_STRING;
if (strcmp(name,"dt") == 0) return LAMMPS_DOUBLE;
if (strcmp(name,"ntimestep") == 0) return LAMMPS_BIGINT;
@ -2963,7 +2961,7 @@ void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data
BEGIN_CAPTURE
{
int i,j,offset,fcid,ltype;
int i,offset,fcid,ltype;
// error if tags are not defined or not consecutive
int flag = 0;
@ -3221,8 +3219,6 @@ void lammps_gather_subset(void *ptr, char *name,
return;
}
int natoms = static_cast<int> (lmp->atom->natoms);
void *vptr = lmp->atom->extract(name);
if (vptr==nullptr && strstr(name,"f_") == name) { // fix

View File

@ -249,7 +249,6 @@ double Timer::get_timeout_remain()
------------------------------------------------------------------------- */
static const char *timer_style[] = { "off", "loop", "normal", "full" };
static const char *timer_mode[] = { "nosync", "(dummy)", "sync" };
static const char timer_fmt[] = "New timer settings: style=%s mode=%s timeout=%s\n";
void Timer::modify_params(int narg, char **arg)
{
@ -271,15 +270,15 @@ void Timer::modify_params(int narg, char **arg)
++iarg;
if (iarg < narg) {
_timeout = utils::timespec2seconds(arg[iarg]);
} else error->all(FLERR,"Illegal timers command");
} else error->all(FLERR,"Illegal timer command");
} else if (strcmp(arg[iarg],"every") == 0) {
++iarg;
if (iarg < narg) {
_checkfreq = utils::inumeric(FLERR,arg[iarg],false,lmp);
if (_checkfreq <= 0)
error->all(FLERR,"Illegal timers command");
} else error->all(FLERR,"Illegal timers command");
} else error->all(FLERR,"Illegal timers command");
error->all(FLERR,"Illegal timer command");
} else error->all(FLERR,"Illegal timer command");
} else error->all(FLERR,"Illegal timer command");
++iarg;
}
@ -295,9 +294,8 @@ void Timer::modify_params(int narg, char **arg)
strftime(timebuf,32,"%H:%M:%S",tm);
}
if (screen)
fprintf(screen,timer_fmt,timer_style[_level],timer_mode[_sync],timebuf);
if (logfile)
fprintf(logfile,timer_fmt,timer_style[_level],timer_mode[_sync],timebuf);
utils::logmesg(lmp,fmt::format("New timer settings: style={} mode={} "
"timeout={}\n",timer_style[_level],
timer_mode[_sync],timebuf));
}
}

View File

@ -4902,7 +4902,7 @@ double Variable::evaluate_boolean(char *str)
// set I to end of string
int istart = i++;
while (isalnum(str[i]) || str[i] == '_') i++;
while (isalnum(str[i]) || (str[i] == '_') || (str[i] == '/')) i++;
int n = i - istart + 1;
argstack[nargstack].str = new char[n];

View File

@ -84,11 +84,13 @@ Additional commands
The followind commands are added to the LAMMPS shell on top of the
regular LAMMPS commands:
- help (or ?) print a brief help message
- history display the current command history list
- clear_history wipe out the current command history list
- |<command> execute <command> as a shell command and return to the command prompt
- exit exit the LAMMPS shell cleanly (unlike the "quit" command)
- help (or ?) print a brief help message
- history display the current command history list
- clear_history wipe out the current command history list
- pwd print current working directory
- cd <directory> change current working directory (same as pwd if no directory)
- |<command> execute <command> as a shell command and return to the command prompt
- exit exit the LAMMPS shell cleanly (unlike the "quit" command)
Compilation
===========

View File

@ -25,6 +25,7 @@
#include <io.h>
#include <windows.h>
#define isatty(x) _isatty(x)
#define getcwd(buf, len) _getcwd(buf, len)
#endif
#if !defined(_WIN32)
@ -460,6 +461,8 @@ static void init_commands()
// store LAMMPS shell specific command names
commands.push_back("help");
commands.push_back("exit");
commands.push_back("pwd");
commands.push_back("cd");
commands.push_back("history");
commands.push_back("clear_history");
@ -549,6 +552,16 @@ static int shell_cmd(const std::string &cmd)
} else if (words[0] == "exit") {
free(text);
return shell_end();
} else if ((words[0] == "pwd") || ((words[0] == "cd") && (words.size() == 1))) {
if (getcwd(buf, buflen)) std::cout << buf << "\n";
free(text);
return 0;
} else if (words[0] == "cd") {
std::string shellcmd = "shell ";
shellcmd += text;
lammps_command(lmp, shellcmd.c_str());
free(text);
return 0;
} else if (words[0] == "history") {
free(text);
HIST_ENTRY **list = history_list();

View File

@ -6,9 +6,9 @@ From: centos:7
yum -y update
yum -y install vim-enhanced \
ccache gcc-c++ gcc-gfortran clang gdb valgrind-openmpi \
make cmake cmake3 ninja-build patch which file git Lmod \
make cmake3 ninja-build patch which file git Lmod \
libpng-devel libjpeg-devel openmpi-devel mpich-devel python-devel python36-devel \
hdf5-devel python36-virtualenv python36-pip python-pip \
hdf5-devel python36-virtualenv python36-pip python-pip readline-devel \
netcdf-devel netcdf-cxx-devel netcdf-mpich-devel netcdf-openmpi-devel \
python-virtualenv fftw-devel voro++-devel eigen3-devel gsl-devel openblas-devel enchant \
blas-devel lapack-devel libyaml-devel openkim-models kim-api-devel zstd libzstd-devel
@ -48,6 +48,21 @@ From: centos:7
cd ../../
rm -rvf plumed
# create missing readline pkgconfig file
cat > /usr/lib64/pkgconfig/readline.pc <<EOF
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include
Name: Readline
Description: GNU Readline library for command line editing
URL: http://tiswww.cwru.edu/php/chet/readline/rltop.html
Version: 6.2
Requires.private: ncurses
Libs: -L\${libdir} -lreadline
Cflags: -I\${includedir}/readline
EOF
# set custom prompt indicating the container name
CUSTOM_PROMPT_ENV=/.singularity.d/env/99-zz_custom_prompt.sh
cat >$CUSTOM_PROMPT_ENV <<EOF

View File

@ -10,7 +10,7 @@ From: centos:8
eigen3-devel openblas-devel libpng-devel libjpeg-devel platform-python-devel \
openmpi-devel mpich-devel fftw-devel voro++-devel gsl-devel hdf5-devel \
netcdf-devel netcdf-cxx-devel netcdf-mpich-devel netcdf-openmpi-devel \
enchant python3-virtualenv doxygen diffutils latexmk \
enchant python3-virtualenv doxygen diffutils latexmk readline-devel \
texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \
texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \
texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \
@ -54,6 +54,21 @@ From: centos:8
cd ../../
rm -rvf plumed
# create missing readline pkgconfig file
cat > /usr/lib64/pkgconfig/readline.pc <<EOF
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include
Name: Readline
Description: GNU Readline library for command line editing
URL: http://tiswww.cwru.edu/php/chet/readline/rltop.html
Version: 7.0
Requires.private: ncurses
Libs: -L\${libdir} -lreadline
Cflags: -I\${includedir}/readline
EOF
# set custom prompt indicating the container name
CUSTOM_PROMPT_ENV=/.singularity.d/env/99-zz_custom_prompt.sh
cat >$CUSTOM_PROMPT_ENV <<EOF

View File

@ -9,7 +9,7 @@ From: fedora:32
ccache gcc-c++ gcc-gfortran gdb valgrind eigen3-devel openblas-devel \
openmpi-devel mpich-devel fftw-devel voro++-devel gsl-devel hdf5-devel \
netcdf-devel netcdf-cxx-devel netcdf-mpich-devel netcdf-openmpi-devel \
python3-pyyaml \
readline-devel python3-pyyaml \
mingw-filesystem-base mingw32-nsis mingw-binutils-generic \
mingw32-filesystem mingw32-pkg-config \
mingw64-filesystem mingw64-pkg-config \
@ -18,16 +18,13 @@ From: fedora:32
mingw32-cpp mingw32-gcc mingw32-gcc-gfortran mingw32-gcc-c++ \
mingw64-cpp mingw64-gcc mingw64-gcc-gfortran mingw64-gcc-c++ \
mingw32-libgomp mingw64-libgomp \
mingw32-winpthreads mingw64-winpthreads \
mingw32-winpthreads-static mingw64-winpthreads-static \
mingw32-eigen3 mingw64-eigen3 \
mingw32-libjpeg-turbo mingw64-libjpeg-turbo \
mingw32-libjpeg-turbo-static mingw64-libjpeg-turbo-static \
mingw32-libpng mingw64-libpng \
mingw32-libpng-static mingw64-libpng-static \
mingw32-zlib mingw64-zlib \
mingw32-readline-static mingw64-readline-static \
mingw32-termcap-static mingw64-termcap-static \
mingw32-zlib-static mingw64-zlib-static \
mingw32-expat mingw64-expat \
mingw64-expat-static mingw32-expat-static \
mingw32-sqlite-static mingw64-sqlite-static \
enchant python3-virtualenv doxygen latexmk \
@ -60,6 +57,33 @@ From: fedora:32
cd ../../
rm -rvf plumed
# create missing termcap pkgconfig files
cat > /usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig/termcap.pc <<EOF
prefix=/usr/i686-w64-mingw32/sys-root/mingw
exec_prefix=/usr/i686-w64-mingw32/sys-root/mingw
libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib
includedir=/usr/i686-w64-mingw32/sys-root/mingw/include
Name: Termcap
Description: GNU/MinGW terminal feature database
URL: ftp://ftp.gnu.org/gnu/termcap/
Version: 1.3
Libs: -L\${libdir} -ltermcap
Cflags:
EOF
cat > /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/termcap.pc <<EOF
prefix=/usr/x86_64-w64-mingw32/sys-root/mingw
exec_prefix=/usr/x86_64-w64-mingw32/sys-root/mingw
libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib
includedir=/usr/x86_64-w64-mingw32/sys-root/mingw/include
Name: Termcap
Description: GNU/MinGW terminal feature database
URL: ftp://ftp.gnu.org/gnu/termcap/
Version: 1.3
Libs: -L\${libdir} -ltermcap
Cflags:
EOF
# set custom prompt indicating the container name
CUSTOM_PROMPT_ENV=/.singularity.d/env/99-zz_custom_prompt.sh
cat >$CUSTOM_PROMPT_ENV <<EOF

View File

@ -12,7 +12,7 @@ From: ubuntu:16.04
ccache gcc g++ gfortran \
mpi-default-bin mpi-default-dev \
libfftw3-dev libjpeg-dev libpng12-dev libblas-dev liblapack-dev \
python-dev libeigen3-dev libgsl-dev libopenblas-dev \
python-dev libeigen3-dev libgsl-dev libopenblas-dev libreadline-dev \
virtualenv python3-dev python3-pip python3-pkg-resources \
python3-setuptools python3-virtualenv \
enchant

View File

@ -39,6 +39,7 @@ From: ubuntu:18.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -57,6 +57,7 @@ From: ubuntu:18.04
libopenblas-dev \
libnuma-dev \
libpng-dev \
libreadline-dev \
libproj-dev \
libvtk6-dev \
libyaml-dev \

View File

@ -61,6 +61,7 @@ From: ubuntu:18.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -39,6 +39,7 @@ From: ubuntu:18.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -39,6 +39,7 @@ From: nvidia/cuda:11.0-devel-ubuntu18.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -39,6 +39,7 @@ From: ubuntu:20.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -58,6 +58,7 @@ From: ubuntu:20.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -62,6 +62,7 @@ From: ubuntu:20.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -39,6 +39,7 @@ From: ubuntu:20.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \

View File

@ -39,6 +39,7 @@ From: nvidia/cuda:11.0-devel-ubuntu20.04
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk6-dev \
libyaml-dev \
libzstd-dev \