Skip to content

Commit

Permalink
Merge pull request #2260 from akohlmey/collected-small-changes
Browse files Browse the repository at this point in the history
Collected small changes
  • Loading branch information
akohlmey committed Aug 3, 2020
2 parents ca7039a + d09d40a commit 6576c4c
Show file tree
Hide file tree
Showing 26 changed files with 496 additions and 232 deletions.
29 changes: 29 additions & 0 deletions .github/codecov.yml
@@ -0,0 +1,29 @@
comment: false
coverage:
notify:
slack:
default:
url: "secret:HWZbvgtc6OD7F3v3PfrK3/rzCJvScbh69Fi1CkLwuHK0+wIBIHVR+Q5i7q6F9Ln4OChbiRGtYAEUUsT8/jmBu4qDpIi8mx746codc0z/Z3aafLd24pBrCEPLvdCfIZxqPnw3TuUgGhwmMDZf0+thg8YNUr/MbOZ7Li2L6+ZbYuA="
threshold: 10%
only_pulls: false
branches:
- "master"
flags:
- "unit"
paths:
- "src"
status:
project:
default:
branches:
- "master"
paths:
- "src"
informational: true
patch:
default:
branches:
- "master"
paths:
- "src"
informational: true
15 changes: 9 additions & 6 deletions cmake/Modules/Testing.cmake
Expand Up @@ -23,14 +23,17 @@ if(ENABLE_TESTING)
OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
include(CheckCXXCompilerFlag)
set(CMAKE_CUSTOM_LINKER_DEFAULT default)
check_cxx_compiler_flag(-fuse-ld=lld HAVE_LLD_LINKER)
check_cxx_compiler_flag(-fuse-ld=gold HAVE_GOLD_LINKER)
check_cxx_compiler_flag(-fuse-ld=bfd HAVE_BFD_LINKER)
if(HAVE_LLD_LINKER)
check_cxx_compiler_flag(-fuse-ld=lld HAVE_LLD_LINKER_FLAG)
check_cxx_compiler_flag(-fuse-ld=gold HAVE_GOLD_LINKER_FLAG)
check_cxx_compiler_flag(-fuse-ld=bfd HAVE_BFD_LINKER_FLAG)
find_program(HAVE_LLD_LINKER_BIN lld ld.lld)
find_program(HAVE_GOLD_LINKER_BIN ld.gold)
find_program(HAVE_BFD_LINKER_BIN ld.bfd)
if(HAVE_LLD_LINKER_FLAG AND HAVE_LLD_LINKER_BIN)
set(CMAKE_CUSTOM_LINKER_DEFAULT lld)
elseif(HAVE_GOLD_LINKER)
elseif(HAVE_GOLD_LINKER_FLAG AND HAVE_GOLD_LINKER_BIN)
set(CMAKE_CUSTOM_LINKER_DEFAULT gold)
elseif(HAVE_BFD_LINKER)
elseif(HAVE_BFD_LINKER_FLAG AND HAVE_BFD_LINKER_BIN)
set(CMAKE_CUSTOM_LINKER_DEFAULT bfd)
endif()
set(CMAKE_CUSTOM_LINKER_VALUES lld gold bfd default)
Expand Down
18 changes: 18 additions & 0 deletions doc/src/Errors_warnings.rst
Expand Up @@ -118,6 +118,24 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
incorrect periodic images of atoms in interaction lists. To avoid, either use
:doc:`pair style zero <pair_zero>` with a suitable cutoff or use :doc:`comm_modify cutoff <comm_modify>`.

*Communication cutoff is shorter than a bond length based estimate. This may lead to errors.*

Since LAMMPS stores topology data with individual atoms, all atoms
comprising a bond, angle, dihedral or improper must be present on any
sub-domain that "owns" the atom with the information, either as a
local or a ghost atom. The communication cutoff is what determines up
to what distance from a sub-domain boundary ghost atoms are created.
The communication cutoff is by default the largest non-bonded cutoff
plus the neighbor skin distance, but for short or non-bonded cutoffs
and/or long bonds, this may not be sufficient. This warning indicates
that there is an increased risk of a simulation stopping unexpectedly
because of Bond/Angle/Dihedral/Improper atoms missing. It can be
silenced by manually setting the communication cutoff via
:doc:`comm_modify cutoff <comm_modify>`. However, since the
heuristic used to determine the estimate is not always accurate, it
is not changed automatically and the warning may be ignored depending
on the specific system being simulated.

*Communication cutoff is too small for SNAP micro load balancing, increased to %lf*
Self-explanatory.

Expand Down
4 changes: 2 additions & 2 deletions src/MC/fix_widom.h
Expand Up @@ -32,7 +32,7 @@ class FixWidom : public Fix {
int setmask();
void init();
void pre_exchange();

void attempt_atomic_insertion();
void attempt_molecule_insertion();

Expand Down Expand Up @@ -207,7 +207,7 @@ is on.
E: Cannot use fix Widom in a 2d simulation
Fix Widom is set up to run in 3d only. No 2d simulations with fix Widom
Fix Widom is set up to run in 3d only. No 2d simulations with fix Widom
are allowed.
E: Could not find fix Widom exclusion group ID
Expand Down
52 changes: 38 additions & 14 deletions src/USER-MISC/pair_lennard_mdf.cpp
Expand Up @@ -32,11 +32,11 @@ using namespace LAMMPS_NS;

/* ---------------------------------------------------------------------- */

PairLJ_AB_MDF::PairLJ_AB_MDF(LAMMPS *lmp) : Pair(lmp) {}
PairLennardMDF::PairLennardMDF(LAMMPS *lmp) : Pair(lmp) {}

/* ---------------------------------------------------------------------- */

PairLJ_AB_MDF::~PairLJ_AB_MDF()
PairLennardMDF::~PairLennardMDF()
{
if (allocated) {
memory->destroy(setflag);
Expand All @@ -56,7 +56,7 @@ PairLJ_AB_MDF::~PairLJ_AB_MDF()

/* ---------------------------------------------------------------------- */

void PairLJ_AB_MDF::compute(int eflag, int vflag)
void PairLennardMDF::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
Expand Down Expand Up @@ -153,7 +153,7 @@ void PairLJ_AB_MDF::compute(int eflag, int vflag)
allocate all arrays
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::allocate()
void PairLennardMDF::allocate()
{
allocated = 1;
int n = atom->ntypes;
Expand All @@ -180,7 +180,7 @@ void PairLJ_AB_MDF::allocate()
global settings
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::settings(int narg, char **arg)
void PairLennardMDF::settings(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal pair_style command");

Expand All @@ -207,7 +207,7 @@ void PairLJ_AB_MDF::settings(int narg, char **arg)
set coeffs for one or more type pairs
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::coeff(int narg, char **arg)
void PairLennardMDF::coeff(int narg, char **arg)
{
if (narg != 4 && narg != 6)
error->all(FLERR,"Incorrect args for pair coefficients");
Expand Down Expand Up @@ -248,7 +248,7 @@ void PairLJ_AB_MDF::coeff(int narg, char **arg)
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */

double PairLJ_AB_MDF::init_one(int i, int j)
double PairLennardMDF::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");

Expand All @@ -259,6 +259,7 @@ double PairLJ_AB_MDF::init_one(int i, int j)
lj3[i][j] = aparm[i][j];
lj4[i][j] = bparm[i][j];

cut[j][i] = cut[i][j];
cut_inner[j][i] = cut_inner[i][j];
cut_inner_sq[j][i] = cut_inner_sq[i][j];
lj1[j][i] = lj1[i][j];
Expand All @@ -273,7 +274,7 @@ double PairLJ_AB_MDF::init_one(int i, int j)
proc 0 writes to restart file
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::write_restart(FILE *fp)
void PairLennardMDF::write_restart(FILE *fp)
{
write_restart_settings(fp);

Expand All @@ -294,7 +295,7 @@ void PairLJ_AB_MDF::write_restart(FILE *fp)
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::read_restart(FILE *fp)
void PairLennardMDF::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
Expand Down Expand Up @@ -324,7 +325,7 @@ void PairLJ_AB_MDF::read_restart(FILE *fp)
proc 0 writes to restart file
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::write_restart_settings(FILE *fp)
void PairLennardMDF::write_restart_settings(FILE *fp)
{
fwrite(&mix_flag,sizeof(int),1,fp);
}
Expand All @@ -333,7 +334,7 @@ void PairLJ_AB_MDF::write_restart_settings(FILE *fp)
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */

void PairLJ_AB_MDF::read_restart_settings(FILE *fp)
void PairLennardMDF::read_restart_settings(FILE *fp)
{
int me = comm->me;
if (me == 0) {
Expand All @@ -342,9 +343,32 @@ void PairLJ_AB_MDF::read_restart_settings(FILE *fp)
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}

/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */

void PairLennardMDF::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
fprintf(fp,"%d %g %g\n",i,aparm[i][i],bparm[i][i]);
}

/* ----------------------------------------------------------------------
proc 0 writes all pairs to data file
------------------------------------------------------------------------- */

void PairLennardMDF::write_data_all(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
fprintf(fp,"%d %d %g %g %g %g\n",
i,j,aparm[i][j],bparm[i][j],
cut_inner[i][j],cut[i][j]);
}

/* ---------------------------------------------------------------------- */

double PairLJ_AB_MDF::single(int /*i*/, int /*j*/, int itype, int jtype,
double PairLennardMDF::single(int /*i*/, int /*j*/, int itype, int jtype,
double rsq,
double /*factor_coul*/, double factor_lj,
double &fforce)
Expand All @@ -368,7 +392,7 @@ double PairLJ_AB_MDF::single(int /*i*/, int /*j*/, int itype, int jtype,
dt = 30.* d*d * dd*dd * rr / dp;

forcelj = forcelj*tt + philj*dt;
philj *= dt;
philj *= tt;
}

fforce = factor_lj*forcelj*r2inv;
Expand All @@ -378,7 +402,7 @@ double PairLJ_AB_MDF::single(int /*i*/, int /*j*/, int itype, int jtype,

/* ---------------------------------------------------------------------- */

void *PairLJ_AB_MDF::extract(const char *str, int &dim)
void *PairLennardMDF::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"a") == 0) return (void *) aparm;
Expand Down
14 changes: 8 additions & 6 deletions src/USER-MISC/pair_lennard_mdf.h
Expand Up @@ -13,21 +13,21 @@

#ifdef PAIR_CLASS

PairStyle(lennard/mdf,PairLJ_AB_MDF)
PairStyle(lennard/mdf,PairLennardMDF)

#else

#ifndef LMP_PAIR_LJ_AB_MDF_H
#define LMP_PAIR_LJ_AB_MDF_H
#ifndef LMP_PAIR_LENNARD_MDF_H
#define LMP_PAIR_LENNARD_MDF_H

#include "pair.h"

namespace LAMMPS_NS {

class PairLJ_AB_MDF : public Pair {
class PairLennardMDF : public Pair {
public:
PairLJ_AB_MDF(class LAMMPS *);
virtual ~PairLJ_AB_MDF();
PairLennardMDF(class LAMMPS *);
virtual ~PairLennardMDF();

virtual void compute(int, int);
void settings(int, char **);
Expand All @@ -37,6 +37,8 @@ class PairLJ_AB_MDF : public Pair {
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void write_data(FILE *);
void write_data_all(FILE *);
double single(int, int, int, int, double, double, double, double &);
void *extract(const char *, int &);

Expand Down

0 comments on commit 6576c4c

Please sign in to comment.