Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collected small changes for the next patch release #1374

Merged
merged 8 commits into from Mar 25, 2019
4 changes: 2 additions & 2 deletions cmake/CMakeLists.txt
Expand Up @@ -613,8 +613,9 @@ if(PKG_USER-PLUMED)
endif()

if(PKG_USER-MOLFILE)
set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers")
add_library(molfile INTERFACE)
target_include_directories(molfile INTERFACE ${LAMMPS_LIB_SOURCE_DIR}/molfile)
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
target_link_libraries(molfile INTERFACE ${CMAKE_DL_LIBS})
list(APPEND LAMMPS_LINK_LIBS molfile)
endif()
Expand All @@ -626,7 +627,6 @@ if(PKG_USER-NETCDF)
add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020)
endif()


if(PKG_USER-SMD)
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF)
if(DOWNLOAD_EIGEN3)
Expand Down
18 changes: 16 additions & 2 deletions doc/src/Build_extras.txt
Expand Up @@ -893,7 +893,17 @@ USER-MOLFILE package :h4,link(user-molfile)

[CMake build]:

No additional settings are needed besides "-D PKG_USER-MOLFILE=yes".
-D MOLFILE_INCLUDE_DIRS=path # (optional) path where VMD molfile plugin headers are installed
-D PKG_USER-MOLFILE=yes :pre


Using "-D PKG_USER-MOLFILE=yes" enables the package, and setting
"-D MOLFILE_INCLUDE DIRS" allows to provide a custom location for
the molfile plugin header files. These should match the ABI of the
plugin files used, and thus one typically sets them to include
folder of the local VMD installation in use. LAMMPS ships with a
couple of default header files that correspond to a popular VMD
version, usually the latest release.

[Traditional make]:

Expand All @@ -902,7 +912,11 @@ loading library libdl.a that is typically present on all systems. It
is required for LAMMPS to link with this package. If the setting is
not valid for your system, you will need to edit the Makefile.lammps
file. See lib/molfile/README and lib/molfile/Makefile.lammps for
details.
details. It is also possible to configure a different folder with
the VMD molfile plugin header files. LAMMPS ships with a couple of
default headers, but these are not compatible with all VMD versions,
so it is often best to change this setting to the location of the
same include files of the local VMD installation in use.

:line

Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/lal_device.cpp
Expand Up @@ -237,7 +237,7 @@ int DeviceT::set_ocl_params(char *ocl_vendor) {
" -DBLOCK_CELL_ID="+params[11]+
" -DMAX_BIO_SHARED_TYPES="+params[12];
}
_ocl_compile_string="-cl-fast-relaxed-math -cl-mad-enable "+std::string(OCL_INT_TYPE)+" "+
_ocl_compile_string="-cl-std=CL1.2 -cl-fast-relaxed-math -cl-mad-enable "+std::string(OCL_INT_TYPE)+" "+
std::string(OCL_PRECISION_COMPILE)+" "+_ocl_vendor_string;
#endif
return 0;
Expand Down
28 changes: 14 additions & 14 deletions src/CLASS2/pair_lj_class2.cpp
Expand Up @@ -38,20 +38,20 @@ PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp)

PairLJClass2::~PairLJClass2()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}

Expand Down
34 changes: 17 additions & 17 deletions src/CLASS2/pair_lj_class2_coul_cut.cpp
Expand Up @@ -39,23 +39,23 @@ PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp)

PairLJClass2CoulCut::~PairLJClass2CoulCut()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(cut_coul);
memory->destroy(cut_coulsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(cut_coul);
memory->destroy(cut_coulsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
}

Expand Down
30 changes: 15 additions & 15 deletions src/CLASS2/pair_lj_class2_coul_long.cpp
Expand Up @@ -50,21 +50,21 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp)

PairLJClass2CoulLong::~PairLJClass2CoulLong()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
}
if (ftable) free_tables();
}
Expand Down
32 changes: 16 additions & 16 deletions src/KSPACE/pair_buck_coul_long.cpp
Expand Up @@ -50,23 +50,23 @@ PairBuckCoulLong::PairBuckCoulLong(LAMMPS *lmp) : Pair(lmp)

PairBuckCoulLong::~PairBuckCoulLong()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(c);
memory->destroy(rhoinv);
memory->destroy(buck1);
memory->destroy(buck2);
memory->destroy(offset);
}
if (ftable) free_tables();
if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(cut_lj);
memory->destroy(cut_ljsq);
memory->destroy(a);
memory->destroy(rho);
memory->destroy(c);
memory->destroy(rhoinv);
memory->destroy(buck1);
memory->destroy(buck2);
memory->destroy(offset);
}
if (ftable) free_tables();
}

/* ---------------------------------------------------------------------- */
Expand Down
14 changes: 7 additions & 7 deletions src/KSPACE/pair_coul_long.cpp
Expand Up @@ -55,15 +55,15 @@ PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp)

PairCoulLong::~PairCoulLong()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
if (copymode) return;

memory->destroy(scale);
}
if (ftable) free_tables();
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(scale);
}
if (ftable) free_tables();
}

/* ---------------------------------------------------------------------- */
Expand Down
40 changes: 20 additions & 20 deletions src/KSPACE/pair_lj_charmm_coul_long.cpp
Expand Up @@ -59,27 +59,27 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)

PairLJCharmmCoulLong::~PairLJCharmmCoulLong()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
memory->destroy(offset);
}
if (ftable) free_tables();
if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
memory->destroy(offset);
}
if (ftable) free_tables();
}

/* ---------------------------------------------------------------------- */
Expand Down
42 changes: 21 additions & 21 deletions src/KSPACE/pair_lj_charmmfsw_coul_long.cpp
Expand Up @@ -77,27 +77,6 @@ PairLJCharmmfswCoulLong::PairLJCharmmfswCoulLong(LAMMPS *lmp) : Pair(lmp)

PairLJCharmmfswCoulLong::~PairLJCharmmfswCoulLong()
{
if (!copymode) {
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
if (ftable) free_tables();
}

// switch qqr2e back from CHARMM value to LAMMPS value

if (update && strcmp(update->unit_style,"real") == 0) {
Expand All @@ -106,6 +85,27 @@ PairLJCharmmfswCoulLong::~PairLJCharmmfswCoulLong()
" conversion constant");
force->qqr2e = force->qqr2e_lammps_real;
}

if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(eps14);
memory->destroy(sigma14);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(lj14_1);
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
if (ftable) free_tables();
}

/* ---------------------------------------------------------------------- */
Expand Down
6 changes: 3 additions & 3 deletions src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
Expand Up @@ -43,8 +43,9 @@ PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)

PairLJCharmmCoulCharmm::~PairLJCharmmCoulCharmm()
{
if (!copymode) {
if (allocated) {
if (copymode) return;

if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);

Expand All @@ -60,7 +61,6 @@ PairLJCharmmCoulCharmm::~PairLJCharmmCoulCharmm()
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
}
}
}

Expand Down