Merge branch 'master' into report-uninstalled-pkg-style
# Conflicts: # cmake/CMakeLists.txt
This commit is contained in:
@ -52,7 +52,7 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Designed for use with the kim-api-v2-2.0.0 (and newer) package
|
||||
Designed for use with the kim-api-2.0.2 (and newer) package
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include <mpi.h>
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Designed for use with the kim-api-v2-2.0.0 (and newer) package
|
||||
Designed for use with the kim-api-2.0.2 (and newer) package
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef COMMAND_CLASS
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Designed for use with the kim-api-v2-2.0.0 (and newer) package
|
||||
Designed for use with the kim-api-2.0.2 (and newer) package
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include <cstring>
|
||||
@ -189,8 +189,6 @@ void PairKIM::set_contributing()
|
||||
|
||||
void PairKIM::compute(int eflag , int vflag)
|
||||
{
|
||||
int kimerror;
|
||||
|
||||
ev_init(eflag,vflag);
|
||||
|
||||
// grow kim_particleSpecies and kim_particleContributing array if necessary
|
||||
@ -238,7 +236,7 @@ void PairKIM::compute(int eflag , int vflag)
|
||||
lmps_local_tot_num_atoms = (int) nall;
|
||||
|
||||
// compute via KIM model
|
||||
kimerror = KIM_Model_Compute(pkim, pargs);
|
||||
int kimerror = KIM_Model_Compute(pkim, pargs);
|
||||
if (kimerror) error->all(FLERR,"KIM Compute returned error");
|
||||
|
||||
// compute virial before reverse comm!
|
||||
@ -313,7 +311,7 @@ void PairKIM::settings(int narg, char **arg)
|
||||
(0 == strcmp("LAMMPSvirial", arg[0]))))
|
||||
{
|
||||
error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with "
|
||||
"kim-api-v2.");
|
||||
"kim-api.");
|
||||
}
|
||||
else
|
||||
error->all(FLERR,"Illegal pair_style command");
|
||||
@ -434,10 +432,9 @@ void PairKIM::coeff(int narg, char **arg)
|
||||
kim_particle_codes = new int[lmps_num_unique_elements];
|
||||
kim_particle_codes_ok = true;
|
||||
for(int i = 0; i < lmps_num_unique_elements; i++){
|
||||
int kimerror;
|
||||
int supported;
|
||||
int code;
|
||||
kimerror = KIM_Model_GetSpeciesSupportAndCode(
|
||||
KIM_Model_GetSpeciesSupportAndCode(
|
||||
pkim,
|
||||
KIM_SpeciesName_FromString(lmps_unique_elements[i]),
|
||||
&supported,
|
||||
@ -468,8 +465,6 @@ void PairKIM::init_style()
|
||||
if (domain->dimension != 3)
|
||||
error->all(FLERR,"PairKIM only works with 3D problems");
|
||||
|
||||
int kimerror;
|
||||
|
||||
// setup lmps_stripped_neigh_list for neighbors of one atom, if needed
|
||||
if (lmps_using_molecular) {
|
||||
memory->destroy(lmps_stripped_neigh_list);
|
||||
@ -676,9 +671,9 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf)
|
||||
va[j*6+4]+=buf[m++];
|
||||
va[j*6+5]+=buf[m++];
|
||||
}
|
||||
} else {
|
||||
; // do nothing
|
||||
}
|
||||
else
|
||||
;// do nothing
|
||||
|
||||
return;
|
||||
}
|
||||
@ -720,11 +715,8 @@ int PairKIM::get_neigh(void const * const dataObject,
|
||||
*numberOfNeighbors = 0;
|
||||
|
||||
NeighList * neiobj = Model->neighborLists[neighborListIndex];
|
||||
int nAtoms = Model->lmps_local_tot_num_atoms;
|
||||
|
||||
int j, jj, inum, *ilist, *numneigh, **firstneigh;
|
||||
inum = neiobj->inum; //# of I atoms neighbors are stored for
|
||||
ilist = neiobj->ilist; //local indices of I atoms
|
||||
int *numneigh, **firstneigh;
|
||||
numneigh = neiobj->numneigh; // # of J neighbors for each I atom
|
||||
firstneigh = neiobj->firstneigh; // ptr to 1st J int value of each I atom
|
||||
|
||||
@ -750,8 +742,6 @@ int PairKIM::get_neigh(void const * const dataObject,
|
||||
|
||||
void PairKIM::kim_free()
|
||||
{
|
||||
int kimerror;
|
||||
|
||||
if (kim_init_ok)
|
||||
{
|
||||
int kimerror = KIM_Model_ComputeArgumentsDestroy(pkim, &pargs);
|
||||
@ -1043,10 +1033,10 @@ void PairKIM::set_kim_model_has_flags()
|
||||
for (int i = 0; i < numberOfComputeArgumentNames; ++i)
|
||||
{
|
||||
KIM_ComputeArgumentName computeArgumentName;
|
||||
int kimerror = KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName(
|
||||
KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName(
|
||||
i, &computeArgumentName);
|
||||
KIM_SupportStatus supportStatus;
|
||||
kimerror = KIM_ComputeArguments_GetArgumentSupportStatus(
|
||||
KIM_ComputeArguments_GetArgumentSupportStatus(
|
||||
pargs, computeArgumentName, &supportStatus);
|
||||
|
||||
if (KIM_ComputeArgumentName_Equal(computeArgumentName,
|
||||
@ -1105,10 +1095,10 @@ void PairKIM::set_kim_model_has_flags()
|
||||
for (int i = 0; i < numberOfComputeCallbackNames; ++i)
|
||||
{
|
||||
KIM_ComputeCallbackName computeCallbackName;
|
||||
int kimerror = KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(
|
||||
KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(
|
||||
i, &computeCallbackName);
|
||||
KIM_SupportStatus supportStatus;
|
||||
kimerror = KIM_ComputeArguments_GetCallbackSupportStatus(
|
||||
KIM_ComputeArguments_GetCallbackSupportStatus(
|
||||
pargs, computeCallbackName, &supportStatus);
|
||||
|
||||
if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required))
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Designed for use with the kim-api-v2-2.0.0 (and newer) package
|
||||
Designed for use with the kim-api-2.0.2 (and newer) package
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
@ -182,9 +182,9 @@ E: KIM Compute returned error
|
||||
|
||||
The KIM model was unable, for some reason, to complete the computation.
|
||||
|
||||
E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api-v2.
|
||||
E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api.
|
||||
|
||||
"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api-v2. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api-v2, and rerun.
|
||||
"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api, and rerun.
|
||||
|
||||
E: Illegal pair_style command
|
||||
|
||||
|
||||
@ -1390,7 +1390,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag,
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShake::rendezvous_ids(int n, char *inbuf,
|
||||
int &flag, int *&proclist, char *&outbuf,
|
||||
int &flag, int *& /*proclist*/, char *& /*outbuf*/,
|
||||
void *ptr)
|
||||
{
|
||||
FixShake *fsptr = (FixShake *) ptr;
|
||||
|
||||
@ -226,6 +226,9 @@ void PairMEAMC::coeff(int narg, char **arg)
|
||||
}
|
||||
nelements = narg - 4 - atom->ntypes;
|
||||
if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
if (nelements > maxelt)
|
||||
error->all(FLERR,"Too many elements extracted from MEAM library. "
|
||||
"Increase 'maxelt' in meam.h and recompile.");
|
||||
elements = new char*[nelements];
|
||||
mass = new double[nelements];
|
||||
|
||||
|
||||
@ -196,6 +196,10 @@ void PairReaxCOMP::compute(int eflag, int vflag)
|
||||
if (vflag_global) control->virial = 1;
|
||||
else control->virial = 0;
|
||||
|
||||
if (vflag_atom)
|
||||
error->all(FLERR,"Pair style reax/c/omp does not support "
|
||||
"computing per-atom stress");
|
||||
|
||||
system->n = atom->nlocal; // my atoms
|
||||
system->N = atom->nlocal + atom->nghost; // mine + ghosts
|
||||
system->bigN = static_cast<int> (atom->natoms); // all atoms in the system
|
||||
|
||||
@ -262,8 +262,8 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list **lists,
|
||||
int step, int n, int N, int numH, MPI_Comm comm )
|
||||
void Validate_ListsOMP(reax_system *system, storage * /*workspace*/, reax_list **lists,
|
||||
int step, int n, int N, int numH, MPI_Comm /*comm*/)
|
||||
{
|
||||
int i, comp, Hindex;
|
||||
reax_list *bonds, *hbonds;
|
||||
|
||||
@ -213,9 +213,9 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control,
|
||||
rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
|
||||
-1., system->my_atoms[j].x );
|
||||
f_tmp = -(CEvd + CEclmb);
|
||||
pair_reax_ptr->ev_tally_thr_proxy( system->pair_ptr, i, j, natoms,
|
||||
1, pe_vdw, e_ele, f_tmp,
|
||||
delij[0], delij[1], delij[2], thr);
|
||||
pair_reax_ptr->ev_tally_thr_proxy(system->pair_ptr, i, j, natoms,
|
||||
1, pe_vdw, e_ele, f_tmp,
|
||||
delij[0], delij[1], delij[2], thr);
|
||||
}
|
||||
|
||||
if (control->virial == 0) {
|
||||
|
||||
@ -76,8 +76,10 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
|
||||
|
||||
system = (reax_system *)
|
||||
memory->smalloc(sizeof(reax_system),"reax:system");
|
||||
memset(system,0,sizeof(reax_system));
|
||||
control = (control_params *)
|
||||
memory->smalloc(sizeof(control_params),"reax:control");
|
||||
memset(control,0,sizeof(control_params));
|
||||
data = (simulation_data *)
|
||||
memory->smalloc(sizeof(simulation_data),"reax:data");
|
||||
workspace = (storage *)
|
||||
@ -87,6 +89,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
|
||||
memset(lists,0,LIST_N * sizeof(reax_list));
|
||||
out_control = (output_controls *)
|
||||
memory->smalloc(sizeof(output_controls),"reax:out_control");
|
||||
memset(out_control,0,sizeof(output_controls));
|
||||
mpi_data = (mpi_datatypes *)
|
||||
memory->smalloc(sizeof(mpi_datatypes),"reax:mpi");
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ int Init_MPI_Datatypes( reax_system *system, storage * /*workspace*/,
|
||||
|
||||
int Init_Lists( reax_system *system, control_params *control,
|
||||
simulation_data * /*data*/, storage * /*workspace*/, reax_list **lists,
|
||||
mpi_datatypes *mpi_data, char * /*msg*/ )
|
||||
mpi_datatypes * /*mpi_data*/, char * /*msg*/ )
|
||||
{
|
||||
int i, total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop;
|
||||
int *hb_top, *bond_top;
|
||||
@ -219,8 +219,6 @@ void Initialize( reax_system *system, control_params *control,
|
||||
mpi_datatypes *mpi_data, MPI_Comm comm )
|
||||
{
|
||||
char msg[MAX_STR];
|
||||
char errmsg[128];
|
||||
|
||||
|
||||
if (Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE) {
|
||||
control->error_ptr->one(FLERR,"Could not create datatypes");
|
||||
|
||||
@ -92,13 +92,15 @@ int Close_Output_Files( reax_system *system, control_params *control,
|
||||
End_Traj( system->my_rank, out_control );
|
||||
|
||||
if (system->my_rank == MASTER_NODE) {
|
||||
if (out_control->energy_update_freq > 0) {
|
||||
if (out_control->pot) {
|
||||
fclose( out_control->pot );
|
||||
out_control->pot = NULL;
|
||||
}
|
||||
|
||||
if( control->ensemble == NPT || control->ensemble == iNPT ||
|
||||
control->ensemble == sNPT )
|
||||
fclose( out_control->prs );
|
||||
if (out_control->prs) {
|
||||
fclose(out_control->prs);
|
||||
out_control->prs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@ -122,7 +124,7 @@ void Output_Results( reax_system *system, control_params *control,
|
||||
out_control->energy_update_freq > 0 &&
|
||||
data->step % out_control->energy_update_freq == 0 ) {
|
||||
|
||||
if (control->virial) {
|
||||
if (control->virial && out_control->prs) {
|
||||
fprintf( out_control->prs,
|
||||
"%8d%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n",
|
||||
data->step,
|
||||
|
||||
@ -58,7 +58,7 @@ void Write_Skip_Line( output_controls *out_control, mpi_datatypes * /*mpi_data*/
|
||||
|
||||
|
||||
int Write_Header( reax_system *system, control_params *control,
|
||||
output_controls *out_control, mpi_datatypes *mpi_data )
|
||||
output_controls *out_control, mpi_datatypes * /*mpi_data*/ )
|
||||
{
|
||||
int num_hdr_lines, my_hdr_lines, buffer_req;
|
||||
char ensembles[ens_N][25] = { "NVE", "NVT", "fully flexible NPT",
|
||||
@ -357,7 +357,7 @@ int Init_Traj( reax_system *system, control_params *control,
|
||||
|
||||
int Write_Frame_Header( reax_system *system, control_params *control,
|
||||
simulation_data *data, output_controls *out_control,
|
||||
mpi_datatypes *mpi_data )
|
||||
mpi_datatypes * /*mpi_data*/ )
|
||||
{
|
||||
int me, num_frm_hdr_lines, my_frm_hdr_lines, buffer_req;
|
||||
|
||||
|
||||
@ -642,7 +642,7 @@ void ComputeVoronoi::compute_local()
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int ComputeVoronoi::pack_forward_comm(int n, int *list, double *buf,
|
||||
int pbc_flag, int *pbc)
|
||||
int /* pbc_flag */, int * /* pbc */)
|
||||
{
|
||||
int i,m=0;
|
||||
for (i = 0; i < n; ++i) buf[m++] = rfield[list[i]];
|
||||
|
||||
@ -72,7 +72,9 @@ void Error::universe_all(const char *file, int line, const char *str)
|
||||
#ifdef LAMMPS_EXCEPTIONS
|
||||
|
||||
// allow commands if an exception was caught in a run
|
||||
update->whichflag = 0;
|
||||
// update may be NULL when catching command line errors
|
||||
|
||||
if (update) update->whichflag = 0;
|
||||
|
||||
char msg[100];
|
||||
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
|
||||
@ -97,7 +99,9 @@ void Error::universe_one(const char *file, int line, const char *str)
|
||||
#ifdef LAMMPS_EXCEPTIONS
|
||||
|
||||
// allow commands if an exception was caught in a run
|
||||
update->whichflag = 0;
|
||||
// update may be NULL when catching command line errors
|
||||
|
||||
if (update) update->whichflag = 0;
|
||||
|
||||
char msg[100];
|
||||
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
|
||||
@ -148,7 +152,9 @@ void Error::all(const char *file, int line, const char *str)
|
||||
#ifdef LAMMPS_EXCEPTIONS
|
||||
|
||||
// allow commands if an exception was caught in a run
|
||||
update->whichflag = 0;
|
||||
// update may be NULL when catching command line errors
|
||||
|
||||
if (update) update->whichflag = 0;
|
||||
|
||||
char msg[100];
|
||||
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
|
||||
@ -198,7 +204,9 @@ void Error::one(const char *file, int line, const char *str)
|
||||
#ifdef LAMMPS_EXCEPTIONS
|
||||
|
||||
// allow commands if an exception was caught in a run
|
||||
update->whichflag = 0;
|
||||
// update may be NULL when catching command line errors
|
||||
|
||||
if (update) update->whichflag = 0;
|
||||
|
||||
char msg[100];
|
||||
snprintf(msg, 100, "ERROR on proc %d: %s (%s:%d)\n", me, str, truncpath(file), line);
|
||||
|
||||
@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
|
||||
#define MAX_GROUP 32
|
||||
#define EPSILON 1.0e-6
|
||||
|
||||
enum{TYPE,MOLECULE,ID};
|
||||
enum{NONE,TYPE,MOLECULE,ID};
|
||||
enum{LT,LE,GT,GE,EQ,NEQ,BETWEEN};
|
||||
|
||||
#define BIG 1.0e20
|
||||
@ -202,7 +202,7 @@ void Group::assign(int narg, char **arg)
|
||||
|
||||
if (narg < 3) error->all(FLERR,"Illegal group command");
|
||||
|
||||
int category;
|
||||
int category=NONE;
|
||||
if (strcmp(arg[1],"type") == 0) category = TYPE;
|
||||
else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE;
|
||||
else if (strcmp(arg[1],"id") == 0) category = ID;
|
||||
|
||||
@ -477,7 +477,7 @@ class Memory : protected Pointers {
|
||||
}
|
||||
|
||||
template <typename TYPE>
|
||||
TYPE *****grow(TYPE *****&array, int n1, int n2, int n3, int n4,
|
||||
TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/,
|
||||
const char *name)
|
||||
{
|
||||
fail(name); return NULL;
|
||||
|
||||
Reference in New Issue
Block a user