Merge branch 'develop' into nm_split_styles

This commit is contained in:
Axel Kohlmeyer
2021-12-03 14:18:07 -05:00
1150 changed files with 53227 additions and 17063 deletions

6
src/.gitignore vendored
View File

@ -611,6 +611,8 @@
/fft3d_wrap.h
/fix_accelerate_cos.cpp
/fix_accelerate_cos.h
/fix_acks2_reaxff.cpp
/fix_acks2_reaxff.h
/fix_adapt_fep.cpp
/fix_adapt_fep.h
/fix_addtorque.cpp
@ -1176,6 +1178,8 @@
/pair_oxrna2_*.cpp
/pair_oxrna2_*.h
/mf_oxdna.h
/pair_peri.cpp
/pair_peri.h
/pair_peri_eps.cpp
/pair_peri_eps.h
/pair_peri_lps.cpp
@ -1397,6 +1401,8 @@
/fix_drude_transform.h
/fix_langevin_drude.cpp
/fix_langevin_drude.h
/fix_mol_swap.cpp
/fix_mol_swap.h
/fix_pimd.cpp
/fix_pimd.h
/fix_qbmsst.cpp

View File

@ -246,8 +246,8 @@ void PairAWPMDCut::compute(int eflag, int vflag)
fi= new Vector_3[wpmd->ni];
// adding electrons
for (std::map<int,std::vector<int> >::iterator it=etmap.begin(); it!= etmap.end(); ++it) {
std::vector<int> &el=it->second;
for (auto & it : etmap) {
std::vector<int> &el=it.second;
if (!el.size()) // should not happen
continue;
int s=spin[el[0]] >0 ? 0 : 1;

View File

@ -637,7 +637,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
char line[MAX_F_TABLE_LINE_LENGTH];
std::vector<std::string> inputLines;
while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {
inputLines.push_back(std::string(line));
inputLines.emplace_back(line);
}
fclose(fpi);

View File

@ -45,7 +45,7 @@ void FixBrownian::init()
{
FixBrownianBase::init();
g1 /= gamma_t;
g2 *= sqrt(gamma_t);
g2 /= sqrt(gamma_t);
}
/* ---------------------------------------------------------------------- */

View File

@ -52,9 +52,6 @@ AtomVecOxdna::AtomVecOxdna(LAMMPS *lmp) : AtomVec(lmp)
error->warning(FLERR, "Write_data command requires newton on to preserve 3'->5' bond polarity");
}
/* ---------------------------------------------------------------------- */
AtomVecOxdna::~AtomVecOxdna() {}
/* ----------------------------------------------------------------------
set local copies of all grow ptrs used by this class, except defaults
needed in replicate when 2 atom classes exist and it calls pack_restart()

View File

@ -27,7 +27,7 @@ namespace LAMMPS_NS {
class AtomVecOxdna : public AtomVec {
public:
AtomVecOxdna(class LAMMPS *);
~AtomVecOxdna();
~AtomVecOxdna() = default;
void grow_pointers();
void data_atom_post(int);

View File

@ -303,7 +303,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) :
me = comm->me;
root2root = MPI_COMM_NULL;
conf_file = strdup(arg[3]);
conf_file = utils::strdup(arg[3]);
rng_seed = 1966;
unwrap_flag = 1;
@ -319,22 +319,22 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Missing argument to keyword");
if (0 == strcmp(arg[iarg], "input")) {
inp_name = strdup(arg[iarg+1]);
inp_name = utils::strdup(arg[iarg+1]);
} else if (0 == strcmp(arg[iarg], "output")) {
out_name = strdup(arg[iarg+1]);
out_name = utils::strdup(arg[iarg+1]);
} else if (0 == strcmp(arg[iarg], "seed")) {
rng_seed = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
} else if (0 == strcmp(arg[iarg], "unwrap")) {
unwrap_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
} else if (0 == strcmp(arg[iarg], "tstat")) {
tmp_name = strdup(arg[iarg+1]);
tmp_name = utils::strdup(arg[iarg+1]);
} else {
error->all(FLERR,"Unknown fix colvars parameter");
}
++iarg; ++iarg;
}
if (!out_name) out_name = strdup("out");
if (!out_name) out_name = utils::strdup("out");
/* initialize various state variables. */
tstat_id = -1;
@ -359,10 +359,10 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) :
FixColvars::~FixColvars()
{
memory->sfree(conf_file);
memory->sfree(inp_name);
memory->sfree(out_name);
memory->sfree(tmp_name);
delete[] conf_file;
delete[] inp_name;
delete[] out_name;
delete[] tmp_name;
memory->sfree(comm_buf);
if (proxy) {
@ -430,17 +430,15 @@ void FixColvars::one_time_init()
// create and initialize the colvars proxy
if (me == 0) {
if (screen) fputs("colvars: Creating proxy instance\n",screen);
if (logfile) fputs("colvars: Creating proxy instance\n",logfile);
utils::logmesg(lmp,"colvars: Creating proxy instance\n");
#ifdef LAMMPS_BIGBIG
if (screen) fputs("colvars: cannot handle atom ids > 2147483647\n",screen);
if (logfile) fputs("colvars: cannot handle atom ids > 2147483647\n",logfile);
utils::logmesg(lmp,"colvars: cannot handle atom ids > 2147483647\n");
#endif
if (inp_name) {
if (strcmp(inp_name,"NULL") == 0) {
memory->sfree(inp_name);
delete[] inp_name;
inp_name = nullptr;
}
}
@ -458,8 +456,7 @@ void FixColvars::one_time_init()
}
}
proxy = new colvarproxy_lammps(lmp,inp_name,out_name,
rng_seed,t_target,root2root);
proxy = new colvarproxy_lammps(lmp,inp_name,out_name,rng_seed,t_target,root2root);
proxy->init(conf_file);
num_coords = (proxy->modify_atom_positions()->size());

View File

@ -27,13 +27,9 @@ DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg,
if (!compressed) error->all(FLERR, "Dump atom/gz only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpAtomGZ::~DumpAtomGZ() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -28,7 +28,7 @@ namespace LAMMPS_NS {
class DumpAtomGZ : public DumpAtom {
public:
DumpAtomGZ(class LAMMPS *, int, char **);
virtual ~DumpAtomGZ();
virtual ~DumpAtomGZ() = default;
protected:
GzFileWriter writer;

View File

@ -33,10 +33,6 @@ DumpAtomZstd::DumpAtomZstd(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, na
if (!compressed) error->all(FLERR, "Dump atom/zstd only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpAtomZstd::~DumpAtomZstd() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or compressed

View File

@ -34,7 +34,7 @@ namespace LAMMPS_NS {
class DumpAtomZstd : public DumpAtom {
public:
DumpAtomZstd(class LAMMPS *, int, char **);
virtual ~DumpAtomZstd();
virtual ~DumpAtomZstd() = default;
protected:
ZstdFileWriter writer;

View File

@ -29,13 +29,9 @@ DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg
if (!compressed) error->all(FLERR, "Dump cfg/gz only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpCFGGZ::~DumpCFGGZ() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -28,7 +28,7 @@ namespace LAMMPS_NS {
class DumpCFGGZ : public DumpCFG {
public:
DumpCFGGZ(class LAMMPS *, int, char **);
virtual ~DumpCFGGZ();
virtual ~DumpCFGGZ() = default;
protected:
GzFileWriter writer;

View File

@ -35,10 +35,6 @@ DumpCFGZstd::DumpCFGZstd(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg,
if (!compressed) error->all(FLERR, "Dump cfg/zstd only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpCFGZstd::~DumpCFGZstd() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or compressed

View File

@ -33,7 +33,7 @@ namespace LAMMPS_NS {
class DumpCFGZstd : public DumpCFG {
public:
DumpCFGZstd(class LAMMPS *, int, char **);
virtual ~DumpCFGZstd();
virtual ~DumpCFGZstd() = default;
protected:
ZstdFileWriter writer;

View File

@ -27,13 +27,9 @@ DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp,
if (!compressed) error->all(FLERR, "Dump custom/gz only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpCustomGZ::~DumpCustomGZ() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -28,7 +28,7 @@ namespace LAMMPS_NS {
class DumpCustomGZ : public DumpCustom {
public:
DumpCustomGZ(class LAMMPS *, int, char **);
virtual ~DumpCustomGZ();
virtual ~DumpCustomGZ() = default;
protected:
GzFileWriter writer;

View File

@ -37,15 +37,9 @@ DumpCustomZstd::DumpCustomZstd(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Dump custom/zstd only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpCustomZstd::~DumpCustomZstd()
{
}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -34,7 +34,7 @@ namespace LAMMPS_NS {
class DumpCustomZstd : public DumpCustom {
public:
DumpCustomZstd(class LAMMPS *, int, char **);
virtual ~DumpCustomZstd();
virtual ~DumpCustomZstd() = default;
protected:
ZstdFileWriter writer;

View File

@ -27,13 +27,9 @@ DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp, nar
if (!compressed) error->all(FLERR, "Dump local/gz only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpLocalGZ::~DumpLocalGZ() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -28,7 +28,7 @@ namespace LAMMPS_NS {
class DumpLocalGZ : public DumpLocal {
public:
DumpLocalGZ(class LAMMPS *, int, char **);
virtual ~DumpLocalGZ();
virtual ~DumpLocalGZ() = default;
protected:
GzFileWriter writer;

View File

@ -33,13 +33,9 @@ DumpLocalZstd::DumpLocalZstd(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp,
if (!compressed) error->all(FLERR, "Dump local/zstd only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpLocalZstd::~DumpLocalZstd() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -34,7 +34,7 @@ namespace LAMMPS_NS {
class DumpLocalZstd : public DumpLocal {
public:
DumpLocalZstd(class LAMMPS *, int, char **);
virtual ~DumpLocalZstd();
virtual ~DumpLocalZstd() = default;
protected:
ZstdFileWriter writer;

View File

@ -26,13 +26,9 @@ DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg, arg
if (!compressed) error->all(FLERR, "Dump xyz/gz only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpXYZGZ::~DumpXYZGZ() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -28,7 +28,7 @@ namespace LAMMPS_NS {
class DumpXYZGZ : public DumpXYZ {
public:
DumpXYZGZ(class LAMMPS *, int, char **);
virtual ~DumpXYZGZ();
virtual ~DumpXYZGZ() = default;
protected:
GzFileWriter writer;

View File

@ -32,13 +32,9 @@ DumpXYZZstd::DumpXYZZstd(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg,
if (!compressed) error->all(FLERR, "Dump xyz/zstd only writes compressed files");
}
/* ---------------------------------------------------------------------- */
DumpXYZZstd::~DumpXYZZstd() {}
/* ----------------------------------------------------------------------
generic opening of a dump file
ASCII or binary or gzipped
ASCII or binary or compressed
some derived classes override this function
------------------------------------------------------------------------- */

View File

@ -34,7 +34,7 @@ namespace LAMMPS_NS {
class DumpXYZZstd : public DumpXYZ {
public:
DumpXYZZstd(class LAMMPS *, int, char **);
virtual ~DumpXYZZstd();
virtual ~DumpXYZZstd() = default;
protected:
ZstdFileWriter writer;

View File

@ -93,10 +93,6 @@ FixPolarizeBEMICC::FixPolarizeBEMICC(LAMMPS *lmp, int narg, char **arg) : Fix(lm
/* ---------------------------------------------------------------------- */
FixPolarizeBEMICC::~FixPolarizeBEMICC() {}
/* ---------------------------------------------------------------------- */
int FixPolarizeBEMICC::setmask()
{
int mask = 0;

View File

@ -27,7 +27,7 @@ namespace LAMMPS_NS {
class FixPolarizeBEMICC : public Fix {
public:
FixPolarizeBEMICC(class LAMMPS *, int, char **);
~FixPolarizeBEMICC();
~FixPolarizeBEMICC() = default;
virtual int setmask();
virtual void init();
virtual void setup(int);

View File

@ -31,7 +31,6 @@
#include <cmath>
#include <cstring>
#include <strings.h> // for strcasecmp()
#include "omp_compat.h"
using namespace LAMMPS_NS;
@ -85,13 +84,13 @@ ComputeSAED::ComputeSAED(LAMMPS *lmp, int narg, char **arg) :
ztype[i] = SAEDmaxType + 1;
}
for (int i=0; i<ntypes; i++) {
for (int j = 0; j < SAEDmaxType; j++) {
if (strcasecmp(arg[iarg],SAEDtypeList[j]) == 0) {
for (int j = 0; j < SAEDmaxType; j++) {
if (utils::lowercase(arg[iarg]) == utils::lowercase(SAEDtypeList[j])) {
ztype[i] = j;
}
}
if (ztype[i] == SAEDmaxType + 1)
error->all(FLERR,"Compute SAED: Invalid ASF atom type");
}
if (ztype[i] == SAEDmaxType + 1)
error->all(FLERR,"Compute SAED: Invalid ASF atom type");
iarg++;
}
@ -348,7 +347,7 @@ void ComputeSAED::compute_vector()
if (me == 0 && echo)
utils::logmesg(lmp,"-----\nComputing SAED intensities");
double t0 = MPI_Wtime();
double t0 = platform::walltime();
double *Fvec = new double[2*nRows]; // Strct factor (real & imaginary)
// -- Note, vector entries correspond to different RELP
@ -491,7 +490,7 @@ void ComputeSAED::compute_vector()
vector[i] = (scratch[2*i] * scratch[2*i] + scratch[2*i+1] * scratch[2*i+1]) / natoms;
}
double t2 = MPI_Wtime();
double t2 = platform::walltime();
// compute memory usage per processor
double bytes = memory_usage();

View File

@ -32,7 +32,6 @@
#include <cmath>
#include <cstring>
#include <strings.h> // for strcasecmp()
#include "omp_compat.h"
using namespace LAMMPS_NS;
@ -87,7 +86,7 @@ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) :
}
for (int i = 0; i < ntypes; i++) {
for (int j = 0; j < XRDmaxType; j++) {
if (strcasecmp(arg[iarg],XRDtypeList[j]) == 0) {
if (utils::lowercase(arg[iarg]) == utils::lowercase(XRDtypeList[j])) {
ztype[i] = j;
}
}
@ -300,7 +299,7 @@ void ComputeXRD::compute_array()
if (me == 0 && echo) utils::logmesg(lmp, "-----\nComputing XRD intensities");
double t0 = MPI_Wtime();
double t0 = platform::walltime();
double *Fvec = new double[2*size_array_rows]; // Strct factor (real & imaginary)
// -- Note: array rows correspond to different RELP
@ -496,7 +495,7 @@ void ComputeXRD::compute_array()
array[i][1] = (scratch[2*i] * scratch[2*i] + scratch[2*i+1] * scratch[2*i+1]) / natoms;
}
double t2 = MPI_Wtime();
double t2 = platform::walltime();
// compute memory usage per processor
double bytes = memory_usage();

View File

@ -31,6 +31,7 @@
#include <cstring>
#include <cmath>
using namespace LAMMPS_NS;
using namespace FixConst;
@ -100,8 +101,6 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Illegal fix saed/vtk command");
if (nfreq % nevery || nrepeat*nevery > nfreq)
error->all(FLERR,"Illegal fix saed/vtk command");
if (ave != RUNNING && overwrite)
error->all(FLERR,"Illegal fix saed/vtk command");
// allocate memory for averaging
@ -315,7 +314,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep)
if (irepeat == 0)
for (int i = 0; i < nrows; i++)
vector[i] = 0.0;
vector[i] = 0.0;
// accumulate results of computes,fixes,variables to local copy
// compute/fix/variable may invoke computes so wrap with clear/add
@ -369,7 +368,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep)
for (int i = 0; i < nrows; i++) {
vector_total[i] += vector[i];
if (window_limit) vector_total[i] -= vector_list[iwindow][i];
vector_list[iwindow][i] = vector[i];
vector_list[iwindow][i] = vector[i];
}
iwindow++;
@ -391,8 +390,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep)
fp = fopen(nName.c_str(),"w");
if (fp == nullptr)
error->one(FLERR,"Cannot open fix saed/vtk file {}: {}",
nName,utils::getsyserror());
error->one(FLERR,"Cannot open fix saed/vtk file {}: {}", nName,utils::getsyserror());
}
fprintf(fp,"# vtk DataFile Version 3.0 c_%s\n",ids);
@ -406,71 +404,68 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep)
fprintf(fp,"SCALARS intensity float\n");
fprintf(fp,"LOOKUP_TABLE default\n");
filepos = ftell(fp);
if (overwrite) fseek(fp,filepos,SEEK_SET);
// Finding the intersection of the reciprical space and Ewald sphere
int NROW1 = 0;
int NROW2 = 0;
double dinv2 = 0.0;
double r = 0.0;
double K[3];
// Finding the intersection of the reciprical space and Ewald sphere
int NROW1 = 0;
int NROW2 = 0;
double dinv2 = 0.0;
double r = 0.0;
double K[3];
// Zone flag to capture entire recrocal space volume
if ((Zone[0] == 0) && (Zone[1] == 0) && (Zone[2] == 0)) {
for (int k = Knmin[2]; k <= Knmax[2]; k++) {
for (int j = Knmin[1]; j <= Knmax[1]; j++) {
for (int i = Knmin[0]; i <= Knmax[0]; i++) {
K[0] = i * dK[0];
K[1] = j * dK[1];
K[2] = k * dK[2];
dinv2 = (K[0] * K[0] + K[1] * K[1] + K[2] * K[2]);
if (dinv2 < Kmax * Kmax) {
fprintf(fp,"%g\n",vector_total[NROW1]/norm);
fflush(fp);
NROW1++;
NROW2++;
} else {
// Zone flag to capture entire recrocal space volume
if ((Zone[0] == 0) && (Zone[1] == 0) && (Zone[2] == 0)) {
for (int k = Knmin[2]; k <= Knmax[2]; k++) {
for (int j = Knmin[1]; j <= Knmax[1]; j++) {
for (int i = Knmin[0]; i <= Knmax[0]; i++) {
K[0] = i * dK[0];
K[1] = j * dK[1];
K[2] = k * dK[2];
dinv2 = (K[0] * K[0] + K[1] * K[1] + K[2] * K[2]);
if (dinv2 < Kmax * Kmax) {
fprintf(fp,"%g\n",vector_total[NROW1]/norm);
fflush(fp);
NROW1++;
NROW2++;
} else {
fprintf(fp,"%d\n",-1);
fflush(fp);
NROW2++;
}
}
}
}
} else {
for (int k = Knmin[2]; k <= Knmax[2]; k++) {
for (int j = Knmin[1]; j <= Knmax[1]; j++) {
for (int i = Knmin[0]; i <= Knmax[0]; i++) {
K[0] = i * dK[0];
K[1] = j * dK[1];
K[2] = k * dK[2];
dinv2 = (K[0] * K[0] + K[1] * K[1] + K[2] * K[2]);
if (dinv2 < Kmax * Kmax) {
r=0.0;
for (int m=0; m<3; m++) r += pow(K[m] - Zone[m],2.0);
r = sqrt(r);
if ( (r > (R_Ewald - dR_Ewald) ) && (r < (R_Ewald + dR_Ewald) )) {
fprintf(fp,"%g\n",vector_total[NROW1]/norm);
fflush(fp);
NROW2++;
NROW1++;
} else {
fprintf(fp,"%d\n",-1);
fflush(fp);
NROW2++;
}
}
} else {
for (int k = Knmin[2]; k <= Knmax[2]; k++) {
for (int j = Knmin[1]; j <= Knmax[1]; j++) {
for (int i = Knmin[0]; i <= Knmax[0]; i++) {
K[0] = i * dK[0];
K[1] = j * dK[1];
K[2] = k * dK[2];
dinv2 = (K[0] * K[0] + K[1] * K[1] + K[2] * K[2]);
if (dinv2 < Kmax * Kmax) {
r=0.0;
for (int m=0; m<3; m++) r += pow(K[m] - Zone[m],2.0);
r = sqrt(r);
if ( (r > (R_Ewald - dR_Ewald) ) && (r < (R_Ewald + dR_Ewald) )) {
fprintf(fp,"%g\n",vector_total[NROW1]/norm);
fflush(fp);
NROW2++;
NROW1++;
} else {
fprintf(fp,"%d\n",-1);
fflush(fp);
NROW2++;
}
} else {
fprintf(fp,"%d\n",-1);
fflush(fp);
NROW2++;
}
}
}
}
}
}
}
nOutput++;
}
@ -497,7 +492,6 @@ void FixSAEDVTK::options(int narg, char **arg)
fp = nullptr;
ave = ONE;
startstep = 0;
overwrite = 0;
// optional args
int iarg = 7;
@ -534,9 +528,6 @@ void FixSAEDVTK::options(int narg, char **arg)
if (iarg+2 > narg) error->all(FLERR,"Illegal fix saed/vtk command");
startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
iarg += 2;
} else if (strcmp(arg[iarg],"overwrite") == 0) {
overwrite = 1;
iarg += 1;
} else error->all(FLERR,"Illegal fix saed/vtk command");
}
}

View File

@ -43,8 +43,6 @@ class FixSAEDVTK : public Fix {
int nrows;
int ave, nwindow, nsum, startstep;
int overwrite;
long filepos;
int norm, iwindow, window_limit;
double *vector;

View File

@ -61,12 +61,6 @@ FixEDPDSource::FixEDPDSource(LAMMPS *lmp, int narg, char **arg) :
/* ---------------------------------------------------------------------- */
FixEDPDSource::~FixEDPDSource()
{
}
/* ---------------------------------------------------------------------- */
int FixEDPDSource::setmask()
{
int mask = 0;

View File

@ -27,7 +27,7 @@ namespace LAMMPS_NS {
class FixEDPDSource : public Fix {
public:
FixEDPDSource(class LAMMPS *, int, char **);
~FixEDPDSource();
~FixEDPDSource() = default;
int setmask();
void init();
void post_force(int);

View File

@ -62,12 +62,6 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) :
/* ---------------------------------------------------------------------- */
FixTDPDSource::~FixTDPDSource()
{
}
/* ---------------------------------------------------------------------- */
int FixTDPDSource::setmask()
{
int mask = 0;

View File

@ -27,7 +27,7 @@ namespace LAMMPS_NS {
class FixTDPDSource : public Fix {
public:
FixTDPDSource(class LAMMPS *, int, char **);
~FixTDPDSource();
~FixTDPDSource() = default;
int setmask();
void init();
void post_force(int);

View File

@ -19,19 +19,19 @@
#include "pair_mdpd.h"
#include "atom.h"
#include "citeme.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "neigh_list.h"
#include "neighbor.h"
#include "random_mars.h"
#include "update.h"
#include <cmath>
#include <ctime>
#include "atom.h"
#include "comm.h"
#include "update.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "random_mars.h"
#include "citeme.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
@ -217,12 +217,13 @@ void PairMDPD::settings(int narg, char **arg)
seed = utils::inumeric(FLERR,arg[2],false,lmp);
// initialize Marsaglia RNG with processor-unique seed
// create a positive seed based on the system clock, if requested.
if (seed <= 0) {
struct timespec time;
clock_gettime( CLOCK_REALTIME, &time );
seed = time.tv_nsec; // if seed is non-positive, get the current time as the seed
constexpr double LARGE_NUM = 2<<30;
seed = int(fmod(platform::walltime() * LARGE_NUM, LARGE_NUM)) + 1;
}
delete random;
random = new RanMars(lmp,(seed + comm->me) % 900000000);

View File

@ -18,19 +18,19 @@
------------------------------------------------------------------------- */
#include "pair_tdpd.h"
#include <cmath>
#include <ctime>
#include "atom.h"
#include "comm.h"
#include "update.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "random_mars.h"
#include "citeme.h"
#include "memory.h"
#include "error.h"
#include "atom.h"
#include "citeme.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "neigh_list.h"
#include "neighbor.h"
#include "random_mars.h"
#include "update.h"
#include <cmath>
using namespace LAMMPS_NS;
@ -239,12 +239,13 @@ void PairTDPD::settings(int narg, char **arg)
seed = utils::inumeric(FLERR,arg[2],false,lmp);
// initialize Marsaglia RNG with processor-unique seed
// create a positive seed based on the system clock, if requested.
if (seed <= 0) {
struct timespec time;
clock_gettime( CLOCK_REALTIME, &time );
seed = time.tv_nsec; // if seed is non-positive, get the current time as the seed
constexpr double LARGE_NUM = 2<<30;
seed = int(fmod(platform::walltime() * LARGE_NUM, LARGE_NUM)) + 1;
}
delete random;
random = new RanMars(lmp,(seed + comm->me) % 900000000);

View File

@ -207,7 +207,7 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword)
// loop until section found with matching keyword
while (1) {
while (true) {
if (fgets(line,MAXLINE,fp) == nullptr)
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line

View File

@ -321,7 +321,7 @@ void FixEOStableRX::read_file(char *file)
char line[MAXLINE],*ptr;
int eof = 0;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == nullptr) {
@ -427,7 +427,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword)
// loop until section found with matching keyword
while (1) {
while (true) {
if (fgets(line,MAXLINE,fp) == nullptr)
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line

View File

@ -58,7 +58,7 @@ namespace /* anonymous */
{
typedef double TimerType;
TimerType getTimeStamp() { return MPI_Wtime(); }
TimerType getTimeStamp() { return platform::walltime(); }
double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; }
} // end namespace
@ -84,7 +84,7 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) :
id_fix_species = nullptr;
id_fix_species_old = nullptr;
const int Verbosity = 1;
constexpr int Verbosity = 1;
// Keep track of the argument list.
int iarg = 3;
@ -101,13 +101,10 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(word,"none") == 0) {
wtFlag = 0;
localTempFlag = NONE;
}
else if (strcmp(word,"lucy") == 0) {
} else if (strcmp(word,"lucy") == 0) {
wtFlag = LUCY;
localTempFlag = HARMONIC;
}
else
error->all(FLERR,"Illegal fix rx local temperature weighting technique");
} else error->all(FLERR,"Illegal fix rx local temperature weighting technique");
}
// Select either sparse and dense matrix
@ -120,21 +117,11 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) :
useSparseKinetics = true;
else if (strcmp(word,"dense") == 0)
useSparseKinetics = false;
else {
std::string errmsg = "Illegal command " + std::string(word)
+ " expected \"sparse\" or \"dense\"\n";
error->all(FLERR, errmsg);
}
else error->all(FLERR, "Illegal command " + std::string(word)
+ " expected \"sparse\" or \"dense\"\n");
if (comm->me == 0 and Verbosity > 1) {
std::string msg = "FixRX: matrix format is ";
if (useSparseKinetics)
msg += std::string("sparse");
else
msg += std::string("dense");
error->message(FLERR, msg);
}
if (comm->me == 0 && Verbosity > 1)
error->message(FLERR, fmt::format("FixRX: matrix format is {}",word));
}
// Determine the ODE solver/stepper strategy in arg[6].
@ -169,40 +156,32 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) :
}
if (odeIntegrationFlag == ODE_LAMMPS_RK4 && narg==8) {
char *word = arg[iarg++];
minSteps = atoi( word );
minSteps = utils::inumeric(FLERR,arg[iarg++],false,lmp);
if (comm->me == 0 and Verbosity > 1) {
char msg[128];
sprintf(msg, "FixRX: RK4 numSteps= %d", minSteps);
error->message(FLERR, msg);
}
}
else if (odeIntegrationFlag == ODE_LAMMPS_RK4 && narg>8) {
if (comm->me == 0 && Verbosity > 1)
error->message(FLERR,fmt::format("FixRX: RK4 numSteps= {}", minSteps));
} else if (odeIntegrationFlag == ODE_LAMMPS_RK4 && narg>8) {
error->all(FLERR,"Illegal fix rx command. Too many arguments for RK4 solver.");
}
else if (odeIntegrationFlag == ODE_LAMMPS_RKF45) {
} else if (odeIntegrationFlag == ODE_LAMMPS_RKF45) {
// Must have four options.
if (narg < 11)
error->all(FLERR,"Illegal fix rx command. Too few arguments for RKF45 solver.");
minSteps = atoi( arg[iarg++] );
maxIters = atoi( arg[iarg++] );
relTol = strtod( arg[iarg++], nullptr);
absTol = strtod( arg[iarg++], nullptr);
minSteps = utils::inumeric(FLERR,arg[iarg++],false,lmp);
maxIters = utils::inumeric(FLERR,arg[iarg++],false,lmp);
relTol = utils::numeric(FLERR,arg[iarg++],false,lmp);
absTol = utils::numeric(FLERR,arg[iarg++],false,lmp);
if (iarg < narg)
diagnosticFrequency = atoi( arg[iarg++] );
diagnosticFrequency = utils::inumeric(FLERR,arg[iarg++],false,lmp);
// maxIters must be at least minSteps.
maxIters = std::max( minSteps, maxIters );
if (comm->me == 0 and Verbosity > 1) {
//printf("FixRX: RKF45 minSteps= %d maxIters= %d absTol= %e relTol= %e\n", minSteps, maxIters, absTol, relTol);
char msg[128];
sprintf(msg, "FixRX: RKF45 minSteps= %d maxIters= %d relTol= %.1e absTol= %.1e diagnosticFrequency= %d", minSteps, maxIters, relTol, absTol, diagnosticFrequency);
error->message(FLERR, msg);
}
if (comm->me == 0 && Verbosity > 1)
error->message(FLERR, fmt::format("FixRX: RKF45 minSteps= {} maxIters= {} "
"relTol= {:.1e} absTol= {:.1e} diagnosticFrequency= {}",
minSteps, maxIters, relTol, absTol, diagnosticFrequency));
}
// Initialize/Create the sparse matrix database.
@ -265,11 +244,8 @@ void FixRX::post_constructor()
fp = nullptr;
if (comm->me == 0) {
fp = utils::open_potential(kineticsFile,lmp,nullptr);
if (fp == nullptr) {
char str[128];
snprintf(str,128,"Cannot open rx file %s",kineticsFile);
error->one(FLERR,str);
}
if (fp == nullptr)
error->one(FLERR,"Cannot open rx file {}: {}",kineticsFile,utils::getsyserror());
}
// Assign species names to tmpspecies array and determine the number of unique species
@ -279,7 +255,7 @@ void FixRX::post_constructor()
int eof = 0;
char * word;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == nullptr) {
@ -358,7 +334,7 @@ void FixRX::post_constructor()
read_file( kineticsFile );
if (useSparseKinetics)
this->initSparse();
initSparse();
// set comm size needed by this Pair
comm_forward = nspecies*2;
@ -369,9 +345,9 @@ void FixRX::post_constructor()
void FixRX::initSparse()
{
const int Verbosity = 1;
constexpr int Verbosity = 1;
if (comm->me == 0 and Verbosity > 1) {
if (comm->me == 0 && Verbosity > 1) {
for (int k = 0; k < nspecies; ++k)
printf("atom->dvname[%d]= %s\n", k, atom->dvname[k]);
@ -421,7 +397,7 @@ void FixRX::initSparse()
std::string pstr, rstr;
bool allAreIntegral = true;
for (int k = 0; k < nspecies; ++k) {
if (stoichReactants[i][k] == 0 and stoichProducts[i][k] == 0)
if (stoichReactants[i][k] == 0 && stoichProducts[i][k] == 0)
nzeros++;
if (stoichReactants[i][k] > 0.0) {
@ -448,8 +424,9 @@ void FixRX::initSparse()
pstr += atom->dvname[k];
}
}
if (comm->me == 0 and Verbosity > 1)
printf("rx%3d: %d %d %d ... %s %s %s\n", i, nreac_i, nprod_i, allAreIntegral, rstr.c_str(), /*reversible[i]*/ (false) ? "<=>" : "=", pstr.c_str());
if (comm->me == 0 && Verbosity > 1)
utils::logmesg(lmp,"rx{:3d}: {} {} {} ... {} = {}\n",
i, nreac_i, nprod_i, allAreIntegral, rstr, pstr);
mxreac = std::max( mxreac, nreac_i );
mxprod = std::max( mxprod, nprod_i );
@ -457,9 +434,13 @@ void FixRX::initSparse()
if (allAreIntegral) nIntegral++;
}
if (comm->me == 0 and Verbosity > 1) {
char msg[256];
sprintf(msg, "FixRX: Sparsity of Stoichiometric Matrix= %.1f%% non-zeros= %d nspecies= %d nreactions= %d maxReactants= %d maxProducts= %d maxSpecies= %d integralReactions= %d", 100*(double(nzeros) / (nspecies * nreactions)), nzeros, nspecies, nreactions, mxreac, mxprod, (mxreac + mxprod), SparseKinetics_enableIntegralReactions);
if (comm->me == 0 && Verbosity > 1) {
auto msg = fmt::format("FixRX: Sparsity of Stoichiometric Matrix= {:.1f}% non-zeros= {} "
"nspecies= {} nreactions= {} maxReactants= {} maxProducts= {} "
"maxSpecies= {} integralReactions= {}",
100*(double(nzeros) / (nspecies * nreactions)), nzeros, nspecies,
nreactions, mxreac, mxprod, (mxreac + mxprod),
SparseKinetics_enableIntegralReactions);
error->message(FLERR, msg);
}
@ -539,7 +520,7 @@ void FixRX::initSparse()
sparseKinetics_isIntegralReaction[i] = isIntegral_i;
}
if (comm->me == 0 and Verbosity > 1) {
if (comm->me == 0 && Verbosity > 1) {
for (int i = 1; i < nu_bin.size(); ++i)
if (nu_bin[i] > 0)
printf("nu_bin[%d] = %d\n", i, nu_bin[i]);
@ -554,7 +535,7 @@ void FixRX::initSparse()
rstr += " + ";
char digit[6];
if (SparseKinetics_enableIntegralReactions and sparseKinetics_isIntegralReaction[i])
if (SparseKinetics_enableIntegralReactions && sparseKinetics_isIntegralReaction[i])
sprintf(digit,"%d ", sparseKinetics_inu[i][kk]);
else
sprintf(digit,"%4.1f ", sparseKinetics_nu[i][kk]);
@ -570,7 +551,7 @@ void FixRX::initSparse()
pstr += " + ";
char digit[6];
if (SparseKinetics_enableIntegralReactions and sparseKinetics_isIntegralReaction[i])
if (SparseKinetics_enableIntegralReactions && sparseKinetics_isIntegralReaction[i])
sprintf(digit,"%d ", sparseKinetics_inu[i][kk]);
else
sprintf(digit,"%4.1f ", sparseKinetics_nu[i][kk]);
@ -578,7 +559,7 @@ void FixRX::initSparse()
pstr += atom->dvname[k];
}
}
if (comm->me == 0 and Verbosity > 1)
if (comm->me == 0 && Verbosity > 1)
printf("rx%3d: %s %s %s\n", i, rstr.c_str(), /*reversible[i]*/ (false) ? "<=>" : "=", pstr.c_str());
}
// end for nreactions
@ -774,18 +755,9 @@ void FixRX::pre_force(int /*vflag*/)
double time_ODE = getElapsedTime(timer_localTemperature, timer_ODE);
//printf("me= %d total= %g temp= %g ode= %g comm= %g nlocal= %d nfc= %d %d\n", comm->me,
// getElapsedTime(timer_start, timer_stop),
// getElapsedTime(timer_start, timer_localTemperature),
// getElapsedTime(timer_localTemperature, timer_ODE),
// getElapsedTime(timer_ODE, timer_stop), nlocal, nFuncs, nSteps);
// Warn the user if a failure was detected in the ODE solver.
if (nFails > 0) {
char sbuf[128];
sprintf(sbuf,"in FixRX::pre_force, ODE solver failed for %d atoms.", nFails);
error->warning(FLERR, sbuf);
}
if (nFails > 0)
error->warning(FLERR, fmt::format("FixRX::pre_force ODE solver failed for {} atoms.", nFails));
// Compute and report ODE diagnostics, if requested.
if (odeIntegrationFlag == ODE_LAMMPS_RKF45 && diagnosticFrequency != 0) {
@ -832,7 +804,7 @@ void FixRX::read_file(char *file)
char line[MAXLINE],*ptr;
int eof = 0;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == nullptr) {
@ -886,7 +858,7 @@ void FixRX::read_file(char *file)
nreactions=0;
sign = -1.0;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == nullptr) {
@ -1183,7 +1155,7 @@ int FixRX::rkf45_h0 (const int neq, const double t, const double /*t_stop*/,
// compute ydot at t=t0
rhs (t, y, ydot, v_params);
while (1)
while (true)
{
// Estimate y'' with finite-difference ...
@ -1282,7 +1254,7 @@ void FixRX::odeDiagnostics()
double max_per_proc[numCounters];
double min_per_proc[numCounters];
if (1)
if (true)
{
static bool firstStep = true;
@ -1313,7 +1285,7 @@ void FixRX::odeDiagnostics()
printf("me= %d nst= %g nfc= %g time= %g nlocal= %g lmpnst= %g weight_idx= %d 1st= %d aveNeigh= %g\n", comm->me, this->diagnosticCounter[0], this->diagnosticCounter[1], this->diagnosticCounter[2], this->diagnosticCounter[3], this->diagnosticCounter[4], rx_weight_index, firstStep, averageNumNeighbors);
if (rx_weight_index != -1 && !firstStep && 0)
if (rx_weight_index != -1 && !firstStep && false)
{
double *rx_weight = atom->dvector[rx_weight_index];
@ -1422,17 +1394,9 @@ void FixRX::odeDiagnostics()
double time_local = getElapsedTime( timer_start, timer_stop );
if (comm->me == 0) {
char smesg[128];
#define print_mesg(smesg) {\
if (screen) fprintf(screen,"%s\n", smesg); \
if (logfile) fprintf(logfile,"%s\n", smesg); }
sprintf(smesg, "FixRX::ODE Diagnostics: # of iters |# of rhs evals| run-time (sec) | # atoms");
print_mesg(smesg);
sprintf(smesg, " AVG per ODE : %-12.5g | %-12.5g | %-12.5g", avg_per_atom[0], avg_per_atom[1], avg_per_atom[2]);
print_mesg(smesg);
utils::logmesg(lmp,"FixRX::ODE Diagnostics: # of iters |# of rhs evals| run-time (sec) | # atoms\n");
utils::logmesg(lmp," AVG per ODE : {:>12.5g} | {:>12.5g} | {:>12.5g}\n",
avg_per_atom[0], avg_per_atom[1], avg_per_atom[2]);
// only valid for single time-step!
if (diagnosticFrequency == 1) {
@ -1440,41 +1404,32 @@ void FixRX::odeDiagnostics()
for (int i = 0; i < numCounters; ++i)
rms_per_ODE[i] = sqrt( sum_sq[i+numCounters] / nODEs );
sprintf(smesg, " RMS per ODE : %-12.5g | %-12.5g ", rms_per_ODE[0], rms_per_ODE[1]);
print_mesg(smesg);
sprintf(smesg, " MAX per ODE : %-12.5g | %-12.5g ", max_per_ODE[0], max_per_ODE[1]);
print_mesg(smesg);
sprintf(smesg, " MIN per ODE : %-12.5g | %-12.5g ", min_per_ODE[0], min_per_ODE[1]);
print_mesg(smesg);
utils::logmesg(lmp, " RMS per ODE : {:>12.5g} | {:>12.5g}\n",
rms_per_ODE[0], rms_per_ODE[1]);
utils::logmesg(lmp, " MAX per ODE : {:>12.5g} | {:>12.5g}\n",
max_per_ODE[0], max_per_ODE[1]);
utils::logmesg(lmp, " MIN per ODE : {:>12.5g} | {:>12.5g}\n",
min_per_ODE[0], min_per_ODE[1]);
}
sprintf(smesg, " AVG per Proc : %-12.5g | %-12.5g | %-12.5g | %-12.5g", avg_per_proc[StepSum], avg_per_proc[FuncSum], avg_per_proc[TimeSum], avg_per_proc[AtomSum]);
print_mesg(smesg);
utils::logmesg(lmp," AVG per Proc : {:>12.5g} | {:>12.5g} | {:>12.5g} | {:>12.5g}\n",
avg_per_proc[StepSum], avg_per_proc[FuncSum], avg_per_proc[TimeSum], avg_per_proc[AtomSum]);
if (comm->nprocs > 1) {
double rms_per_proc[numCounters];
for (int i = 0; i < numCounters; ++i)
rms_per_proc[i] = sqrt( sum_sq[i] / comm->nprocs );
sprintf(smesg, " RMS per Proc : %-12.5g | %-12.5g | %-12.5g | %-12.5g", rms_per_proc[0], rms_per_proc[1], rms_per_proc[2], rms_per_proc[AtomSum]);
print_mesg(smesg);
sprintf(smesg, " MAX per Proc : %-12.5g | %-12.5g | %-12.5g | %-12.5g", max_per_proc[0], max_per_proc[1], max_per_proc[2], max_per_proc[AtomSum]);
print_mesg(smesg);
sprintf(smesg, " MIN per Proc : %-12.5g | %-12.5g | %-12.5g | %-12.5g", min_per_proc[0], min_per_proc[1], min_per_proc[2], min_per_proc[AtomSum]);
print_mesg(smesg);
utils::logmesg(lmp," RMS per Proc : {:>12.5g} | {:>12.5g} | {:>12.5g} | {:>12.5g}\n",
rms_per_proc[0], rms_per_proc[1], rms_per_proc[2], rms_per_proc[AtomSum]);
utils::logmesg(lmp," MAX per Proc : {:>12.5g} | {:>12.5g} | {:>12.5g} | {:>12.5g}\n",
max_per_proc[0], max_per_proc[1], max_per_proc[2], max_per_proc[AtomSum]);
utils::logmesg(lmp," MIN per Proc : {:>12.5g} | {:>12.5g} | {:>12.5g} | {:>12.5g}\n",
min_per_proc[0], min_per_proc[1], min_per_proc[2], min_per_proc[AtomSum]);
}
sprintf(smesg, " AVG'd over %d time-steps", nTimes);
print_mesg(smesg);
sprintf(smesg, " AVG'ing took %g sec", time_local);
print_mesg(smesg);
#undef print_mesg
utils::logmesg(lmp, " AVG'd over {} time-steps\n", nTimes);
utils::logmesg(lmp, " AVG'ing took {} sec", time_local);
}
// Reset the counters.

View File

@ -97,7 +97,7 @@ class FixRX : public Fix {
// Sparse stoichiometric matrix storage format and methods.
bool useSparseKinetics;
//SparseKinetics sparseKinetics;
void initSparse(void);
void initSparse();
int rhs_sparse(double, const double *, double *, void *) const;
int sparseKinetics_maxReactants; //<! Max # of reactants species in any reaction
@ -134,7 +134,7 @@ class FixRX : public Fix {
int *diagnosticCounterPerODE[numDiagnosticCounters];
//!< ODE Solver diagnostics.
void odeDiagnostics(void);
void odeDiagnostics();
protected:
char *kineticsFile;

View File

@ -549,12 +549,9 @@ void FixShardlow::initial_integrate(int /*vflag*/)
error->all(FLERR,"Fix shardlow does not yet support triclinic geometries");
if (rcut >= bbx || rcut >= bby || rcut>= bbz )
{
char fmt[] = {"Shardlow algorithm requires sub-domain length > 2*(rcut+skin). Either reduce the number of processors requested, or change the cutoff/skin: rcut= %e bbx= %e bby= %e bbz= %e\n"};
char *msg = (char *) malloc(sizeof(fmt) + 4*15);
sprintf(msg, fmt, rcut, bbx, bby, bbz);
error->one(FLERR, msg);
}
error->one(FLERR,"Shardlow algorithm requires sub-domain length > 2*(rcut+skin). "
"Either reduce the number of processors requested, or change the cutoff/skin: "
"rcut= {} bbx= {} bby= {} bbz= {}\n", rcut, bbx, bby, bbz);
NPairHalfBinNewtonSSA *np_ssa = dynamic_cast<NPairHalfBinNewtonSSA*>(list->np);
if (!np_ssa) error->one(FLERR, "NPair wasn't a NPairHalfBinNewtonSSA object");

View File

@ -34,10 +34,6 @@ NBinSSA::NBinSSA(LAMMPS *lmp) : NBinStandard(lmp)
}
}
NBinSSA::~NBinSSA()
{
}
/* ----------------------------------------------------------------------
bin owned and ghost atoms for the Shardlow Splitting Algorithm (SSA)
local atoms are in distinct bins (binhead[]) from the ghosts

View File

@ -41,7 +41,7 @@ class NBinSSA : public NBinStandard {
int lbinzhi; // highest local bin z-dim coordinate
NBinSSA(class LAMMPS *);
~NBinSSA();
virtual ~NBinSSA() = default;
void bin_atoms_setup(int);
void bin_atoms();

View File

@ -58,7 +58,7 @@ struct PairExp6ParamDataType
*epsilonOld2, *alphaOld2, *rmOld2, *mixWtSite2old;
// Default constructor -- nullify everything.
PairExp6ParamDataType(void)
PairExp6ParamDataType()
: n(0), epsilon1(nullptr), alpha1(nullptr), rm1(nullptr), mixWtSite1(nullptr),
epsilon2(nullptr), alpha2(nullptr), rm2(nullptr), mixWtSite2(nullptr),
epsilonOld1(nullptr), alphaOld1(nullptr), rmOld1(nullptr), mixWtSite1old(nullptr),
@ -731,7 +731,7 @@ void PairExp6rx::read_file(char *file)
char line[MAXLINE],*ptr;
int eof = 0;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == nullptr) {
@ -838,7 +838,7 @@ void PairExp6rx::read_file2(char *file)
char line[MAXLINE],*ptr;
int eof = 0;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == nullptr) {

View File

@ -356,7 +356,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword)
// loop until section found with matching keyword
while (1) {
while (true) {
if (fgets(line,MAXLINE,fp) == nullptr)
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line

View File

@ -496,7 +496,7 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword)
// loop until section found with matching keyword
while (1) {
while (true) {
if (fgets(line,MAXLINE,fp) == nullptr)
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line

View File

@ -89,9 +89,7 @@ void ComputeTempDrude::dof_compute()
int dim = domain->dimension;
int *drudetype = fix_drude->drudetype;
fix_dof = 0;
for (int i = 0; i < modify->nfix; i++)
fix_dof += modify->fix[i]->dof(igroup);
adjust_dof_fix();
bigint dof_core_loc = 0, dof_drude_loc = 0;
for (int i = 0; i < nlocal; i++) {

View File

@ -35,7 +35,6 @@ class ComputeTempDrude : public Compute {
int modify_param(int, char **);
private:
int fix_dof;
class FixDrude *fix_drude;
char *id_temp;
class Compute *temperature;

View File

@ -761,7 +761,7 @@ void FixTGNHDrude::setup_mol_mass_dof() {
dof_mol, dof_int, dof_drude);
}
}
if (dof_mol <=0 or dof_int <=0 or dof_drude <=0)
if (dof_mol <=0 || dof_int <=0 || dof_drude <=0)
error->all(FLERR, "TGNHC thermostat requires DOFs of molecules, atoms and dipoles larger than 0");
}

View File

@ -29,7 +29,7 @@ class ComputeTempDeformEff : public Compute {
ComputeTempDeformEff(class LAMMPS *, int, char **);
virtual ~ComputeTempDeformEff();
void init();
void setup(void);
void setup();
virtual double compute_scalar();
virtual void compute_vector();

View File

@ -33,7 +33,7 @@ class ComputeTempRegionEff : public Compute {
virtual double compute_scalar();
virtual void compute_vector();
void dof_remove_pre(void);
void dof_remove_pre();
int dof_remove(int);
void remove_bias(int, double *);
void remove_bias_all();

View File

@ -43,7 +43,6 @@ class ComputeTempRotate : public Compute {
double memory_usage();
private:
int fix_dof;
double tfactor, masstotal;
double **vbiasall; // stored velocity bias for all atoms
int maxbias; // size of vbiasall array

View File

@ -604,7 +604,7 @@ xdrstdio_create (XDR *xdrs, FILE *file, enum xdr_op op)
xdrs->x_ops = (struct xdr_ops *) &xdrstdio_ops;
xdrs->x_private = (char *) file;
xdrs->x_handy = 0;
xdrs->x_base = 0;
xdrs->x_base = nullptr;
}
/*

View File

@ -59,8 +59,8 @@ extern "C" {
typedef int bool_t;
#if defined(__MINGW32__) || defined(__APPLE__) || defined(__FreeBSD__) || \
defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__) || \
defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__)
typedef char *caddr_t;
typedef unsigned int u_int;
#endif

View File

@ -36,7 +36,6 @@
#include <cmath>
#include <cstring>
#include <unistd.h>
using namespace LAMMPS_NS;
using namespace FixConst;
@ -260,11 +259,11 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg):
fprintf(fp," %s*%s",arg[5+i],arg[5+j]);
fprintf(fp,"\n");
}
filepos = ftell(fp);
filepos = platform::ftell(fp);
}
delete [] title1;
delete [] title2;
delete[] title1;
delete[] title2;
// allocate and initialize memory for calculated values and correlators
@ -319,11 +318,11 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg):
FixAveCorrelateLong::~FixAveCorrelateLong()
{
delete [] which;
delete [] argindex;
delete [] value2index;
for (int i = 0; i < nvalues; i++) delete [] ids[i];
delete [] ids;
delete[] which;
delete[] argindex;
delete[] value2index;
for (int i = 0; i < nvalues; i++) delete[] ids[i];
delete[] ids;
memory->destroy(values);
memory->destroy(shift);
@ -467,7 +466,7 @@ void FixAveCorrelateLong::end_of_step()
evaluate();
if (fp && me == 0) {
if (overwrite) fseek(fp,filepos,SEEK_SET);
if (overwrite) platform::fseek(fp,filepos);
fprintf(fp,"# Timestep: " BIGINT_FORMAT "\n", ntimestep);
for (unsigned int i=0;i<npcorr;++i) {
fprintf(fp, "%lg ", t[i]*update->dt*nevery);
@ -478,9 +477,9 @@ void FixAveCorrelateLong::end_of_step()
}
fflush(fp);
if (overwrite) {
long fileend = ftell(fp);
if ((fileend > 0) && (ftruncate(fileno(fp),fileend)))
perror("Error while tuncating output");
bigint fileend = platform::ftell(fp);
if ((fileend > 0) && (platform::ftruncate(fp,fileend)))
error->warning(FLERR,"Error while tuncating output: {}", utils::getsyserror());
}
}

View File

@ -66,7 +66,7 @@ class FixAveCorrelateLong : public Fix {
FILE *fp;
int type, startstep, overwrite;
long filepos;
bigint filepos;
int npair; // number of correlation pairs to calculate
double *values;

View File

@ -234,7 +234,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) :
char line[MAXLINE],*ptr;
int n,nwords,ndone=0,eof=0;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fgle);
if (ptr == nullptr) {
@ -300,7 +300,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) :
ndone = eof = 0;
const double cfac = force->boltz / force->mvv2e;
while (1) {
while (true) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fgle);
if (ptr == nullptr) {

View File

@ -123,7 +123,10 @@ nfileevery(0), fp(nullptr), xf(nullptr), xold(nullptr)
FixTMD::~FixTMD()
{
if (nfileevery && me == 0) fclose(fp);
if (nfileevery && me == 0) {
if (compressed) platform::pclose(fp);
else fclose(fp);
}
// unregister callbacks to this fix from Atom class
@ -492,7 +495,7 @@ void FixTMD::readfile(char *file)
delete [] buffer;
if (me == 0) {
if (compressed) pclose(fp);
if (compressed) platform::pclose(fp);
else fclose(fp);
}
@ -514,33 +517,21 @@ void FixTMD::readfile(char *file)
/* ----------------------------------------------------------------------
proc 0 opens TMD data file
test if gzipped
test if compressed
------------------------------------------------------------------------- */
void FixTMD::open(char *file)
void FixTMD::open(const std::string &file)
{
if (utils::strmatch(file,"\\.gz$")) {
if (platform::has_compress_extension(file)) {
compressed = 1;
#ifdef LAMMPS_GZIP
auto gunzip = fmt::format("gzip -c -d {}",file);
#ifdef _WIN32
fp = _popen(gunzip.c_str(),"rb");
#else
fp = popen(gunzip.c_str(),"r");
#endif
#else
error->one(FLERR,"Cannot open gzipped file without gzip support");
#endif
fp = platform::compressed_read(file);
if (!fp) error->one(FLERR,"Cannot open compressed file for reading");
} else {
compressed = 0;
fp = fopen(file,"r");
fp = fopen(file.c_str(),"r");
}
if (fp == nullptr)
error->one(FLERR,"Cannot open file {}: {}",file, utils::getsyserror());
if (!fp) error->one(FLERR,"Cannot open file {}: {}", file, utils::getsyserror());
}
/* ---------------------------------------------------------------------- */

View File

@ -52,7 +52,7 @@ class FixTMD : public Fix {
double **xf, **xold;
void readfile(char *);
void open(char *);
void open(const std::string &);
};
} // namespace LAMMPS_NS

View File

@ -28,7 +28,6 @@
#include "random_mars.h"
#include "respa.h"
#include "potential_file_reader.h"
#include "tokenizer.h"
#include "update.h"
#include <cmath>
@ -77,7 +76,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
nzgrid = utils::inumeric(FLERR,arg[12],false,lmp);
tinit = 0.0;
infile = outfile = NULL;
infile = outfile = nullptr;
int iarg = 13;
while (iarg < narg) {
@ -491,10 +490,10 @@ void FixTTM::read_electron_temperatures(const std::string &filename)
// check correctness of input data
if ((ix < 0) || (ix >= nxgrid) || (iy < 0) || (iy >= nygrid) || (iz < 0) || (iz >= nzgrid))
throw parser_error("Fix ttm invalid grid index in fix ttm grid file");
throw TokenizerException("Fix ttm invalid grid index in fix ttm grid file","");
if (T_tmp < 0.0)
throw parser_error("Fix ttm electron temperatures must be > 0.0");
throw TokenizerException("Fix ttm electron temperatures must be > 0.0","");
T_electron[iz][iy][ix] = T_tmp;
T_initial_set[iz][iy][ix] = 1;

View File

@ -77,14 +77,6 @@ class FixTTM : public Fix {
virtual void deallocate_grid();
virtual void read_electron_temperatures(const std::string &);
virtual void write_electron_temperatures(const std::string &);
class parser_error : public std::exception {
std::string message;
public:
parser_error(const std::string &mesg) { message = mesg; }
const char *what() const noexcept { return message.c_str(); }
};
};
} // namespace LAMMPS_NS

View File

@ -306,7 +306,7 @@ void FixTTMGrid::read_electron_temperatures(const std::string &filename)
int iz = values.next_int();
if (ix < 0 || ix >= nxgrid || iy < 0 || iy >= nygrid || iz < 0 || iz >= nzgrid)
throw parser_error("Fix ttm/grid invalid grid index in input");
throw TokenizerException("Fix ttm/grid invalid grid index in input","");
if (ix >= nxlo_in && ix <= nxhi_in && iy >= nylo_in && iy <= nyhi_in
&& iz >= nzlo_in && iz <= nzhi_in) {
@ -314,7 +314,7 @@ void FixTTMGrid::read_electron_temperatures(const std::string &filename)
T_initial_set[iz][iy][ix] = 1;
}
} else {
throw parser_error("Incorrect format in fix ttm electron grid file");
throw TokenizerException("Incorrect format in fix ttm electron grid file","");
}
} catch (std::exception &e) {
error->one(FLERR,e.what());

View File

@ -584,10 +584,10 @@ void FixTTMMod::read_electron_temperatures(const std::string &filename)
// check correctness of input data
if ((ix < 0) || (ix >= nxgrid) || (iy < 0) || (iy >= nygrid) || (iz < 0) || (iz >= nzgrid))
throw parser_error("Fix ttm invalid grid index in fix ttm/mod grid file");
throw TokenizerException("Fix ttm invalid grid index in fix ttm/mod grid file","");
if (T_tmp < 0.0)
throw parser_error("Fix ttm electron temperatures must be > 0.0");
throw TokenizerException("Fix ttm electron temperatures must be > 0.0","");
T_electron[iz][iy][ix] = T_tmp;
T_initial_set[iz][iy][ix] = 1;

View File

@ -87,14 +87,6 @@ class FixTTMMod : public Fix {
void read_parameters(const std::string &);
void read_electron_temperatures(const std::string &);
void write_electron_temperatures(const std::string &);
class parser_error : public std::exception {
std::string message;
public:
parser_error(const std::string &mesg) { message = mesg; }
const char *what() const noexcept { return message.c_str(); }
};
};
} // namespace LAMMPS_NS

View File

@ -121,8 +121,10 @@ void FixWallEES::wall_particle(int m, int which, double coord)
double* shape = bonus[ellipsoid[i]].shape;;
MathExtra::quat_to_mat(bonus[ellipsoid[i]].quat,A);
MathExtra::transpose_matvec(A,nhat,tempvec);
for (int k = 0; k<3; k++) tempvec[k] *= shape[k];
for (int k = 0; k<3 ; k++) sigman2 += tempvec[k]*tempvec[k];
for (int k = 0; k<3; k++) {
tempvec[k] *= shape[k];
sigman2 += tempvec[k]*tempvec[k];
}
sigman = sqrt(sigman2);
if (delta <= sigman) {

View File

@ -194,8 +194,10 @@ void FixWallRegionEES::post_force(int /*vflag*/)
nhat[(which+2)%3] = 0 ;
sn2 = 0 ;
MathExtra::transpose_matvec(A,nhat,tempvec);
for (int k = 0; k<3; k++) tempvec[k] *= shape[k];
for (int k = 0; k<3 ; k++) sn2 += tempvec[k]*tempvec[k];
for (int k = 0; k<3; k++) {
tempvec[k] *= shape[k];
sn2 += tempvec[k]*tempvec[k];
}
sn = sqrt(sn2);
tooclose[which] = sn;
}
@ -321,9 +323,11 @@ void FixWallRegionEES::ees(int m, int i)
sigman2 = 0.0;
MathExtra::transpose_matvec(A,nhat,tempvec);
for (int k = 0; k<3; k++) tempvec[k] *= shape[k];
for (int k = 0; k<3; k++) sigman2 += tempvec[k]*tempvec[k];
for (int k = 0; k<3; k++) SAn[k] = tempvec[k];
for (int k = 0; k<3; k++) {
tempvec[k] *= shape[k];
sigman2 += tempvec[k]*tempvec[k];
SAn[k] = tempvec[k];
}
sigman = sqrt(sigman2);
delta = fabs(region->contact[m].r);

View File

@ -643,7 +643,7 @@ void PairE3B::checkInputs(const double &bondL)
if (k2 == NOT_SET) error->all(FLERR, "K2 keyword missing");
//now test that values are within acceptable ranges
if (k2 < 0.0 or k3 < 0.0) error->all(FLERR, "exponential decay is negative");
if (k2 < 0.0 || k3 < 0.0) error->all(FLERR, "exponential decay is negative");
if (bondL < 0.0) error->all(FLERR, "OH bond length is negative");
if (rc2 < 0.0 || rc3 < 0.0 || rs < 0.0) error->all(FLERR, "potential cutoff is negative");
if (rs > rc3) error->all(FLERR, "potential switching distance is larger than cutoff");

View File

@ -114,7 +114,7 @@ action pair_lj_cut_coul_msm_gpu.h pair_lj_cut_coul_msm.h
action pair_lj_cut_gpu.cpp
action pair_lj_cut_gpu.h
action pair_lj_smooth_gpu.cpp pair_lj_smooth.cpp
action pair_lj_smooth_gpu.h pair_lj_smooth.h
action pair_lj_smooth_gpu.h pair_lj_smooth.cpp
action pair_lj_expand_gpu.cpp
action pair_lj_expand_gpu.h
action pair_lj_expand_coul_long_gpu.cpp pair_lj_expand_coul_long.cpp

View File

@ -206,14 +206,16 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
#endif
// set newton pair flag
// require newtonflag = 0 since currently required by all GPU pair styles
if (newtonflag == 1) error->all(FLERR,"Illegal package gpu command");
force->newton_pair = newtonflag;
if (force->newton_pair || force->newton_bond) force->newton = 1;
else force->newton = 0;
// require newton pair off if _particle_split < 1
if (force->newton_pair == 1 && _particle_split < 1)
error->all(FLERR,"Cannot use newton pair on for split less than 1 for now");
if (pair_only_flag) {
lmp->suffixp = lmp->suffix;
lmp->suffix = nullptr;
@ -335,7 +337,6 @@ void FixGPU::post_force(int /* vflag */)
force->pair->virial[4] += lvirial[4];
force->pair->virial[5] += lvirial[5];
if (force->pair->vflag_fdotr) force->pair->virial_fdotr_compute();
timer->stamp(Timer::PAIR);
}

View File

@ -120,9 +120,9 @@ void PairBeckGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -132,8 +132,6 @@ void PairBeckGPU::compute(int eflag, int vflag)
void PairBeckGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style beck/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -143,9 +143,9 @@ void PairBornCoulLongCSGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -157,8 +157,6 @@ void PairBornCoulLongCSGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style born/coul/long/cs/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style born/coul/long/cs/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -138,9 +138,9 @@ void PairBornCoulLongGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -152,8 +152,6 @@ void PairBornCoulLongGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style born/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style born/coul/long/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -133,9 +133,9 @@ void PairBornCoulWolfCSGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -147,8 +147,6 @@ void PairBornCoulWolfCSGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style born/coul/wolf/cs/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style born/coul/wolf/cs/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -131,9 +131,9 @@ void PairBornCoulWolfGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -145,8 +145,6 @@ void PairBornCoulWolfGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style born/coul/wolf/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style born/coul/wolf/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -122,9 +122,9 @@ void PairBornGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -134,8 +134,6 @@ void PairBornGPU::compute(int eflag, int vflag)
void PairBornGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style born/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -125,9 +125,9 @@ void PairBuckCoulCutGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -139,8 +139,6 @@ void PairBuckCoulCutGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style buck/coul/cut/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style buck/coul/cut/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -134,9 +134,9 @@ void PairBuckCoulLongGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -148,8 +148,6 @@ void PairBuckCoulLongGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style buck/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style buck/coul/long/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -120,9 +120,9 @@ void PairBuckGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -132,8 +132,6 @@ void PairBuckGPU::compute(int eflag, int vflag)
void PairBuckGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style buck/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -121,9 +121,9 @@ void PairColloidGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -133,8 +133,6 @@ void PairColloidGPU::compute(int eflag, int vflag)
void PairColloidGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style colloid/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -122,9 +122,9 @@ void PairCoulCutGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -137,8 +137,6 @@ void PairCoulCutGPU::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/cut/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style coul/cut/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -123,9 +123,9 @@ void PairCoulDebyeGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -138,8 +138,6 @@ void PairCoulDebyeGPU::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/debye/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style coul/debye/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -134,9 +134,9 @@ void PairCoulDSFGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -149,8 +149,6 @@ void PairCoulDSFGPU::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/dsf/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style coul/dsf/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -136,9 +136,9 @@ void PairCoulLongCSGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -152,8 +152,6 @@ void PairCoulLongCSGPU::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/long/cs/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style coul/long/cs/gpu requires newton pair off");
// Call init_one calculation make sure scale is correct
for (int i = 1; i <= atom->ntypes; i++) {

View File

@ -131,9 +131,9 @@ void PairCoulLongGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -147,8 +147,6 @@ void PairCoulLongGPU::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style coul/long/gpu requires newton pair off");
// Call init_one calculation make sure scale is correct
for (int i = 1; i <= atom->ntypes; i++) {

View File

@ -267,9 +267,9 @@ void PairDPDGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -279,8 +279,6 @@ void PairDPDGPU::compute(int eflag, int vflag)
void PairDPDGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style dpd/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -286,9 +286,9 @@ void PairDPDTstatGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -298,8 +298,6 @@ void PairDPDTstatGPU::compute(int eflag, int vflag)
void PairDPDTstatGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style dpd/tstat/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -157,8 +157,6 @@ void PairEAMAlloyGPU::compute(int eflag, int vflag)
void PairEAMAlloyGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style eam/alloy/gpu requires newton pair off");
// convert read-in file(s) to arrays and spline them

View File

@ -156,8 +156,6 @@ void PairEAMFSGPU::compute(int eflag, int vflag)
void PairEAMFSGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style eam/fs/gpu requires newton pair off");
// convert read-in file(s) to arrays and spline them

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -155,9 +154,6 @@ void PairEAMGPU::compute(int eflag, int vflag)
void PairEAMGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style eam/gpu requires newton pair off");
// convert read-in file(s) to arrays and spline them
file2array();

View File

@ -118,9 +118,9 @@ void PairGaussGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -130,8 +130,6 @@ void PairGaussGPU::compute(int eflag, int vflag)
void PairGaussGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style gauss/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -145,9 +145,9 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start < inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -160,8 +160,6 @@ void PairGayBerneGPU::init_style()
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Pair gayberne/gpu requires atom style ellipsoid");
if (force->newton_pair)
error->all(FLERR,"Pair style gayberne/gpu requires newton pair off");
if (!atom->ellipsoid_flag)
error->all(FLERR,"Pair gayberne/gpu requires atom style ellipsoid");

View File

@ -117,9 +117,9 @@ void PairLJ96CutGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -131,8 +131,6 @@ void PairLJ96CutGPU::init_style()
{
cut_respa = nullptr;
if (force->newton_pair)
error->all(FLERR,"Pair style lj96/cut/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -115,9 +115,9 @@ void PairLJCharmmCoulCharmmGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -129,8 +129,6 @@ void PairLJCharmmCoulCharmmGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR, "Pair style lj/charmm/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR, "Pair style lj/charmm/coul/long/gpu requires newton pair off");
// Repeated cutsq calculation in init_one() is required for GPU package

View File

@ -136,9 +136,9 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -152,8 +152,6 @@ void PairLJCharmmCoulLongGPU::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style

View File

@ -133,9 +133,9 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -147,8 +147,6 @@ void PairLJClass2CoulLongGPU::init_style()
{
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/class2/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all(FLERR,"Pair style lj/class2/coul/long/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -117,9 +117,9 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -129,8 +129,6 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
void PairLJClass2GPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style lj/class2/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -123,9 +123,9 @@ void PairLJCubicGPU::compute(int eflag, int vflag)
error->one(FLERR,"Insufficient memory on accelerator");
if (host_start<inum) {
cpu_time = MPI_Wtime();
cpu_time = platform::walltime();
cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
cpu_time = MPI_Wtime() - cpu_time;
cpu_time = platform::walltime() - cpu_time;
}
}
@ -135,8 +135,6 @@ void PairLJCubicGPU::compute(int eflag, int vflag)
void PairLJCubicGPU::init_style()
{
if (force->newton_pair)
error->all(FLERR,"Pair style lj/cubic/gpu requires newton pair off");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

Some files were not shown because too many files have changed in this diff Show More