From 2fa9a986de88ded5c0768be36b0a7935c2b5777a Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 21 Jun 2018 10:48:07 -0500 Subject: [PATCH 01/49] Strip out all but NEIGH_PURE_F and Loca from pair_kim Progress toward implementation of kim-api-v2 support --- src/KIM/pair_kim.cpp | 458 +++++-------------------------------------- src/KIM/pair_kim.h | 26 +-- 2 files changed, 56 insertions(+), 428 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index fe638214ba..8947bd6c3b 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -18,8 +18,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the openkim-api-v1.5.0 package and for use with - the kim-api-v1.6.0 (and newer) package + Designed for use with the kim-api-v1.6.0 (and newer) package ------------------------------------------------------------------------- */ #include @@ -42,13 +41,6 @@ #include "KIM_API.h" #include "KIM_API_status.h" -#ifndef KIM_API_VERSION_MAJOR -// support v1.5.0 -#define KIM_API_VERSION_MAJOR 1 -#define KIM_API_VERSION_MINOR 5 -#define KIM_API_VERSION_PATCH 0 -#endif - using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -81,10 +73,7 @@ PairKIM::PairKIM(LAMMPS *lmp) : kim_global_cutoff(0.0), lmps_maxalloc(0), kim_particleSpecies(0), - lmps_force_tmp(0), - lmps_stripped_neigh_list(0), - kim_iterator_position(0), - Rij(0) + lmps_stripped_neigh_list(0) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -115,7 +104,6 @@ PairKIM::~PairKIM() // clean up local memory used to support KIM interface memory->destroy(kim_particleSpecies); - memory->destroy(lmps_force_tmp); memory->destroy(lmps_stripped_neigh_list); // clean up allocated memory for standard Pair class usage @@ -126,9 +114,6 @@ PairKIM::~PairKIM() delete [] lmps_map_species_to_unique; } - // clean up Rij array - memory->destroy(Rij); - // clean up KIM interface (if necessary) kim_free(); @@ -150,11 +135,9 @@ void PairKIM::compute(int eflag , int vflag) // needs to be atom->nmax in length if (atom->nmax > lmps_maxalloc) { memory->destroy(kim_particleSpecies); - memory->destroy(lmps_force_tmp); lmps_maxalloc = atom->nmax; memory->create(kim_particleSpecies,lmps_maxalloc,"pair:kim_particleSpecies"); - memory->create(lmps_force_tmp,lmps_maxalloc,3,"pair:lmps_force_tmp"); } // kim_particleSpecies = KIM atom species for each LAMMPS atom @@ -167,11 +150,6 @@ void PairKIM::compute(int eflag , int vflag) for (int i = 0; i < nall; i++) { ielement = lmps_map_species_to_unique[species[i]]; ielement = MAX(ielement,0); - // @@ this (above line) provides bogus info - // @@ (when lmps_map_species_to_unique[species[i]]==-1) to KIM, but - // @@ I guess this only happens when lmps_hybrid==true, - // @@ and we are sure that iterator mode will - // @@ not use these atoms.... (?) kim_particleSpecies[i] = kim_particle_codes[ielement]; } @@ -193,16 +171,6 @@ void PairKIM::compute(int eflag , int vflag) // assemble force and particleVirial if needed if (!lmps_using_newton) comm->reverse_comm_pair(this); - // sum lmps_force_tmp to f if running in hybrid mode - if (lmps_hybrid) { - double **f = atom->f; - for (int i = 0; i < nall; i++) { - f[i][0] += lmps_force_tmp[i][0]; - f[i][1] += lmps_force_tmp[i][1]; - f[i][2] += lmps_force_tmp[i][2]; - } - } - if ((no_virial_fdotr_compute == 1) && (vflag_global)) { // flip sign and order of virial if KIM is computing it for (int i = 0; i < 3; ++i) virial[i] = -1.0*virial[i]; @@ -313,6 +281,7 @@ void PairKIM::settings(int narg, char **arg) strcpy(kim_modelname, arg[1]); // set print_kim_file + // @@@ should be removed for v2; update docs if ((2 == narg) || ('0' == *(arg[2]))) { print_kim_file = false; @@ -341,13 +310,19 @@ void PairKIM::coeff(int narg, char **arg) if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); + // insure I,J args are * * + + if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) + error->all(FLERR,"Incorrect args for pair coefficients"); + + int ilo,ihi,jlo,jhi; force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); // read args that map atom species to KIM elements // lmps_map_species_to_unique[i] = - // which element the Ith atom type is, -1 if NULL + // which element the Ith atom type is // lmps_num_unique_elements = # of unique elements // lmps_unique_elements = list of element names @@ -360,23 +335,20 @@ void PairKIM::coeff(int narg, char **arg) lmps_unique_elements = new char*[atom->ntypes]; for (i = 0; i < atom->ntypes; i++) lmps_unique_elements[i] = 0; + + // Assume all species arguments are valid + // errors will be detected by kim_api_init() matching lmps_num_unique_elements = 0; for (i = 2; i < narg; i++) { - if (strcmp(arg[i],"NULL") == 0) { - if (!lmps_hybrid) - error->all(FLERR,"Invalid args for non-hybrid pair coefficients"); - lmps_map_species_to_unique[i-1] = -1; - continue; - } - for (j = 0; j < lmps_num_unique_elements; j++) - if (strcmp(arg[i],lmps_unique_elements[j]) == 0) break; - lmps_map_species_to_unique[i-1] = j; - if (j == lmps_num_unique_elements) { - n = strlen(arg[i]) + 1; - lmps_unique_elements[j] = new char[n]; - strcpy(lmps_unique_elements[j],arg[i]); - lmps_num_unique_elements++; - } + for (j = 0; j < lmps_num_unique_elements; j++) + if (strcmp(arg[i],lmps_unique_elements[j]) == 0) break; + lmps_map_species_to_unique[i-1] = j; + if (j == lmps_num_unique_elements) { + n = strlen(arg[i]) + 1; + lmps_unique_elements[j] = new char[n]; + strcpy(lmps_unique_elements[j],arg[i]); + lmps_num_unique_elements++; + } } int count = 0; @@ -419,43 +391,18 @@ void PairKIM::init_style() else { kim_model_init_ok = true; - - // allocate enough memory to ensure we are safe - // (by using neighbor->oneatom) - if (kim_model_using_Rij) - memory->create(Rij,3*(neighbor->oneatom),"pair:Rij"); } } - // request none, half, or full neighbor list - // depending on KIM model requirement + // make sure comm_reverse expects (at most) 9 values when newton is off + if (!lmps_using_newton) comm_reverse_off = 9; + // request full neighbor list int irequest = neighbor->request(this,instance_me); - if (kim_model_using_cluster) - { - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 0; - } - else - { - // make sure comm_reverse expects (at most) 9 values when newton is off - if (!lmps_using_newton) comm_reverse_off = 9; - - if (kim_model_using_half) - { - neighbor->requests[irequest]->half = 1; - neighbor->requests[irequest]->full = 0; - // make sure half lists also include local-ghost pairs - if (lmps_using_newton) neighbor->requests[irequest]->newton = 2; - } - else - { - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - // make sure full lists also include local-ghost pairs - if (lmps_using_newton) neighbor->requests[irequest]->newton = 0; - } - } + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + // make sure full lists also include local-ghost pairs + if (lmps_using_newton) neighbor->requests[irequest]->newton = 0; return; } @@ -476,27 +423,11 @@ double PairKIM::init_one(int i, int j) /* ---------------------------------------------------------------------- */ -void PairKIM::reinit() -{ - // This is called by fix-adapt - - // Call parent class implementation - Pair::reinit(); - - // Then reinit KIM model - int kimerror; - kimerror = pkim->model_reinit(); - kim_error(__LINE__,"model_reinit unsuccessful", kimerror); -} - -/* ---------------------------------------------------------------------- */ - int PairKIM::pack_reverse_comm(int n, int first, double *buf) { int i,m,last; double *fp; - if (lmps_hybrid) fp = &(lmps_force_tmp[0][0]); - else fp = &(atom->f[0][0]); + fp = &(atom->f[0][0]); m = 0; last = first + n; @@ -555,8 +486,7 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) { int i,j,m; double *fp; - if (lmps_hybrid) fp = &(lmps_force_tmp[0][0]); - else fp = &(atom->f[0][0]); + fp = &(atom->f[0][0]); m = 0; if ((kim_model_has_forces) && ((vflag_atom == 0) || @@ -643,13 +573,6 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, int kimerror; PairKIM *self = (PairKIM *) pkim->get_sim_buffer(&kimerror); - if (self->kim_model_using_Rij) { - *pRij = &(self->Rij[0]); - } else { - *pRij = 0; - } - - // subvert KIM api by using direct access to self->list // // get neighObj from KIM API obj @@ -671,53 +594,7 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, firstneigh = neiobj->firstneigh; // ptr to 1st J int value of each I atom if (*mode==0){ //iterator mode - if (*request==1) { //increment iterator - if (self->kim_iterator_position < inum) { - *atom = ilist[self->kim_iterator_position]; - *numnei = numneigh[*atom]; - - // strip off neighbor mask for molecular systems - if (!self->lmps_using_molecular) - *nei1atom = firstneigh[*atom]; - else - { - int n = *numnei; - int *ptr = firstneigh[*atom]; - int *lmps_stripped_neigh_list = self->lmps_stripped_neigh_list; - for (int i = 0; i < n; i++) - lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; - *nei1atom = lmps_stripped_neigh_list; - } - - // set Rij if needed - if (self->kim_model_using_Rij) { - double* x = (double *) - (*pkim).get_data_by_index(self->kim_ind_coordinates, - &kimerror); - for (jj=0; jj < *numnei; jj++) { - int i = *atom; - j = (*nei1atom)[jj]; - self->Rij[jj*3 +0] = -x[i*3+0] + x[j*3+0]; - self->Rij[jj*3 +1] = -x[i*3+1] + x[j*3+1]; - self->Rij[jj*3 +2] = -x[i*3+2] + x[j*3+2]; - } - } - - // increment iterator - self->kim_iterator_position++; - - return KIM_STATUS_OK; //successful increment - } else if (self->kim_iterator_position == inum) { - *numnei = 0; - return KIM_STATUS_NEIGH_ITER_PAST_END; //reached end by iterator - } else if (self->kim_iterator_position > inum || inum < 0){ - self->error->one(FLERR, "KIM neighbor iterator exceeded range"); - } - } else if (*request == 0){ //restart iterator - self->kim_iterator_position = 0; - *numnei = 0; - return KIM_STATUS_NEIGH_ITER_INIT_OK; //succsesful restart - } + return KIM_STATUS_NEIGH_INVALID_MODE; //unsupported mode } else if (*mode == 1){//locator mode //... if (*request < inum) { @@ -737,18 +614,7 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, *nei1atom = lmps_stripped_neigh_list; } - // set Rij if needed - if (self->kim_model_using_Rij){ - double* x = (double *) - (*pkim).get_data_by_index(self->kim_ind_coordinates, &kimerror); - for(int jj=0; jj < *numnei; jj++){ - int i = *atom; - int j = (*nei1atom)[jj]; - self->Rij[jj*3 +0] = -x[i*3+0] + x[j*3+0]; - self->Rij[jj*3 +1] = -x[i*3+1] + x[j*3+1]; - self->Rij[jj*3 +2] = -x[i*3+2] + x[j*3+2]; - } - } + *pRij = NULL; return KIM_STATUS_OK; //successful end } else if (*request >= nAtoms || inum < 0) @@ -800,8 +666,6 @@ void PairKIM::kim_init() { int kimerror; - // - // determine KIM Model capabilities (used in this function below) set_kim_model_has_flags(); @@ -827,40 +691,19 @@ void PairKIM::kim_init() test_descriptor_string = 0; } - // determine kim_model_using_* true/false values - // - // check for half or full list - kim_model_using_half = (pkim->is_half_neighbors(&kimerror)); - // - const char* NBC_method; - kimerror = pkim->get_NBC_method(&NBC_method); - kim_error(__LINE__,"NBC method not set",kimerror); - // check for CLUSTER mode - kim_model_using_cluster = (strcmp(NBC_method,"CLUSTER")==0); - // check if Rij needed for get_neigh - kim_model_using_Rij = ((strcmp(NBC_method,"NEIGH_RVEC_H")==0) || - (strcmp(NBC_method,"NEIGH_RVEC_F")==0)); - // get correct index of each variable in kim_api object - pkim->getm_index(&kimerror, 3*13, + pkim->getm_index(&kimerror, 3*12, "coordinates", &kim_ind_coordinates, 1, "cutoff", &kim_ind_cutoff, 1, "numberOfParticles", &kim_ind_numberOfParticles, 1, -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSON_MINOR == 5 - "numberParticleTypes", &kim_ind_numberOfSpecies, 1, - "particleTypes", &kim_ind_particleSpecies, 1, -#else "numberOfSpecies", &kim_ind_numberOfSpecies, 1, "particleSpecies", &kim_ind_particleSpecies, 1, -#endif - "numberContributingParticles", &kim_ind_numberContributingParticles, - kim_model_using_half, "particleEnergy", &kim_ind_particleEnergy, (int) kim_model_has_particleEnergy, "energy", &kim_ind_energy, (int) kim_model_has_energy, "forces", &kim_ind_forces, (int) kim_model_has_forces, - "neighObject", &kim_ind_neighObject, (int) !kim_model_using_cluster, - "get_neigh", &kim_ind_get_neigh, (int) !kim_model_using_cluster, + "neighObject", &kim_ind_neighObject, 1, + "get_neigh", &kim_ind_get_neigh, 1, "particleVirial", &kim_ind_particleVirial, (int) kim_model_has_particleVirial, "virial", &kim_ind_virial, no_virial_fdotr_compute); @@ -891,21 +734,17 @@ void PairKIM::set_statics() lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); int kimerror; - pkim->setm_data_by_index(&kimerror, 4*6, + pkim->setm_data_by_index(&kimerror, 4*5, kim_ind_numberOfSpecies, 1, (void *) &(atom->ntypes), 1, kim_ind_cutoff, 1, (void *) &(kim_global_cutoff), 1, kim_ind_numberOfParticles, 1, (void *) &lmps_local_tot_num_atoms, 1, - kim_ind_numberContributingParticles, 1, (void *) &(atom->nlocal), - (int) kim_model_using_half, kim_ind_energy, 1, (void *) &(eng_vdwl), (int) kim_model_has_energy, kim_ind_virial, 1, (void *) &(virial[0]), no_virial_fdotr_compute); kim_error(__LINE__, "setm_data_by_index", kimerror); - if (!kim_model_using_cluster) - { - kimerror = pkim->set_method_by_index(kim_ind_get_neigh, 1, - (func_ptr) &get_neigh); - kim_error(__LINE__, "set_method_by_index", kimerror); - } + + kimerror = pkim->set_method_by_index(kim_ind_get_neigh, 1, + (func_ptr) &get_neigh); + kim_error(__LINE__, "set_method_by_index", kimerror); pkim->set_sim_buffer((void *)this, &kimerror); kim_error(__LINE__, "set_sim_buffer", kimerror); @@ -942,13 +781,9 @@ void PairKIM::set_volatiles() if (kim_model_has_forces) { - if (lmps_hybrid) - kimerror = pkim->set_data_by_index(kim_ind_forces, nall*3, - (void*) &(lmps_force_tmp[0][0])); - else - kimerror = pkim->set_data_by_index(kim_ind_forces, nall*3, - (void*) &(atom->f[0][0])); - kim_error(__LINE__, "setm_data_by_index", kimerror); + kimerror = pkim->set_data_by_index(kim_ind_forces, nall*3, + (void*) &(atom->f[0][0])); + kim_error(__LINE__, "set_data_by_index", kimerror); } // subvert the KIM api by direct access to this->list in get_neigh @@ -994,16 +829,10 @@ void PairKIM::set_lmps_flags() } // determine if running with pair hybrid - lmps_hybrid = (force->pair_match("hybrid",0)); - - // support cluster mode if everything is just right - lmps_support_cluster = ((domain->xperiodic == 0 && - domain->yperiodic == 0 && - domain->zperiodic == 0 - ) - && - (comm->nprocs == 1) - ); + if (force->pair_match("hybrid",0)) + { + error->all(FLERR,"pair_kim does not support hybrid."); + } // determine unit system and set lmps_units flag if ((strcmp(update->unit_style,"real")==0)) @@ -1177,30 +1006,9 @@ void PairKIM::write_descriptor(char** test_descriptor_string) "\n" "CONVENTIONS:\n" "# Name Type\n" - "ZeroBasedLists flag\n"); - // can use iterator or locator neighbor mode, unless in hybrid mode - if (lmps_hybrid) - strcat(*test_descriptor_string, - "Neigh_IterAccess flag\n"); - else - strcat(*test_descriptor_string, - "Neigh_BothAccess flag\n\n"); - - strcat(*test_descriptor_string, - "NEIGH_PURE_H flag\n" - "NEIGH_PURE_F flag\n" - "NEIGH_RVEC_H flag\n" - "NEIGH_RVEC_F flag\n"); - // @@ add code for MI_OPBC_? support ???? - if (lmps_support_cluster) - { - strcat(*test_descriptor_string, - "CLUSTER flag\n\n"); - } - else - { - strcat(*test_descriptor_string, "\n"); - } + "ZeroBasedLists flag\n" + "Neigh_LocaAccess flag\n" + "NEIGH_PURE_F flag\n\n"); // Write input section strcat(*test_descriptor_string, @@ -1208,14 +1016,8 @@ void PairKIM::write_descriptor(char** test_descriptor_string) "MODEL_INPUT:\n" "# Name Type Unit Shape\n" "numberOfParticles integer none []\n" - "numberContributingParticles integer none []\n" -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSON_MINOR == 5 - "numberParticleTypes integer none []\n" - "particleTypes integer none " -#else "numberOfSpecies integer none []\n" "particleSpecies integer none " -#endif "[numberOfParticles]\n" "coordinates double length " "[numberOfParticles,3]\n" @@ -1256,161 +1058,3 @@ void PairKIM::write_descriptor(char** test_descriptor_string) return; } - -void *PairKIM::extract(const char *str, int &dim) -{ - void *paramData; - int kimerror=0; - int ier; - int dummyint; - int isIndexed = 0; - const int MAXLINE = 1024; - int rank; - int validParam = 0; - int numParams; - int *speciesIndex = new int[MAXLINE]; - char *paramStr = new char[MAXLINE]; - char *paramName; - char *indexStr; - char message[MAXLINE]; - int offset; - double* paramPtr; - - // set dim to 0, we will always deal with scalars to circumvent lammps species - // indexing - dim = 0; - - // copy the input str into paramStr for parsing - strcpy(paramStr, str); - // get the name of the parameter (whatever is before ":") - paramName = strtok(paramStr, ":"); - if (0 == strcmp(paramName, str)) - paramName = (char*) str; - else - isIndexed = 1; - - // parse the rest of the string into tokens deliminated by "," and convert - // them to integers, saving them into speciesIndex - int count = -1; - if (isIndexed == 1) - { - while((indexStr = strtok(NULL, ",")) != NULL) - { - count++; - ier = sscanf(indexStr, "%d", &speciesIndex[count]); - if (ier != 1) - { - ier = -1; - break; - } - } - } - if (ier == -1) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - kim_error(__LINE__,"error in PairKIM::extract(), invalid parameter-indicie format", KIM_STATUS_FAIL); - } - - // check to make sure that the requested parameter is a valid free parameter - - kimerror = pkim->get_num_params(&numParams, &dummyint); - kim_error(__LINE__, "get_num_free_params", kimerror); - char **freeParamNames = new char*[numParams]; - for (int k = 0; k < numParams; k++) - { - kimerror = pkim->get_free_parameter(k, (const char**) &freeParamNames[k]); - kim_error(__LINE__, "get_free_parameter", kimerror); - if (0 == strcmp(paramName, freeParamNames[k])) - { - validParam = 1; - break; - } - } - delete [] freeParamNames, freeParamNames = 0; - if (validParam == 0) - { - sprintf(message, "Invalid parameter to adapt: \"%s\" is not a FREE_PARAM", paramName); - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - kim_error(__LINE__, message, KIM_STATUS_FAIL); - } - - // get the parameter arry from pkim object - paramData = pkim->get_data(paramName, &kimerror); - if (kimerror == KIM_STATUS_FAIL) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - } - kim_error(__LINE__,"get_data",kimerror); - - // get rank and shape of parameter - rank = (*pkim).get_rank(paramName, &kimerror); - if (kimerror == KIM_STATUS_FAIL) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - } - kim_error(__LINE__,"get_rank",kimerror); - - int *shape = new int[MAXLINE]; - dummyint = (*pkim).get_shape(paramName, shape, &kimerror); - if (kimerror == KIM_STATUS_FAIL) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - delete [] shape, shape = 0; - } - kim_error(__LINE__,"get_shape",kimerror); - - delete [] paramStr, paramStr = 0; - // check that number of inputs is rank, and that input indicies are less than - // their respective dimensions in shape - if ((count+1) != rank) - { - sprintf(message, "Number of input indicies not equal to rank of specified parameter (%d)", rank); - kimerror = KIM_STATUS_FAIL; - delete [] speciesIndex, speciesIndex = 0; - delete [] shape, shape = 0; - kim_error(__LINE__,message, kimerror); - } - if (isIndexed == 1) - { - for (int i=0; i <= count; i++) - { - if (shape[i] <= speciesIndex[i] || speciesIndex[i] < 0) - { - kimerror = KIM_STATUS_FAIL; - break; - } - } - } - delete [] shape, shape = 0; - if (kimerror == KIM_STATUS_FAIL) - { - sprintf(message, "One or more parameter indicies out of bounds"); - delete [] speciesIndex, speciesIndex = 0; - kim_error(__LINE__, message, kimerror); - } - - // Cast it to a double - paramPtr = static_cast(paramData); - - // If it is indexed (not just a scalar for the whole model), then get pointer - // corresponding to specified indicies by calculating the adress offset using - // specified indicies and the shape - if (isIndexed == 1) - { - offset = 0; - for (int i = 0; i < (rank-1); i++) - { - offset = (offset + speciesIndex[i]) * shape[i+1]; - } - offset = offset + speciesIndex[(rank - 1)]; - paramPtr = (paramPtr + offset); - } - delete [] speciesIndex, speciesIndex = 0; - - return ((void*) paramPtr); -} diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index fb4cda8af9..493aa9066a 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -18,8 +18,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the openkim-api-v1.5.0 package and for use with - the kim-api-v1.6.0 (and newer) package + Designed for use with the kim-api-v1.6.0 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS @@ -49,11 +48,9 @@ namespace LAMMPS_NS { virtual void coeff(int, char**); virtual void init_style(); virtual double init_one(int, int); - virtual void reinit(); virtual int pack_reverse_comm(int, int, double*); virtual void unpack_reverse_comm(int, int*, double*); virtual double memory_usage(); - void *extract(const char *, int &); private: // (nearly) all bool flags are not initialized in constructor, but set @@ -80,9 +77,6 @@ namespace LAMMPS_NS { // values set in set_lmps_flags(), called from init_style() bool lmps_using_newton; bool lmps_using_molecular; - bool lmps_hybrid; // true if running with pair hybrid - bool lmps_support_cluster; // true if running in mode compat. - // with CLUSTER enum unit_sys {REAL, METAL, SI, CGS, ELECTRON}; unit_sys lmps_units; @@ -95,9 +89,6 @@ namespace LAMMPS_NS { // values set in kim_init(), after call to string_init(_) bool kim_init_ok; - bool kim_model_using_half; - bool kim_model_using_cluster; - bool kim_model_using_Rij; int kim_ind_coordinates; int kim_ind_numberOfParticles; int kim_ind_numberContributingParticles; @@ -125,16 +116,9 @@ namespace LAMMPS_NS { // values set in compute() int lmps_maxalloc; // max allocated memory value int* kim_particleSpecies; // array of KIM particle species - double** lmps_force_tmp; // temp storage for f, when running in - // hybrid mode needed to avoid resetting - // f to zero in each object int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS // is in molecular mode - // values used in get_neigh() - int kim_iterator_position; //get_neigh iterator current position - double *Rij; - // KIM specific helper functions void kim_error(int, const char *, int); void kim_init(); @@ -199,19 +183,19 @@ Self-explanatory. Check the input script or data file. W: KIM Model does not provide `energy'; Potential energy will be zero -UNDOCUMENTED +Self-explanatory. W: KIM Model does not provide `forces'; Forces will be zero -UNDOCUMENTED +Self-explanatory. W: KIM Model does not provide `particleEnergy'; energy per atom will be zero -UNDOCUMENTED +Self-explanatory. W: KIM Model does not provide `particleVirial'; virial per atom will be zero -UNDOCUMENTED + E: Test_descriptor_string already allocated From 8bbba22867fd451d451875b72b3c462b79815c9d Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Fri, 22 Jun 2018 13:33:15 -0500 Subject: [PATCH 02/49] First working version of pair_kim with kim-api-v2 --- lib/kim/Install.py | 8 +- lib/kim/Makefile.lammps | 6 +- src/KIM/pair_kim.cpp | 677 ++++++++++++++++------------------------ src/KIM/pair_kim.h | 40 ++- 4 files changed, 289 insertions(+), 442 deletions(-) diff --git a/lib/kim/Install.py b/lib/kim/Install.py index d098250906..1bcaffd34a 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -21,7 +21,7 @@ Syntax from lib dir: python Install.py -b -v version -a kim-name specify one or more options, order does not matter -v = version of KIM API library to use - default = kim-api-v1.9.5 (current as of May 2018) + default = kim-api-v2.0.0-beta.0 (current as of June 2018) -b = download and build base KIM API library with example Models this will delete any previous installation in the current folder -n = do NOT download and build base KIM API library. @@ -109,7 +109,7 @@ nargs = len(args) if nargs == 0: error() thisdir = os.environ['PWD'] -version = "kim-api-v1.9.5" +version = "kim-api-v2.0.0-beta.0" buildflag = False everythingflag = False @@ -234,7 +234,7 @@ if buildflag: # add all OpenKIM models, if desired if everythingflag: print("Adding all OpenKIM models, this will take a while ...") - cmd = '%s/bin/kim-api-v1-collections-management install system OpenKIM' % (kimdir) + cmd = '%s/bin/kim-api-v2-collections-management install system OpenKIM' % (kimdir) txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if verboseflag: print(txt.decode("UTF-8")) @@ -251,6 +251,6 @@ if addflag: error() # download single model - cmd = '%s/bin/kim-api-v1-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) + cmd = '%s/bin/kim-api-v2-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if verboseflag: print (txt.decode("UTF-8")) diff --git a/lib/kim/Makefile.lammps b/lib/kim/Makefile.lammps index d73891d1e2..c7c9d9fd2f 100644 --- a/lib/kim/Makefile.lammps +++ b/lib/kim/Makefile.lammps @@ -18,10 +18,10 @@ include ../../lib/kim/Makefile.KIM_DIR -ifeq ($(wildcard $(KIM_INSTALL_DIR)/bin/kim-api-v1-build-config),) - KIM_CONFIG_HELPER = kim-api-v1-build-config +ifeq ($(wildcard $(KIM_INSTALL_DIR)/bin/kim-api-v2-build-config),) + KIM_CONFIG_HELPER = kim-api-v2-build-config else - KIM_CONFIG_HELPER = $(KIM_INSTALL_DIR)/bin/kim-api-v1-build-config + KIM_CONFIG_HELPER = $(KIM_INSTALL_DIR)/bin/kim-api-v2-build-config endif ifeq ($(shell $(KIM_CONFIG_HELPER) --version 2> /dev/null),) $(error $(KIM_CONFIG_HELPER) utility is not available. Something is wrong with your KIM API package setup) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 8947bd6c3b..413c5303e1 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -37,10 +37,6 @@ #include "domain.h" #include "error.h" -// includes from KIM -#include "KIM_API.h" -#include "KIM_API_status.h" - using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -55,24 +51,15 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_num_unique_elements(0), lmps_units(METAL), pkim(0), - kim_ind_coordinates(-1), - kim_ind_numberOfParticles(-1), - kim_ind_numberContributingParticles(-1), - kim_ind_numberOfSpecies(-1), - kim_ind_particleSpecies(-1), - kim_ind_get_neigh(-1), - kim_ind_neighObject(-1), - kim_ind_cutoff(-1), - kim_ind_energy(-1), - kim_ind_particleEnergy(-1), - kim_ind_forces(-1), - kim_ind_virial(-1), - kim_ind_particleVirial(-1), + pargs(0), kim_particle_codes(0), lmps_local_tot_num_atoms(0), - kim_global_cutoff(0.0), + kim_global_influence_distance(0.0), + kim_number_of_cutoffs(0), + kim_cutoff_values(0), lmps_maxalloc(0), kim_particleSpecies(0), + kim_particleContributing(0), lmps_stripped_neigh_list(0) { // Initialize Pair data members to appropriate values @@ -104,6 +91,7 @@ PairKIM::~PairKIM() // clean up local memory used to support KIM interface memory->destroy(kim_particleSpecies); + memory->destroy(kim_particleContributing); memory->destroy(lmps_stripped_neigh_list); // clean up allocated memory for standard Pair class usage @@ -131,13 +119,27 @@ void PairKIM::compute(int eflag , int vflag) else ev_unset(); - // grow kim_particleSpecies array if necessary + // grow kim_particleSpecies and kim_particleContributing array if necessary // needs to be atom->nmax in length if (atom->nmax > lmps_maxalloc) { memory->destroy(kim_particleSpecies); + memory->destroy(kim_particleContributing); lmps_maxalloc = atom->nmax; - memory->create(kim_particleSpecies,lmps_maxalloc,"pair:kim_particleSpecies"); + memory->create(kim_particleSpecies,lmps_maxalloc, + "pair:kim_particleSpecies"); + int kimerror = pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::particleSpeciesCodes, + kim_particleSpecies); + memory->create(kim_particleContributing,lmps_maxalloc, + "pair:kim_particleContributing"); + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::particleContributing, + kim_particleContributing); + if (kimerror) + error->all( + FLERR, + "Unable to set KIM particle species codes and/or contributing"); } // kim_particleSpecies = KIM atom species for each LAMMPS atom @@ -151,23 +153,17 @@ void PairKIM::compute(int eflag , int vflag) ielement = lmps_map_species_to_unique[species[i]]; ielement = MAX(ielement,0); kim_particleSpecies[i] = kim_particle_codes[ielement]; + + kim_particleContributing[i] = ( (inlocal) ? 1 : 0 ); } // pass current atom pointers to KIM set_volatiles(); - pkim->setm_compute_by_index(&kimerror,3*3, - kim_ind_particleEnergy, eflag_atom, - (int) kim_model_has_particleEnergy, - kim_ind_particleVirial, vflag_atom, - (int) kim_model_has_particleVirial, - kim_ind_virial, vflag_global!=0, - no_virial_fdotr_compute); - kim_error(__LINE__,"setm_compute_by_index",kimerror); - // compute via KIM model - kimerror = pkim->model_compute(); - kim_error(__LINE__,"PairKIM::pkim->model_compute() error",kimerror); + kimerror = pkim->Compute(pargs); + if (kimerror) error->all(FLERR,"KIM Compute returned error"); + // assemble force and particleVirial if needed if (!lmps_using_newton) comm->reverse_comm_pair(this); @@ -280,17 +276,6 @@ void PairKIM::settings(int narg, char **arg) kim_modelname = new char[nmlen+1]; strcpy(kim_modelname, arg[1]); - // set print_kim_file - // @@@ should be removed for v2; update docs - if ((2 == narg) || ('0' == *(arg[2]))) - { - print_kim_file = false; - } - else - { - print_kim_file = true; - } - return; } @@ -385,13 +370,6 @@ void PairKIM::init_style() if (!kim_init_ok) { kim_init(); - kimerror = pkim->model_init(); - if (kimerror != KIM_STATUS_OK) - kim_error(__LINE__, "KIM API:model_init() failed", kimerror); - else - { - kim_model_init_ok = true; - } } // make sure comm_reverse expects (at most) 9 values when newton is off @@ -418,7 +396,7 @@ double PairKIM::init_one(int i, int j) if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); - return kim_global_cutoff; + return kim_global_influence_distance; } /* ---------------------------------------------------------------------- */ @@ -554,38 +532,31 @@ double PairKIM::memory_usage() KIM-specific interface ------------------------------------------------------------------------- */ -void PairKIM::kim_error(int ln, const char* msg, int errcode) +int PairKIM::get_neigh(void const * const dataObject, + int const numberOfCutoffs, double const * const cutoffs, + int const neighborListIndex, int const particleNumber, + int * const numberOfNeighbors, + int const ** const neighborsOfParticle) { - if (errcode == KIM_STATUS_OK) return; - KIM_API_model::report_error(ln,(char *) __FILE__, (char *) msg,errcode); - error->all(__FILE__,ln,"Internal KIM error"); + PairKIM const * const Model + = reinterpret_cast(dataObject); - return; -} + if ((numberOfCutoffs != 1) || (cutoffs[0] > Model->kim_cutoff_values[0])) + return true; -/* ---------------------------------------------------------------------- */ + if (neighborListIndex != 0) return true; -int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, - int *atom, int *numnei, int **nei1atom, double **pRij) -{ - KIM_API_model *pkim = (KIM_API_model *) *kimmdl; + // initialize numNeigh + *numberOfNeighbors = 0; - int kimerror; - PairKIM *self = (PairKIM *) pkim->get_sim_buffer(&kimerror); + if ((particleNumber >= Model->lmps_local_tot_num_atoms) || + (particleNumber < 0)) /* invalid id */ + { + return true; + } - // subvert KIM api by using direct access to self->list - // - // get neighObj from KIM API obj - // NeighList * neiobj = (NeighList * ) - // (*pkim).get_data_by_index(self->kim_ind_neighObject, &kimerror); - NeighList * neiobj = self->list; - - // subvert KIM api by using direct acces to self->lmps_local_tot_num_atoms - // - //int * pnAtoms = (int *) - // (*pkim).get_data_by_index(self->kim_ind_numberOfParticles, &kimerror); - //int nAtoms = *pnAtoms; - int nAtoms = self->lmps_local_tot_num_atoms; + NeighList * neiobj = Model->list; + 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 @@ -593,40 +564,21 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, numneigh = neiobj->numneigh; // # of J neighbors for each I atom firstneigh = neiobj->firstneigh; // ptr to 1st J int value of each I atom - if (*mode==0){ //iterator mode - return KIM_STATUS_NEIGH_INVALID_MODE; //unsupported mode - } else if (*mode == 1){//locator mode - //... - if (*request < inum) { - *atom = *request; - *numnei = numneigh[*atom]; + *numberOfNeighbors = numneigh[particleNumber]; - // strip off neighbor mask for molecular systems - if (!self->lmps_using_molecular) - *nei1atom = firstneigh[*atom]; - else - { - int n = *numnei; - int *ptr = firstneigh[*atom]; - int *lmps_stripped_neigh_list = self->lmps_stripped_neigh_list; - for (int i = 0; i < n; i++) - lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; - *nei1atom = lmps_stripped_neigh_list; - } - - *pRij = NULL; - return KIM_STATUS_OK; //successful end - } - else if (*request >= nAtoms || inum < 0) - return KIM_STATUS_NEIGH_INVALID_REQUEST; - else if (*request >= inum) { - *atom = *request; - *numnei = 0; - return KIM_STATUS_OK; //successfull but no neighbors in the list - } - } else return KIM_STATUS_NEIGH_INVALID_MODE; //invalid mode - - return -16; //should not get here: unspecified error + // strip off neighbor mask for molecular systems + if (!Model->lmps_using_molecular) + *neighborsOfParticle = firstneigh[particleNumber]; + else + { + int n = *numberOfNeighbors; + int *ptr = firstneigh[particleNumber]; + int *lmps_stripped_neigh_list = Model->lmps_stripped_neigh_list; + for (int i = 0; i < n; i++) + lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; + *neighborsOfParticle = lmps_stripped_neigh_list; + } + return false; } /* ---------------------------------------------------------------------- */ @@ -637,19 +589,15 @@ void PairKIM::kim_free() if (kim_model_init_ok) { - kimerror = pkim->model_destroy(); - kim_model_init_ok = false; - } - if (kim_init_ok) - { - pkim->free(&kimerror); - kim_init_ok = false; - } - if (pkim != 0) - { - delete pkim; - pkim = 0; + int kimerror = pkim->ComputeArgumentsDestroy(&pargs); + if (kimerror) + error->all(FLERR,"Unable to destroy Compute Arguments Object"); + + KIM::Model::Destroy(&pkim); + kim_model_init_ok = false; } + kim_init_ok = false; + if (kim_particle_codes_ok) { delete [] kim_particle_codes; @@ -666,58 +614,47 @@ void PairKIM::kim_init() { int kimerror; + // initialize KIM model + int requestedUnitsAccepted; + kimerror = KIM::Model::Create( + KIM::NUMBERING::zeroBased, + lengthUnit, energyUnit, chargeUnit, temperatureUnit, timeUnit, + kim_modelname, + &requestedUnitsAccepted, + &pkim); + if (kimerror) + error->all(FLERR,"KIM ModelCreate failed"); + else { + if (!requestedUnitsAccepted) { + // @@@ error for now. Fix as needed + error->all(FLERR,"KIM Model did not accept the requested unit system"); + } + + kimerror = pkim->ComputeArgumentsCreate(&pargs); + if (kimerror) + error->all(FLERR,"KIM ComputeArgumentsCreate failed"); + else + kim_init_ok = true; + } + // determine KIM Model capabilities (used in this function below) set_kim_model_has_flags(); - // create appropriate KIM descriptor file - char* test_descriptor_string = 0; - // allocate memory for test_descriptor_string and write descriptor file - write_descriptor(&test_descriptor_string); - // print descriptor - if (print_kim_file) - { - error->message(FLERR, test_descriptor_string); - } - - // initialize KIM model - pkim = new KIM_API_model(); - kimerror = pkim->string_init(test_descriptor_string, kim_modelname); - if (kimerror != KIM_STATUS_OK) - kim_error(__LINE__,"KIM initialization failed", kimerror); - else - { - kim_init_ok = true; - delete [] test_descriptor_string; - test_descriptor_string = 0; - } - - // get correct index of each variable in kim_api object - pkim->getm_index(&kimerror, 3*12, - "coordinates", &kim_ind_coordinates, 1, - "cutoff", &kim_ind_cutoff, 1, - "numberOfParticles", &kim_ind_numberOfParticles, 1, - "numberOfSpecies", &kim_ind_numberOfSpecies, 1, - "particleSpecies", &kim_ind_particleSpecies, 1, - "particleEnergy", &kim_ind_particleEnergy, - (int) kim_model_has_particleEnergy, - "energy", &kim_ind_energy, (int) kim_model_has_energy, - "forces", &kim_ind_forces, (int) kim_model_has_forces, - "neighObject", &kim_ind_neighObject, 1, - "get_neigh", &kim_ind_get_neigh, 1, - "particleVirial", &kim_ind_particleVirial, - (int) kim_model_has_particleVirial, - "virial", &kim_ind_virial, no_virial_fdotr_compute); - kim_error(__LINE__,"getm_index",kimerror); - // setup mapping between LAMMPS unique elements and KIM species codes 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; - kim_particle_codes[i] - = pkim->get_species_code(lmps_unique_elements[i], &kimerror); - kim_error(__LINE__, "create_kim_particle_codes: symbol not found ", - kimerror); + int supported; + int code; + kimerror = pkim->GetSpeciesSupportAndCode( + KIM::SpeciesName(lmps_unique_elements[i]), + &supported, + &code); + if (supported) + kim_particle_codes[i] = code; + else + error->all(FLERR,"create_kim_particle_codes: symbol not found "); } // set pointer values in KIM API object that will not change during run @@ -733,21 +670,26 @@ void PairKIM::set_statics() // set total number of atoms lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); - int kimerror; - pkim->setm_data_by_index(&kimerror, 4*5, - kim_ind_numberOfSpecies, 1, (void *) &(atom->ntypes), 1, - kim_ind_cutoff, 1, (void *) &(kim_global_cutoff), 1, - kim_ind_numberOfParticles, 1, (void *) &lmps_local_tot_num_atoms, 1, - kim_ind_energy, 1, (void *) &(eng_vdwl), (int) kim_model_has_energy, - kim_ind_virial, 1, (void *) &(virial[0]), no_virial_fdotr_compute); - kim_error(__LINE__, "setm_data_by_index", kimerror); + pkim->GetInfluenceDistance(&kim_global_influence_distance); + pkim->GetNeighborListCutoffsPointer(&kim_number_of_cutoffs, + &kim_cutoff_values); - kimerror = pkim->set_method_by_index(kim_ind_get_neigh, 1, - (func_ptr) &get_neigh); - kim_error(__LINE__, "set_method_by_index", kimerror); + int kimerror = pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, + &lmps_local_tot_num_atoms); + if (kim_model_has_energy) + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialEnergy, + &(eng_vdwl)); - pkim->set_sim_buffer((void *)this, &kimerror); - kim_error(__LINE__, "set_sim_buffer", kimerror); + kimerror = pargs->SetCallbackPointer( + KIM::COMPUTE_CALLBACK_NAME::GetNeighborList, + KIM::LANGUAGE_NAME::cpp, + reinterpret_cast(get_neigh), + reinterpret_cast(this)); + + if (kimerror) + error->all(FLERR,"Unable to register KIM static pointers"); return; } @@ -758,56 +700,56 @@ void PairKIM::set_volatiles() { int kimerror; lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); - intptr_t nall = (intptr_t) lmps_local_tot_num_atoms; - pkim->setm_data_by_index(&kimerror, 4*2, - kim_ind_coordinates, 3*nall, (void*) &(atom->x[0][0]), 1, - kim_ind_particleSpecies, nall, (void*) kim_particleSpecies, 1); - kim_error(__LINE__, "setm_data_by_index", kimerror); + kimerror = pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::coordinates, + &(atom->x[0][0])); if (kim_model_has_particleEnergy && (eflag_atom == 1)) { - kimerror = pkim->set_data_by_index(kim_ind_particleEnergy, nall, - (void*) eatom); - kim_error(__LINE__, "set_data_by_index", kimerror); - } - - if (kim_model_has_particleVirial && (vflag_atom == 1)) - { - kimerror = pkim->set_data_by_index(kim_ind_particleVirial, 6*nall, - (void*) &(vatom[0][0])); - kim_error(__LINE__, "set_data_by_index", kimerror); + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialParticleEnergy, + eatom); } if (kim_model_has_forces) { - kimerror = pkim->set_data_by_index(kim_ind_forces, nall*3, - (void*) &(atom->f[0][0])); - kim_error(__LINE__, "set_data_by_index", kimerror); + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialForces, + &(atom->f[0][0])); } - // subvert the KIM api by direct access to this->list in get_neigh - // - //if (!kim_model_using_cluster) - // kimerror = pkim->set_data_by_index(kim_ind_neighObject, 1, - // (void*) this->list); - if (kim_model_has_particleVirial) { - if(vflag_atom != 1) { - pkim->set_compute_by_index(kim_ind_particleVirial, KIM_COMPUTE_FALSE, - &kimerror); - } else { - pkim->set_compute_by_index(kim_ind_particleVirial, KIM_COMPUTE_TRUE, - &kimerror); - } + if(vflag_atom != 1) { + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, + &(vatom[0][0])); + } else { + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, + reinterpret_cast(NULL)); + } } if (no_virial_fdotr_compute == 1) { - pkim->set_compute_by_index(kim_ind_virial, - ((vflag_global != 1) ? KIM_COMPUTE_FALSE : KIM_COMPUTE_TRUE), - &kimerror); + if (kim_model_has_virial) + { + if (vflag_global == 1) + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialVirial, + &(virial[0])); + else + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialVirial, + reinterpret_cast(NULL)); + } + } + + if (kimerror) + { + error->all(FLERR,"Unable to set KIM volatile pointers"); } return; @@ -835,20 +777,46 @@ void PairKIM::set_lmps_flags() } // determine unit system and set lmps_units flag - if ((strcmp(update->unit_style,"real")==0)) - lmps_units = REAL; - else if ((strcmp(update->unit_style,"metal")==0)) - lmps_units = METAL; - else if ((strcmp(update->unit_style,"si")==0)) - lmps_units = SI; - else if ((strcmp(update->unit_style,"cgs")==0)) - lmps_units = CGS; - else if ((strcmp(update->unit_style,"electron")==0)) - lmps_units = ELECTRON; - else if ((strcmp(update->unit_style,"lj")==0)) - error->all(FLERR,"LAMMPS unit_style lj not supported by KIM models"); - else - error->all(FLERR,"Unknown unit_style"); + if ((strcmp(update->unit_style,"real")==0)) { + lmps_units = REAL; + lengthUnit = KIM::LENGTH_UNIT::A; + energyUnit = KIM::ENERGY_UNIT::kcal_mol; + chargeUnit = KIM::CHARGE_UNIT::e; + temperatureUnit = KIM::TEMPERATURE_UNIT::K; + timeUnit = KIM::TIME_UNIT::fs; + } else if ((strcmp(update->unit_style,"metal")==0)) { + lmps_units = METAL; + lengthUnit = KIM::LENGTH_UNIT::A; + energyUnit = KIM::ENERGY_UNIT::eV; + chargeUnit = KIM::CHARGE_UNIT::e; + temperatureUnit = KIM::TEMPERATURE_UNIT::K; + timeUnit = KIM::TIME_UNIT::ps; + } else if ((strcmp(update->unit_style,"si")==0)) { + lmps_units = SI; + lengthUnit = KIM::LENGTH_UNIT::m; + energyUnit = KIM::ENERGY_UNIT::J; + chargeUnit = KIM::CHARGE_UNIT::C; + temperatureUnit = KIM::TEMPERATURE_UNIT::K; + timeUnit = KIM::TIME_UNIT::s; + } else if ((strcmp(update->unit_style,"cgs")==0)) { + lmps_units = CGS; + lengthUnit = KIM::LENGTH_UNIT::cm; + energyUnit = KIM::ENERGY_UNIT::erg; + chargeUnit = KIM::CHARGE_UNIT::statC; + temperatureUnit = KIM::TEMPERATURE_UNIT::K; + timeUnit = KIM::TIME_UNIT::s; + } else if ((strcmp(update->unit_style,"electron")==0)) { + lmps_units = ELECTRON; + lengthUnit = KIM::LENGTH_UNIT::Bohr; + energyUnit = KIM::ENERGY_UNIT::Hartree; + chargeUnit = KIM::CHARGE_UNIT::e; + temperatureUnit = KIM::TEMPERATURE_UNIT::K; + timeUnit = KIM::TIME_UNIT::fs; + } else if ((strcmp(update->unit_style,"lj")==0)) { + error->all(FLERR,"LAMMPS unit_style lj not supported by KIM models"); + } else { + error->all(FLERR,"Unknown unit_style"); + } return; } @@ -857,204 +825,85 @@ void PairKIM::set_lmps_flags() void PairKIM::set_kim_model_has_flags() { - KIM_API_model mdl; - + // @@ the procedure below should be improved to be more comprehensive + // @@ and ensure that there are no additions/changes to the kim-api + // @@ that could cause a problem. This should be done using the + // @@ "discoverability" features of the kim-api int kimerror; + KIM::SupportStatus supportStatus; - // get KIM API object representing the KIM Model only - kimerror = mdl.model_info(kim_modelname); - kim_error(__LINE__,"KIM initialization failed", kimerror); + // determine if the KIM Model can compute the total partialEnergy - // determine if the KIM Model can compute the total energy - mdl.get_index((char*) "energy", &kimerror); - kim_model_has_energy = (kimerror == KIM_STATUS_OK); - if (!kim_model_has_energy) - error->warning(FLERR,"KIM Model does not provide `energy'; " + // determine if the KIM Model can compute the energy + kimerror = pargs->GetArgumentSupportStatus( + KIM::COMPUTE_ARGUMENT_NAME::partialEnergy, + &supportStatus); + if (kimerror) + error->all(FLERR,"Unable to get KIM Support Status"); + if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { + kim_model_has_energy = false; + error->warning(FLERR,"KIM Model does not provide `partialEnergy'; " "Potential energy will be zero"); + } else { + kim_model_has_energy = true; + } - // determine if the KIM Model can compute the forces - mdl.get_index((char*) "forces", &kimerror); - kim_model_has_forces = (kimerror == KIM_STATUS_OK); - if (!kim_model_has_forces) - error->warning(FLERR,"KIM Model does not provide `forces'; " + // determine if the KIM Model can compute the partialForces + kimerror = pargs->GetArgumentSupportStatus( + KIM::COMPUTE_ARGUMENT_NAME::partialForces, + &supportStatus); + if (kimerror) + error->all(FLERR,"Unable to get KIM Support Status"); + if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { + kim_model_has_forces = false; + error->warning(FLERR,"KIM Model does not provide `partialForce'; " "Forces will be zero"); + } else { + kim_model_has_forces = true; + } - // determine if the KIM Model can compute the particleEnergy - mdl.get_index((char*) "particleEnergy", &kimerror); - kim_model_has_particleEnergy = (kimerror == KIM_STATUS_OK); - if (!kim_model_has_particleEnergy) - error->warning(FLERR,"KIM Model does not provide `particleEnergy'; " + // determine if the KIM Model can compute the partialVirial + kimerror = pargs->GetArgumentSupportStatus( + KIM::COMPUTE_ARGUMENT_NAME::partialVirial, + &supportStatus); + if (kimerror) + error->all(FLERR,"Unable to get KIM Support Status"); + if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { + kim_model_has_virial = false; + error->warning(FLERR,"KIM Model does not provide `partialVirial'. " + "pair_kim now using `LAMMPSvirial' option."); + no_virial_fdotr_compute = 0; + } else { + kim_model_has_virial = true; + } + + // determine if the KIM Model can compute the partialParticleEnergy + kimerror = pargs->GetArgumentSupportStatus( + KIM::COMPUTE_ARGUMENT_NAME::partialParticleEnergy, + &supportStatus); + if (kimerror) + error->all(FLERR,"Unable to get KIM Support Status"); + if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { + kim_model_has_particleEnergy = false; + error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " "energy per atom will be zero"); + } else { + kim_model_has_particleEnergy = true; + } - // determine if the KIM Model can compute the particleVerial - mdl.get_index((char*) "particleVirial", &kimerror); - kim_model_has_particleVirial = (kimerror == KIM_STATUS_OK); - mdl.get_index((char*) "process_dEdr", &kimerror); - kim_model_has_particleVirial = kim_model_has_particleVirial || - (kimerror == KIM_STATUS_OK); - if (!kim_model_has_particleVirial) - error->warning(FLERR,"KIM Model does not provide `particleVirial'; " + // determine if the KIM Model can compute the partialParticleVirial + kimerror = pargs->GetArgumentSupportStatus( + KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, + &supportStatus); + if (kimerror) + error->all(FLERR,"Unable to get KIM Support Status"); + if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { + kim_model_has_particleVirial = false; + error->warning(FLERR,"KIM Model does not provide `partialParticleVirial'; " "virial per atom will be zero"); - - // tear down KIM API object - mdl.free(&kimerror); - // now destructor will do the remaining tear down for mdl - - return; -} - -/* ---------------------------------------------------------------------- */ - -void PairKIM::write_descriptor(char** test_descriptor_string) -{ - // allocate memory - if (*test_descriptor_string != 0) - error->all(FLERR, "Test_descriptor_string already allocated"); - // assuming 75 lines at 100 characters each (should be plenty) - *test_descriptor_string = new char[100*75]; - // initialize - strcpy(*test_descriptor_string, ""); - - // Write Test name and units - strcat(*test_descriptor_string, - "#\n" - "# BEGINNING OF KIM DESCRIPTOR FILE\n" - "#\n" - "# This file is automatically generated from LAMMPS pair_style " - "kim command\n"); - strcat(*test_descriptor_string, - "\n" - "# The call number is (pair_style).(init_style): "); - char tmp_num[100]; - sprintf(tmp_num, "%i.%i\n", settings_call_count, init_style_call_count); - strcat(*test_descriptor_string, tmp_num); - strcat(*test_descriptor_string, - "#\n" - "\n" -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSION_MINOR == 5 -#else - "KIM_API_Version := 1.6.0\n\n" -#endif - "# Base units\n"); - switch (lmps_units) - { - case REAL: - strcat(*test_descriptor_string, - "Unit_length := A\n" - "Unit_energy := kcal/mol\n" - "Unit_charge := e\n" - "Unit_temperature := K\n" - "Unit_time := fs\n\n"); - break; - case METAL: - strcat(*test_descriptor_string, - "Unit_length := A\n" - "Unit_energy := eV\n" - "Unit_charge := e\n" - "Unit_temperature := K\n" - "Unit_time := ps\n\n"); - break; - case SI: - strcat(*test_descriptor_string, - "Unit_length := m\n" - "Unit_energy := J\n" - "Unit_charge := C\n" - "Unit_temperature := K\n" - "Unit_time := s\n\n"); - break; - case CGS: - strcat(*test_descriptor_string, - "Unit_length := cm\n" - "Unit_energy := erg\n" - "Unit_charge := statC\n" - "Unit_temperature := K\n" - "Unit_time := s\n\n"); - break; - case ELECTRON: - strcat(*test_descriptor_string, - "Unit_length := Bohr\n" - "Unit_energy := Hartree\n" - "Unit_charge := e\n" - "Unit_temperature := K\n" - "Unit_time := fs\n\n"); - break; - } - - // Write Supported species section - strcat(*test_descriptor_string, - "\n" -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSON_MINOR == 5 - "SUPPORTED_ATOM/PARTICLES_TYPES:\n" -#else - "PARTICLE_SPECIES:\n" -#endif - "# Symbol/name Type code\n"); - int code=1; - char* tmp_line = 0; - tmp_line = new char[100]; - for (int i=0; i < lmps_num_unique_elements; i++){ - sprintf(tmp_line, "%-24s%-16s%-3i\n", lmps_unique_elements[i], - "spec", code++); - strcat(*test_descriptor_string, tmp_line); - } - delete [] tmp_line; - tmp_line = 0; - strcat(*test_descriptor_string, "\n"); - - // Write conventions section - strcat(*test_descriptor_string, - "\n" - "CONVENTIONS:\n" - "# Name Type\n" - "ZeroBasedLists flag\n" - "Neigh_LocaAccess flag\n" - "NEIGH_PURE_F flag\n\n"); - - // Write input section - strcat(*test_descriptor_string, - "\n" - "MODEL_INPUT:\n" - "# Name Type Unit Shape\n" - "numberOfParticles integer none []\n" - "numberOfSpecies integer none []\n" - "particleSpecies integer none " - "[numberOfParticles]\n" - "coordinates double length " - "[numberOfParticles,3]\n" - "neighObject pointer none []\n" - "get_neigh method none []\n"); - - // Write output section - strcat(*test_descriptor_string, - "\n" - "MODEL_OUPUT:\n" - "# Name Type Unit Shape\n" - "compute method none []\n" - "destroy method none []\n" - "cutoff double length []\n"); - if (!kim_model_has_energy) strcat(*test_descriptor_string,"# "); - strcat(*test_descriptor_string, - "energy double energy []\n"); - if (!kim_model_has_forces) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "forces double force " - "[numberOfParticles,3]\n"); - if (!kim_model_has_particleEnergy) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "particleEnergy double energy " - "[numberOfParticles]\n"); - if (no_virial_fdotr_compute != 1) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "virial double energy [6]\n"); - if (!kim_model_has_particleVirial) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "particleVirial double energy " - "[numberOfParticles,6]\n" - "\n"); - strcat(*test_descriptor_string, - "#\n" - "# END OF KIM DESCRIPTOR FILE\n" - "#\n"); + } else { + kim_model_has_particleVirial = true; + } return; } diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 493aa9066a..07790fb44b 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -33,6 +33,7 @@ PairStyle(kim,PairKIM) // includes from KIM & LAMMPS class KIM_API_model; #include "pair.h" +#include "KIM_SimulatorHeaders.hpp" namespace LAMMPS_NS { @@ -61,7 +62,6 @@ namespace LAMMPS_NS { // values set in settings() char* kim_modelname; - bool print_kim_file; // values set in coeff() @@ -79,29 +79,23 @@ namespace LAMMPS_NS { bool lmps_using_molecular; enum unit_sys {REAL, METAL, SI, CGS, ELECTRON}; unit_sys lmps_units; + KIM::LengthUnit lengthUnit; + KIM::EnergyUnit energyUnit; + KIM::ChargeUnit chargeUnit; + KIM::TemperatureUnit temperatureUnit; + KIM::TimeUnit timeUnit; // values set in set_kim_model_has_flags(), called by kim_init() - KIM_API_model* pkim; + KIM::Model * pkim; + KIM::ComputeArguments * pargs; bool kim_model_has_energy; bool kim_model_has_forces; + bool kim_model_has_virial; bool kim_model_has_particleEnergy; bool kim_model_has_particleVirial; // values set in kim_init(), after call to string_init(_) bool kim_init_ok; - int kim_ind_coordinates; - int kim_ind_numberOfParticles; - int kim_ind_numberContributingParticles; - int kim_ind_numberOfSpecies; - int kim_ind_particleSpecies; - int kim_ind_get_neigh; - int kim_ind_neighObject; - int kim_ind_cutoff; - int kim_ind_energy; - int kim_ind_particleEnergy; - int kim_ind_forces; - int kim_ind_virial; - int kim_ind_particleVirial; // values set in init_style(), after calling pkim->model_init() bool kim_model_init_ok; @@ -111,27 +105,31 @@ namespace LAMMPS_NS { // values set in set_statics(), called at end of kim_init(), // then again in set_volatiles(), called in compute() int lmps_local_tot_num_atoms; - double kim_global_cutoff; // KIM Model cutoff value + double kim_global_influence_distance; // KIM Model cutoff value + int kim_number_of_cutoffs; + double const * kim_cutoff_values; // values set in compute() int lmps_maxalloc; // max allocated memory value int* kim_particleSpecies; // array of KIM particle species + int* kim_particleContributing; // array of KIM particle contributing int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS // is in molecular mode // KIM specific helper functions - void kim_error(int, const char *, int); void kim_init(); void kim_free(); void set_statics(); void set_volatiles(); void set_lmps_flags(); void set_kim_model_has_flags(); - void write_descriptor(char** test_descriptor_string); // static methods used as callbacks from KIM - static int get_neigh(void** kimmdl, int* mode, int* request, - int* atom, int* numnei, int** nei1atom, - double** pRij); + static int get_neigh( + void const * const dataObject, + int const numberOfCutoffs, double const * const cutoffs, + int const neighborListIndex, int const particleNumber, + int * const numberOfNeighbors, + int const ** const neighborsOfParticle); }; } From 906a12353c97a4a7ba47bd97e708109e957fd908 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 24 Jun 2018 08:28:34 -0500 Subject: [PATCH 03/49] Fixup neighbor list settings for pair_kim --- src/KIM/pair_kim.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 413c5303e1..34deca3862 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -379,8 +379,7 @@ void PairKIM::init_style() int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; - // make sure full lists also include local-ghost pairs - if (lmps_using_newton) neighbor->requests[irequest]->newton = 0; + neighbor->requests[irequest]->ghost = 1; return; } From da9441471a373ca3c7bf1c6d5525a1ce20d01540 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 24 Jun 2018 08:44:28 -0500 Subject: [PATCH 04/49] Fixup partialVirial bug in pair_kim --- src/KIM/pair_kim.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 34deca3862..040c90b42b 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -723,11 +723,11 @@ void PairKIM::set_volatiles() if(vflag_atom != 1) { kimerror = kimerror || pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, - &(vatom[0][0])); + reinterpret_cast(NULL)); } else { kimerror = kimerror || pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, - reinterpret_cast(NULL)); + &(vatom[0][0])); } } From 8a8b968d55c715f87d7ff57df75796de3ad28251 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 24 Jun 2018 15:23:25 -0500 Subject: [PATCH 05/49] Fixup the pressure/virial computation in pair_kim --- src/KIM/pair_kim.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 040c90b42b..d1f5887341 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -735,14 +735,18 @@ void PairKIM::set_volatiles() { if (kim_model_has_virial) { - if (vflag_global == 1) - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialVirial, - &(virial[0])); - else + if (vflag_global == 0) + { kimerror = kimerror || pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::partialVirial, reinterpret_cast(NULL)); + } + else + { + kimerror = kimerror || pargs->SetArgumentPointer( + KIM::COMPUTE_ARGUMENT_NAME::partialVirial, + &(virial[0])); + } } } From 5958b24edc01d60b20c26b0e6a3b62a294505f0e Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 27 Jun 2018 11:06:18 -0500 Subject: [PATCH 06/49] Adjust some internal pair_kim things --- src/KIM/pair_kim.cpp | 24 ++++++++---------------- src/KIM/pair_kim.h | 23 +++++++++++------------ 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index d1f5887341..3fc94944fc 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -52,11 +52,11 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_units(METAL), pkim(0), pargs(0), - kim_particle_codes(0), lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), kim_number_of_cutoffs(0), kim_cutoff_values(0), + kim_particle_codes(0), lmps_maxalloc(0), kim_particleSpecies(0), kim_particleContributing(0), @@ -119,6 +119,8 @@ void PairKIM::compute(int eflag , int vflag) else ev_unset(); + // @@@@ can we strip the neighbor list here (like pair_meamc does)? + // grow kim_particleSpecies and kim_particleContributing array if necessary // needs to be atom->nmax in length if (atom->nmax > lmps_maxalloc) { @@ -158,7 +160,7 @@ void PairKIM::compute(int eflag , int vflag) } // pass current atom pointers to KIM - set_volatiles(); + set_argument_pointers(); // compute via KIM model kimerror = pkim->Compute(pargs); @@ -656,16 +658,6 @@ void PairKIM::kim_init() error->all(FLERR,"create_kim_particle_codes: symbol not found "); } - // set pointer values in KIM API object that will not change during run - set_statics(); - - return; -} - -/* ---------------------------------------------------------------------- */ - -void PairKIM::set_statics() -{ // set total number of atoms lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); @@ -673,7 +665,7 @@ void PairKIM::set_statics() pkim->GetNeighborListCutoffsPointer(&kim_number_of_cutoffs, &kim_cutoff_values); - int kimerror = pargs->SetArgumentPointer( + kimerror = pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, &lmps_local_tot_num_atoms); if (kim_model_has_energy) @@ -688,14 +680,14 @@ void PairKIM::set_statics() reinterpret_cast(this)); if (kimerror) - error->all(FLERR,"Unable to register KIM static pointers"); + error->all(FLERR,"Unable to register KIM pointers"); return; } /* ---------------------------------------------------------------------- */ -void PairKIM::set_volatiles() +void PairKIM::set_argument_pointers() { int kimerror; lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); @@ -752,7 +744,7 @@ void PairKIM::set_volatiles() if (kimerror) { - error->all(FLERR,"Unable to set KIM volatile pointers"); + error->all(FLERR,"Unable to set KIM argument pointers"); } return; diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 07790fb44b..37807ebfbc 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -48,6 +48,7 @@ namespace LAMMPS_NS { virtual void settings(int, char**); virtual void coeff(int, char**); virtual void init_style(); + //virtual void init_list(int id, NeighList *ptr); virtual double init_one(int, int); virtual int pack_reverse_comm(int, int, double*); virtual void unpack_reverse_comm(int, int*, double*); @@ -85,30 +86,29 @@ namespace LAMMPS_NS { KIM::TemperatureUnit temperatureUnit; KIM::TimeUnit timeUnit; - // values set in set_kim_model_has_flags(), called by kim_init() + KIM::Model * pkim; KIM::ComputeArguments * pargs; + + // values set in set_kim_model_has_flags(), called by kim_init() bool kim_model_has_energy; bool kim_model_has_forces; bool kim_model_has_virial; bool kim_model_has_particleEnergy; bool kim_model_has_particleVirial; - // values set in kim_init(), after call to string_init(_) + // values set in kim_init() bool kim_init_ok; - - // values set in init_style(), after calling pkim->model_init() - bool kim_model_init_ok; - bool kim_particle_codes_ok; - int *kim_particle_codes; - - // values set in set_statics(), called at end of kim_init(), - // then again in set_volatiles(), called in compute() int lmps_local_tot_num_atoms; double kim_global_influence_distance; // KIM Model cutoff value int kim_number_of_cutoffs; double const * kim_cutoff_values; + // values set in init_style() + bool kim_model_init_ok; + bool kim_particle_codes_ok; + int *kim_particle_codes; + // values set in compute() int lmps_maxalloc; // max allocated memory value int* kim_particleSpecies; // array of KIM particle species @@ -119,8 +119,7 @@ namespace LAMMPS_NS { // KIM specific helper functions void kim_init(); void kim_free(); - void set_statics(); - void set_volatiles(); + void set_argument_pointers(); void set_lmps_flags(); void set_kim_model_has_flags(); // static methods used as callbacks from KIM From cb077829356450d8a64161c67428adc3110b4d6a Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 27 Jun 2018 12:46:13 -0500 Subject: [PATCH 07/49] Multiple neig lists working in pair_kim --- src/KIM/pair_kim.cpp | 57 ++++++++++++++++++++++++++++++++------------ src/KIM/pair_kim.h | 3 ++- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 3fc94944fc..afc4a89675 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -56,6 +56,7 @@ PairKIM::PairKIM(LAMMPS *lmp) : kim_global_influence_distance(0.0), kim_number_of_cutoffs(0), kim_cutoff_values(0), + neighborLists(0), kim_particle_codes(0), lmps_maxalloc(0), kim_particleSpecies(0), @@ -102,6 +103,13 @@ PairKIM::~PairKIM() delete [] lmps_map_species_to_unique; } + // clean up neighborlist pointers + if (neighborLists) + { + delete [] neighborLists; + neighborLists = 0; + } + // clean up KIM interface (if necessary) kim_free(); @@ -378,14 +386,30 @@ void PairKIM::init_style() if (!lmps_using_newton) comm_reverse_off = 9; // request full neighbor list - int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - neighbor->requests[irequest]->ghost = 1; + for (int i = 0; i < kim_number_of_cutoffs; ++i) + { + int irequest = neighbor->request(this,instance_me); + neighbor->requests[irequest]->id = i; + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + neighbor->requests[irequest]->ghost = 1; + neighbor->requests[irequest]->cut = 1; + neighbor->requests[irequest]->cutoff = kim_cutoff_values[i]; + } return; } +/* ---------------------------------------------------------------------- + neighbor callback to inform pair style of neighbor list to use + half or full +------------------------------------------------------------------------- */ + +void PairKIM::init_list(int id, NeighList *ptr) +{ + neighborLists[id] = ptr; +} + /* ---------------------------------------------------------------------- init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ @@ -525,7 +549,7 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) double PairKIM::memory_usage() { - double bytes = lmps_maxalloc * sizeof(int); + double bytes = 2 * lmps_maxalloc * sizeof(int); return bytes; } @@ -542,21 +566,18 @@ int PairKIM::get_neigh(void const * const dataObject, PairKIM const * const Model = reinterpret_cast(dataObject); - if ((numberOfCutoffs != 1) || (cutoffs[0] > Model->kim_cutoff_values[0])) - return true; + if (numberOfCutoffs != Model->kim_number_of_cutoffs) return true; + for (int i = 0; i < numberOfCutoffs; ++i) + { + if (Model->kim_cutoff_values[i] < cutoffs[i]) return true; + } - if (neighborListIndex != 0) return true; + // neighborListIndex and particleNumber are validated by KIM API // initialize numNeigh *numberOfNeighbors = 0; - if ((particleNumber >= Model->lmps_local_tot_num_atoms) || - (particleNumber < 0)) /* invalid id */ - { - return true; - } - - NeighList * neiobj = Model->list; + NeighList * neiobj = Model->neighborLists[neighborListIndex]; int nAtoms = Model->lmps_local_tot_num_atoms; int j, jj, inum, *ilist, *numneigh, **firstneigh; @@ -664,6 +685,12 @@ void PairKIM::kim_init() pkim->GetInfluenceDistance(&kim_global_influence_distance); pkim->GetNeighborListCutoffsPointer(&kim_number_of_cutoffs, &kim_cutoff_values); + if (neighborLists) + { + delete [] neighborLists; + neighborLists = 0; + } + neighborLists = new NeighList*[kim_number_of_cutoffs]; kimerror = pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 37807ebfbc..4542b656b7 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -48,7 +48,7 @@ namespace LAMMPS_NS { virtual void settings(int, char**); virtual void coeff(int, char**); virtual void init_style(); - //virtual void init_list(int id, NeighList *ptr); + virtual void init_list(int id, NeighList *ptr); virtual double init_one(int, int); virtual int pack_reverse_comm(int, int, double*); virtual void unpack_reverse_comm(int, int*, double*); @@ -103,6 +103,7 @@ namespace LAMMPS_NS { double kim_global_influence_distance; // KIM Model cutoff value int kim_number_of_cutoffs; double const * kim_cutoff_values; + class NeighList ** neighborLists; // values set in init_style() bool kim_model_init_ok; From f1f140dd5f9bfe9bed2dcb42fb5dce990ea445b9 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 27 Jun 2018 15:13:48 -0500 Subject: [PATCH 08/49] remove unnecessary code in pair_kim.cpp --- src/KIM/pair_kim.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index afc4a89675..658e8cb483 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -679,9 +679,6 @@ void PairKIM::kim_init() error->all(FLERR,"create_kim_particle_codes: symbol not found "); } - // set total number of atoms - lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); - pkim->GetInfluenceDistance(&kim_global_influence_distance); pkim->GetNeighborListCutoffsPointer(&kim_number_of_cutoffs, &kim_cutoff_values); From a7e3ccd8c4e039baf9060ebecf512a29bb35e0b8 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 27 Jun 2018 15:50:50 -0500 Subject: [PATCH 09/49] Finish off multi-neighbor list support for pair_kim --- src/KIM/pair_kim.cpp | 39 ++++++++++++++++++++++++++++----------- src/KIM/pair_kim.h | 1 + 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 658e8cb483..e41cc94ea0 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -61,6 +61,7 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_maxalloc(0), kim_particleSpecies(0), kim_particleContributing(0), + lmps_stripped_neigh_ptr(0), lmps_stripped_neigh_list(0) { // Initialize Pair data members to appropriate values @@ -94,6 +95,12 @@ PairKIM::~PairKIM() memory->destroy(kim_particleSpecies); memory->destroy(kim_particleContributing); memory->destroy(lmps_stripped_neigh_list); + // clean up lmps_stripped_neigh_ptr + if (lmps_stripped_neigh_ptr) + { + delete [] lmps_stripped_neigh_ptr; + lmps_stripped_neigh_ptr = 0; + } // clean up allocated memory for standard Pair class usage // also, we allocate lmps_map_species_to_uniuqe in the allocate() function @@ -241,10 +248,11 @@ void PairKIM::settings(int narg, char **arg) ++settings_call_count; init_style_call_count = 0; - if (narg < 2) error->all(FLERR,"Illegal pair_style command"); + if (narg != 2) error->all(FLERR,"Illegal pair_style command"); // arg[0] is the virial handling option: "LAMMPSvirial" or "KIMvirial" // arg[1] is the KIM Model name - // arg[2] is the print-kim-file flag: 0/1 do-not/do print (default 0) + + lmps_using_molecular = (atom->molecular > 0); // ensure we are in a clean state for KIM (needed on repeated call) // first time called will do nothing... @@ -382,6 +390,22 @@ void PairKIM::init_style() kim_init(); } + // setup lmps_stripped_neigh_list for neighbors of one atom, if needed + if (lmps_using_molecular) { + memory->destroy(lmps_stripped_neigh_list); + memory->create(lmps_stripped_neigh_list, + kim_number_of_cutoffs*neighbor->oneatom, + "pair:lmps_stripped_neigh_list"); + delete [] lmps_stripped_neigh_ptr; + lmps_stripped_neigh_ptr = new int*[kim_number_of_cutoffs]; + for (int i = 0; i < kim_number_of_cutoffs; ++i) + { + lmps_stripped_neigh_ptr[0] + = &(lmps_stripped_neigh_list[(i-1)*(neighbor->oneatom)]); + } + + } + // make sure comm_reverse expects (at most) 9 values when newton is off if (!lmps_using_newton) comm_reverse_off = 9; @@ -595,7 +619,8 @@ int PairKIM::get_neigh(void const * const dataObject, { int n = *numberOfNeighbors; int *ptr = firstneigh[particleNumber]; - int *lmps_stripped_neigh_list = Model->lmps_stripped_neigh_list; + int *lmps_stripped_neigh_list + = Model->lmps_stripped_neigh_ptr[neighborListIndex]; for (int i = 0; i < n; i++) lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; *neighborsOfParticle = lmps_stripped_neigh_list; @@ -781,14 +806,6 @@ void PairKIM::set_lmps_flags() // determint if newton is on or off lmps_using_newton = (force->newton_pair == 1); - // setup lmps_stripped_neigh_list for neighbors of one atom, if needed - lmps_using_molecular = (atom->molecular > 0); - if (lmps_using_molecular) { - memory->destroy(lmps_stripped_neigh_list); - memory->create(lmps_stripped_neigh_list,neighbor->oneatom, - "pair:lmps_stripped_neigh_list"); - } - // determine if running with pair hybrid if (force->pair_match("hybrid",0)) { diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 4542b656b7..a22bf1492f 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -116,6 +116,7 @@ namespace LAMMPS_NS { int* kim_particleContributing; // array of KIM particle contributing int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS // is in molecular mode + int** lmps_stripped_neigh_ptr; // pointer into lists // KIM specific helper functions void kim_init(); From 199a01714864964e317208b90dcfb9c433182351 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 28 Jun 2018 09:32:28 -0500 Subject: [PATCH 10/49] Some cleanup in pair_kim --- src/KIM/pair_kim.cpp | 20 +++++++++++--------- src/KIM/pair_kim.h | 1 - 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index e41cc94ea0..2785d5793a 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -50,6 +50,11 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_unique_elements(0), lmps_num_unique_elements(0), lmps_units(METAL), + lengthUnit(KIM::LENGTH_UNIT::unused), + energyUnit(KIM::ENERGY_UNIT::unused), + chargeUnit(KIM::CHARGE_UNIT::unused), + temperatureUnit(KIM::TEMPERATURE_UNIT::unused), + timeUnit(KIM::TIME_UNIT::unused), pkim(0), pargs(0), lmps_local_tot_num_atoms(0), @@ -61,8 +66,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_maxalloc(0), kim_particleSpecies(0), kim_particleContributing(0), - lmps_stripped_neigh_ptr(0), - lmps_stripped_neigh_list(0) + lmps_stripped_neigh_list(0), + lmps_stripped_neigh_ptr(0) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -134,8 +139,6 @@ void PairKIM::compute(int eflag , int vflag) else ev_unset(); - // @@@@ can we strip the neighbor list here (like pair_meamc does)? - // grow kim_particleSpecies and kim_particleContributing array if necessary // needs to be atom->nmax in length if (atom->nmax > lmps_maxalloc) { @@ -160,7 +163,6 @@ void PairKIM::compute(int eflag , int vflag) } // kim_particleSpecies = KIM atom species for each LAMMPS atom - // set ielement to valid 0 if lmps_map_species_to_unique[] stores an un-used -1 int *species = atom->type; int nall = atom->nlocal + atom->nghost; @@ -168,7 +170,6 @@ void PairKIM::compute(int eflag , int vflag) for (int i = 0; i < nall; i++) { ielement = lmps_map_species_to_unique[species[i]]; - ielement = MAX(ielement,0); kim_particleSpecies[i] = kim_particle_codes[ielement]; kim_particleContributing[i] = ( (inlocal) ? 1 : 0 ); @@ -177,6 +178,9 @@ void PairKIM::compute(int eflag , int vflag) // pass current atom pointers to KIM set_argument_pointers(); + // set number of particles + lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); + // compute via KIM model kimerror = pkim->Compute(pargs); if (kimerror) error->all(FLERR,"KIM Compute returned error"); @@ -409,7 +413,7 @@ void PairKIM::init_style() // make sure comm_reverse expects (at most) 9 values when newton is off if (!lmps_using_newton) comm_reverse_off = 9; - // request full neighbor list + // request full neighbor lists for (int i = 0; i < kim_number_of_cutoffs; ++i) { int irequest = neighbor->request(this,instance_me); @@ -739,8 +743,6 @@ void PairKIM::kim_init() void PairKIM::set_argument_pointers() { int kimerror; - lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); - kimerror = pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::coordinates, &(atom->x[0][0])); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index a22bf1492f..0c017e75ed 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -86,7 +86,6 @@ namespace LAMMPS_NS { KIM::TemperatureUnit temperatureUnit; KIM::TimeUnit timeUnit; - KIM::Model * pkim; KIM::ComputeArguments * pargs; From cb21051eb82f8f1e7337827bfbff1df2a9e0055a Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 28 Jun 2018 19:59:39 -0500 Subject: [PATCH 11/49] Update KIM Model matching code in pair_kim.cpp --- src/KIM/pair_kim.cpp | 331 +++++++++++++++++++++++++------------------ src/KIM/pair_kim.h | 11 +- 2 files changed, 195 insertions(+), 147 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 2785d5793a..5f123de45d 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -57,6 +57,11 @@ PairKIM::PairKIM(LAMMPS *lmp) : timeUnit(KIM::TIME_UNIT::unused), pkim(0), pargs(0), + kim_model_support_for_energy(KIM::SUPPORT_STATUS::notSupported), + kim_model_support_for_forces(KIM::SUPPORT_STATUS::notSupported), + kim_model_support_for_virial(KIM::SUPPORT_STATUS::notSupported), + kim_model_support_for_particleEnergy(KIM::SUPPORT_STATUS::notSupported), + kim_model_support_for_particleVirial(KIM::SUPPORT_STATUS::notSupported), lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), kim_number_of_cutoffs(0), @@ -76,8 +81,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : // BEGIN: initial values that determine the KIM state // (used by kim_free(), etc.) - kim_model_init_ok = false; kim_init_ok = false; + kim_particle_codes_ok = false; // END return; @@ -201,7 +206,9 @@ void PairKIM::compute(int eflag , int vflag) if (vflag_fdotr) virial_fdotr_compute(); } - if ((kim_model_has_particleVirial) && (vflag_atom)) + if ((kim_model_support_for_particleVirial != + KIM::SUPPORT_STATUS::notSupported) && + (vflag_atom)) { // flip sign and order of virial if KIM is computing it double tmp; for (int i = 0; i < nall; ++i) @@ -456,14 +463,17 @@ double PairKIM::init_one(int i, int j) int PairKIM::pack_reverse_comm(int n, int first, double *buf) { + using namespace KIM::SUPPORT_STATUS; + int i,m,last; double *fp; fp = &(atom->f[0][0]); m = 0; last = first + n; - if ((kim_model_has_forces) && ((vflag_atom == 0) || - (!kim_model_has_particleVirial))) + if ((kim_model_support_for_forces != notSupported) && + ((vflag_atom == 0) || + (kim_model_support_for_particleVirial == notSupported))) { for (i = first; i < last; i++) { @@ -473,8 +483,9 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if ((kim_model_support_for_forces != notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) { double *va=&(vatom[0][0]); for (i = first; i < last; i++) @@ -492,8 +503,9 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((!kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if ((kim_model_support_for_forces == notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) { double *va=&(vatom[0][0]); for (i = first; i < last; i++) @@ -515,13 +527,16 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) { + using namespace KIM::SUPPORT_STATUS; + int i,j,m; double *fp; fp = &(atom->f[0][0]); m = 0; - if ((kim_model_has_forces) && ((vflag_atom == 0) || - (!kim_model_has_particleVirial))) + if ((kim_model_support_for_forces != notSupported) && + ((vflag_atom == 0) || + (kim_model_support_for_particleVirial == notSupported))) { for (i = 0; i < n; i++) { @@ -531,8 +546,9 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp[3*j+2]+= buf[m++]; } } - else if ((kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if ((kim_model_support_for_forces != notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) { double *va=&(vatom[0][0]); for (i = 0; i < n; i++) @@ -550,8 +566,9 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) va[j*6+5]+=buf[m++]; } } - else if ((!kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if ((kim_model_support_for_forces == notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) { double *va=&(vatom[0][0]); for (i = 0; i < n; i++) @@ -638,14 +655,13 @@ void PairKIM::kim_free() { int kimerror; - if (kim_model_init_ok) + if (kim_init_ok) { int kimerror = pkim->ComputeArgumentsDestroy(&pargs); if (kimerror) error->all(FLERR,"Unable to destroy Compute Arguments Object"); KIM::Model::Destroy(&pkim); - kim_model_init_ok = false; } kim_init_ok = false; @@ -683,9 +699,14 @@ void PairKIM::kim_init() kimerror = pkim->ComputeArgumentsCreate(&pargs); if (kimerror) + { + KIM::Model::Destroy(&pkim); error->all(FLERR,"KIM ComputeArgumentsCreate failed"); + } else + { kim_init_ok = true; + } } // determine KIM Model capabilities (used in this function below) @@ -721,7 +742,7 @@ void PairKIM::kim_init() kimerror = pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, &lmps_local_tot_num_atoms); - if (kim_model_has_energy) + if (kim_model_support_for_energy != KIM::SUPPORT_STATUS::notSupported) kimerror = kimerror || pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::partialEnergy, &(eng_vdwl)); @@ -742,63 +763,98 @@ void PairKIM::kim_init() void PairKIM::set_argument_pointers() { - int kimerror; - kimerror = pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::coordinates, - &(atom->x[0][0])); + using namespace KIM::COMPUTE_ARGUMENT_NAME; + using namespace KIM::SUPPORT_STATUS; - if (kim_model_has_particleEnergy && (eflag_atom == 1)) - { - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialParticleEnergy, - eatom); - } + int kimerror; + kimerror = pargs->SetArgumentPointer(coordinates, &(atom->x[0][0])); - if (kim_model_has_forces) - { - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialForces, - &(atom->f[0][0])); - } + // Set KIM pointer appropriately for particalEnergy + if ((kim_model_support_for_particleEnergy == required) && (eflag_atom != 1)) + { + // reallocate per-atom energy array if necessary + if (atom->nmax > maxeatom) + { + maxeatom = atom->nmax; + memory->destroy(eatom); + memory->create(eatom,comm->nthreads*maxeatom,"pair:eatom"); + } + } + if ((kim_model_support_for_particleEnergy == optional) && (eflag_atom != 1)) + { + kimerror = kimerror || pargs->SetArgumentPointer( + partialParticleEnergy, + reinterpret_cast(NULL)); + } + else if (kim_model_support_for_particleEnergy != notSupported) + { + kimerror = kimerror || pargs->SetArgumentPointer(partialParticleEnergy, + eatom); + } - if (kim_model_has_particleVirial) - { - if(vflag_atom != 1) { - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, - reinterpret_cast(NULL)); - } else { - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, - &(vatom[0][0])); - } - } + // Set KIM pointer appropriately for forces + if (kim_model_support_for_forces == notSupported) + { + kimerror = kimerror || pargs->SetArgumentPointer( + partialForces, + reinterpret_cast(NULL)); + } + else + { + kimerror = kimerror || pargs->SetArgumentPointer(partialForces, + &(atom->f[0][0])); + } - if (no_virial_fdotr_compute == 1) - { - if (kim_model_has_virial) - { - if (vflag_global == 0) - { - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialVirial, - reinterpret_cast(NULL)); - } - else - { - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialVirial, - &(virial[0])); - } - } - } + // Set KIM pointer appropriately for particleVirial + if ((kim_model_support_for_particleVirial == required) && (vflag_atom != 1)) + { + // reallocate per-atom virial array if necessary + if (atom->nmax > maxeatom) + { + maxvatom = atom->nmax; + memory->destroy(vatom); + memory->create(vatom,comm->nthreads*maxvatom,6,"pair:vatom"); + } + } + if ((kim_model_support_for_particleVirial == optional) && (vflag_atom != 1)) + { + kimerror = kimerror || pargs->SetArgumentPointer( + partialParticleVirial, + reinterpret_cast(NULL)); + } + else if (kim_model_support_for_particleVirial != notSupported) + { + kimerror = kimerror || pargs->SetArgumentPointer(partialParticleEnergy, + &(vatom[0][0])); + } - if (kimerror) - { - error->all(FLERR,"Unable to set KIM argument pointers"); - } + // Set KIM pointer appropriately for virial - return; + if (kim_model_support_for_virial == required) + { + kimerror = kimerror || pargs->SetArgumentPointer(partialVirial, + &(virial[0])); + } + else if ((kim_model_support_for_virial == optional) && + (no_virial_fdotr_compute == 1) && + (vflag_global)) + { + kimerror = kimerror || pargs->SetArgumentPointer(partialVirial, + &(virial[0])); + } + else if (kim_model_support_for_virial == optional) + { + kimerror = kimerror || pargs->SetArgumentPointer( + partialVirial, + reinterpret_cast(NULL)); + } + + if (kimerror) + { + error->all(FLERR,"Unable to set KIM argument pointers"); + } + + return; } /* ---------------------------------------------------------------------- */ @@ -863,85 +919,78 @@ void PairKIM::set_lmps_flags() void PairKIM::set_kim_model_has_flags() { - // @@ the procedure below should be improved to be more comprehensive - // @@ and ensure that there are no additions/changes to the kim-api - // @@ that could cause a problem. This should be done using the - // @@ "discoverability" features of the kim-api - int kimerror; - KIM::SupportStatus supportStatus; + { // BEGIN enclosing scope for using directives + using namespace KIM::COMPUTE_ARGUMENT_NAME; + using namespace KIM::SUPPORT_STATUS; - // determine if the KIM Model can compute the total partialEnergy + int numberOfComputeArgumentNames; + GetNumberOfComputeArgumentNames(&numberOfComputeArgumentNames); + for (int i = 0; i < numberOfComputeArgumentNames; ++i) + { + KIM::ComputeArgumentName computeArgumentName; + int kimerror = GetComputeArgumentName(i, &computeArgumentName); + KIM::SupportStatus supportStatus; + kimerror = pargs->GetArgumentSupportStatus(computeArgumentName, + &supportStatus); - // determine if the KIM Model can compute the energy - kimerror = pargs->GetArgumentSupportStatus( - KIM::COMPUTE_ARGUMENT_NAME::partialEnergy, - &supportStatus); - if (kimerror) - error->all(FLERR,"Unable to get KIM Support Status"); - if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { - kim_model_has_energy = false; - error->warning(FLERR,"KIM Model does not provide `partialEnergy'; " - "Potential energy will be zero"); - } else { - kim_model_has_energy = true; - } + if (computeArgumentName == partialEnergy) + kim_model_support_for_energy = supportStatus; + else if (computeArgumentName == partialForces) + kim_model_support_for_forces = supportStatus; + else if (computeArgumentName == partialVirial) + kim_model_support_for_virial = supportStatus; + else if (computeArgumentName == partialParticleEnergy) + kim_model_support_for_particleEnergy = supportStatus; + else if (computeArgumentName == partialParticleVirial) + kim_model_support_for_particleVirial = supportStatus; + else if (supportStatus == required) + { + error->all(FLERR,"KIM Model requires unsupported compute argument"); + } + } - // determine if the KIM Model can compute the partialForces - kimerror = pargs->GetArgumentSupportStatus( - KIM::COMPUTE_ARGUMENT_NAME::partialForces, - &supportStatus); - if (kimerror) - error->all(FLERR,"Unable to get KIM Support Status"); - if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { - kim_model_has_forces = false; - error->warning(FLERR,"KIM Model does not provide `partialForce'; " - "Forces will be zero"); - } else { - kim_model_has_forces = true; - } + if (kim_model_support_for_energy == notSupported) + error->warning(FLERR,"KIM Model does not provide `partialEnergy'; " + "Potential energy will be zero"); - // determine if the KIM Model can compute the partialVirial - kimerror = pargs->GetArgumentSupportStatus( - KIM::COMPUTE_ARGUMENT_NAME::partialVirial, - &supportStatus); - if (kimerror) - error->all(FLERR,"Unable to get KIM Support Status"); - if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { - kim_model_has_virial = false; - error->warning(FLERR,"KIM Model does not provide `partialVirial'. " - "pair_kim now using `LAMMPSvirial' option."); - no_virial_fdotr_compute = 0; - } else { - kim_model_has_virial = true; - } + if (kim_model_support_for_forces == notSupported) + error->warning(FLERR,"KIM Model does not provide `partialForce'; " + "Forces will be zero"); - // determine if the KIM Model can compute the partialParticleEnergy - kimerror = pargs->GetArgumentSupportStatus( - KIM::COMPUTE_ARGUMENT_NAME::partialParticleEnergy, - &supportStatus); - if (kimerror) - error->all(FLERR,"Unable to get KIM Support Status"); - if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { - kim_model_has_particleEnergy = false; - error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " - "energy per atom will be zero"); - } else { - kim_model_has_particleEnergy = true; - } + if (kim_model_support_for_virial == notSupported) + error->warning(FLERR,"KIM Model does not provide `partialVirial'. " + "pair_kim now using `LAMMPSvirial' option."); - // determine if the KIM Model can compute the partialParticleVirial - kimerror = pargs->GetArgumentSupportStatus( - KIM::COMPUTE_ARGUMENT_NAME::partialParticleVirial, - &supportStatus); - if (kimerror) - error->all(FLERR,"Unable to get KIM Support Status"); - if (KIM::SUPPORT_STATUS::notSupported == supportStatus) { - kim_model_has_particleVirial = false; - error->warning(FLERR,"KIM Model does not provide `partialParticleVirial'; " - "virial per atom will be zero"); - } else { - kim_model_has_particleVirial = true; - } + if (kim_model_support_for_particleEnergy == notSupported) + error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " + "energy per atom will be zero"); + + if (kim_model_support_for_particleVirial == notSupported) + error->warning(FLERR,"KIM Model does not provide `partialParticleVirial'; " + "virial per atom will be zero"); + } // END enclosing scope for using directives + + + { // BEGIN enclosing scope for using directives + using namespace KIM::COMPUTE_CALLBACK_NAME; + using namespace KIM::SUPPORT_STATUS; + + int numberOfComputeCallbackNames; + GetNumberOfComputeCallbackNames(&numberOfComputeCallbackNames); + for (int i = 0; i < numberOfComputeCallbackNames; ++i) + { + KIM::ComputeCallbackName computeCallbackName; + int kimerror = GetComputeCallbackName(i, &computeCallbackName); + KIM::SupportStatus supportStatus; + kimerror = pargs->GetCallbackSupportStatus(computeCallbackName, + &supportStatus); + + if (supportStatus == required) + { + error->all(FLERR,"KIM Model requires unsupported compute callback"); + } + } + } // END enclosing scope for using directives return; } diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 0c017e75ed..a236a3f87a 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -90,11 +90,11 @@ namespace LAMMPS_NS { KIM::ComputeArguments * pargs; // values set in set_kim_model_has_flags(), called by kim_init() - bool kim_model_has_energy; - bool kim_model_has_forces; - bool kim_model_has_virial; - bool kim_model_has_particleEnergy; - bool kim_model_has_particleVirial; + KIM::SupportStatus kim_model_support_for_energy; + KIM::SupportStatus kim_model_support_for_forces; + KIM::SupportStatus kim_model_support_for_virial; + KIM::SupportStatus kim_model_support_for_particleEnergy; + KIM::SupportStatus kim_model_support_for_particleVirial; // values set in kim_init() bool kim_init_ok; @@ -105,7 +105,6 @@ namespace LAMMPS_NS { class NeighList ** neighborLists; // values set in init_style() - bool kim_model_init_ok; bool kim_particle_codes_ok; int *kim_particle_codes; From 955fe583d8e24ae4e054b74410e60db256ac0f60 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Fri, 29 Jun 2018 10:53:19 -0500 Subject: [PATCH 12/49] Updated docs for new pair_kim --- cmake/CMakeLists.txt | 20 +++++++++---------- cmake/Modules/FindKIM.cmake | 4 ++-- doc/src/Section_packages.txt | 37 ++++++++++++++++++------------------ doc/src/fix_adapt.txt | 9 +-------- doc/src/pair_kim.txt | 22 +++++---------------- examples/kim/in.kim.lj | 10 +++++----- examples/kim/in.kim.lj.lmp | 10 +++++----- lib/kim/Install.py | 8 ++++---- lib/kim/README | 4 ++-- src/KIM/README | 3 +-- 10 files changed, 53 insertions(+), 74 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index bf57398c71..4672b4a3db 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -309,7 +309,7 @@ if(PKG_VORONOI) ExternalProject_Add(voro_build URL http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz URL_MD5 2338b824c3b7b25590e18e8df5d68af9 - CONFIGURE_COMMAND "" BUILD_IN_SOURCE 1 INSTALL_COMMAND "" + CONFIGURE_COMMAND "" BUILD_IN_SOURCE 1 INSTALL_COMMAND "" ) ExternalProject_get_property(voro_build SOURCE_DIR) set(VORO_LIBRARIES ${SOURCE_DIR}/src/libvoro++.a) @@ -367,7 +367,7 @@ if(PKG_USER-SMD) if(DOWNLOAD_Eigen3) include(ExternalProject) ExternalProject_Add(Eigen3_build - URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz + URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz URL_MD5 1a47e78efe365a97de0c022d127607c3 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) @@ -407,14 +407,14 @@ if(PKG_KIM) if(DOWNLOAD_KIM) include(ExternalProject) ExternalProject_Add(kim_build - URL https://github.com/openkim/kim-api/archive/v1.9.5.tar.gz - URL_MD5 9f66efc128da33039e30659f36fc6d00 + URL https://github.com/openkim/kim-api/archive/v2.0.0-beta.0.tar.gz + URL_MD5 2c099fe2603fda9a6904fc50d626f71b BUILD_IN_SOURCE 1 CONFIGURE_COMMAND /configure --prefix= ) ExternalProject_get_property(kim_build INSTALL_DIR) - set(KIM_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v1) - set(KIM_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v1.so) + set(KIM_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) + set(KIM_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v2.so) list(APPEND LAMMPS_DEPS kim_build) else() find_package(KIM) @@ -706,7 +706,7 @@ if(PKG_USER-INTEL) endif() if(PKG_GPU) - if (CMAKE_VERSION VERSION_LESS "3.1") + if (CMAKE_VERSION VERSION_LESS "3.1") message(FATAL_ERROR "For the GPU package you need at least cmake-3.1") endif() set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU) @@ -892,7 +892,7 @@ if(BUILD_EXE) add_dependencies(lmp ${LAMMPS_DEPS}) endif() endif() - + set_target_properties(lmp PROPERTIES OUTPUT_NAME lmp${LAMMPS_MACHINE}) install(TARGETS lmp DESTINATION ${CMAKE_INSTALL_BINDIR}) if(ENABLE_TESTING) @@ -954,14 +954,14 @@ message(STATUS "<<< Build configuration >>> get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) list (FIND LANGUAGES "Fortran" _index) if (${_index} GREATER -1) - message(STATUS "Fortran Compiler ${CMAKE_Fortran_COMPILER} + message(STATUS "Fortran Compiler ${CMAKE_Fortran_COMPILER} Type ${CMAKE_Fortran_COMPILER_ID} Version ${CMAKE_Fortran_COMPILER_VERSION} Fortran Flags ${CMAKE_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS_${BTYPE}}") endif() list (FIND LANGUAGES "C" _index) if (${_index} GREATER -1) - message(STATUS "C Compiler ${CMAKE_C_COMPILER} + message(STATUS "C Compiler ${CMAKE_C_COMPILER} Type ${CMAKE_C_COMPILER_ID} Version ${CMAKE_C_COMPILER_VERSION} C Flags ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}") diff --git a/cmake/Modules/FindKIM.cmake b/cmake/Modules/FindKIM.cmake index a01f817cf6..e29f26e01d 100644 --- a/cmake/Modules/FindKIM.cmake +++ b/cmake/Modules/FindKIM.cmake @@ -6,9 +6,9 @@ # KIM_FOUND - True if kim found. # -find_path(KIM_INCLUDE_DIR KIM_API.h PATH_SUFFIXES kim-api-v1) +find_path(KIM_INCLUDE_DIR KIM_SimulatorHeaders.hpp PATH_SUFFIXES kim-api-v2) -find_library(KIM_LIBRARY NAMES kim-api-v1) +find_library(KIM_LIBRARY NAMES kim-api-v2) set(KIM_LIBRARIES ${KIM_LIBRARY}) set(KIM_INCLUDE_DIRS ${KIM_INCLUDE_DIR}) diff --git a/doc/src/Section_packages.txt b/doc/src/Section_packages.txt index 218866e271..839a02b4b6 100644 --- a/doc/src/Section_packages.txt +++ b/doc/src/Section_packages.txt @@ -516,8 +516,7 @@ Elliott (U Minnesota) and James Sethna (Cornell U). [Authors:] Ryan Elliott (U Minnesota) is the main developer for the KIM API which the "pair_style kim"_pair_kim.html command uses. He -developed the pair style in collaboration with Valeriu Smirichinski (U -Minnesota). +developed the pair style. [Install or un-install:] @@ -530,11 +529,11 @@ lib/kim/Install.py script with the specified args. make lib-kim # print help message make lib-kim args="-b " # (re-)install KIM API lib with only example models -make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model +make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_002" # ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models -make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver -make lib-kim args="-p /usr/local/kim-api" # use an existing KIM API installation at the provided location -make lib-kim args="-p /usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre +make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_003" # add one model or model driver +make lib-kim args="-p /usr/local/lib/kim-api-v2" # use an existing KIM API installation at the provided location +make lib-kim args="-p /usr/local/lib/kim-api-v2 -a EAM_Dynamo_Ackland_W__MO_141627196590_003" # ditto but add one model or driver :pre Note that in LAMMPS lingo, a KIM model driver is a pair style (e.g. EAM or Tersoff). A KIM model is a pair style for a particular @@ -730,13 +729,13 @@ args: make lib-latte # print help message make lib-latte args="-b" # download and build in lib/latte/LATTE-master make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte -make lib-latte args="-b -m gfortran" # download and build in lib/latte and +make lib-latte args="-b -m gfortran" # download and build in lib/latte and # copy Makefile.lammps.gfortran to Makefile.lammps :pre Note that 3 symbolic (soft) links, "includelink" and "liblink" and "filelink.o", are created in lib/latte to point into the LATTE home dir. -When LAMMPS builds in src it will use these links. You should +When LAMMPS builds in src it will use these links. You should also check that the Makefile.lammps file you create is appropriate for the compiler you use on your system to build LATTE. @@ -1667,7 +1666,7 @@ This package provides "fix bocs"_fix_bocs.html, a modified version of "fix npt"_fix_nh.html which includes the pressure correction to the barostat as outlined in: -N. J. H. Dunn and W. G. Noid, "Bottom-up coarse-grained models that +N. J. H. Dunn and W. G. Noid, "Bottom-up coarse-grained models that accurately describe the structure, pressure, and compressibility of molecular liquids," J. Chem. Phys. 143, 243148 (2015). @@ -2279,13 +2278,13 @@ based on the Fortran version of Greg Wagner (Northwestern U) while at Sandia. [Install or un-install:] - + make yes-user-meamc make machine :pre - + make no-user-meamc make machine :pre - + [Supporting info:] src/USER-MEAMC: filenames -> commands @@ -2310,13 +2309,13 @@ algorithm. [Author:] Zhen Li (Division of Applied Mathematics, Brown University) [Install or un-install:] - + make yes-user-meso make machine :pre - + make no-user-meso make machine :pre - + [Supporting info:] src/USER-MESO: filenames -> commands @@ -2336,17 +2335,17 @@ USER-MOFFF package :link(USER-MOFFF),h4 [Contents:] Pair, angle and improper styles needed to employ the MOF-FF -force field by Schmid and coworkers with LAMMPS. +force field by Schmid and coworkers with LAMMPS. MOF-FF is a first principles derived force field with the primary aim -to simulate MOFs and related porous framework materials, using spherical +to simulate MOFs and related porous framework materials, using spherical Gaussian charges. It is described in S. Bureekaew et al., Phys. Stat. Sol. B 2013, 250, 1128-1141. -For the usage of MOF-FF see the example in the example directory as +For the usage of MOF-FF see the example in the example directory as well as the "MOF+"_MOFplus website. :link(MOFplus,https://www.mofplus.org/content/show/MOF-FF) -[Author:] Hendrik Heenen (Technical U of Munich), +[Author:] Hendrik Heenen (Technical U of Munich), Rochus Schmid (Ruhr-University Bochum). [Install or un-install:] diff --git a/doc/src/fix_adapt.txt b/doc/src/fix_adapt.txt index 7a34f2ff44..939a664501 100644 --- a/doc/src/fix_adapt.txt +++ b/doc/src/fix_adapt.txt @@ -123,8 +123,7 @@ meaning of these parameters: "lubricate"_pair_lubricate.html: mu: global: "gauss"_pair_gauss.html: a: type pairs: "morse"_pair_morse.html: d0,r0,alpha: type pairs: -"soft"_pair_soft.html: a: type pairs: -"kim"_pair_kim.html: PARAM_FREE_*:i,j,...: global :tb(c=3,s=:) +"soft"_pair_soft.html: a: type pairs: :tb(c=3,s=:) NOTE: It is easy to add new pairwise potentials and their parameters to this list. All it typically takes is adding an extract() method to @@ -132,12 +131,6 @@ the pair_*.cpp file associated with the potential. Some parameters are global settings for the pair style, e.g. the viscosity setting "mu" for "pair_style lubricate"_pair_lubricate.html. -For "pair_kim"_pair_kim.html, all free parameters supported by the -KIM Model are available (e.g., PARAM_FREE_sigmas provided by the -LennardJones612_Universal__MO_826355984548_001 Model). If the free -parameter corresponds to an array, then the particular array element -to be adapted must be specified (e.g., "PARAM_FREE_sigmas:10", to -adapt the tenth entry of the sigmas array). Other parameters apply to atom type pairs within the pair style, e.g. the prefactor "a" for "pair_style soft"_pair_soft.html. diff --git a/doc/src/pair_kim.txt b/doc/src/pair_kim.txt index c5d910e27c..3d105e2226 100644 --- a/doc/src/pair_kim.txt +++ b/doc/src/pair_kim.txt @@ -10,18 +10,14 @@ pair_style kim command :h3 [Syntax:] -pair_style kim virialmode model printflag :pre +pair_style kim virialmode model :pre virialmode = KIMvirial or LAMMPSvirial model = name of KIM model (potential) -printflag = 1/0 do or do not print KIM descriptor file, optional :ul [Examples:] -pair_style kim KIMvirial model_Ar_P_Morse -pair_coeff * * Ar Ar :pre - -pair_style kim KIMvirial model_Ar_P_Morse 1 +pair_style kim KIMvirial ex_model_Ar_P_LJ pair_coeff * * Ar Ar :pre [Description:] @@ -66,10 +62,6 @@ potential as KIM defines it. In principle, LAMMPS can invoke any KIM model. You should get an error or warning message from either LAMMPS or KIM if there is an incompatibility. -The argument {printflag} is optional. If it is set to a non-zero -value then a KIM descriptor file is printed when KIM is invoked. This -can be useful for debugging. The default is to not print this file. - Only a single pair_coeff command is used with the {kim} style which specifies the mapping of LAMMPS atom types to KIM elements. This is done by specifying N additional arguments after the * * in the @@ -86,18 +78,14 @@ pair_coeff * * Si Si Si C :pre The 1st 2 arguments must be * * so as to span all LAMMPS atom types. The first three Si arguments map LAMMPS atom types 1,2,3 to Si as defined within KIM. The final C argument maps LAMMPS atom type 4 to C -as defined within KIM. If a mapping value is specified as NULL, the -mapping is not performed. This can only be used when a {kim} -potential is used as part of the {hybrid} pair style. The NULL values -are placeholders for atom types that will be used with other -potentials. +as defined within KIM. :line In addition to the usual LAMMPS error messages, the KIM library itself may generate errors, which should be printed to the screen. In this case it is also useful to check the kim.log file for additional error -information. This file kim.log should be generated in the same +information. The file kim.log should be generated in the same directory where LAMMPS is running. To download, build, and install the KIM library on your system, see @@ -130,7 +118,7 @@ LAMMPS was built with that package. See the "Making LAMMPS"_Section_start.html#start_3 section for more info. This current version of pair_style kim is compatible with the -kim-api package version 1.6.0 and higher. +kim-api package version 2.0.0-beta.0 and higher. [Related commands:] diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj index f33b258be8..a8e2b9616b 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj @@ -16,14 +16,14 @@ region box block 0 ${xx} 0 ${yy} 0 ${zz} create_box 1 box create_atoms 1 box -#pair_style lj/cut 8.1500 -#pair_coeff 1 1 0.0031 2.7400 +#pair_style lj/cut 7.5548200 +#pair_coeff 1 1 0.0123529 1.8887100 #pair_modify shift yes -pair_style kim KIMvirial ex_model_Ne_P_fastLJ -pair_coeff * * Ne +pair_style kim KIMvirial LennardJones612_Ar +pair_coeff * * Ar -mass 1 20.18 +mass 1 39.95 velocity all create 200.0 232345 loop geom neighbor 0.3 bin diff --git a/examples/kim/in.kim.lj.lmp b/examples/kim/in.kim.lj.lmp index 8879024590..ddb7624945 100644 --- a/examples/kim/in.kim.lj.lmp +++ b/examples/kim/in.kim.lj.lmp @@ -16,14 +16,14 @@ region box block 0 ${xx} 0 ${yy} 0 ${zz} create_box 1 box create_atoms 1 box -pair_style lj/cut 8.1500 -pair_coeff 1 1 0.0031 2.7400 +pair_style lj/cut 7.5548200 +pair_coeff 1 1 0.0123529 1.8887100 pair_modify shift yes -#pair_style kim KIMvirial ex_model_Ne_P_fastLJ -#pair_coeff * * Ne +#pair_style kim KIMvirial LennardJones612_Ar +#pair_coeff * * Ar -mass 1 20.18 +mass 1 39.95 velocity all create 200.0 232345 loop geom neighbor 0.3 bin diff --git a/lib/kim/Install.py b/lib/kim/Install.py index 1bcaffd34a..f9eb1c5eed 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -12,11 +12,11 @@ help = """ Syntax from src dir: make lib-kim args="-b -v version -a kim-name" or: make lib-kim args="-b -a everything" or: make lib-kim args="-n -a kim-name" - or: make lib-kim args="-p /usr/local/open-kim -a kim-name" + or: make lib-kim args="-p /usr/local/lib/kim-api-v2 -a kim-name" Syntax from lib dir: python Install.py -b -v version -a kim-name or: python Install.py -b -a everything or: python Install.py -n -a kim-name - or: python Install.py -p /usr/local/open-kim -a kim-name + or: python Install.py -p /usr/local/lib/kim-api-v2 -a kim-name specify one or more options, order does not matter @@ -36,9 +36,9 @@ specify one or more options, order does not matter Examples: make lib-kim args="-b" # install KIM API lib with only example models -make lib-kim args="-a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # Ditto plus one model +make lib-kim args="-a Glue_Ercolessi_Adams_Al__MO_324507536345_002" # Ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models -make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # only add one model or model driver +make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_003" # only add one model or model driver See the list of KIM model drivers here: https://openkim.org/kim-items/model-drivers/alphabetical diff --git a/lib/kim/README b/lib/kim/README index ce4ea1bdff..80d77d3332 100644 --- a/lib/kim/README +++ b/lib/kim/README @@ -46,8 +46,8 @@ $ rm -rf kim-api-vX.Y.Z.txz 5. To add items do the following (replace the kim item name with your desired value) -$ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-v1-activate -$ kim-api-v1-collections-management install system Pair_Johnson_Fe__MO_857282754307_002 +$ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-vX-activate +$ kim-api-vX-collections-management install system Pair_Johnson_Fe__MO_857282754307_002 ----------------- diff --git a/src/KIM/README b/src/KIM/README index 496db92cf2..a69206596f 100644 --- a/src/KIM/README +++ b/src/KIM/README @@ -26,5 +26,4 @@ library you can test it using an input file from the examples dir: ./lmp_serial < lammps/examples/kim/in.kim.lj -This pair_style was written by Valeriu Smirichinski and Ryan -S. Elliott (U Minn). +This pair_style was written by Ryan S. Elliott (U Minn). From 68ec8822ee4b09476d4496eb56522f5d2478a3ec Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Fri, 29 Jun 2018 16:24:15 -0500 Subject: [PATCH 13/49] Update example/kim/log.* --- examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 | 33 ---------- examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 | 33 ---------- examples/kim/log.28Jun15.kim.lj.ubuntu.1 | 33 ---------- examples/kim/log.28Jun15.kim.lj.ubuntu.4 | 33 ---------- examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 | 66 +++++++++++++++++++ examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 | 66 +++++++++++++++++++ examples/kim/log.29Jun18.kim.lj.ubuntu.1 | 68 ++++++++++++++++++++ examples/kim/log.29Jun18.kim.lj.ubuntu.4 | 68 ++++++++++++++++++++ 8 files changed, 268 insertions(+), 132 deletions(-) delete mode 100644 examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 delete mode 100644 examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 delete mode 100644 examples/kim/log.28Jun15.kim.lj.ubuntu.1 delete mode 100644 examples/kim/log.28Jun15.kim.lj.ubuntu.4 create mode 100644 examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 create mode 100644 examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 create mode 100644 examples/kim/log.29Jun18.kim.lj.ubuntu.1 create mode 100644 examples/kim/log.29Jun18.kim.lj.ubuntu.4 diff --git a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 b/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 deleted file mode 100644 index efae0587a1..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 9.18789 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 2.95205 on 1 procs for 100 steps with 32000 atoms - -Pair time (%) = 2.52074 (85.3894) -Neigh time (%) = 0.347949 (11.7867) -Comm time (%) = 0.0228171 (0.772925) -Outpt time (%) = 0.000188828 (0.00639649) -Other time (%) = 0.0603588 (2.04464) - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 20131 ave 20131 max 20131 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1.88909e+06 ave 1.88909e+06 max 1.88909e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1889091 -Ave neighs/atom = 59.0341 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 b/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 deleted file mode 100644 index 12c1c76695..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 4.58461 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 6.15911 on 4 procs for 100 steps with 32000 atoms - -Pair time (%) = 1.76201 (28.6083) -Neigh time (%) = 0.265002 (4.30261) -Comm time (%) = 3.64452 (59.1729) -Outpt time (%) = 0.0169877 (0.275815) -Other time (%) = 0.470582 (7.64042) - -Nlocal: 8000 ave 8010 max 7989 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 9240.25 ave 9249 max 9228 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Neighs: 472273 ave 473390 max 471652 min -Histogram: 2 0 0 1 0 0 0 0 0 1 - -Total # of neighbors = 1889091 -Ave neighs/atom = 59.0341 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.28Jun15.kim.lj.ubuntu.1 b/examples/kim/log.28Jun15.kim.lj.ubuntu.1 deleted file mode 100644 index 95284453b1..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.ubuntu.1 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 9.43789 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 3.79746 on 1 procs for 100 steps with 32000 atoms - -Pair time (%) = 3.18686 (83.9207) -Neigh time (%) = 0.524724 (13.8178) -Comm time (%) = 0.0244031 (0.642616) -Outpt time (%) = 0.000174046 (0.00458321) -Other time (%) = 0.061305 (1.61437) - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 20131 ave 20131 max 20131 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2.09236e+06 ave 2.09236e+06 max 2.09236e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2092355 -Ave neighs/atom = 65.3861 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.28Jun15.kim.lj.ubuntu.4 b/examples/kim/log.28Jun15.kim.lj.ubuntu.4 deleted file mode 100644 index 7eaf58aad4..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.ubuntu.4 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 4.70961 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 7.25305 on 4 procs for 100 steps with 32000 atoms - -Pair time (%) = 2.52571 (34.8227) -Neigh time (%) = 0.500287 (6.8976) -Comm time (%) = 3.70236 (51.0456) -Outpt time (%) = 0.00146681 (0.0202234) -Other time (%) = 0.523229 (7.21391) - -Nlocal: 8000 ave 8010 max 7989 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 9240.25 ave 9249 max 9228 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Neighs: 555266 ave 555920 max 554805 min -Histogram: 2 0 0 0 0 1 0 0 0 1 - -Total # of neighbors = 2221065 -Ave neighs/atom = 69.4083 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 b/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 new file mode 100644 index 0000000000..76106e009f --- /dev/null +++ b/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 @@ -0,0 +1,66 @@ +-------------------------------------------------------------------------- +[[30970,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.0031676 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.85482 + ghost atom cutoff = 7.85482 + binsize = 3.92741, bins = 23 23 23 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 16.58 | 16.58 | 16.58 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -495.29247 0 331.94661 -978.84224 + 100 212.66365 -547.67175 0 331.94665 -1054.2086 +Loop time of 1.40245 on 1 procs for 100 steps with 32000 atoms + +Performance: 6.161 ns/day, 3.896 hours/ns, 71.304 timesteps/s +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2556 | 1.2556 | 1.2556 | 0.0 | 89.53 +Neigh | 0.098976 | 0.098976 | 0.098976 | 0.0 | 7.06 +Comm | 0.011525 | 0.011525 | 0.011525 | 0.0 | 0.82 +Output | 0.00021903 | 0.00021903 | 0.00021903 | 0.0 | 0.02 +Modify | 0.023739 | 0.023739 | 0.023739 | 0.0 | 1.69 +Other | | 0.01244 | | | 0.89 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.36493e+06 ave 1.36493e+06 max 1.36493e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1364931 +Ave neighs/atom = 42.6541 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 b/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 new file mode 100644 index 0000000000..634c038efd --- /dev/null +++ b/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 @@ -0,0 +1,66 @@ +-------------------------------------------------------------------------- +[[30962,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00143054 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.85482 + ghost atom cutoff = 7.85482 + binsize = 3.92741, bins = 23 23 23 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 6.875 | 6.875 | 6.875 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -495.29247 0 331.94661 -978.84224 + 100 212.66365 -547.67175 0 331.94665 -1054.2086 +Loop time of 1.55473 on 4 procs for 100 steps with 32000 atoms + +Performance: 5.557 ns/day, 4.319 hours/ns, 64.320 timesteps/s +23.8% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.47168 | 0.51922 | 0.58923 | 6.2 | 33.40 +Neigh | 0.061309 | 0.077009 | 0.10276 | 5.7 | 4.95 +Comm | 0.87185 | 0.92596 | 0.95327 | 3.4 | 59.56 +Output | 0.00035269 | 0.00047555 | 0.00055331 | 0.0 | 0.03 +Modify | 0.0060711 | 0.00616 | 0.0062612 | 0.1 | 0.40 +Other | | 0.0259 | | | 1.67 + +Nlocal: 8000 ave 8014 max 7988 min +Histogram: 1 0 0 1 1 0 0 0 0 1 +Nghost: 9131 ave 9143 max 9117 min +Histogram: 1 0 0 0 0 1 1 0 0 1 +Neighs: 341233 ave 341715 max 340679 min +Histogram: 1 0 0 0 1 0 0 1 0 1 + +Total # of neighbors = 1364931 +Ave neighs/atom = 42.6541 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/kim/log.29Jun18.kim.lj.ubuntu.1 b/examples/kim/log.29Jun18.kim.lj.ubuntu.1 new file mode 100644 index 0000000000..c1875916db --- /dev/null +++ b/examples/kim/log.29Jun18.kim.lj.ubuntu.1 @@ -0,0 +1,68 @@ +-------------------------------------------------------------------------- +[[30495,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.00259765 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.85482 + ghost atom cutoff = 7.85482 + binsize = 3.92741, bins = 23 23 23 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton on, ghost, cut 7.55482 + pair build: full/bin/ghost + stencil: full/ghost/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 27.14 | 27.14 | 27.14 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -495.29247 0 331.94661 -978.84224 + 100 212.65961 -547.66877 0 331.93294 -1053.7732 +Loop time of 2.12331 on 1 procs for 100 steps with 32000 atoms + +Performance: 4.069 ns/day, 5.898 hours/ns, 47.096 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.7197 | 1.7197 | 1.7197 | 0.0 | 80.99 +Neigh | 0.35501 | 0.35501 | 0.35501 | 0.0 | 16.72 +Comm | 0.012289 | 0.012289 | 0.012289 | 0.0 | 0.58 +Output | 0.00021102 | 0.00021102 | 0.00021102 | 0.0 | 0.01 +Modify | 0.023484 | 0.023484 | 0.023484 | 0.0 | 1.11 +Other | | 0.01266 | | | 0.60 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 2.569e+06 ave 2.569e+06 max 2.569e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2568996 +Ave neighs/atom = 80.2811 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/kim/log.29Jun18.kim.lj.ubuntu.4 b/examples/kim/log.29Jun18.kim.lj.ubuntu.4 new file mode 100644 index 0000000000..5ef352a667 --- /dev/null +++ b/examples/kim/log.29Jun18.kim.lj.ubuntu.4 @@ -0,0 +1,68 @@ +-------------------------------------------------------------------------- +[[30487,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00128874 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.85482 + ghost atom cutoff = 7.85482 + binsize = 3.92741, bins = 23 23 23 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton on, ghost, cut 7.55482 + pair build: full/bin/ghost + stencil: full/ghost/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 10.82 | 10.82 | 10.82 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 -495.29247 0 331.94661 -978.84224 + 100 212.65961 -547.66877 0 331.93294 -1053.7732 +Loop time of 2.58934 on 4 procs for 100 steps with 32000 atoms + +Performance: 3.337 ns/day, 7.193 hours/ns, 38.620 timesteps/s +24.3% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.85344 | 0.94031 | 1.0212 | 7.2 | 36.31 +Neigh | 0.40159 | 0.42603 | 0.43728 | 2.2 | 16.45 +Comm | 1.1013 | 1.1823 | 1.2796 | 6.9 | 45.66 +Output | 0.00041301 | 0.00056702 | 0.00081648 | 0.0 | 0.02 +Modify | 0.0062882 | 0.0063459 | 0.0064657 | 0.1 | 0.25 +Other | | 0.03375 | | | 1.30 + +Nlocal: 8000 ave 8014 max 7988 min +Histogram: 1 0 0 1 1 0 0 0 0 1 +Nghost: 9131 ave 9143 max 9117 min +Histogram: 1 0 0 0 0 1 1 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 642249 ave 643365 max 641215 min +Histogram: 1 0 0 0 2 0 0 0 0 1 + +Total # of neighbors = 2568996 +Ave neighs/atom = 80.2811 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 From 5bdc29533123fa6f1d0ef487215ad2496c3bc6cd Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 1 Jul 2018 16:23:17 -0500 Subject: [PATCH 14/49] Add skin to pair_kim neigh-list cutoffs & update docs --- doc/src/pair_kim.txt | 7 +++++-- examples/kim/in.kim.lj | 6 ++++++ lib/kim/README | 12 +++++++++--- src/KIM/pair_kim.cpp | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/doc/src/pair_kim.txt b/doc/src/pair_kim.txt index 3d105e2226..4599779ca8 100644 --- a/doc/src/pair_kim.txt +++ b/doc/src/pair_kim.txt @@ -47,8 +47,11 @@ section of Section packages"_Section_packages.html#KIM has instructions on how to do this with a simple make command, when building LAMMPS. -See the examples/kim dir for an input script that uses a KIM model -(potential) for Lennard-Jones. +See the examples/kim dir for an input script that uses a KIM model (potential) +for Lennard-Jones. Note, for this example input script, the example models +shipped with with kim-api package must be installed. See the "Making +LAMMPS"_Section_start.html#start_3 section and the ./lib/kim/README for details +on how to build LAMMSPS with the kim-api and how to install the example models. :line diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj index a8e2b9616b..4ce7af97c4 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj @@ -1,4 +1,10 @@ # 3d Lennard-Jones melt +# +# This example requires that the example models provided with +# the kim-api package are installed. see the ./lib/kim/README or +# ./lib/kim/Install.py files for details on how to install these +# example models. +# variable x index 1 variable y index 1 diff --git a/lib/kim/README b/lib/kim/README index 80d77d3332..6bcad18ce0 100644 --- a/lib/kim/README +++ b/lib/kim/README @@ -36,14 +36,20 @@ $ ./configure --prefix=${PWD}/../installed-kim-api-vX.Y.Z $ make $ make install -$ cd .. -4. Remove source and build files +4. To install the example models shipped with the kim-api + +$ cd examples +$ make model-drivers-all-system +$ make models-all-system +$ cd ../.. + +5. Remove source and build files $ rm -rf kim-api-vX.Y.Z $ rm -rf kim-api-vX.Y.Z.txz -5. To add items do the following (replace the kim item name with your +6. To add items do the following (replace the kim item name with your desired value) $ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-vX-activate diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 5f123de45d..79ced5b9e9 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -429,7 +429,8 @@ void PairKIM::init_style() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->ghost = 1; neighbor->requests[irequest]->cut = 1; - neighbor->requests[irequest]->cutoff = kim_cutoff_values[i]; + neighbor->requests[irequest]->cutoff + = kim_cutoff_values[i] + neighbor->skin; } return; From 0fbc6bebf545c2d53a2acefc14f5289bfd08b365 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 2 Jul 2018 21:48:47 -0500 Subject: [PATCH 15/49] Fix no-virial support -> LAMMPSvirial in pair_kim --- src/KIM/pair_kim.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 79ced5b9e9..ee9bac000d 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -958,9 +958,13 @@ void PairKIM::set_kim_model_has_flags() error->warning(FLERR,"KIM Model does not provide `partialForce'; " "Forces will be zero"); - if (kim_model_support_for_virial == notSupported) + if ((no_virial_fdotr_compute == 1) && + (kim_model_support_for_virial == notSupported)) + { error->warning(FLERR,"KIM Model does not provide `partialVirial'. " "pair_kim now using `LAMMPSvirial' option."); + no_virial_fdotr_compute = 0; + } if (kim_model_support_for_particleEnergy == notSupported) error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " From 0264e044e2d7db5635fae76f74c09bd71b6b392d Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 2 Jul 2018 21:51:05 -0500 Subject: [PATCH 16/49] Update example/kim input files --- examples/kim/in.kim.lj | 8 ++++---- examples/kim/in.kim.lj.lmp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj index 4ce7af97c4..851243bed8 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj @@ -22,11 +22,11 @@ region box block 0 ${xx} 0 ${yy} 0 ${zz} create_box 1 box create_atoms 1 box -#pair_style lj/cut 7.5548200 -#pair_coeff 1 1 0.0123529 1.8887100 -#pair_modify shift yes +#pair_style lj/cut 8.1500 +#pair_coeff 1 1 0.0104 3.4000 +#pair_modify shift no -pair_style kim KIMvirial LennardJones612_Ar +pair_style kim LAMMPSvirial LennardJones_Ar pair_coeff * * Ar mass 1 39.95 diff --git a/examples/kim/in.kim.lj.lmp b/examples/kim/in.kim.lj.lmp index ddb7624945..aa6dbcad6f 100644 --- a/examples/kim/in.kim.lj.lmp +++ b/examples/kim/in.kim.lj.lmp @@ -16,11 +16,11 @@ region box block 0 ${xx} 0 ${yy} 0 ${zz} create_box 1 box create_atoms 1 box -pair_style lj/cut 7.5548200 -pair_coeff 1 1 0.0123529 1.8887100 -pair_modify shift yes +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 +pair_modify shift no -#pair_style kim KIMvirial LennardJones612_Ar +#pair_style kim KIMvirial LennardJones_Ar #pair_coeff * * Ar mass 1 39.95 From 7eeb96f1afdc3aa1a37cd5429727e3549b8ebcc0 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Tue, 3 Jul 2018 23:37:54 -0500 Subject: [PATCH 17/49] Update pair_kim to work with new neig. list Hints --- examples/kim/in.kim.lj | 4 +- examples/kim/in.kim.lj.lmp | 2 +- examples/kim/in.kim.lj.lmp.newton-on | 35 ++++ ...g.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1} | 42 ++-- ...g.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4} | 52 ++--- ...tu.1 => log.04Jul2018.kim.lj.lmp.ubuntu.1} | 48 +++-- .../kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 | 66 ++++++ examples/kim/log.04Jul2018.kim.lj.ubuntu.1 | 69 +++++++ examples/kim/log.04Jul2018.kim.lj.ubuntu.4 | 78 ++++++++ examples/kim/log.29Jun18.kim.lj.ubuntu.4 | 68 ------- src/KIM/pair_kim.cpp | 188 ++++++++++-------- src/KIM/pair_kim.h | 10 +- 12 files changed, 433 insertions(+), 229 deletions(-) create mode 100644 examples/kim/in.kim.lj.lmp.newton-on rename examples/kim/{log.29Jun18.kim.lj.lmp.ubuntu.1 => log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1} (56%) rename examples/kim/{log.29Jun18.kim.lj.lmp.ubuntu.4 => log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4} (50%) rename examples/kim/{log.29Jun18.kim.lj.ubuntu.1 => log.04Jul2018.kim.lj.lmp.ubuntu.1} (52%) create mode 100644 examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 create mode 100644 examples/kim/log.04Jul2018.kim.lj.ubuntu.1 create mode 100644 examples/kim/log.04Jul2018.kim.lj.ubuntu.4 delete mode 100644 examples/kim/log.29Jun18.kim.lj.ubuntu.4 diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj index 851243bed8..a17ec982da 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj @@ -16,6 +16,7 @@ variable zz equal 20*$z units metal atom_style atomic +newton off lattice fcc 4.4300 region box block 0 ${xx} 0 ${yy} 0 ${zz} @@ -24,9 +25,8 @@ create_atoms 1 box #pair_style lj/cut 8.1500 #pair_coeff 1 1 0.0104 3.4000 -#pair_modify shift no -pair_style kim LAMMPSvirial LennardJones_Ar +pair_style kim KIMvirial LennardJones_Ar pair_coeff * * Ar mass 1 39.95 diff --git a/examples/kim/in.kim.lj.lmp b/examples/kim/in.kim.lj.lmp index aa6dbcad6f..a10e3e2e90 100644 --- a/examples/kim/in.kim.lj.lmp +++ b/examples/kim/in.kim.lj.lmp @@ -10,6 +10,7 @@ variable zz equal 20*$z units metal atom_style atomic +newton off lattice fcc 4.4300 region box block 0 ${xx} 0 ${yy} 0 ${zz} @@ -18,7 +19,6 @@ create_atoms 1 box pair_style lj/cut 8.1500 pair_coeff 1 1 0.0104 3.4000 -pair_modify shift no #pair_style kim KIMvirial LennardJones_Ar #pair_coeff * * Ar diff --git a/examples/kim/in.kim.lj.lmp.newton-on b/examples/kim/in.kim.lj.lmp.newton-on new file mode 100644 index 0000000000..d17bc14984 --- /dev/null +++ b/examples/kim/in.kim.lj.lmp.newton-on @@ -0,0 +1,35 @@ +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units metal +atom_style atomic +newton on + +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box + +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 + +#pair_style kim KIMvirial LennardJones_Ar +#pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 diff --git a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 similarity index 56% rename from examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 rename to examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 index 76106e009f..70eae36a48 100644 --- a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[30970,1],0]: A high-performance Open MPI point-to-point messaging module +[[19053,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,13 +16,13 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.0031676 secs + Time spent = 0.00270113 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair lj/cut, perpetual attributes: half, newton on @@ -33,34 +33,34 @@ Setting up Verlet run ... Unit style : metal Current step : 0 Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 16.58 | 16.58 | 16.58 Mbytes +Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.66365 -547.67175 0 331.94665 -1054.2086 -Loop time of 1.40245 on 1 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.18554 on 1 procs for 100 steps with 32000 atoms -Performance: 6.161 ns/day, 3.896 hours/ns, 71.304 timesteps/s -100.0% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.953 ns/day, 6.071 hours/ns, 45.755 timesteps/s +99.6% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.2556 | 1.2556 | 1.2556 | 0.0 | 89.53 -Neigh | 0.098976 | 0.098976 | 0.098976 | 0.0 | 7.06 -Comm | 0.011525 | 0.011525 | 0.011525 | 0.0 | 0.82 -Output | 0.00021903 | 0.00021903 | 0.00021903 | 0.0 | 0.02 -Modify | 0.023739 | 0.023739 | 0.023739 | 0.0 | 1.69 -Other | | 0.01244 | | | 0.89 +Pair | 2.0006 | 2.0006 | 2.0006 | 0.0 | 91.54 +Neigh | 0.13933 | 0.13933 | 0.13933 | 0.0 | 6.38 +Comm | 0.011122 | 0.011122 | 0.011122 | 0.0 | 0.51 +Output | 0.00020978 | 0.00020978 | 0.00020978 | 0.0 | 0.01 +Modify | 0.022358 | 0.022358 | 0.022358 | 0.0 | 1.02 +Other | | 0.01188 | | | 0.54 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 19911 ave 19911 max 19911 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1.36493e+06 ave 1.36493e+06 max 1.36493e+06 min +Neighs: 2.12688e+06 ave 2.12688e+06 max 2.12688e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 1364931 -Ave neighs/atom = 42.6541 +Total # of neighbors = 2126875 +Ave neighs/atom = 66.4648 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:01 +Total wall time: 0:00:02 diff --git a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 similarity index 50% rename from examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 rename to examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 index 634c038efd..e7157c11b8 100644 --- a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[30962,1],0]: A high-performance Open MPI point-to-point messaging module +[[19045,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,13 +16,13 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00143054 secs + Time spent = 0.00117056 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair lj/cut, perpetual attributes: half, newton on @@ -33,34 +33,34 @@ Setting up Verlet run ... Unit style : metal Current step : 0 Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 6.875 | 6.875 | 6.875 Mbytes +Per MPI rank memory allocation (min/avg/max) = 7.632 | 7.632 | 7.632 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.66365 -547.67175 0 331.94665 -1054.2086 -Loop time of 1.55473 on 4 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.34104 on 4 procs for 100 steps with 32000 atoms -Performance: 5.557 ns/day, 4.319 hours/ns, 64.320 timesteps/s -23.8% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 3.691 ns/day, 6.503 hours/ns, 42.716 timesteps/s +24.0% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.47168 | 0.51922 | 0.58923 | 6.2 | 33.40 -Neigh | 0.061309 | 0.077009 | 0.10276 | 5.7 | 4.95 -Comm | 0.87185 | 0.92596 | 0.95327 | 3.4 | 59.56 -Output | 0.00035269 | 0.00047555 | 0.00055331 | 0.0 | 0.03 -Modify | 0.0060711 | 0.00616 | 0.0062612 | 0.1 | 0.40 -Other | | 0.0259 | | | 1.67 +Pair | 0.91499 | 0.96396 | 1.0567 | 5.6 | 41.18 +Neigh | 0.092245 | 0.11781 | 0.14572 | 6.0 | 5.03 +Comm | 1.1264 | 1.2287 | 1.2906 | 5.6 | 52.49 +Output | 0.00045199 | 0.00051154 | 0.00060273 | 0.0 | 0.02 +Modify | 0.0058738 | 0.0059629 | 0.0061675 | 0.2 | 0.25 +Other | | 0.02406 | | | 1.03 -Nlocal: 8000 ave 8014 max 7988 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Nghost: 9131 ave 9143 max 9117 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Neighs: 341233 ave 341715 max 340679 min -Histogram: 1 0 0 0 1 0 0 1 0 1 +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 531719 ave 533273 max 529395 min +Histogram: 1 0 0 0 1 0 0 0 0 2 -Total # of neighbors = 1364931 -Ave neighs/atom = 42.6541 +Total # of neighbors = 2126875 +Ave neighs/atom = 66.4648 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:01 +Total wall time: 0:00:02 diff --git a/examples/kim/log.29Jun18.kim.lj.ubuntu.1 b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 similarity index 52% rename from examples/kim/log.29Jun18.kim.lj.ubuntu.1 rename to examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 index c1875916db..217568072c 100644 --- a/examples/kim/log.29Jun18.kim.lj.ubuntu.1 +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[30495,1],0]: A high-performance Open MPI point-to-point messaging module +[[19074,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,53 +16,51 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00259765 secs + Time spent = 0.00251478 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton on, ghost, cut 7.55482 - pair build: full/bin/ghost - stencil: full/ghost/bin/3d + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff bin: standard Setting up Verlet run ... Unit style : metal Current step : 0 Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 27.14 | 27.14 | 27.14 Mbytes +Per MPI rank memory allocation (min/avg/max) = 20.37 | 20.37 | 20.37 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.65961 -547.66877 0 331.93294 -1053.7732 -Loop time of 2.12331 on 1 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.6218 on 1 procs for 100 steps with 32000 atoms -Performance: 4.069 ns/day, 5.898 hours/ns, 47.096 timesteps/s +Performance: 3.295 ns/day, 7.283 hours/ns, 38.142 timesteps/s 99.9% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.7197 | 1.7197 | 1.7197 | 0.0 | 80.99 -Neigh | 0.35501 | 0.35501 | 0.35501 | 0.0 | 16.72 -Comm | 0.012289 | 0.012289 | 0.012289 | 0.0 | 0.58 -Output | 0.00021102 | 0.00021102 | 0.00021102 | 0.0 | 0.01 -Modify | 0.023484 | 0.023484 | 0.023484 | 0.0 | 1.11 -Other | | 0.01266 | | | 0.60 +Pair | 2.2623 | 2.2623 | 2.2623 | 0.0 | 86.29 +Neigh | 0.31859 | 0.31859 | 0.31859 | 0.0 | 12.15 +Comm | 0.005914 | 0.005914 | 0.005914 | 0.0 | 0.23 +Output | 0.00033105 | 0.00033105 | 0.00033105 | 0.0 | 0.01 +Modify | 0.023461 | 0.023461 | 0.023461 | 0.0 | 0.89 +Other | | 0.01123 | | | 0.43 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 19911 ave 19911 max 19911 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 2.569e+06 ave 2.569e+06 max 2.569e+06 min +Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 2568996 -Ave neighs/atom = 80.2811 +Total # of neighbors = 2370499 +Ave neighs/atom = 74.0781 Neighbor list builds = 3 Dangerous builds = 0 Total wall time: 0:00:02 diff --git a/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 new file mode 100644 index 0000000000..806c674efb --- /dev/null +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 @@ -0,0 +1,66 @@ +-------------------------------------------------------------------------- +[[19098,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00123697 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 8.013 | 8.013 | 8.013 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.88232 on 4 procs for 100 steps with 32000 atoms + +Performance: 2.998 ns/day, 8.006 hours/ns, 34.694 timesteps/s +24.6% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3577 | 1.415 | 1.467 | 3.7 | 49.09 +Neigh | 0.25761 | 0.28189 | 0.29894 | 3.2 | 9.78 +Comm | 0.58287 | 0.73218 | 0.85561 | 11.5 | 25.40 +Output | 0.00082721 | 0.0029034 | 0.0051877 | 3.1 | 0.10 +Modify | 0.0058569 | 0.015767 | 0.033242 | 8.6 | 0.55 +Other | | 0.4346 | | | 15.08 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 630904 ave 632094 max 628209 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 2523614 +Ave neighs/atom = 78.8629 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 b/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 new file mode 100644 index 0000000000..3832bd060a --- /dev/null +++ b/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 @@ -0,0 +1,69 @@ +-------------------------------------------------------------------------- +[[19111,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.00257231 secs +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: half, newton off, cut 8.45 + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 21.26 | 21.26 | 21.26 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 1270.4248 + 100 95.179725 6718.814 0 7112.496 604.59343 +Loop time of 3.22934 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.675 ns/day, 8.970 hours/ns, 30.966 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.821 | 2.821 | 2.821 | 0.0 | 87.36 +Neigh | 0.35198 | 0.35198 | 0.35198 | 0.0 | 10.90 +Comm | 0.0081757 | 0.0081757 | 0.0081757 | 0.0 | 0.25 +Output | 0.00030922 | 0.00030922 | 0.00030922 | 0.0 | 0.01 +Modify | 0.032856 | 0.032856 | 0.032856 | 0.0 | 1.02 +Other | | 0.01501 | | | 0.46 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2370499 +Ave neighs/atom = 74.0781 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 b/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 new file mode 100644 index 0000000000..70b2f82812 --- /dev/null +++ b/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 @@ -0,0 +1,78 @@ +-------------------------------------------------------------------------- +[[19135,1],1]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00154417 secs +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: half, newton off, cut 8.45 + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 8.528 | 8.528 | 8.528 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 1270.4248 + 100 95.179725 6718.814 0 7112.496 604.59343 +Loop time of 3.17877 on 4 procs for 100 steps with 32000 atoms + +Performance: 2.718 ns/day, 8.830 hours/ns, 31.459 timesteps/s +24.3% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.0514 | 2.1009 | 2.1859 | 3.6 | 66.09 +Neigh | 0.29304 | 0.31706 | 0.33568 | 2.7 | 9.97 +Comm | 0.61926 | 0.72709 | 0.77083 | 7.3 | 22.87 +Output | 0.00035457 | 0.00043741 | 0.000547 | 0.0 | 0.01 +Modify | 0.0066107 | 0.0067653 | 0.0069097 | 0.1 | 0.21 +Other | | 0.02653 | | | 0.83 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 630904 ave 632094 max 628209 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 2523614 +Ave neighs/atom = 78.8629 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.29Jun18.kim.lj.ubuntu.4 b/examples/kim/log.29Jun18.kim.lj.ubuntu.4 deleted file mode 100644 index 5ef352a667..0000000000 --- a/examples/kim/log.29Jun18.kim.lj.ubuntu.4 +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------------- -[[30487,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms - Time spent = 0.00128874 secs -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton on, ghost, cut 7.55482 - pair build: full/bin/ghost - stencil: full/ghost/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : metal - Current step : 0 - Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 10.82 | 10.82 | 10.82 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.65961 -547.66877 0 331.93294 -1053.7732 -Loop time of 2.58934 on 4 procs for 100 steps with 32000 atoms - -Performance: 3.337 ns/day, 7.193 hours/ns, 38.620 timesteps/s -24.3% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.85344 | 0.94031 | 1.0212 | 7.2 | 36.31 -Neigh | 0.40159 | 0.42603 | 0.43728 | 2.2 | 16.45 -Comm | 1.1013 | 1.1823 | 1.2796 | 6.9 | 45.66 -Output | 0.00041301 | 0.00056702 | 0.00081648 | 0.0 | 0.02 -Modify | 0.0062882 | 0.0063459 | 0.0064657 | 0.1 | 0.25 -Other | | 0.03375 | | | 1.30 - -Nlocal: 8000 ave 8014 max 7988 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Nghost: 9131 ave 9143 max 9117 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Neighs: 0 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 642249 ave 643365 max 641215 min -Histogram: 1 0 0 0 2 0 0 0 0 1 - -Total # of neighbors = 2568996 -Ave neighs/atom = 80.2811 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:03 diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index ee9bac000d..ca39b5601e 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -12,13 +12,11 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ryan S. Elliott, - Valeriu Smirichinski, - Ellad Tadmor + Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v1.6.0 (and newer) package + Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package ------------------------------------------------------------------------- */ #include @@ -45,9 +43,9 @@ PairKIM::PairKIM(LAMMPS *lmp) : Pair(lmp), settings_call_count(0), init_style_call_count(0), - kim_modelname(0), - lmps_map_species_to_unique(0), - lmps_unique_elements(0), + kim_modelname(NULL), + lmps_map_species_to_unique(NULL), + lmps_unique_elements(NULL), lmps_num_unique_elements(0), lmps_units(METAL), lengthUnit(KIM::LENGTH_UNIT::unused), @@ -55,8 +53,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : chargeUnit(KIM::CHARGE_UNIT::unused), temperatureUnit(KIM::TEMPERATURE_UNIT::unused), timeUnit(KIM::TIME_UNIT::unused), - pkim(0), - pargs(0), + pkim(NULL), + pargs(NULL), kim_model_support_for_energy(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_forces(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_virial(KIM::SUPPORT_STATUS::notSupported), @@ -64,15 +62,17 @@ PairKIM::PairKIM(LAMMPS *lmp) : kim_model_support_for_particleVirial(KIM::SUPPORT_STATUS::notSupported), lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), - kim_number_of_cutoffs(0), - kim_cutoff_values(0), - neighborLists(0), - kim_particle_codes(0), + kim_number_of_neighbor_lists(0), + kim_cutoff_values(NULL), + padding_neighbor_hints(NULL), + half_list_hints(NULL), + neighborLists(NULL), + kim_particle_codes(NULL), lmps_maxalloc(0), - kim_particleSpecies(0), - kim_particleContributing(0), - lmps_stripped_neigh_list(0), - lmps_stripped_neigh_ptr(0) + kim_particleSpecies(NULL), + kim_particleContributing(NULL), + lmps_stripped_neigh_list(NULL), + lmps_stripped_neigh_ptr(NULL) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -101,6 +101,13 @@ PairKIM::~PairKIM() delete [] lmps_unique_elements[i]; delete [] lmps_unique_elements; + if (kim_particle_codes_ok) + { + delete [] kim_particle_codes; + kim_particle_codes = NULL; + kim_particle_codes_ok = false; + } + // clean up local memory used to support KIM interface memory->destroy(kim_particleSpecies); memory->destroy(kim_particleContributing); @@ -281,20 +288,6 @@ void PairKIM::settings(int narg, char **arg) // set lmps_* bool flags set_lmps_flags(); - // set virial handling - if (strcmp(arg[0],"LAMMPSvirial") == 0) - { - no_virial_fdotr_compute = 0; - } - else if (strcmp(arg[0],"KIMvirial") == 0) - { - no_virial_fdotr_compute = 1; - } - else - { - error->all(FLERR,"Unrecognized virial argument in pair_style command"); - } - // set KIM Model name int nmlen = strlen(arg[1]); if (kim_modelname != 0) @@ -305,6 +298,26 @@ void PairKIM::settings(int narg, char **arg) kim_modelname = new char[nmlen+1]; strcpy(kim_modelname, arg[1]); + // initialize KIM Model + kim_init(); + + // set virial handling + if (strcmp(arg[0],"KIMvirial") == 0) + { + if (kim_model_support_for_virial == KIM::SUPPORT_STATUS::notSupported) + no_virial_fdotr_compute = 0; + else + no_virial_fdotr_compute = 1; + } + else if (strcmp(arg[0],"LAMMPSvirial") == 0) + { + no_virial_fdotr_compute = 0; + } + else + { + error->all(FLERR,"Unrecognized virial argument in pair_style command"); + } + return; } @@ -351,7 +364,7 @@ void PairKIM::coeff(int narg, char **arg) // Assume all species arguments are valid - // errors will be detected by kim_api_init() matching + // errors will be detected by below lmps_num_unique_elements = 0; for (i = 2; i < narg; i++) { for (j = 0; j < lmps_num_unique_elements; j++) @@ -378,6 +391,29 @@ void PairKIM::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); + // setup mapping between LAMMPS unique elements and KIM species codes + if (kim_particle_codes_ok) + { + delete [] kim_particle_codes; + kim_particle_codes = NULL; + kim_particle_codes_ok = false; + } + 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 = pkim->GetSpeciesSupportAndCode( + KIM::SpeciesName(lmps_unique_elements[i]), + &supported, + &code); + if (supported) + kim_particle_codes[i] = code; + else + error->all(FLERR,"create_kim_particle_codes: symbol not found "); + } + return; } @@ -394,22 +430,16 @@ void PairKIM::init_style() error->all(FLERR,"PairKIM only works with 3D problems"); int kimerror; - // KIM and Model initialization (only once) - // also sets kim_ind_* and kim_* bool flags - if (!kim_init_ok) - { - kim_init(); - } // setup lmps_stripped_neigh_list for neighbors of one atom, if needed if (lmps_using_molecular) { memory->destroy(lmps_stripped_neigh_list); memory->create(lmps_stripped_neigh_list, - kim_number_of_cutoffs*neighbor->oneatom, + kim_number_of_neighbor_lists*neighbor->oneatom, "pair:lmps_stripped_neigh_list"); delete [] lmps_stripped_neigh_ptr; - lmps_stripped_neigh_ptr = new int*[kim_number_of_cutoffs]; - for (int i = 0; i < kim_number_of_cutoffs; ++i) + lmps_stripped_neigh_ptr = new int*[kim_number_of_neighbor_lists]; + for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { lmps_stripped_neigh_ptr[0] = &(lmps_stripped_neigh_list[(i-1)*(neighbor->oneatom)]); @@ -420,14 +450,32 @@ void PairKIM::init_style() // make sure comm_reverse expects (at most) 9 values when newton is off if (!lmps_using_newton) comm_reverse_off = 9; - // request full neighbor lists - for (int i = 0; i < kim_number_of_cutoffs; ++i) + // request full neighbor lists (unless hints allow for better alternatives) + for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = i; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - neighbor->requests[irequest]->ghost = 1; + if (half_list_hints[i]) + { + neighbor->requests[irequest]->half = 1; + if (! lmps_using_newton) neighbor->requests[irequest]->newton = 2; + neighbor->requests[irequest]->full = 0; + } + else + { + neighbor->requests[irequest]->half = 0; + if (! lmps_using_newton) neighbor->requests[irequest]->newton = 0; + neighbor->requests[irequest]->full = 1; + } + if (padding_neighbor_hints[i]) + { + neighbor->requests[irequest]->ghost = 0; + } + else + { + neighbor->requests[irequest]->ghost = 1; + + } neighbor->requests[irequest]->cut = 1; neighbor->requests[irequest]->cutoff = kim_cutoff_values[i] + neighbor->skin; @@ -604,7 +652,8 @@ double PairKIM::memory_usage() ------------------------------------------------------------------------- */ int PairKIM::get_neigh(void const * const dataObject, - int const numberOfCutoffs, double const * const cutoffs, + int const numberOfNeighborLists, + double const * const cutoffs, int const neighborListIndex, int const particleNumber, int * const numberOfNeighbors, int const ** const neighborsOfParticle) @@ -612,8 +661,9 @@ int PairKIM::get_neigh(void const * const dataObject, PairKIM const * const Model = reinterpret_cast(dataObject); - if (numberOfCutoffs != Model->kim_number_of_cutoffs) return true; - for (int i = 0; i < numberOfCutoffs; ++i) + if (numberOfNeighborLists != Model->kim_number_of_neighbor_lists) + return true; + for (int i = 0; i < numberOfNeighborLists; ++i) { if (Model->kim_cutoff_values[i] < cutoffs[i]) return true; } @@ -666,13 +716,6 @@ void PairKIM::kim_free() } kim_init_ok = false; - if (kim_particle_codes_ok) - { - delete [] kim_particle_codes; - kim_particle_codes = 0; - kim_particle_codes_ok = false; - } - return; } @@ -713,32 +756,17 @@ void PairKIM::kim_init() // determine KIM Model capabilities (used in this function below) set_kim_model_has_flags(); - // setup mapping between LAMMPS unique elements and KIM species codes - 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 = pkim->GetSpeciesSupportAndCode( - KIM::SpeciesName(lmps_unique_elements[i]), - &supported, - &code); - if (supported) - kim_particle_codes[i] = code; - else - error->all(FLERR,"create_kim_particle_codes: symbol not found "); - } - pkim->GetInfluenceDistance(&kim_global_influence_distance); - pkim->GetNeighborListCutoffsPointer(&kim_number_of_cutoffs, - &kim_cutoff_values); + pkim->GetNeighborListPointers(&kim_number_of_neighbor_lists, + &kim_cutoff_values, + &padding_neighbor_hints, + &half_list_hints); if (neighborLists) { delete [] neighborLists; neighborLists = 0; } - neighborLists = new NeighList*[kim_number_of_cutoffs]; + neighborLists = new NeighList*[kim_number_of_neighbor_lists]; kimerror = pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, @@ -932,7 +960,7 @@ void PairKIM::set_kim_model_has_flags() int kimerror = GetComputeArgumentName(i, &computeArgumentName); KIM::SupportStatus supportStatus; kimerror = pargs->GetArgumentSupportStatus(computeArgumentName, - &supportStatus); + &supportStatus); if (computeArgumentName == partialEnergy) kim_model_support_for_energy = supportStatus; @@ -958,12 +986,10 @@ void PairKIM::set_kim_model_has_flags() error->warning(FLERR,"KIM Model does not provide `partialForce'; " "Forces will be zero"); - if ((no_virial_fdotr_compute == 1) && - (kim_model_support_for_virial == notSupported)) + if (kim_model_support_for_virial == notSupported) { error->warning(FLERR,"KIM Model does not provide `partialVirial'. " - "pair_kim now using `LAMMPSvirial' option."); - no_virial_fdotr_compute = 0; + "pair_kim will always use `LAMMPSvirial' option."); } if (kim_model_support_for_particleEnergy == notSupported) diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index a236a3f87a..8929fd2b75 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -12,13 +12,11 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ryan S. Elliott, - Valeriu Smirichinski, - Ellad Tadmor (U Minn) + Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v1.6.0 (and newer) package + Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS @@ -100,8 +98,10 @@ namespace LAMMPS_NS { bool kim_init_ok; int lmps_local_tot_num_atoms; double kim_global_influence_distance; // KIM Model cutoff value - int kim_number_of_cutoffs; + int kim_number_of_neighbor_lists; double const * kim_cutoff_values; + int const * padding_neighbor_hints; + int const * half_list_hints; class NeighList ** neighborLists; // values set in init_style() From 90a9b7ccd12c1a54daa29f1383cc23a32c8c910b Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 11 Jul 2018 10:29:45 -0700 Subject: [PATCH 18/49] Remove pair_kim support for partialVirial - do it w/fdotr --- src/KIM/pair_kim.cpp | 100 ++++++++++++------------------------------- src/KIM/pair_kim.h | 2 +- 2 files changed, 28 insertions(+), 74 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index ca39b5601e..404e4f9cf0 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -57,7 +57,6 @@ PairKIM::PairKIM(LAMMPS *lmp) : pargs(NULL), kim_model_support_for_energy(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_forces(KIM::SUPPORT_STATUS::notSupported), - kim_model_support_for_virial(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_particleEnergy(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_particleVirial(KIM::SUPPORT_STATUS::notSupported), lmps_local_tot_num_atoms(0), @@ -78,6 +77,9 @@ PairKIM::PairKIM(LAMMPS *lmp) : single_enable = 0; // We do not provide the Single() function restartinfo = 0; // We do not write any restart info one_coeff = 1; // We only allow one coeff * * call + // set to 1, regardless use of fdotr, to avoid ev_set()'s futzing with + // vflag_global + no_virial_fdotr_compute = 1; // BEGIN: initial values that determine the KIM state // (used by kim_free(), etc.) @@ -197,25 +199,21 @@ void PairKIM::compute(int eflag , int vflag) kimerror = pkim->Compute(pargs); if (kimerror) error->all(FLERR,"KIM Compute returned error"); - // assemble force and particleVirial if needed - if (!lmps_using_newton) comm->reverse_comm_pair(this); - - if ((no_virial_fdotr_compute == 1) && (vflag_global)) - { // flip sign and order of virial if KIM is computing it - for (int i = 0; i < 3; ++i) virial[i] = -1.0*virial[i]; - double tmp = virial[3]; - virial[3] = -virial[5]; - virial[4] = -virial[4]; - virial[5] = -tmp; - } - else - { // compute virial via LAMMPS fdotr mechanism - if (vflag_fdotr) virial_fdotr_compute(); + // compute virial before reverse comm! + if (vflag_global) + { + virial_fdotr_compute(); } - if ((kim_model_support_for_particleVirial != - KIM::SUPPORT_STATUS::notSupported) && - (vflag_atom)) + // if newton is off, perform reverse comm + if (!lmps_using_newton) + { + comm->reverse_comm_pair(this); + } + + if ((vflag_atom) && + (kim_model_support_for_particleVirial != + KIM::SUPPORT_STATUS::notSupported)) { // flip sign and order of virial if KIM is computing it double tmp; for (int i = 0; i < nall; ++i) @@ -266,9 +264,8 @@ void PairKIM::settings(int narg, char **arg) ++settings_call_count; init_style_call_count = 0; - if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - // arg[0] is the virial handling option: "LAMMPSvirial" or "KIMvirial" - // arg[1] is the KIM Model name + if (narg != 1) error->all(FLERR,"Illegal pair_style command"); + // arg[0] is the KIM Model name lmps_using_molecular = (atom->molecular > 0); @@ -289,35 +286,18 @@ void PairKIM::settings(int narg, char **arg) set_lmps_flags(); // set KIM Model name - int nmlen = strlen(arg[1]); + int nmlen = strlen(arg[0]); if (kim_modelname != 0) { delete [] kim_modelname; kim_modelname = 0; } kim_modelname = new char[nmlen+1]; - strcpy(kim_modelname, arg[1]); + strcpy(kim_modelname, arg[0]); // initialize KIM Model kim_init(); - // set virial handling - if (strcmp(arg[0],"KIMvirial") == 0) - { - if (kim_model_support_for_virial == KIM::SUPPORT_STATUS::notSupported) - no_virial_fdotr_compute = 0; - else - no_virial_fdotr_compute = 1; - } - else if (strcmp(arg[0],"LAMMPSvirial") == 0) - { - no_virial_fdotr_compute = 0; - } - else - { - error->all(FLERR,"Unrecognized virial argument in pair_style command"); - } - return; } @@ -458,13 +438,11 @@ void PairKIM::init_style() if (half_list_hints[i]) { neighbor->requests[irequest]->half = 1; - if (! lmps_using_newton) neighbor->requests[irequest]->newton = 2; neighbor->requests[irequest]->full = 0; } else { neighbor->requests[irequest]->half = 0; - if (! lmps_using_newton) neighbor->requests[irequest]->newton = 0; neighbor->requests[irequest]->full = 1; } if (padding_neighbor_hints[i]) @@ -476,6 +454,9 @@ void PairKIM::init_style() neighbor->requests[irequest]->ghost = 1; } + // always want all owned/ghost pairs + neighbor->requests[irequest]->newton = 2; + // set cutoff neighbor->requests[irequest]->cut = 1; neighbor->requests[irequest]->cutoff = kim_cutoff_values[i] + neighbor->skin; @@ -737,7 +718,6 @@ void PairKIM::kim_init() error->all(FLERR,"KIM ModelCreate failed"); else { if (!requestedUnitsAccepted) { - // @@@ error for now. Fix as needed error->all(FLERR,"KIM Model did not accept the requested unit system"); } @@ -857,27 +837,6 @@ void PairKIM::set_argument_pointers() &(vatom[0][0])); } - // Set KIM pointer appropriately for virial - - if (kim_model_support_for_virial == required) - { - kimerror = kimerror || pargs->SetArgumentPointer(partialVirial, - &(virial[0])); - } - else if ((kim_model_support_for_virial == optional) && - (no_virial_fdotr_compute == 1) && - (vflag_global)) - { - kimerror = kimerror || pargs->SetArgumentPointer(partialVirial, - &(virial[0])); - } - else if (kim_model_support_for_virial == optional) - { - kimerror = kimerror || pargs->SetArgumentPointer( - partialVirial, - reinterpret_cast(NULL)); - } - if (kimerror) { error->all(FLERR,"Unable to set KIM argument pointers"); @@ -966,15 +925,16 @@ void PairKIM::set_kim_model_has_flags() kim_model_support_for_energy = supportStatus; else if (computeArgumentName == partialForces) kim_model_support_for_forces = supportStatus; - else if (computeArgumentName == partialVirial) - kim_model_support_for_virial = supportStatus; else if (computeArgumentName == partialParticleEnergy) kim_model_support_for_particleEnergy = supportStatus; else if (computeArgumentName == partialParticleVirial) kim_model_support_for_particleVirial = supportStatus; else if (supportStatus == required) { - error->all(FLERR,"KIM Model requires unsupported compute argument"); + std::stringstream msg; + msg << "KIM Model requires unsupported compute argument: " + << computeArgumentName.String(); + error->all(FLERR, msg.str().c_str()); } } @@ -986,12 +946,6 @@ void PairKIM::set_kim_model_has_flags() error->warning(FLERR,"KIM Model does not provide `partialForce'; " "Forces will be zero"); - if (kim_model_support_for_virial == notSupported) - { - error->warning(FLERR,"KIM Model does not provide `partialVirial'. " - "pair_kim will always use `LAMMPSvirial' option."); - } - if (kim_model_support_for_particleEnergy == notSupported) error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " "energy per atom will be zero"); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 8929fd2b75..afba20651d 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -32,6 +32,7 @@ PairStyle(kim,PairKIM) class KIM_API_model; #include "pair.h" #include "KIM_SimulatorHeaders.hpp" +#include namespace LAMMPS_NS { @@ -90,7 +91,6 @@ namespace LAMMPS_NS { // values set in set_kim_model_has_flags(), called by kim_init() KIM::SupportStatus kim_model_support_for_energy; KIM::SupportStatus kim_model_support_for_forces; - KIM::SupportStatus kim_model_support_for_virial; KIM::SupportStatus kim_model_support_for_particleEnergy; KIM::SupportStatus kim_model_support_for_particleVirial; From fcec1498e31bb98313ae10d4afa8802ad72d82fd Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 11 Jul 2018 10:34:07 -0700 Subject: [PATCH 19/49] update input example scripts for pair_kim --- ...in.kim.lj.lmp => in.kim.lj.lmp.newton-off} | 2 +- examples/kim/in.kim.lj.lmp.newton-on | 2 +- .../kim/{in.kim.lj => in.kim.lj.newton-off} | 2 +- examples/kim/in.kim.lj.newton-on | 41 +++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) rename examples/kim/{in.kim.lj.lmp => in.kim.lj.lmp.newton-off} (92%) rename examples/kim/{in.kim.lj => in.kim.lj.newton-off} (94%) create mode 100644 examples/kim/in.kim.lj.newton-on diff --git a/examples/kim/in.kim.lj.lmp b/examples/kim/in.kim.lj.lmp.newton-off similarity index 92% rename from examples/kim/in.kim.lj.lmp rename to examples/kim/in.kim.lj.lmp.newton-off index a10e3e2e90..197755294a 100644 --- a/examples/kim/in.kim.lj.lmp +++ b/examples/kim/in.kim.lj.lmp.newton-off @@ -20,7 +20,7 @@ create_atoms 1 box pair_style lj/cut 8.1500 pair_coeff 1 1 0.0104 3.4000 -#pair_style kim KIMvirial LennardJones_Ar +#pair_style kim LennardJones_Ar #pair_coeff * * Ar mass 1 39.95 diff --git a/examples/kim/in.kim.lj.lmp.newton-on b/examples/kim/in.kim.lj.lmp.newton-on index d17bc14984..f9f79e2bb2 100644 --- a/examples/kim/in.kim.lj.lmp.newton-on +++ b/examples/kim/in.kim.lj.lmp.newton-on @@ -20,7 +20,7 @@ create_atoms 1 box pair_style lj/cut 8.1500 pair_coeff 1 1 0.0104 3.4000 -#pair_style kim KIMvirial LennardJones_Ar +#pair_style kim LennardJones_Ar #pair_coeff * * Ar mass 1 39.95 diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj.newton-off similarity index 94% rename from examples/kim/in.kim.lj rename to examples/kim/in.kim.lj.newton-off index a17ec982da..82cf5ba602 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj.newton-off @@ -26,7 +26,7 @@ create_atoms 1 box #pair_style lj/cut 8.1500 #pair_coeff 1 1 0.0104 3.4000 -pair_style kim KIMvirial LennardJones_Ar +pair_style kim LennardJones_Ar pair_coeff * * Ar mass 1 39.95 diff --git a/examples/kim/in.kim.lj.newton-on b/examples/kim/in.kim.lj.newton-on new file mode 100644 index 0000000000..3a95f1dbb0 --- /dev/null +++ b/examples/kim/in.kim.lj.newton-on @@ -0,0 +1,41 @@ +# 3d Lennard-Jones melt +# +# This example requires that the example models provided with +# the kim-api package are installed. see the ./lib/kim/README or +# ./lib/kim/Install.py files for details on how to install these +# example models. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units metal +atom_style atomic +newton on + +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box + +#pair_style lj/cut 8.1500 +#pair_coeff 1 1 0.0104 3.4000 + +pair_style kim LennardJones_Ar +pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 From af42251142914046b1b2d2f5bb4983704d3ee648 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 11 Jul 2018 13:42:26 -0700 Subject: [PATCH 20/49] Update doc/src/pair_kim.txt --- doc/src/pair_kim.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/src/pair_kim.txt b/doc/src/pair_kim.txt index 4599779ca8..a53de79abf 100644 --- a/doc/src/pair_kim.txt +++ b/doc/src/pair_kim.txt @@ -10,14 +10,13 @@ pair_style kim command :h3 [Syntax:] -pair_style kim virialmode model :pre +pair_style kim model :pre -virialmode = KIMvirial or LAMMPSvirial model = name of KIM model (potential) [Examples:] -pair_style kim KIMvirial ex_model_Ar_P_LJ +pair_style kim ex_model_Ar_P_LJ pair_coeff * * Ar Ar :pre [Description:] @@ -55,11 +54,6 @@ on how to build LAMMSPS with the kim-api and how to install the example models. :line -The argument {virialmode} determines how the global virial is -calculated. If {KIMvirial} is specified, the KIM model performs the -global virial calculation (if it knows how). If {LAMMPSvirial} is -specified, LAMMPS computes the global virial using its fdotr mechanism. - The argument {model} is the name of the KIM model for a specific potential as KIM defines it. In principle, LAMMPS can invoke any KIM model. You should get an error or warning message from either LAMMPS @@ -121,7 +115,7 @@ LAMMPS was built with that package. See the "Making LAMMPS"_Section_start.html#start_3 section for more info. This current version of pair_style kim is compatible with the -kim-api package version 2.0.0-beta.0 and higher. +kim-api package version 2.0.0-beta.1 and higher. [Related commands:] From 81e33f5f7893bd0ab799fb92a8f12a81f38bc8aa Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 11 Jul 2018 14:25:35 -0700 Subject: [PATCH 21/49] Minor fixes & Error message updates in pair_kim.h --- src/KIM/pair_kim.cpp | 13 +++++--- src/KIM/pair_kim.h | 79 ++++++++++++++++++++++++-------------------- 2 files changed, 52 insertions(+), 40 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 404e4f9cf0..88f576bad2 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -193,7 +193,7 @@ void PairKIM::compute(int eflag , int vflag) set_argument_pointers(); // set number of particles - lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); + lmps_local_tot_num_atoms = (int) nall; // compute via KIM model kimerror = pkim->Compute(pargs); @@ -391,7 +391,12 @@ void PairKIM::coeff(int narg, char **arg) if (supported) kim_particle_codes[i] = code; else - error->all(FLERR,"create_kim_particle_codes: symbol not found "); + { + std::stringstream msg; + msg << "create_kim_particle_codes: symbol not found: " + << lmps_unique_elements[i]; + error->all(FLERR, msg.str().c_str()); + } } return; @@ -421,7 +426,7 @@ void PairKIM::init_style() lmps_stripped_neigh_ptr = new int*[kim_number_of_neighbor_lists]; for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { - lmps_stripped_neigh_ptr[0] + lmps_stripped_neigh_ptr[i] = &(lmps_stripped_neigh_list[(i-1)*(neighbor->oneatom)]); } @@ -855,7 +860,7 @@ void PairKIM::set_lmps_flags() // determine if running with pair hybrid if (force->pair_match("hybrid",0)) { - error->all(FLERR,"pair_kim does not support hybrid."); + error->all(FLERR,"pair_kim does not support hybrid"); } // determine unit system and set lmps_units flag diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index afba20651d..bdebfbcad0 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -137,81 +137,88 @@ namespace LAMMPS_NS { /* ERROR/WARNING messages: -E: Illegal ... command +E: Unable to set KIM particle species codes and/or contributing -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. +A low-level kim-api error has occurred. -E: Unrecognized virial argument in pair_style command +E: KIM Compute returned error -Only two options are supported: LAMMPSvirial and KIMvirial +The KIM model was unable, for some reason, to complete the computation. + +E: Illegal pair_style command + +Self-explanatory. E: Incorrect args for pair coefficients -Self-explanatory. Check the input script or data file. +Self-explanatory. -E: Invalid args for non-hybrid pair coefficients +E: create_kim_particle_codes: symbol not found: XX -"NULL" is only supported in pair_coeff calls when using pair hybrid +The KIM model specified does not support the atomic species symbol E: PairKIM only works with 3D problems -This is a current limitation. +Self-explanatory. E: All pair coeffs are not set -All pair coefficients must be set in the data file or by the -pair_coeff command before running a simulation. +Self-explanatory. -E: KIM neighbor iterator exceeded range +E: Unable to destroy Compute Arguments Object -This should not happen. It likely indicates a bug -in the KIM implementation of the interatomic potential -where it is requesting neighbors incorrectly. +A low-level kim-api error has occurred. -E: LAMMPS unit_style lj not supported by KIM models +E: KIM ModelCreate failed -Self-explanatory. Check the input script or data file. +The kim-api was not able to create a model object for the specified model. -E: Unknown unit_style +E: KIM Model did not accept the requested unit system -Self-explanatory. Check the input script or data file. +The KIM Model does not support the specified LAMMPS unit system -W: KIM Model does not provide `energy'; Potential energy will be zero +E: KIM ComputeArgumentsCreate failed + +A low-level kim-api error has occurred. + +E: Unable to register KIM pointers + +A low-level kim-api error has occurred. + +E: Unable to set KIM argument pointers + +A low-level kim-api error has occurred. + +E: pair_kim does not support hybrid Self-explanatory. -W: KIM Model does not provide `forces'; Forces will be zero +E: LAMMPS unit_style lj not suppored by KIM models Self-explanatory. -W: KIM Model does not provide `particleEnergy'; energy per atom will be zero +E: KIM Model requires unsupported compute argument: XXX + +A low-level kim-api error has occurred. + +W: KIM Model does not provide `partialEnergy'; Potential energy will be zero Self-explanatory. -W: KIM Model does not provide `particleVirial'; virial per atom will be zero - - - -E: Test_descriptor_string already allocated - -This is an internal error. Contact the developers. - -U: KIM Model does not provide 'energy'; Potential energy will be zero +W: KIM Model does not provide `partialForce'; Forces will be zero Self-explanatory. -U: KIM Model does not provide 'forces'; Forces will be zero +W: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero Self-explanatory. -U: KIM Model does not provide 'particleEnergy'; energy per atom will be zero +W: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero Self-explanatory. -U: KIM Model does not provide 'particleVirial'; virial per atom will be zero +E: KIM Model requires unsupported compute callback -Self-explanatory. +A low-level kim-api error has occurred. */ From 3e734186016e9ecc8f1ec1a2235fe0ffda904bd1 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 11 Jul 2018 14:57:02 -0700 Subject: [PATCH 22/49] Updated example/kim log files --- ....11Jul2018.kim.lj.lmp.newton-off.ubuntu.1} | 22 +++--- ....11Jul2018.kim.lj.lmp.newton-off.ubuntu.4} | 22 +++--- ...g.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1} | 22 +++--- ...g.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4} | 22 +++--- ... log.11Jul2018.kim.lj.newton-off.ubuntu.1} | 33 ++++----- ... log.11Jul2018.kim.lj.newton-off.ubuntu.4} | 46 ++++++------ .../log.11Jul2018.kim.lj.newton-on.ubuntu.1 | 68 +++++++++++++++++ .../log.11Jul2018.kim.lj.newton-on.ubuntu.4 | 74 +++++++++++++++++++ 8 files changed, 223 insertions(+), 86 deletions(-) rename examples/kim/{log.04Jul2018.kim.lj.lmp.ubuntu.1 => log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1} (74%) rename examples/kim/{log.04Jul2018.kim.lj.lmp.ubuntu.4 => log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4} (74%) rename examples/kim/{log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 => log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1} (74%) rename examples/kim/{log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 => log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4} (74%) rename examples/kim/{log.04Jul2018.kim.lj.ubuntu.1 => log.11Jul2018.kim.lj.newton-off.ubuntu.1} (68%) rename examples/kim/{log.04Jul2018.kim.lj.ubuntu.4 => log.11Jul2018.kim.lj.newton-off.ubuntu.4} (60%) create mode 100644 examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 create mode 100644 examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 diff --git a/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 similarity index 74% rename from examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 rename to examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 index 217568072c..bf5864cb08 100644 --- a/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 +++ b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[19074,1],0]: A high-performance Open MPI point-to-point messaging module +[[6124,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,7 +16,7 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00251478 secs + Time spent = 0.00263722 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +37,20 @@ Per MPI rank memory allocation (min/avg/max) = 20.37 | 20.37 | 20.37 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.6218 on 1 procs for 100 steps with 32000 atoms +Loop time of 2.59913 on 1 procs for 100 steps with 32000 atoms -Performance: 3.295 ns/day, 7.283 hours/ns, 38.142 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.324 ns/day, 7.220 hours/ns, 38.474 timesteps/s +99.4% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.2623 | 2.2623 | 2.2623 | 0.0 | 86.29 -Neigh | 0.31859 | 0.31859 | 0.31859 | 0.0 | 12.15 -Comm | 0.005914 | 0.005914 | 0.005914 | 0.0 | 0.23 -Output | 0.00033105 | 0.00033105 | 0.00033105 | 0.0 | 0.01 -Modify | 0.023461 | 0.023461 | 0.023461 | 0.0 | 0.89 -Other | | 0.01123 | | | 0.43 +Pair | 2.2753 | 2.2753 | 2.2753 | 0.0 | 87.54 +Neigh | 0.28456 | 0.28456 | 0.28456 | 0.0 | 10.95 +Comm | 0.0055908 | 0.0055908 | 0.0055908 | 0.0 | 0.22 +Output | 0.00034594 | 0.00034594 | 0.00034594 | 0.0 | 0.01 +Modify | 0.023011 | 0.023011 | 0.023011 | 0.0 | 0.89 +Other | | 0.01037 | | | 0.40 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 similarity index 74% rename from examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 rename to examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 index 806c674efb..7f51d447fd 100644 --- a/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 +++ b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[19098,1],0]: A high-performance Open MPI point-to-point messaging module +[[6116,1],1]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,7 +16,7 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00123697 secs + Time spent = 0.00125703 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +37,20 @@ Per MPI rank memory allocation (min/avg/max) = 8.013 | 8.013 | 8.013 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.88232 on 4 procs for 100 steps with 32000 atoms +Loop time of 2.99901 on 4 procs for 100 steps with 32000 atoms -Performance: 2.998 ns/day, 8.006 hours/ns, 34.694 timesteps/s -24.6% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 2.881 ns/day, 8.331 hours/ns, 33.344 timesteps/s +24.4% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.3577 | 1.415 | 1.467 | 3.7 | 49.09 -Neigh | 0.25761 | 0.28189 | 0.29894 | 3.2 | 9.78 -Comm | 0.58287 | 0.73218 | 0.85561 | 11.5 | 25.40 -Output | 0.00082721 | 0.0029034 | 0.0051877 | 3.1 | 0.10 -Modify | 0.0058569 | 0.015767 | 0.033242 | 8.6 | 0.55 -Other | | 0.4346 | | | 15.08 +Pair | 1.3704 | 1.4012 | 1.439 | 2.3 | 46.72 +Neigh | 0.252 | 0.27028 | 0.28236 | 2.2 | 9.01 +Comm | 0.66355 | 0.73942 | 0.82223 | 6.5 | 24.66 +Output | 0.0037821 | 0.0090774 | 0.016142 | 5.1 | 0.30 +Modify | 0.0058855 | 0.019317 | 0.044855 | 11.4 | 0.64 +Other | | 0.5597 | | | 18.66 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 diff --git a/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 similarity index 74% rename from examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 rename to examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 index 70eae36a48..7be22a7f60 100644 --- a/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 +++ b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[19053,1],0]: A high-performance Open MPI point-to-point messaging module +[[5635,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,7 +16,7 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00270113 secs + Time spent = 0.00226572 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +37,20 @@ Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.18554 on 1 procs for 100 steps with 32000 atoms +Loop time of 2.26274 on 1 procs for 100 steps with 32000 atoms -Performance: 3.953 ns/day, 6.071 hours/ns, 45.755 timesteps/s -99.6% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.818 ns/day, 6.285 hours/ns, 44.194 timesteps/s +99.0% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.0006 | 2.0006 | 2.0006 | 0.0 | 91.54 -Neigh | 0.13933 | 0.13933 | 0.13933 | 0.0 | 6.38 -Comm | 0.011122 | 0.011122 | 0.011122 | 0.0 | 0.51 -Output | 0.00020978 | 0.00020978 | 0.00020978 | 0.0 | 0.01 -Modify | 0.022358 | 0.022358 | 0.022358 | 0.0 | 1.02 -Other | | 0.01188 | | | 0.54 +Pair | 2.0589 | 2.0589 | 2.0589 | 0.0 | 90.99 +Neigh | 0.15362 | 0.15362 | 0.15362 | 0.0 | 6.79 +Comm | 0.012277 | 0.012277 | 0.012277 | 0.0 | 0.54 +Output | 0.0003387 | 0.0003387 | 0.0003387 | 0.0 | 0.01 +Modify | 0.02416 | 0.02416 | 0.02416 | 0.0 | 1.07 +Other | | 0.01346 | | | 0.59 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 similarity index 74% rename from examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 rename to examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 index e7157c11b8..d910afbbc2 100644 --- a/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 +++ b/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[19045,1],0]: A high-performance Open MPI point-to-point messaging module +[[5659,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,7 +16,7 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00117056 secs + Time spent = 0.00213171 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +37,20 @@ Per MPI rank memory allocation (min/avg/max) = 7.632 | 7.632 | 7.632 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.34104 on 4 procs for 100 steps with 32000 atoms +Loop time of 2.44628 on 4 procs for 100 steps with 32000 atoms -Performance: 3.691 ns/day, 6.503 hours/ns, 42.716 timesteps/s -24.0% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 3.532 ns/day, 6.795 hours/ns, 40.878 timesteps/s +24.2% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.91499 | 0.96396 | 1.0567 | 5.6 | 41.18 -Neigh | 0.092245 | 0.11781 | 0.14572 | 6.0 | 5.03 -Comm | 1.1264 | 1.2287 | 1.2906 | 5.6 | 52.49 -Output | 0.00045199 | 0.00051154 | 0.00060273 | 0.0 | 0.02 -Modify | 0.0058738 | 0.0059629 | 0.0061675 | 0.2 | 0.25 -Other | | 0.02406 | | | 1.03 +Pair | 0.98717 | 1.0434 | 1.1582 | 6.6 | 42.65 +Neigh | 0.10195 | 0.12588 | 0.15258 | 5.2 | 5.15 +Comm | 1.1525 | 1.2449 | 1.3061 | 5.1 | 50.89 +Output | 0.0005828 | 0.00075188 | 0.00087256 | 0.0 | 0.03 +Modify | 0.0057955 | 0.0059132 | 0.006044 | 0.1 | 0.24 +Other | | 0.02542 | | | 1.04 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 diff --git a/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 b/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 similarity index 68% rename from examples/kim/log.04Jul2018.kim.lj.ubuntu.1 rename to examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 index 3832bd060a..c8c1919de5 100644 --- a/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 +++ b/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[19111,1],0]: A high-performance Open MPI point-to-point messaging module +[[5713,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,10 +16,9 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00257231 secs -WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) + Time spent = 0.00256546 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -38,22 +37,22 @@ Setting up Verlet run ... Time step : 0.001 Per MPI rank memory allocation (min/avg/max) = 21.26 | 21.26 | 21.26 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 7118.0584 1270.4248 - 100 95.179725 6718.814 0 7112.496 604.59343 -Loop time of 3.22934 on 1 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.69522 on 1 procs for 100 steps with 32000 atoms -Performance: 2.675 ns/day, 8.970 hours/ns, 30.966 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.206 ns/day, 7.487 hours/ns, 37.103 timesteps/s +99.8% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.821 | 2.821 | 2.821 | 0.0 | 87.36 -Neigh | 0.35198 | 0.35198 | 0.35198 | 0.0 | 10.90 -Comm | 0.0081757 | 0.0081757 | 0.0081757 | 0.0 | 0.25 -Output | 0.00030922 | 0.00030922 | 0.00030922 | 0.0 | 0.01 -Modify | 0.032856 | 0.032856 | 0.032856 | 0.0 | 1.02 -Other | | 0.01501 | | | 0.46 +Pair | 2.3655 | 2.3655 | 2.3655 | 0.0 | 87.77 +Neigh | 0.28659 | 0.28659 | 0.28659 | 0.0 | 10.63 +Comm | 0.0061924 | 0.0061924 | 0.0061924 | 0.0 | 0.23 +Output | 0.00034901 | 0.00034901 | 0.00034901 | 0.0 | 0.01 +Modify | 0.025061 | 0.025061 | 0.025061 | 0.0 | 0.93 +Other | | 0.01157 | | | 0.43 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -66,4 +65,4 @@ Total # of neighbors = 2370499 Ave neighs/atom = 74.0781 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:03 +Total wall time: 0:00:02 diff --git a/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 b/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 similarity index 60% rename from examples/kim/log.04Jul2018.kim.lj.ubuntu.4 rename to examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 index 70b2f82812..c8d5faeb20 100644 --- a/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 +++ b/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[19135,1],1]: A high-performance Open MPI point-to-point messaging module +[[5673,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,19 +16,15 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00154417 secs -WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) -WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) -WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) -WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) + Time spent = 0.00215514 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -47,22 +43,22 @@ Setting up Verlet run ... Time step : 0.001 Per MPI rank memory allocation (min/avg/max) = 8.528 | 8.528 | 8.528 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 7118.0584 1270.4248 - 100 95.179725 6718.814 0 7112.496 604.59343 -Loop time of 3.17877 on 4 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 3.06157 on 4 procs for 100 steps with 32000 atoms -Performance: 2.718 ns/day, 8.830 hours/ns, 31.459 timesteps/s -24.3% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 2.822 ns/day, 8.504 hours/ns, 32.663 timesteps/s +24.4% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.0514 | 2.1009 | 2.1859 | 3.6 | 66.09 -Neigh | 0.29304 | 0.31706 | 0.33568 | 2.7 | 9.97 -Comm | 0.61926 | 0.72709 | 0.77083 | 7.3 | 22.87 -Output | 0.00035457 | 0.00043741 | 0.000547 | 0.0 | 0.01 -Modify | 0.0066107 | 0.0067653 | 0.0069097 | 0.1 | 0.21 -Other | | 0.02653 | | | 0.83 +Pair | 1.9964 | 2.0369 | 2.084 | 2.5 | 66.53 +Neigh | 0.25048 | 0.27467 | 0.29605 | 3.1 | 8.97 +Comm | 0.66611 | 0.71603 | 0.74496 | 3.6 | 23.39 +Output | 0.00048383 | 0.00070085 | 0.00098836 | 0.0 | 0.02 +Modify | 0.0064885 | 0.0065907 | 0.006806 | 0.2 | 0.22 +Other | | 0.02664 | | | 0.87 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 diff --git a/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 b/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 new file mode 100644 index 0000000000..21af1a6299 --- /dev/null +++ b/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 @@ -0,0 +1,68 @@ +-------------------------------------------------------------------------- +[[5690,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.00258302 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: half, newton off, cut 8.45 + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 20.87 | 20.87 | 20.87 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.7052 on 1 procs for 100 steps with 32000 atoms + +Performance: 3.194 ns/day, 7.514 hours/ns, 36.966 timesteps/s +99.6% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.3715 | 2.3715 | 2.3715 | 0.0 | 87.67 +Neigh | 0.28386 | 0.28386 | 0.28386 | 0.0 | 10.49 +Comm | 0.012808 | 0.012808 | 0.012808 | 0.0 | 0.47 +Output | 0.00033716 | 0.00033716 | 0.00033716 | 0.0 | 0.01 +Modify | 0.02349 | 0.02349 | 0.02349 | 0.0 | 0.87 +Other | | 0.01317 | | | 0.49 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2370499 +Ave neighs/atom = 74.0781 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 b/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 new file mode 100644 index 0000000000..1214436d4d --- /dev/null +++ b/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 @@ -0,0 +1,74 @@ +-------------------------------------------------------------------------- +[[5682,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00322684 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: half, newton off, cut 8.45 + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 8.263 | 8.263 | 8.263 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 3.1366 on 4 procs for 100 steps with 32000 atoms + +Performance: 2.755 ns/day, 8.713 hours/ns, 31.882 timesteps/s +23.7% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3641 | 1.4213 | 1.4783 | 3.5 | 45.31 +Neigh | 0.25408 | 0.27714 | 0.29697 | 3.2 | 8.84 +Comm | 1.3588 | 1.4045 | 1.4806 | 4.0 | 44.78 +Output | 0.00055232 | 0.00072915 | 0.00087484 | 0.0 | 0.02 +Modify | 0.0061178 | 0.0062019 | 0.0062811 | 0.1 | 0.20 +Other | | 0.02673 | | | 0.85 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 630904 ave 632094 max 628209 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 2523614 +Ave neighs/atom = 78.8629 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 From 67e6afaab2b75f5a39c34edb7221d4a4672c69e4 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 11 Jul 2018 15:04:34 -0700 Subject: [PATCH 23/49] Update to KIM kim-api-v2.0.0-beta.1 --- cmake/CMakeLists.txt | 4 ++-- lib/kim/Install.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 4672b4a3db..be5bc74f1c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -407,8 +407,8 @@ if(PKG_KIM) if(DOWNLOAD_KIM) include(ExternalProject) ExternalProject_Add(kim_build - URL https://github.com/openkim/kim-api/archive/v2.0.0-beta.0.tar.gz - URL_MD5 2c099fe2603fda9a6904fc50d626f71b + URL https://github.com/openkim/kim-api/archive/v2.0.0-beta.1.tar.gz + URL_MD5 633e331cc7942c1f0462da71f41f94be BUILD_IN_SOURCE 1 CONFIGURE_COMMAND /configure --prefix= ) diff --git a/lib/kim/Install.py b/lib/kim/Install.py index f9eb1c5eed..da0dcd2789 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -21,7 +21,7 @@ Syntax from lib dir: python Install.py -b -v version -a kim-name specify one or more options, order does not matter -v = version of KIM API library to use - default = kim-api-v2.0.0-beta.0 (current as of June 2018) + default = kim-api-v2.0.0-beta.1 (current as of July 2018) -b = download and build base KIM API library with example Models this will delete any previous installation in the current folder -n = do NOT download and build base KIM API library. @@ -109,7 +109,7 @@ nargs = len(args) if nargs == 0: error() thisdir = os.environ['PWD'] -version = "kim-api-v2.0.0-beta.0" +version = "kim-api-v2.0.0-beta.1" buildflag = False everythingflag = False From e37e9cfa2f0b1dff19e5114cb2a2f2b992be83a0 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 16 Jul 2018 19:46:00 -0500 Subject: [PATCH 24/49] Add virtual set_contributing() to pair_kim --- src/KIM/pair_kim.cpp | 15 +++++++++++++-- src/KIM/pair_kim.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 88f576bad2..6d30cff01d 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -142,6 +142,16 @@ PairKIM::~PairKIM() return; } +/* ---------------------------------------------------------------------- */ +void PairKIM::set_contributing() +{ + int const nall = atom->nlocal + atom->nghost; + for (int i = 0; i < nall; ++i) + { + kim_particleContributing[i] = ( (i < atom->nlocal) ? 1 : 0 ); + } +} + /* ---------------------------------------------------------------------- */ void PairKIM::compute(int eflag , int vflag) @@ -185,10 +195,11 @@ void PairKIM::compute(int eflag , int vflag) for (int i = 0; i < nall; i++) { ielement = lmps_map_species_to_unique[species[i]]; kim_particleSpecies[i] = kim_particle_codes[ielement]; - - kim_particleContributing[i] = ( (inlocal) ? 1 : 0 ); } + // Set kim contributing flags + set_contributing(); + // pass current atom pointers to KIM set_argument_pointers(); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index bdebfbcad0..59f477b1e4 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -117,6 +117,7 @@ namespace LAMMPS_NS { int** lmps_stripped_neigh_ptr; // pointer into lists // KIM specific helper functions + virtual void set_contributing(); void kim_init(); void kim_free(); void set_argument_pointers(); From 62c8ba78249790e629cd78b0ad3553432ed4887b Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 16 Jul 2018 21:21:28 -0500 Subject: [PATCH 25/49] pair_kim : private to protected and add virtual to all routines --- src/KIM/pair_kim.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 59f477b1e4..79b8c5d792 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -53,7 +53,7 @@ namespace LAMMPS_NS { virtual void unpack_reverse_comm(int, int*, double*); virtual double memory_usage(); - private: + protected: // (nearly) all bool flags are not initialized in constructor, but set // explicitly in the indicated function. All other data members are // initialized in constructor @@ -66,7 +66,7 @@ namespace LAMMPS_NS { // values set in coeff() // values set in allocate(), called by coeff() - void allocate(); + virtual void allocate(); int* lmps_map_species_to_unique; // values set in coeff(), after calling allocate() @@ -118,13 +118,13 @@ namespace LAMMPS_NS { // KIM specific helper functions virtual void set_contributing(); - void kim_init(); - void kim_free(); - void set_argument_pointers(); - void set_lmps_flags(); - void set_kim_model_has_flags(); + virtual void kim_init(); + virtual void kim_free(); + virtual void set_argument_pointers(); + virtual void set_lmps_flags(); + virtual void set_kim_model_has_flags(); // static methods used as callbacks from KIM - static int get_neigh( + static int get_neigh( void const * const dataObject, int const numberOfCutoffs, double const * const cutoffs, int const neighborListIndex, int const particleNumber, From c0a7cabcba95f9a16b95ac6e8bf659b9db34eab1 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 18 Jul 2018 22:15:23 -0500 Subject: [PATCH 26/49] Added GPLv2 exception to link to kim-api in pair_kim.* --- src/KIM/pair_kim.cpp | 34 ++++++++++++++++++++++++++++++++++ src/KIM/pair_kim.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 6d30cff01d..39f3c4a240 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -15,6 +15,40 @@ Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, see . + + Linking LAMMPS statically or dynamically with other modules is making a + combined work based on LAMMPS. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + In addition, as a special exception, the copyright holders of LAMMPS give + you permission to combine LAMMPS with free software programs or libraries + that are released under the GNU LGPL and with code included in the standard + release of the "kim-api" under the CDDL (or modified versions of such code, + with unchanged license). You may copy and distribute such a system following + the terms of the GNU GPL for LAMMPS and the licenses of the other code + concerned, provided that you include the source code of that other code + when and as the GNU GPL requires distribution of source code. + + Note that people who make modified versions of LAMMPS are not obligated to + grant this special exception for their modified versions; it is their choice + whether to do so. The GNU General Public License gives permission to release + a modified version without this exception; this exception also makes it + possible to release a modified version which carries forward this exception. +------------------------------------------------------------------------- */ + /* ---------------------------------------------------------------------- Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package ------------------------------------------------------------------------- */ diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 79b8c5d792..b6d3489c71 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -15,6 +15,40 @@ Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, see . + + Linking LAMMPS statically or dynamically with other modules is making a + combined work based on LAMMPS. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + In addition, as a special exception, the copyright holders of LAMMPS give + you permission to combine LAMMPS with free software programs or libraries + that are released under the GNU LGPL and with code included in the standard + release of the "kim-api" under the CDDL (or modified versions of such code, + with unchanged license). You may copy and distribute such a system following + the terms of the GNU GPL for LAMMPS and the licenses of the other code + concerned, provided that you include the source code of that other code + when and as the GNU GPL requires distribution of source code. + + Note that people who make modified versions of LAMMPS are not obligated to + grant this special exception for their modified versions; it is their choice + whether to do so. The GNU General Public License gives permission to release + a modified version without this exception; this exception also makes it + possible to release a modified version which carries forward this exception. +------------------------------------------------------------------------- */ + /* ---------------------------------------------------------------------- Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package ------------------------------------------------------------------------- */ From dde0974a1aac9c48ce164c5f57813c381f4119a2 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 13 Aug 2018 22:34:42 -0500 Subject: [PATCH 27/49] Update for corrected neighbor list hint --- src/KIM/pair_kim.cpp | 28 ++++++++++------------------ src/KIM/pair_kim.h | 5 ++--- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 39f3c4a240..a298187c12 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -97,8 +97,7 @@ PairKIM::PairKIM(LAMMPS *lmp) : kim_global_influence_distance(0.0), kim_number_of_neighbor_lists(0), kim_cutoff_values(NULL), - padding_neighbor_hints(NULL), - half_list_hints(NULL), + modelWillNotRequestNeighborsOfNoncontributingParticles(NULL), neighborLists(NULL), kim_particle_codes(NULL), lmps_maxalloc(0), @@ -480,22 +479,15 @@ void PairKIM::init_style() // make sure comm_reverse expects (at most) 9 values when newton is off if (!lmps_using_newton) comm_reverse_off = 9; - // request full neighbor lists (unless hints allow for better alternatives) + // request full neighbor for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = i; - if (half_list_hints[i]) - { - neighbor->requests[irequest]->half = 1; - neighbor->requests[irequest]->full = 0; - } - else - { - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - } - if (padding_neighbor_hints[i]) + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + + if (modelWillNotRequestNeighborsOfNoncontributingParticles[i]) { neighbor->requests[irequest]->ghost = 0; } @@ -787,10 +779,10 @@ void PairKIM::kim_init() set_kim_model_has_flags(); pkim->GetInfluenceDistance(&kim_global_influence_distance); - pkim->GetNeighborListPointers(&kim_number_of_neighbor_lists, - &kim_cutoff_values, - &padding_neighbor_hints, - &half_list_hints); + pkim->GetNeighborListPointers( + &kim_number_of_neighbor_lists, + &kim_cutoff_values, + &modelWillNotRequestNeighborsOfNoncontributingParticles); if (neighborLists) { delete [] neighborLists; diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index b6d3489c71..e2be0855db 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -134,9 +134,8 @@ namespace LAMMPS_NS { double kim_global_influence_distance; // KIM Model cutoff value int kim_number_of_neighbor_lists; double const * kim_cutoff_values; - int const * padding_neighbor_hints; - int const * half_list_hints; - class NeighList ** neighborLists; + int const * modelWillNotRequestNeighborsOfNoncontributingParticles; + class NeighList ** neighborLists; // values set in init_style() bool kim_particle_codes_ok; From 9962f941e674e3dd18e76dec4ba5017e98832513 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sat, 18 Aug 2018 11:53:03 -0500 Subject: [PATCH 28/49] pair_kim - no need to comm vatom() values --- src/KIM/pair_kim.cpp | 86 +++----------------------------------------- 1 file changed, 5 insertions(+), 81 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index a298187c12..d6dfa9112c 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -476,8 +476,8 @@ void PairKIM::init_style() } - // make sure comm_reverse expects (at most) 9 values when newton is off - if (!lmps_using_newton) comm_reverse_off = 9; + // make sure comm_reverse expects (at most) 3 values when newton is off + if (!lmps_using_newton) comm_reverse_off = 3; // request full neighbor for (int i = 0; i < kim_number_of_neighbor_lists; ++i) @@ -543,9 +543,7 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) m = 0; last = first + n; - if ((kim_model_support_for_forces != notSupported) && - ((vflag_atom == 0) || - (kim_model_support_for_particleVirial == notSupported))) + if (kim_model_support_for_forces != notSupported) { for (i = first; i < last; i++) { @@ -555,42 +553,6 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((kim_model_support_for_forces != notSupported) && - (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) - { - double *va=&(vatom[0][0]); - for (i = first; i < last; i++) - { - buf[m++] = fp[3*i+0]; - buf[m++] = fp[3*i+1]; - buf[m++] = fp[3*i+2]; - - buf[m++] = va[6*i+0]; - buf[m++] = va[6*i+1]; - buf[m++] = va[6*i+2]; - buf[m++] = va[6*i+3]; - buf[m++] = va[6*i+4]; - buf[m++] = va[6*i+5]; - } - return m; - } - else if ((kim_model_support_for_forces == notSupported) && - (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) - { - double *va=&(vatom[0][0]); - for (i = first; i < last; i++) - { - buf[m++] = va[6*i+0]; - buf[m++] = va[6*i+1]; - buf[m++] = va[6*i+2]; - buf[m++] = va[6*i+3]; - buf[m++] = va[6*i+4]; - buf[m++] = va[6*i+5]; - } - return m; - } else return 0; } @@ -606,9 +568,7 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp = &(atom->f[0][0]); m = 0; - if ((kim_model_support_for_forces != notSupported) && - ((vflag_atom == 0) || - (kim_model_support_for_particleVirial == notSupported))) + if (kim_model_support_for_forces != notSupported) { for (i = 0; i < n; i++) { @@ -618,42 +578,6 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp[3*j+2]+= buf[m++]; } } - else if ((kim_model_support_for_forces != notSupported) && - (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) - { - double *va=&(vatom[0][0]); - for (i = 0; i < n; i++) - { - j = list[i]; - fp[3*j+0]+= buf[m++]; - fp[3*j+1]+= buf[m++]; - fp[3*j+2]+= buf[m++]; - - va[j*6+0]+=buf[m++]; - va[j*6+1]+=buf[m++]; - va[j*6+2]+=buf[m++]; - va[j*6+3]+=buf[m++]; - va[j*6+4]+=buf[m++]; - va[j*6+5]+=buf[m++]; - } - } - else if ((kim_model_support_for_forces == notSupported) && - (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) - { - double *va=&(vatom[0][0]); - for (i = 0; i < n; i++) - { - j = list[i]; - va[j*6+0]+=buf[m++]; - va[j*6+1]+=buf[m++]; - va[j*6+2]+=buf[m++]; - va[j*6+3]+=buf[m++]; - va[j*6+4]+=buf[m++]; - va[j*6+5]+=buf[m++]; - } - } else ;// do nothing @@ -875,7 +799,7 @@ void PairKIM::set_argument_pointers() } else if (kim_model_support_for_particleVirial != notSupported) { - kimerror = kimerror || pargs->SetArgumentPointer(partialParticleEnergy, + kimerror = kimerror || pargs->SetArgumentPointer(partialParticleVirial, &(vatom[0][0])); } From 7aa7002347f709af29016071538182c8157f8d87 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sat, 18 Aug 2018 12:02:22 -0500 Subject: [PATCH 29/49] Added check & error for KIM/LAMMPSvirial argument --- src/KIM/pair_kim.cpp | 12 +++++++++++- src/KIM/pair_kim.h | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index d6dfa9112c..f82617ee0e 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -308,7 +308,17 @@ void PairKIM::settings(int narg, char **arg) ++settings_call_count; init_style_call_count = 0; - if (narg != 1) error->all(FLERR,"Illegal pair_style command"); + if (narg != 1) + { + if ((narg > 0) && ((0 == strcmp("KIMvirial", argv[0])) || + (0 == strcmp("LAMMPSvirial", argv[0])))) + { + error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with " + "kim-api-v2."); + } + else + error->all(FLERR,"Illegal pair_style command"); + } // arg[0] is the KIM Model name lmps_using_molecular = (atom->molecular > 0); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index e2be0855db..eef6e0345b 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -179,6 +179,10 @@ 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. + +"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. + E: Illegal pair_style command Self-explanatory. From dd2a1e4787a927ccf00f34bd0dc6e7e5c4c7023f Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sat, 18 Aug 2018 12:38:29 -0500 Subject: [PATCH 30/49] Fix typos in pair_kim.cpp --- src/KIM/pair_kim.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index f82617ee0e..e209cb1202 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -310,8 +310,8 @@ void PairKIM::settings(int narg, char **arg) if (narg != 1) { - if ((narg > 0) && ((0 == strcmp("KIMvirial", argv[0])) || - (0 == strcmp("LAMMPSvirial", argv[0])))) + if ((narg > 0) && ((0 == strcmp("KIMvirial", arg[0])) || + (0 == strcmp("LAMMPSvirial", arg[0])))) { error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with " "kim-api-v2."); From 634ed487a5048b72147acdb09443218a5386fd60 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Tue, 4 Sep 2018 22:43:55 -0500 Subject: [PATCH 31/49] Use pkg-config to find kim-api-v2 library settings --- lib/kim/Makefile.lammps | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/kim/Makefile.lammps b/lib/kim/Makefile.lammps index c7c9d9fd2f..1c2ab417d5 100644 --- a/lib/kim/Makefile.lammps +++ b/lib/kim/Makefile.lammps @@ -5,8 +5,6 @@ # The KIM API package can be downloaded from https://openkim.org/kim-api # Follow the instructions in the INSTALL file to build and install the # KIM API. Add the openkim.org Models you are interested in using. -# Make sure the directory where the "kim-api-build-conifg" utility is -# located is on the PATH. # # As long as you have followed the KIM API build and install instructions, # there should not be any reason to change this file. @@ -15,18 +13,5 @@ # Settings that the LAMMPS build will import when this package is installed - -include ../../lib/kim/Makefile.KIM_DIR - -ifeq ($(wildcard $(KIM_INSTALL_DIR)/bin/kim-api-v2-build-config),) - KIM_CONFIG_HELPER = kim-api-v2-build-config -else - KIM_CONFIG_HELPER = $(KIM_INSTALL_DIR)/bin/kim-api-v2-build-config -endif -ifeq ($(shell $(KIM_CONFIG_HELPER) --version 2> /dev/null),) - $(error $(KIM_CONFIG_HELPER) utility is not available. Something is wrong with your KIM API package setup) -endif - -kim_SYSINC = $(shell $(KIM_CONFIG_HELPER) --includes) -kim_SYSLIB = $(shell $(KIM_CONFIG_HELPER) --ldlibs) -kim_SYSPATH = $(shell $(KIM_CONFIG_HELPER) --ldflags) +kim_SYSINC = $(shell pkg-config --cflags libkim-api-v2) +kim_SYSLIB = $(shell pkg-config --libs libkim-api-v2) From b9d12f0aa0148fa1777527e307facac7893b2de9 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 1 Oct 2018 22:01:12 -0500 Subject: [PATCH 32/49] Update function pointer name --- src/KIM/pair_kim.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index e209cb1202..eca3f6f1d7 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -735,7 +735,7 @@ void PairKIM::kim_init() kimerror = pargs->SetCallbackPointer( KIM::COMPUTE_CALLBACK_NAME::GetNeighborList, KIM::LANGUAGE_NAME::cpp, - reinterpret_cast(get_neigh), + reinterpret_cast(get_neigh), reinterpret_cast(this)); if (kimerror) From 762a4b97acce6917fd8335b2593ed66396c7a68f Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Tue, 30 Oct 2018 21:54:59 -0500 Subject: [PATCH 33/49] Revert "pair_kim - no need to comm vatom() values" This reverts commit 9962f941e674e3dd18e76dec4ba5017e98832513. --- src/KIM/pair_kim.cpp | 86 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 5 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index eca3f6f1d7..1bd21884eb 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -486,8 +486,8 @@ void PairKIM::init_style() } - // make sure comm_reverse expects (at most) 3 values when newton is off - if (!lmps_using_newton) comm_reverse_off = 3; + // make sure comm_reverse expects (at most) 9 values when newton is off + if (!lmps_using_newton) comm_reverse_off = 9; // request full neighbor for (int i = 0; i < kim_number_of_neighbor_lists; ++i) @@ -553,7 +553,9 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) m = 0; last = first + n; - if (kim_model_support_for_forces != notSupported) + if ((kim_model_support_for_forces != notSupported) && + ((vflag_atom == 0) || + (kim_model_support_for_particleVirial == notSupported))) { for (i = first; i < last; i++) { @@ -563,6 +565,42 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } + else if ((kim_model_support_for_forces != notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) + { + double *va=&(vatom[0][0]); + for (i = first; i < last; i++) + { + buf[m++] = fp[3*i+0]; + buf[m++] = fp[3*i+1]; + buf[m++] = fp[3*i+2]; + + buf[m++] = va[6*i+0]; + buf[m++] = va[6*i+1]; + buf[m++] = va[6*i+2]; + buf[m++] = va[6*i+3]; + buf[m++] = va[6*i+4]; + buf[m++] = va[6*i+5]; + } + return m; + } + else if ((kim_model_support_for_forces == notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) + { + double *va=&(vatom[0][0]); + for (i = first; i < last; i++) + { + buf[m++] = va[6*i+0]; + buf[m++] = va[6*i+1]; + buf[m++] = va[6*i+2]; + buf[m++] = va[6*i+3]; + buf[m++] = va[6*i+4]; + buf[m++] = va[6*i+5]; + } + return m; + } else return 0; } @@ -578,7 +616,9 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp = &(atom->f[0][0]); m = 0; - if (kim_model_support_for_forces != notSupported) + if ((kim_model_support_for_forces != notSupported) && + ((vflag_atom == 0) || + (kim_model_support_for_particleVirial == notSupported))) { for (i = 0; i < n; i++) { @@ -588,6 +628,42 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp[3*j+2]+= buf[m++]; } } + else if ((kim_model_support_for_forces != notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) + { + double *va=&(vatom[0][0]); + for (i = 0; i < n; i++) + { + j = list[i]; + fp[3*j+0]+= buf[m++]; + fp[3*j+1]+= buf[m++]; + fp[3*j+2]+= buf[m++]; + + va[j*6+0]+=buf[m++]; + va[j*6+1]+=buf[m++]; + va[j*6+2]+=buf[m++]; + va[j*6+3]+=buf[m++]; + va[j*6+4]+=buf[m++]; + va[j*6+5]+=buf[m++]; + } + } + else if ((kim_model_support_for_forces == notSupported) && + (vflag_atom == 1) && + (kim_model_support_for_particleVirial != notSupported)) + { + double *va=&(vatom[0][0]); + for (i = 0; i < n; i++) + { + j = list[i]; + va[j*6+0]+=buf[m++]; + va[j*6+1]+=buf[m++]; + va[j*6+2]+=buf[m++]; + va[j*6+3]+=buf[m++]; + va[j*6+4]+=buf[m++]; + va[j*6+5]+=buf[m++]; + } + } else ;// do nothing @@ -809,7 +885,7 @@ void PairKIM::set_argument_pointers() } else if (kim_model_support_for_particleVirial != notSupported) { - kimerror = kimerror || pargs->SetArgumentPointer(partialParticleVirial, + kimerror = kimerror || pargs->SetArgumentPointer(partialParticleEnergy, &(vatom[0][0])); } From 8dd3bce7c5ae65d56a9c1281d55fa94a683a2e47 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 1 Nov 2018 19:33:52 -0500 Subject: [PATCH 34/49] Update to C KIM_API bindings --- src/KIM/pair_kim.cpp | 320 ++++++++++++++++++++++++------------------- src/KIM/pair_kim.h | 28 ++-- 2 files changed, 195 insertions(+), 153 deletions(-) diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 1bd21884eb..072c3a6296 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -50,7 +50,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package + Designed for use with the kim-api-v2.0.0-beta.2 (and newer) package ------------------------------------------------------------------------- */ #include @@ -82,17 +82,17 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_unique_elements(NULL), lmps_num_unique_elements(0), lmps_units(METAL), - lengthUnit(KIM::LENGTH_UNIT::unused), - energyUnit(KIM::ENERGY_UNIT::unused), - chargeUnit(KIM::CHARGE_UNIT::unused), - temperatureUnit(KIM::TEMPERATURE_UNIT::unused), - timeUnit(KIM::TIME_UNIT::unused), + lengthUnit(KIM_LENGTH_UNIT_unused), + energyUnit(KIM_ENERGY_UNIT_unused), + chargeUnit(KIM_CHARGE_UNIT_unused), + temperatureUnit(KIM_TEMPERATURE_UNIT_unused), + timeUnit(KIM_TIME_UNIT_unused), pkim(NULL), pargs(NULL), - kim_model_support_for_energy(KIM::SUPPORT_STATUS::notSupported), - kim_model_support_for_forces(KIM::SUPPORT_STATUS::notSupported), - kim_model_support_for_particleEnergy(KIM::SUPPORT_STATUS::notSupported), - kim_model_support_for_particleVirial(KIM::SUPPORT_STATUS::notSupported), + kim_model_support_for_energy(KIM_SUPPORT_STATUS_notSupported), + kim_model_support_for_forces(KIM_SUPPORT_STATUS_notSupported), + kim_model_support_for_particleEnergy(KIM_SUPPORT_STATUS_notSupported), + kim_model_support_for_particleVirial(KIM_SUPPORT_STATUS_notSupported), lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), kim_number_of_neighbor_lists(0), @@ -205,13 +205,14 @@ void PairKIM::compute(int eflag , int vflag) lmps_maxalloc = atom->nmax; memory->create(kim_particleSpecies,lmps_maxalloc, "pair:kim_particleSpecies"); - int kimerror = pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::particleSpeciesCodes, + int kimerror = KIM_ComputeArguments_SetArgumentPointerInteger(pargs, + KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes, kim_particleSpecies); memory->create(kim_particleContributing,lmps_maxalloc, "pair:kim_particleContributing"); - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::particleContributing, + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerInteger( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_particleContributing, kim_particleContributing); if (kimerror) error->all( @@ -240,7 +241,7 @@ void PairKIM::compute(int eflag , int vflag) lmps_local_tot_num_atoms = (int) nall; // compute via KIM model - kimerror = pkim->Compute(pargs); + kimerror = KIM_Model_Compute(pkim, pargs); if (kimerror) error->all(FLERR,"KIM Compute returned error"); // compute virial before reverse comm! @@ -256,8 +257,9 @@ void PairKIM::compute(int eflag , int vflag) } if ((vflag_atom) && - (kim_model_support_for_particleVirial != - KIM::SUPPORT_STATUS::notSupported)) + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported) + ) { // flip sign and order of virial if KIM is computing it double tmp; for (int i = 0; i < nall; ++i) @@ -438,8 +440,9 @@ void PairKIM::coeff(int narg, char **arg) int kimerror; int supported; int code; - kimerror = pkim->GetSpeciesSupportAndCode( - KIM::SpeciesName(lmps_unique_elements[i]), + kimerror = KIM_Model_GetSpeciesSupportAndCode( + pkim, + KIM_SpeciesName_FromString(lmps_unique_elements[i]), &supported, &code); if (supported) @@ -545,17 +548,18 @@ double PairKIM::init_one(int i, int j) int PairKIM::pack_reverse_comm(int n, int first, double *buf) { - using namespace KIM::SUPPORT_STATUS; - int i,m,last; double *fp; fp = &(atom->f[0][0]); m = 0; last = first + n; - if ((kim_model_support_for_forces != notSupported) && + if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && ((vflag_atom == 0) || - (kim_model_support_for_particleVirial == notSupported))) + KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported))) { for (i = first; i < last; i++) { @@ -565,9 +569,11 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((kim_model_support_for_forces != notSupported) && + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) && (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = first; i < last; i++) @@ -585,9 +591,12 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((kim_model_support_for_forces == notSupported) && + else if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = first; i < last; i++) @@ -609,16 +618,17 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) { - using namespace KIM::SUPPORT_STATUS; - int i,j,m; double *fp; fp = &(atom->f[0][0]); m = 0; - if ((kim_model_support_for_forces != notSupported) && + if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && ((vflag_atom == 0) || - (kim_model_support_for_particleVirial == notSupported))) + KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported))) { for (i = 0; i < n; i++) { @@ -628,9 +638,12 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp[3*j+2]+= buf[m++]; } } - else if ((kim_model_support_for_forces != notSupported) && + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = 0; i < n; i++) @@ -648,9 +661,12 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) va[j*6+5]+=buf[m++]; } } - else if ((kim_model_support_for_forces == notSupported) && + else if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && (vflag_atom == 1) && - (kim_model_support_for_particleVirial != notSupported)) + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = 0; i < n; i++) @@ -741,11 +757,11 @@ void PairKIM::kim_free() if (kim_init_ok) { - int kimerror = pkim->ComputeArgumentsDestroy(&pargs); + int kimerror = KIM_Model_ComputeArgumentsDestroy(pkim, &pargs); if (kimerror) error->all(FLERR,"Unable to destroy Compute Arguments Object"); - KIM::Model::Destroy(&pkim); + KIM_Model_Destroy(&pkim); } kim_init_ok = false; @@ -760,8 +776,8 @@ void PairKIM::kim_init() // initialize KIM model int requestedUnitsAccepted; - kimerror = KIM::Model::Create( - KIM::NUMBERING::zeroBased, + kimerror = KIM_Model_Create( + KIM_NUMBERING_zeroBased, lengthUnit, energyUnit, chargeUnit, temperatureUnit, timeUnit, kim_modelname, &requestedUnitsAccepted, @@ -773,10 +789,10 @@ void PairKIM::kim_init() error->all(FLERR,"KIM Model did not accept the requested unit system"); } - kimerror = pkim->ComputeArgumentsCreate(&pargs); + kimerror = KIM_Model_ComputeArgumentsCreate(pkim, &pargs); if (kimerror) { - KIM::Model::Destroy(&pkim); + KIM_Model_Destroy(&pkim); error->all(FLERR,"KIM ComputeArgumentsCreate failed"); } else @@ -788,8 +804,9 @@ void PairKIM::kim_init() // determine KIM Model capabilities (used in this function below) set_kim_model_has_flags(); - pkim->GetInfluenceDistance(&kim_global_influence_distance); - pkim->GetNeighborListPointers( + KIM_Model_GetInfluenceDistance(pkim, &kim_global_influence_distance); + KIM_Model_GetNeighborListPointers( + pkim, &kim_number_of_neighbor_lists, &kim_cutoff_values, &modelWillNotRequestNeighborsOfNoncontributingParticles); @@ -800,18 +817,19 @@ void PairKIM::kim_init() } neighborLists = new NeighList*[kim_number_of_neighbor_lists]; - kimerror = pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, + kimerror = KIM_ComputeArguments_SetArgumentPointerInteger(pargs, + KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles, &lmps_local_tot_num_atoms); - if (kim_model_support_for_energy != KIM::SUPPORT_STATUS::notSupported) - kimerror = kimerror || pargs->SetArgumentPointer( - KIM::COMPUTE_ARGUMENT_NAME::partialEnergy, + if (KIM_SupportStatus_NotEqual(kim_model_support_for_energy, + KIM_SUPPORT_STATUS_notSupported)) + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble(pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialEnergy, &(eng_vdwl)); - kimerror = pargs->SetCallbackPointer( - KIM::COMPUTE_CALLBACK_NAME::GetNeighborList, - KIM::LANGUAGE_NAME::cpp, - reinterpret_cast(get_neigh), + kimerror = KIM_ComputeArguments_SetCallbackPointer(pargs, + KIM_COMPUTE_CALLBACK_NAME_GetNeighborList, + KIM_LANGUAGE_NAME_cpp, + reinterpret_cast(get_neigh), reinterpret_cast(this)); if (kimerror) @@ -824,14 +842,14 @@ void PairKIM::kim_init() void PairKIM::set_argument_pointers() { - using namespace KIM::COMPUTE_ARGUMENT_NAME; - using namespace KIM::SUPPORT_STATUS; - int kimerror; - kimerror = pargs->SetArgumentPointer(coordinates, &(atom->x[0][0])); + kimerror = KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_coordinates, &(atom->x[0][0])); // Set KIM pointer appropriately for particalEnergy - if ((kim_model_support_for_particleEnergy == required) && (eflag_atom != 1)) + if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_required) + && (eflag_atom != 1)) { // reallocate per-atom energy array if necessary if (atom->nmax > maxeatom) @@ -841,33 +859,41 @@ void PairKIM::set_argument_pointers() memory->create(eatom,comm->nthreads*maxeatom,"pair:eatom"); } } - if ((kim_model_support_for_particleEnergy == optional) && (eflag_atom != 1)) + if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_optional) + && (eflag_atom != 1)) { - kimerror = kimerror || pargs->SetArgumentPointer( - partialParticleEnergy, + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, reinterpret_cast(NULL)); } - else if (kim_model_support_for_particleEnergy != notSupported) + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_notSupported)) { - kimerror = kimerror || pargs->SetArgumentPointer(partialParticleEnergy, - eatom); + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, eatom); } // Set KIM pointer appropriately for forces - if (kim_model_support_for_forces == notSupported) + if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported)) { - kimerror = kimerror || pargs->SetArgumentPointer( - partialForces, + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialForces, reinterpret_cast(NULL)); } else { - kimerror = kimerror || pargs->SetArgumentPointer(partialForces, - &(atom->f[0][0])); + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, &(atom->f[0][0])); } // Set KIM pointer appropriately for particleVirial - if ((kim_model_support_for_particleVirial == required) && (vflag_atom != 1)) + if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_required) + && (vflag_atom != 1)) { // reallocate per-atom virial array if necessary if (atom->nmax > maxeatom) @@ -877,16 +903,20 @@ void PairKIM::set_argument_pointers() memory->create(vatom,comm->nthreads*maxvatom,6,"pair:vatom"); } } - if ((kim_model_support_for_particleVirial == optional) && (vflag_atom != 1)) + if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_optional) + && (vflag_atom != 1)) { - kimerror = kimerror || pargs->SetArgumentPointer( - partialParticleVirial, + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial, reinterpret_cast(NULL)); } - else if (kim_model_support_for_particleVirial != notSupported) + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { - kimerror = kimerror || pargs->SetArgumentPointer(partialParticleEnergy, - &(vatom[0][0])); + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, &(vatom[0][0])); } if (kimerror) @@ -913,39 +943,39 @@ void PairKIM::set_lmps_flags() // determine unit system and set lmps_units flag if ((strcmp(update->unit_style,"real")==0)) { lmps_units = REAL; - lengthUnit = KIM::LENGTH_UNIT::A; - energyUnit = KIM::ENERGY_UNIT::kcal_mol; - chargeUnit = KIM::CHARGE_UNIT::e; - temperatureUnit = KIM::TEMPERATURE_UNIT::K; - timeUnit = KIM::TIME_UNIT::fs; + lengthUnit = KIM_LENGTH_UNIT_A; + energyUnit = KIM_ENERGY_UNIT_kcal_mol; + chargeUnit = KIM_CHARGE_UNIT_e; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_fs; } else if ((strcmp(update->unit_style,"metal")==0)) { lmps_units = METAL; - lengthUnit = KIM::LENGTH_UNIT::A; - energyUnit = KIM::ENERGY_UNIT::eV; - chargeUnit = KIM::CHARGE_UNIT::e; - temperatureUnit = KIM::TEMPERATURE_UNIT::K; - timeUnit = KIM::TIME_UNIT::ps; + lengthUnit = KIM_LENGTH_UNIT_A; + energyUnit = KIM_ENERGY_UNIT_eV; + chargeUnit = KIM_CHARGE_UNIT_e; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_ps; } else if ((strcmp(update->unit_style,"si")==0)) { lmps_units = SI; - lengthUnit = KIM::LENGTH_UNIT::m; - energyUnit = KIM::ENERGY_UNIT::J; - chargeUnit = KIM::CHARGE_UNIT::C; - temperatureUnit = KIM::TEMPERATURE_UNIT::K; - timeUnit = KIM::TIME_UNIT::s; + lengthUnit = KIM_LENGTH_UNIT_m; + energyUnit = KIM_ENERGY_UNIT_J; + chargeUnit = KIM_CHARGE_UNIT_C; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_s; } else if ((strcmp(update->unit_style,"cgs")==0)) { lmps_units = CGS; - lengthUnit = KIM::LENGTH_UNIT::cm; - energyUnit = KIM::ENERGY_UNIT::erg; - chargeUnit = KIM::CHARGE_UNIT::statC; - temperatureUnit = KIM::TEMPERATURE_UNIT::K; - timeUnit = KIM::TIME_UNIT::s; + lengthUnit = KIM_LENGTH_UNIT_cm; + energyUnit = KIM_ENERGY_UNIT_erg; + chargeUnit = KIM_CHARGE_UNIT_statC; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_s; } else if ((strcmp(update->unit_style,"electron")==0)) { lmps_units = ELECTRON; - lengthUnit = KIM::LENGTH_UNIT::Bohr; - energyUnit = KIM::ENERGY_UNIT::Hartree; - chargeUnit = KIM::CHARGE_UNIT::e; - temperatureUnit = KIM::TEMPERATURE_UNIT::K; - timeUnit = KIM::TIME_UNIT::fs; + lengthUnit = KIM_LENGTH_UNIT_Bohr; + energyUnit = KIM_ENERGY_UNIT_Hartree; + chargeUnit = KIM_CHARGE_UNIT_e; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_fs; } else if ((strcmp(update->unit_style,"lj")==0)) { error->all(FLERR,"LAMMPS unit_style lj not supported by KIM models"); } else { @@ -959,75 +989,85 @@ void PairKIM::set_lmps_flags() void PairKIM::set_kim_model_has_flags() { - { // BEGIN enclosing scope for using directives - using namespace KIM::COMPUTE_ARGUMENT_NAME; - using namespace KIM::SUPPORT_STATUS; - int numberOfComputeArgumentNames; - GetNumberOfComputeArgumentNames(&numberOfComputeArgumentNames); + KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames( + &numberOfComputeArgumentNames); for (int i = 0; i < numberOfComputeArgumentNames; ++i) { - KIM::ComputeArgumentName computeArgumentName; - int kimerror = GetComputeArgumentName(i, &computeArgumentName); - KIM::SupportStatus supportStatus; - kimerror = pargs->GetArgumentSupportStatus(computeArgumentName, - &supportStatus); + KIM_ComputeArgumentName computeArgumentName; + int kimerror = KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName( + i, &computeArgumentName); + KIM_SupportStatus supportStatus; + kimerror = KIM_ComputeArguments_GetArgumentSupportStatus( + pargs, computeArgumentName, &supportStatus); - if (computeArgumentName == partialEnergy) + if (KIM_ComputeArgumentName_Equal(computeArgumentName, + KIM_COMPUTE_ARGUMENT_NAME_partialEnergy) + ) kim_model_support_for_energy = supportStatus; - else if (computeArgumentName == partialForces) + else if (KIM_ComputeArgumentName_Equal( + computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces) + ) kim_model_support_for_forces = supportStatus; - else if (computeArgumentName == partialParticleEnergy) + else if + (KIM_ComputeArgumentName_Equal( + computeArgumentName, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy)\ + ) kim_model_support_for_particleEnergy = supportStatus; - else if (computeArgumentName == partialParticleVirial) + else if + (KIM_ComputeArgumentName_Equal( + computeArgumentName, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial) + ) kim_model_support_for_particleVirial = supportStatus; - else if (supportStatus == required) + else if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required) + ) { std::stringstream msg; msg << "KIM Model requires unsupported compute argument: " - << computeArgumentName.String(); + << KIM_ComputeArgumentName_ToString(computeArgumentName); error->all(FLERR, msg.str().c_str()); } } - if (kim_model_support_for_energy == notSupported) + if (KIM_SupportStatus_Equal(kim_model_support_for_energy, + KIM_SUPPORT_STATUS_notSupported)) error->warning(FLERR,"KIM Model does not provide `partialEnergy'; " "Potential energy will be zero"); - if (kim_model_support_for_forces == notSupported) + if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported)) error->warning(FLERR,"KIM Model does not provide `partialForce'; " "Forces will be zero"); - if (kim_model_support_for_particleEnergy == notSupported) + if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_notSupported)) error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " "energy per atom will be zero"); - if (kim_model_support_for_particleVirial == notSupported) + if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) error->warning(FLERR,"KIM Model does not provide `partialParticleVirial'; " "virial per atom will be zero"); - } // END enclosing scope for using directives + int numberOfComputeCallbackNames; + KIM_COMPUTE_CALLBACK_NAME_GetNumberOfComputeCallbackNames( + &numberOfComputeCallbackNames); + for (int i = 0; i < numberOfComputeCallbackNames; ++i) + { + KIM_ComputeCallbackName computeCallbackName; + int kimerror = KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName( + i, &computeCallbackName); + KIM_SupportStatus supportStatus; + kimerror = KIM_ComputeArguments_GetCallbackSupportStatus( + pargs, computeCallbackName, &supportStatus); - { // BEGIN enclosing scope for using directives - using namespace KIM::COMPUTE_CALLBACK_NAME; - using namespace KIM::SUPPORT_STATUS; - - int numberOfComputeCallbackNames; - GetNumberOfComputeCallbackNames(&numberOfComputeCallbackNames); - for (int i = 0; i < numberOfComputeCallbackNames; ++i) + if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required)) { - KIM::ComputeCallbackName computeCallbackName; - int kimerror = GetComputeCallbackName(i, &computeCallbackName); - KIM::SupportStatus supportStatus; - kimerror = pargs->GetCallbackSupportStatus(computeCallbackName, - &supportStatus); - - if (supportStatus == required) - { - error->all(FLERR,"KIM Model requires unsupported compute callback"); - } + error->all(FLERR,"KIM Model requires unsupported compute callback"); } - } // END enclosing scope for using directives + } - return; + return; } diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index eef6e0345b..1b8051ea1e 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -50,7 +50,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package + Designed for use with the kim-api-v2.0.0-beta.2 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS @@ -65,7 +65,9 @@ PairStyle(kim,PairKIM) // includes from KIM & LAMMPS class KIM_API_model; #include "pair.h" -#include "KIM_SimulatorHeaders.hpp" +extern "C" { +#include "KIM_SimulatorHeaders.h" +} #include @@ -113,20 +115,20 @@ namespace LAMMPS_NS { bool lmps_using_molecular; enum unit_sys {REAL, METAL, SI, CGS, ELECTRON}; unit_sys lmps_units; - KIM::LengthUnit lengthUnit; - KIM::EnergyUnit energyUnit; - KIM::ChargeUnit chargeUnit; - KIM::TemperatureUnit temperatureUnit; - KIM::TimeUnit timeUnit; + KIM_LengthUnit lengthUnit; + KIM_EnergyUnit energyUnit; + KIM_ChargeUnit chargeUnit; + KIM_TemperatureUnit temperatureUnit; + KIM_TimeUnit timeUnit; - KIM::Model * pkim; - KIM::ComputeArguments * pargs; + KIM_Model * pkim; + KIM_ComputeArguments * pargs; // values set in set_kim_model_has_flags(), called by kim_init() - KIM::SupportStatus kim_model_support_for_energy; - KIM::SupportStatus kim_model_support_for_forces; - KIM::SupportStatus kim_model_support_for_particleEnergy; - KIM::SupportStatus kim_model_support_for_particleVirial; + KIM_SupportStatus kim_model_support_for_energy; + KIM_SupportStatus kim_model_support_for_forces; + KIM_SupportStatus kim_model_support_for_particleEnergy; + KIM_SupportStatus kim_model_support_for_particleVirial; // values set in kim_init() bool kim_init_ok; From 9ed6f2fc4395ec962e6c9c849f71f3f329664e56 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 4 Nov 2018 20:10:04 -0600 Subject: [PATCH 35/49] Adjust lib/kim install script and settings --- lib/kim/Install.py | 55 ++++++++++++++++------------------------- lib/kim/Makefile.lammps | 17 +++++++++++-- lib/kim/README | 30 +++++++++------------- 3 files changed, 48 insertions(+), 54 deletions(-) diff --git a/lib/kim/Install.py b/lib/kim/Install.py index da0dcd2789..815827b645 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -9,24 +9,24 @@ import sys,os,re,subprocess # help message help = """ -Syntax from src dir: make lib-kim args="-b -v version -a kim-name" +Syntax from src dir: make lib-kim args="-b -v version -a kim-name" or: make lib-kim args="-b -a everything" or: make lib-kim args="-n -a kim-name" - or: make lib-kim args="-p /usr/local/lib/kim-api-v2 -a kim-name" -Syntax from lib dir: python Install.py -b -v version -a kim-name + or: make lib-kim args="-p /home/bob/kim -a kim-name" +Syntax from lib dir: python Install.py -b -v version -a kim-name or: python Install.py -b -a everything or: python Install.py -n -a kim-name - or: python Install.py -p /usr/local/lib/kim-api-v2 -a kim-name + or: python Install.py -p /home/bob/kim -a kim-name specify one or more options, order does not matter -v = version of KIM API library to use - default = kim-api-v2.0.0-beta.1 (current as of July 2018) + default = kim-api-v2.0.0-beta.2 (current as of November 2018) -b = download and build base KIM API library with example Models this will delete any previous installation in the current folder -n = do NOT download and build base KIM API library. Use an existing installation - -p = specify location of KIM API installation (implies -n) + -p = specify install prefix of KIM API installation (implies -n) -a = add single KIM model or model driver with kim-name to existing KIM API lib (see example below). If kim-name = everything, then rebuild KIM API library with @@ -109,7 +109,7 @@ nargs = len(args) if nargs == 0: error() thisdir = os.environ['PWD'] -version = "kim-api-v2.0.0-beta.1" +version = "kim-api-v2.0.0-beta.2" buildflag = False everythingflag = False @@ -160,13 +160,10 @@ if pathflag: error() # configure LAMMPS to use existing kim-api installation - with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile: - mkfile.write("KIM_INSTALL_DIR=%s\n\n" % kimdir) - mkfile.write(".DUMMY: print_dir\n\n") - mkfile.write("print_dir:\n") - mkfile.write(" @printf $(KIM_INSTALL_DIR)\n") + with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: + pffile.write("%s" % kimdir) - print("Created %s/Makefile.KIM_DIR\n using %s" % (thisdir,kimdir)) + print("Created %s/kim-prefix.txt\n using %s" % (thisdir,kimdir)) else: kimdir = os.path.join(os.path.abspath(thisdir), "installed-" + version) @@ -182,13 +179,10 @@ if buildflag: # configure LAMMPS to use kim-api to be installed - with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile: - mkfile.write("KIM_INSTALL_DIR=%s\n\n" % kimdir) - mkfile.write(".DUMMY: print_dir\n\n") - mkfile.write("print_dir:\n") - mkfile.write(" @printf $(KIM_INSTALL_DIR)\n") + with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: + pffile.write("%s" % kimdir) - print("Created %s/Makefile.KIM_DIR\n using %s" % (thisdir,kimdir)) + print("Created %s/kim-prefix.txt\n using %s" % (thisdir,kimdir)) # download entire kim-api tarball @@ -201,32 +195,25 @@ if buildflag: # configure kim-api print("Configuring kim-api ...") - cmd = 'cd "%s/%s"; ./configure --prefix="%s"' % (thisdir,version,kimdir) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + cmd = 'cd "%s/%s" && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % (thisdir,version,kimdir) + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + if verboseflag: print(txt.decode("UTF-8")) # build kim-api print("Building kim-api ...") - cmd = 'cd "%s/%s"; make' % (thisdir,version) + cmd = 'cd "%s/%s/build" && make' % (thisdir,version) txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if verboseflag: print(txt.decode("UTF-8")) # install kim-api print("Installing kim-api ...") - cmd = 'cd "%s/%s"; make install' % (thisdir,version) + cmd = 'cd "%s/%s/build" && make install' % (thisdir,version) txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if verboseflag: print(txt.decode("UTF-8")) # remove source files - print("Building and installing example Models") - cmd = 'cd "%s/%s/examples"; make model-drivers-all-system' % (thisdir,version) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print (txt.decode("UTF-8")) - cmd = 'cd "%s/%s/examples"; make models-all-system' % (thisdir,version) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print (txt.decode("UTF-8")) - print("Removing kim-api source and build files ...") cmd = 'cd "%s"; rm -rf %s; rm -rf %s.txz' % (thisdir,version,version) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) @@ -241,9 +228,9 @@ if buildflag: # add single OpenKIM model if addflag: - makefile_path = os.path.join(thisdir, "Makefile.KIM_DIR") - if os.path.isfile(makefile_path): - cmd = 'make --no-print-directory -f %s print_dir' % makefile_path + pf_path = os.path.join(thisdir, "kim-prefix.txt") + if os.path.isfile(pf_path): + cmd = 'cat %s' % pf_path kimdir = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if not os.path.isdir(kimdir): diff --git a/lib/kim/Makefile.lammps b/lib/kim/Makefile.lammps index 1c2ab417d5..7c9fc7c5f7 100644 --- a/lib/kim/Makefile.lammps +++ b/lib/kim/Makefile.lammps @@ -13,5 +13,18 @@ # Settings that the LAMMPS build will import when this package is installed -kim_SYSINC = $(shell pkg-config --cflags libkim-api-v2) -kim_SYSLIB = $(shell pkg-config --libs libkim-api-v2) + +ifeq ($(strip $(shell pkg-config --version)),) + $(error 'pkg-config' not found, but is required to configure the KIM API) +endif + +kim_PREFIX := $(shell cat ../../lib/kim/kim-prefix.txt 2> /dev/null) +kim_PREFIX := $(if $(kim_PREFIX),$(kim_PREFIX)/lib/pkgconfig,) +kim_PREFIX := $(if $(shell printf -- "$${PKG_CONFIG_PATH}"),$(kim_PREFIX):$(shell printf -- "$${PKG_CONFIG_PATH}"),$(kim_PREFIX)) + +kim_SYSINC := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --cflags libkim-api-v2 2> /dev/null) +kim_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api-v2 2> /dev/null) + +ifeq ($(strip $(kim_SYSINC)),) + $(error 'pkg-config' could not find an installed KIM API library.) +endif diff --git a/lib/kim/README b/lib/kim/README index 6bcad18ce0..7cf8f9bb7d 100644 --- a/lib/kim/README +++ b/lib/kim/README @@ -3,10 +3,9 @@ is required to use the KIM package and its pair_style kim command in a LAMMPS input script. Information about the KIM project can be found at https://openkim.org. -The KIM project is lead by Ellad Tadmor and Ryan Elliott (U Minn) and -James Sethna (Cornell U). Ryan Elliott is the main developer for the -KIM API and he also maintains the code that implements the pair_style -kim command. +The KIM project is lead by Ellad Tadmor and Ryan Elliott (U Minn). +Ryan Elliott is the main developer for the KIM API and he also +maintains the code that implements the pair_style kim command. You can type "make lib-kim" from the src directory to see help on how to download and build this library via make commands, or you can @@ -21,7 +20,7 @@ Instructions: 1. Configure lammps for use with the kim-api library installed in this directory # replace X.Y.Z as appropriate here and below -$ printf "KIM_INSTALL_DIR=${PWD}/installed-kim-api-vX.Y.Z\n" > ./Makefile.KIM_DIR +$ printf "${PWD}/installed-kim-api-vX.Y.Z" > ./kim-prefix.txt 2. Download and unpack the kim-api @@ -30,26 +29,21 @@ $ tar zxvf kim-api-vX.Y.Z.txz # configure the kim-api $ cd kim-api-vX.Y.Z -$ ./configure --prefix=${PWD}/../installed-kim-api-vX.Y.Z +$ mkdir build && cd build +$ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-vX.Y.Z 3. Build and install the kim-api and model $ make $ make install -4. To install the example models shipped with the kim-api - -$ cd examples -$ make model-drivers-all-system -$ make models-all-system -$ cd ../.. - -5. Remove source and build files +4. Remove source and build files +$ cd ../../ $ rm -rf kim-api-vX.Y.Z $ rm -rf kim-api-vX.Y.Z.txz -6. To add items do the following (replace the kim item name with your +5. To add items do the following (replace the kim item name with your desired value) $ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-vX-activate @@ -65,6 +59,6 @@ $ cd lammpos/src $ make yes-kim $ make g++ (or whatever target you wish) -Note that the Makefile.lammps and Makefile.KIM_DIR files in this directory -are required to allow the LAMMPS build to find the necessary KIM files. -You should not normally need to edit these files. +Note that the Makefile.lammps file in this directory is required to +allow the LAMMPS build to find the necessary KIM files. You should +not normally need to edit these files. From dd61ded311abda89440ee62de0b740684c5acc12 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 5 Nov 2018 09:24:02 -0600 Subject: [PATCH 36/49] Update cmake build to work with cmake-based KIM --- cmake/CMakeLists.txt | 46 ++++++++++++------------- cmake/Modules/FindKIM-API-V2.cmake | 55 ++++++++++++++++++++++++++++++ cmake/Modules/FindKIM.cmake | 22 ------------ 3 files changed, 78 insertions(+), 45 deletions(-) create mode 100644 cmake/Modules/FindKIM-API-V2.cmake delete mode 100644 cmake/Modules/FindKIM.cmake diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 418bdd0dba..5402ac1987 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -454,7 +454,7 @@ endif() if(PKG_LATTE) option(DOWNLOAD_LATTE "Download latte (instead of using the system's one)" OFF) if(DOWNLOAD_LATTE) - if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR + if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7") endif() message(STATUS "LATTE not found - we will build our own") @@ -485,15 +485,15 @@ if(PKG_USER-SCAFACOS) ExternalProject_Add(scafacos_build URL https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz URL_MD5 bd46d74e3296bd8a444d731bb10c1738 - CONFIGURE_COMMAND /configure --prefix= - --disable-doc + CONFIGURE_COMMAND /configure --prefix= + --disable-doc --enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m --with-internal-fftw --with-internal-pfft --with-internal-pnfft - $<$:--with-pic> - FC=${CMAKE_MPI_Fortran_COMPILER} - CXX=${CMAKE_MPI_CXX_COMPILER} + $<$:--with-pic> + FC=${CMAKE_MPI_Fortran_COMPILER} + CXX=${CMAKE_MPI_CXX_COMPILER} CC=${CMAKE_MPI_C_COMPILER} F77= ) @@ -547,7 +547,7 @@ if(PKG_USER-SMD) if(DOWNLOAD_EIGEN3) include(ExternalProject) ExternalProject_Add(Eigen3_build - URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz + URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz URL_MD5 1a47e78efe365a97de0c022d127607c3 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) @@ -588,23 +588,23 @@ if(PKG_KIM) if(DOWNLOAD_KIM) include(ExternalProject) ExternalProject_Add(kim_build - URL https://github.com/openkim/kim-api/archive/v1.9.5.tar.gz - URL_MD5 9f66efc128da33039e30659f36fc6d00 - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND /configure --prefix= + URL https://s3.openkim.org/kim-api/kim-api-v2.0.0-beta.2.txz + URL_MD5 1fbdbb734059cf0dc9d807e6dd6cc8ea + BINARY_DIR build + CMAKE_ARGS -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_Fortran_COMPILER=gfortran-8 -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release ) ExternalProject_get_property(kim_build INSTALL_DIR) - set(KIM_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v1) - set(KIM_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v1.so) + set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) + set(KIM-API-V2_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v2.2${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LAMMPS_DEPS kim_build) else() - find_package(KIM) - if(NOT KIM_FOUND) - message(FATAL_ERROR "KIM not found, help CMake to find it by setting KIM_LIBRARY and KIM_INCLUDE_DIR, or set DOWNLOAD_KIM=ON to download it") + find_package(KIM-API-V2) + if(NOT KIM-API-V2_FOUND) + message(FATAL_ERROR "KIM not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") endif() endif() - list(APPEND LAMMPS_LINK_LIBS ${KIM_LIBRARIES}) - include_directories(${KIM_INCLUDE_DIRS}) + list(APPEND LAMMPS_LINK_LIBS ${KIM-API-V3_LIBRARIES}) + include_directories(${KIM-API-V2_INCLUDE_DIRS}) endif() if(PKG_MESSAGE) @@ -645,7 +645,7 @@ if(PKG_MSCG) find_package(GSL REQUIRED) option(DOWNLOAD_MSCG "Download latte (instead of using the system's one)" OFF) if(DOWNLOAD_MSCG) - if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR + if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7") endif() include(ExternalProject) @@ -1020,7 +1020,7 @@ if(PKG_USER-INTEL) endif() if(PKG_GPU) - if (CMAKE_VERSION VERSION_LESS "3.1") + if (CMAKE_VERSION VERSION_LESS "3.1") message(FATAL_ERROR "For the GPU package you need at least cmake-3.1") endif() set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU) @@ -1224,7 +1224,7 @@ if(BUILD_EXE) add_dependencies(lmp ${LAMMPS_DEPS}) endif() endif() - + set_target_properties(lmp PROPERTIES OUTPUT_NAME ${LAMMPS_BINARY}) install(TARGETS lmp DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${LAMMPS_DOC_DIR}/lammps.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME ${LAMMPS_BINARY}.1) @@ -1361,14 +1361,14 @@ message(STATUS "<<< Build configuration >>> get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) list (FIND LANGUAGES "Fortran" _index) if (${_index} GREATER -1) - message(STATUS "Fortran Compiler ${CMAKE_Fortran_COMPILER} + message(STATUS "Fortran Compiler ${CMAKE_Fortran_COMPILER} Type ${CMAKE_Fortran_COMPILER_ID} Version ${CMAKE_Fortran_COMPILER_VERSION} Fortran Flags ${CMAKE_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS_${BTYPE}}") endif() list (FIND LANGUAGES "C" _index) if (${_index} GREATER -1) - message(STATUS "C Compiler ${CMAKE_C_COMPILER} + message(STATUS "C Compiler ${CMAKE_C_COMPILER} Type ${CMAKE_C_COMPILER_ID} Version ${CMAKE_C_COMPILER_VERSION} C Flags ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}") diff --git a/cmake/Modules/FindKIM-API-V2.cmake b/cmake/Modules/FindKIM-API-V2.cmake new file mode 100644 index 0000000000..0cc947e139 --- /dev/null +++ b/cmake/Modules/FindKIM-API-V2.cmake @@ -0,0 +1,55 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the Common Development +# and Distribution License Version 1.0 (the "License"). +# +# You can obtain a copy of the license at +# http://www.opensource.org/licenses/CDDL-1.0. See the License for the +# specific language governing permissions and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each file and +# include the License file in a prominent location with the name LICENSE.CDDL. +# If applicable, add the following below this CDDL HEADER, with the fields +# enclosed by brackets "[]" replaced with your own identifying information: +# +# Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2013--2018, Regents of the University of Minnesota. +# All rights reserved. +# +# Contributors: +# Richard Berger +# Christoph Junghans +# Ryan S. Elliott +# + +# +# Release: This file is part of the kim-api.git repository. +# + + +# - Find KIM-API-V2 +# +# sets standard pkg_check_modules variables plus: +# +# KIM-API-V2-CMAKE_C_COMPILER +# KIM-API-V2-CMAKE_CXX_COMPILER +# KIM-API-V2-CMAKE_Fortran_COMPILER +# +find_package(PkgConfig REQUIRED) +include(FindPackageHandleStandardArgs) + +pkg_check_modules(KIM-API-V2 REQUIRED libkim-api-v2>=2.0) + +pkg_get_variable(KIM-API-V2-CMAKE_C_COMPILER libkim-api-v2 CMAKE_C_COMPILER) +pkg_get_variable(KIM-API-V2-CMAKE_CXX_COMPILER libkim-api-v2 CMAKE_CXX_COMPILER) +pkg_get_variable(KIM-API-V2_CMAKE_Fortran_COMPILER libkim-api-v2 CMAKE_Fortran_COMPILER) + +# handle the QUIETLY and REQUIRED arguments and set KIM-API-V2_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(KIM-API-V2 REQUIRED_VARS KIM-API-V2_LIBRARIES) diff --git a/cmake/Modules/FindKIM.cmake b/cmake/Modules/FindKIM.cmake deleted file mode 100644 index e29f26e01d..0000000000 --- a/cmake/Modules/FindKIM.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# - Find kim -# Find the native KIM headers and libraries. -# -# KIM_INCLUDE_DIRS - where to find kim.h, etc. -# KIM_LIBRARIES - List of libraries when using kim. -# KIM_FOUND - True if kim found. -# - -find_path(KIM_INCLUDE_DIR KIM_SimulatorHeaders.hpp PATH_SUFFIXES kim-api-v2) - -find_library(KIM_LIBRARY NAMES kim-api-v2) - -set(KIM_LIBRARIES ${KIM_LIBRARY}) -set(KIM_INCLUDE_DIRS ${KIM_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set KIM_FOUND to TRUE -# if all listed variables are TRUE - -find_package_handle_standard_args(KIM DEFAULT_MSG KIM_LIBRARY KIM_INCLUDE_DIR) - -mark_as_advanced(KIM_INCLUDE_DIR KIM_LIBRARY ) From 29ae88e309fd02a3b4fbb3f882f498258096a794 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 5 Nov 2018 09:37:35 -0600 Subject: [PATCH 37/49] Update docs for KIM --- doc/src/Build_extras.txt | 44 ++++++++++++------------- doc/src/Errors_messages.txt | 8 ----- doc/src/Packages_details.txt | 63 +++++++++++++++++------------------- doc/src/pair_kim.txt | 2 +- 4 files changed, 51 insertions(+), 66 deletions(-) diff --git a/doc/src/Build_extras.txt b/doc/src/Build_extras.txt index d256a1afc8..5f4ad6ee69 100644 --- a/doc/src/Build_extras.txt +++ b/doc/src/Build_extras.txt @@ -63,7 +63,7 @@ available on your system. If CMake cannot find the library, you can set these variables: --D ZLIB_INCLUDE_DIR=path # path to zlib.h header file +-D ZLIB_INCLUDE_DIR=path # path to zlib.h header file -D ZLIB_LIBRARIES=path # path to libz.a (.so) file :pre [Traditional make]: @@ -150,7 +150,7 @@ package uses the library settings from the lib/gpu/Makefile.machine used to build the GPU library. :line - + KIM package :h4,link(kim) To build with this package, the KIM library must be downloaded and @@ -176,16 +176,12 @@ package?" page. [CMake build]: --D DOWNLOAD_KIM=value # download OpenKIM API v1 for build, value = no (default) or yes --D KIM_LIBRARY=path # KIM library file (only needed if a custom location) --D KIM_INCLUDE_DIR=path # KIM include directory (only needed if a custom location) :pre +-D DOWNLOAD_KIM=value # download OpenKIM API v1 for build, value = no (default) or yes :pre If DOWNLOAD_KIM is set, the KIM library will be downloaded and built inside the CMake build directory. If the KIM library is already on -your system (in a location CMake cannot find it), KIM_LIBRARY is the -filename (plus path) of the KIM library file, not the directory the -library file is in. KIM_INCLUDE_DIR is the directory the KIM include -file is in. +your system (in a location CMake cannot find it), set the PKG_CONFIG_PATH +environment variable so that libkim-api-v2 can be found. [Traditional make]: @@ -199,8 +195,8 @@ make lib-kim args="-b " # (re-)install KIM API lib with only example models make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver -make lib-kim args="-p /usr/local/kim-api" # use an existing KIM API installation at the provided location -make lib-kim args="-p /usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre +make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location +make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre :line @@ -254,7 +250,7 @@ For NVIDIA GPUs using CUDA, set these 4 variables: -D KOKKOS_ARCH="archCPU;archGPU" # archCPU = CPU from list above that is hosting the GPU # archGPU = GPU from list above -D KOKKOS_ENABLE_CUDA=yes --D KOKKOS_ENABLE_OPENMP=yes +-D KOKKOS_ENABLE_OPENMP=yes -D CMAKE_CXX_COMPILER=wrapper # wrapper = full path to Cuda nvcc wrapper :pre The wrapper value is the Cuda nvcc compiler wrapper provided in the @@ -296,7 +292,7 @@ export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper CC = mpicxx :pre :line - + LATTE package :h4,link(latte) To build with this package, you must download and build the LATTE @@ -324,7 +320,7 @@ args: make lib-latte # print help message make lib-latte args="-b" # download and build in lib/latte/LATTE-master make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte -make lib-latte args="-b -m gfortran" # download and build in lib/latte and +make lib-latte args="-b -m gfortran" # download and build in lib/latte and # copy Makefile.lammps.gfortran to Makefile.lammps :pre @@ -335,7 +331,7 @@ also check that the Makefile.lammps file you create is appropriate for the compiler you use on your system to build LATTE. :line - + MEAM package :h4,link(meam) NOTE: the use of the MEAM package is discouraged, as it has been @@ -378,7 +374,7 @@ EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. :line - + MESSAGE package :h4,link(message) This package can optionally include support for messaging via sockets, @@ -407,7 +403,7 @@ existing Makefile.lammps.* and has settings to link with the ZeroMQ library if requested in the build. :line - + MSCG package :h4,link(mscg) To build with this package, you must download and build the MS-CG @@ -419,7 +415,7 @@ lib/mscg/README and MSCG/Install files for more details. [CMake build]: -D DOWNLOAD_MSCG=value # download MSCG for build, value = no (default) or yes --D MSCG_LIBRARY=path # MSCG library file (only needed if a custom location) +-D MSCG_LIBRARY=path # MSCG library file (only needed if a custom location) -D MSCG_INCLUDE_DIR=path # MSCG include directory (only needed if a custom location) :pre If DOWNLOAD_MSCG is set, the MSCG library will be downloaded and built @@ -464,7 +460,7 @@ line of your Makefile.machine. See src/MAKE/OPTIONS/Makefile.opt for an example. :line - + POEMS package :h4,link(poems) [CMake build]: @@ -493,7 +489,7 @@ for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. :line - + PYTHON package :h4,link(python) Building with the PYTHON package requires you have a Python shared @@ -520,7 +516,7 @@ Makefile.lammps.* file (and copy it to Makefile.lammps) if the LAMMPS build fails. :line - + REAX package :h4,link(reax) NOTE: the use of the REAX package and its "pair_style @@ -570,7 +566,7 @@ library"_voro-home. [CMake build]: -D DOWNLOAD_VORO=value # download Voro++ for build, value = no (default) or yes --D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location) +-D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location) -D VORO_INCLUDE_DIR=path # Voro++ include directory (only needed if at custom location) :pre If DOWNLOAD_VORO is set, the Voro++ library will be downloaded and @@ -869,7 +865,7 @@ Quantum ESPRESSO known to work with this QM/MM interface was version [CMake build]: The CMake build system currently does not support building the full -QM/MM-capable hybrid executable of LAMMPS and QE called pwqmmm.x. +QM/MM-capable hybrid executable of LAMMPS and QE called pwqmmm.x. You must use the traditional make build for this package. [Traditional make]: @@ -939,7 +935,7 @@ Coulomb solver library"_scafacos-home [CMake build]: -D DOWNLOAD_SCAFACOS=value # download ScaFaCoS for build, value = no (default) or yes --D SCAFACOS_LIBRARY=path # ScaFaCos library file (only needed if at custom location) +-D SCAFACOS_LIBRARY=path # ScaFaCos library file (only needed if at custom location) -D SCAFACOS_INCLUDE_DIR=path # ScaFaCoS include directory (only needed if at custom location) :pre If DOWNLOAD_SCAFACOS is set, the ScaFaCoS library will be downloaded diff --git a/doc/src/Errors_messages.txt b/doc/src/Errors_messages.txt index 695b949f7e..3dc93044c8 100644 --- a/doc/src/Errors_messages.txt +++ b/doc/src/Errors_messages.txt @@ -6994,12 +6994,6 @@ The atom style defined does not have this attribute. :dd The atom style defined does not have these attributes. :dd -{KIM neighbor iterator exceeded range} :dt - -This should not happen. It likely indicates a bug -in the KIM implementation of the interatomic potential -where it is requesting neighbors incorrectly. :dd - {KOKKOS package does not yet support comm_style tiled} :dt Self-explanatory. :dd @@ -10193,8 +10187,6 @@ Self-explanatory. :dd {Unrecognized virial argument in pair_style command} :dt -Only two options are supported: LAMMPSvirial and KIMvirial :dd - {Unsupported mixing rule in kspace_style ewald/disp} :dt Only geometric mixing is supported. :dd diff --git a/doc/src/Packages_details.txt b/doc/src/Packages_details.txt index 031858e846..7365e986e5 100644 --- a/doc/src/Packages_details.txt +++ b/doc/src/Packages_details.txt @@ -203,7 +203,7 @@ available on your system. [Author:] Axel Kohlmeyer (Temple U). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -284,7 +284,7 @@ also the "KOKKOS"_#PKG-KOKKOS package, which has GPU-enabled styles. [Authors:] Mike Brown (Intel) while at Sandia and ORNL and Trung Nguyen (Northwestern U) while at ORNL. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -345,14 +345,13 @@ system. Information about the KIM project can be found at its website: https://openkim.org. The KIM project is led by Ellad Tadmor and Ryan -Elliott (U Minnesota) and James Sethna (Cornell U). +Elliott (U Minnesota). [Authors:] Ryan Elliott (U Minnesota) is the main developer for the KIM API which the "pair_style kim"_pair_kim.html command uses. He -developed the pair style in collaboration with Valeriu Smirichinski (U -Minnesota). +developed the pair style. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -398,7 +397,7 @@ which was developed by Carter Edwards, Christian Trott, and others at Sandia, and which is included in the LAMMPS distribution in lib/kokkos. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -546,7 +545,7 @@ and user interface. [Author:] Greg Wagner (Northwestern U) while at Sandia. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -679,7 +678,7 @@ system. library was developed by Jacob Wagner in Greg Voth's group at the University of Chicago. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -711,7 +710,7 @@ have styles optimized for CPU performance. [Authors:] James Fischer (High Performance Technologies), David Richie, and Vincent Natoli (Stone Ridge Technolgy). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -768,7 +767,7 @@ connections at hinge points. [Author:] Rudra Mukherjee (JPL) while at RPI. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -800,7 +799,7 @@ shared library available on your system, which needs to be a Python 2 version, 2.6 or later. Python 3 is not yet supported. See the lib/python/README for more details. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -848,7 +847,7 @@ as bonds are created and destroyed. [Author:] Aidan Thompson (Sandia). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1021,7 +1020,7 @@ system. library was written by Chris Rycroft (Harvard U) while at UC Berkeley and LBNL. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1048,7 +1047,7 @@ atomic information to continuum fields. [Authors:] Reese Jones, Jeremy Templeton, Jon Zimmerman (Sandia). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1075,7 +1074,7 @@ model. [Author:] Ilya Valuev (JIHT, Russia). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1098,7 +1097,7 @@ This package provides "fix bocs"_fix_bocs.html, a modified version of "fix npt"_fix_nh.html which includes the pressure correction to the barostat as outlined in: -N. J. H. Dunn and W. G. Noid, "Bottom-up coarse-grained models that +N. J. H. Dunn and W. G. Noid, "Bottom-up coarse-grained models that accurately describe the structure, pressure, and compressibility of molecular liquids," J. Chem. Phys. 143, 243148 (2015). @@ -1183,7 +1182,7 @@ and Jerome Henin (LISM, CNRS, Marseille, France), originally for the NAMD MD code, but with portability in mind. Axel Kohlmeyer (Temple U) provided the interface to LAMMPS. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1363,7 +1362,7 @@ system. [Author:] Pierre de Buyl (KU Leuven) created both the package and the H5MD format. -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1401,7 +1400,7 @@ NOTE: the USER-INTEL package contains styles that require using the [Author:] Mike Brown (Intel). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1571,17 +1570,17 @@ USER-MOFFF package :link(PKG-USER-MOFFF),h4 [Contents:] Pair, angle and improper styles needed to employ the MOF-FF -force field by Schmid and coworkers with LAMMPS. +force field by Schmid and coworkers with LAMMPS. MOF-FF is a first principles derived force field with the primary aim -to simulate MOFs and related porous framework materials, using spherical +to simulate MOFs and related porous framework materials, using spherical Gaussian charges. It is described in S. Bureekaew et al., Phys. Stat. Sol. B 2013, 250, 1128-1141. -For the usage of MOF-FF see the example in the example directory as +For the usage of MOF-FF see the example in the example directory as well as the "MOF+"_MOFplus website. :link(MOFplus,https://www.mofplus.org/content/show/MOF-FF) -[Author:] Hendrik Heenen (Technical U of Munich), +[Author:] Hendrik Heenen (Technical U of Munich), Rochus Schmid (Ruhr-University Bochum). [Supporting info:] @@ -1622,7 +1621,7 @@ at [Author:] Axel Kohlmeyer (Temple U). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1662,7 +1661,7 @@ tools: [Author:] Lars Pastewka (Karlsruhe Institute of Technology). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1706,7 +1705,7 @@ See src/MAKE/OPTIONS/Makefile.omp for an example. Once you have an appropriate Makefile.machine, you can install/un-install the package and build LAMMPS in the usual manner: -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1785,7 +1784,7 @@ without changes to LAMMPS itself. [Author:] Axel Kohlmeyer (Temple U). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1843,7 +1842,7 @@ on your system. [Author:] Albert Bartok (Cambridge University) -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -1937,7 +1936,7 @@ specified as surface geometries from *.STL files. [Author:] Georg Ganzenmuller (Fraunhofer-Institute for High-Speed Dynamics, Ernst Mach Institute, Germany). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -2063,7 +2062,7 @@ system. [Authors:] Richard Berger (JKU) and Daniel Queteschiner (DCS Computing). -[Install:] +[Install:] This package has "specific installation instructions"_Build_extras.html#gpu on the "Build @@ -2075,5 +2074,3 @@ src/USER-VTK: filenames -> commands src/USER-VTK/README lib/vtk/README "dump vtk"_dump_vtk.html :ul - - diff --git a/doc/src/pair_kim.txt b/doc/src/pair_kim.txt index 8bd6aa9937..0c05913117 100644 --- a/doc/src/pair_kim.txt +++ b/doc/src/pair_kim.txt @@ -115,7 +115,7 @@ LAMMPS was built with that package. See the "Build package"_Build_package.html doc page for more info. This current version of pair_style kim is compatible with the -kim-api package version 2.0.0-beta.1 and higher. +kim-api package version 2.0.0-beta.2 and higher. [Related commands:] From 4a4147e0e4983a871bc17c510abd39f0b77e80e3 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 5 Nov 2018 11:15:07 -0600 Subject: [PATCH 38/49] Remove hard-coded compiler versions for KIM in CMake --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5402ac1987..670313dadd 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -591,7 +591,7 @@ if(PKG_KIM) URL https://s3.openkim.org/kim-api/kim-api-v2.0.0-beta.2.txz URL_MD5 1fbdbb734059cf0dc9d807e6dd6cc8ea BINARY_DIR build - CMAKE_ARGS -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_Fortran_COMPILER=gfortran-8 -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release ) ExternalProject_get_property(kim_build INSTALL_DIR) set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) From 81e79ec884ae2d88d0e5ee8357d6743b526b3abb Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Mon, 5 Nov 2018 15:39:10 -0600 Subject: [PATCH 39/49] Have KIM use LAMMPS specified compilers --- cmake/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 670313dadd..3e6c57c667 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -586,12 +586,18 @@ endif() if(PKG_KIM) option(DOWNLOAD_KIM "Download kim-api (instead of using the system's one)" OFF) if(DOWNLOAD_KIM) + enable_language(C) + enable_language(Fortran) include(ExternalProject) ExternalProject_Add(kim_build URL https://s3.openkim.org/kim-api/kim-api-v2.0.0-beta.2.txz URL_MD5 1fbdbb734059cf0dc9d807e6dd6cc8ea BINARY_DIR build - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release + CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_BUILD_TYPE=Release ) ExternalProject_get_property(kim_build INSTALL_DIR) set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) @@ -603,7 +609,7 @@ if(PKG_KIM) message(FATAL_ERROR "KIM not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") endif() endif() - list(APPEND LAMMPS_LINK_LIBS ${KIM-API-V3_LIBRARIES}) + list(APPEND LAMMPS_LINK_LIBS ${KIM-API-V2_LIBRARIES}) include_directories(${KIM-API-V2_INCLUDE_DIRS}) endif() From 03b1129abde8d85fe20dd450a43976aca8fe623a Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 14 Nov 2018 13:11:47 -0500 Subject: [PATCH 40/49] Update pair_kim to check for ModelRoutine requirements Also fixup cmake settings for PKG_KIM --- cmake/CMakeLists.txt | 2 +- src/KIM/pair_kim.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++ src/KIM/pair_kim.h | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 3e6c57c667..1e0d207a7e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -609,7 +609,7 @@ if(PKG_KIM) message(FATAL_ERROR "KIM not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") endif() endif() - list(APPEND LAMMPS_LINK_LIBS ${KIM-API-V2_LIBRARIES}) + list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}") include_directories(${KIM-API-V2_INCLUDE_DIRS}) endif() diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 072c3a6296..6981b028b2 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -789,6 +789,14 @@ void PairKIM::kim_init() error->all(FLERR,"KIM Model did not accept the requested unit system"); } + // check that the model does not require unknown capabilities + kimerror = check_for_routine_compatibility(); + if (kimerror) + { + error->all(FLERR, + "KIM Model requires unknown Routines. Unable to proceed."); + } + kimerror = KIM_Model_ComputeArgumentsCreate(pkim, &pargs); if (kimerror) { @@ -987,6 +995,49 @@ void PairKIM::set_lmps_flags() /* ---------------------------------------------------------------------- */ +int PairKIM::check_for_routine_compatibility() +{ + /* Check that we know about all required routines */ + int numberOfModelRoutineNames; + KIM_MODEL_ROUTINE_NAME_GetNumberOfModelRoutineNames( + &numberOfModelRoutineNames); + for (int i = 0; i < numberOfModelRoutineNames; ++i) + { + KIM_ModelRoutineName modelRoutineName; + KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(i, &modelRoutineName); + + int present; + int required; + int error = KIM_Model_IsRoutinePresent( + pkim, modelRoutineName, &present, &required); + if (error) { return true; } + + if ((present == true) && (required == true)) + { + if (!(KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Create) + || KIM_ModelRoutineName_Equal( + modelRoutineName, + KIM_MODEL_ROUTINE_NAME_ComputeArgumentsCreate) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Compute) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Refresh) + || KIM_ModelRoutineName_Equal( + modelRoutineName, + KIM_MODEL_ROUTINE_NAME_ComputeArgumentsDestroy) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Destroy))) + { return true; } + } + } + + /* everything is good */ + return false; +} + +/* ---------------------------------------------------------------------- */ + void PairKIM::set_kim_model_has_flags() { int numberOfComputeArgumentNames; diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 1b8051ea1e..a23d5cd317 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -158,6 +158,7 @@ namespace LAMMPS_NS { virtual void set_argument_pointers(); virtual void set_lmps_flags(); virtual void set_kim_model_has_flags(); + virtual int check_for_routine_compatibility(); // static methods used as callbacks from KIM static int get_neigh( void const * const dataObject, From b068690e1392e0c5d6ff0c7faf2293ceab9a40fc Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 12 Dec 2018 16:21:54 -0600 Subject: [PATCH 41/49] Update for kim-api beta.3 release --- cmake/CMakeLists.txt | 6 +- .../log.11Jul2018.kim.lj.newton-off.ubuntu.1 | 68 ----------------- .../log.11Jul2018.kim.lj.newton-off.ubuntu.4 | 74 ------------------- .../log.11Jul2018.kim.lj.newton-on.ubuntu.1 | 68 ----------------- .../log.11Jul2018.kim.lj.newton-on.ubuntu.4 | 74 ------------------- ... log.12Dec2018.in.kim.lj.lmp.newton-off.1} | 37 ++++------ ... log.12Dec2018.in.kim.lj.lmp.newton-off.4} | 39 ++++------ ...> log.12Dec2018.in.kim.lj.lmp.newton-on.1} | 37 ++++------ ...> log.12Dec2018.in.kim.lj.lmp.newton-on.4} | 39 ++++------ .../kim/log.12Dec2018.in.kim.lj.newton-off.1 | 59 +++++++++++++++ .../kim/log.12Dec2018.in.kim.lj.newton-off.4 | 65 ++++++++++++++++ .../kim/log.12Dec2018.in.kim.lj.newton-on.1 | 59 +++++++++++++++ .../kim/log.12Dec2018.in.kim.lj.newton-on.4 | 65 ++++++++++++++++ lib/kim/.gitignore | 3 +- lib/kim/Install.py | 8 +- 15 files changed, 310 insertions(+), 391 deletions(-) delete mode 100644 examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 delete mode 100644 examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 delete mode 100644 examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 delete mode 100644 examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 rename examples/kim/{log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 => log.12Dec2018.in.kim.lj.lmp.newton-off.1} (56%) rename examples/kim/{log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 => log.12Dec2018.in.kim.lj.lmp.newton-off.4} (55%) rename examples/kim/{log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 => log.12Dec2018.in.kim.lj.lmp.newton-on.1} (56%) rename examples/kim/{log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 => log.12Dec2018.in.kim.lj.lmp.newton-on.4} (55%) create mode 100644 examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 create mode 100644 examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 create mode 100644 examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 create mode 100644 examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1e0d207a7e..4abbeb4732 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -590,8 +590,8 @@ if(PKG_KIM) enable_language(Fortran) include(ExternalProject) ExternalProject_Add(kim_build - URL https://s3.openkim.org/kim-api/kim-api-v2.0.0-beta.2.txz - URL_MD5 1fbdbb734059cf0dc9d807e6dd6cc8ea + URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.0-beta.3.txz + URL_MD5 67c103a00e84865848d004837262c76e BINARY_DIR build CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} @@ -601,7 +601,7 @@ if(PKG_KIM) ) ExternalProject_get_property(kim_build INSTALL_DIR) set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) - set(KIM-API-V2_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v2.2${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/lib/libkim-api-v2.2${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LAMMPS_DEPS kim_build) else() find_package(KIM-API-V2) diff --git a/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 b/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 deleted file mode 100644 index c8c1919de5..0000000000 --- a/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.1 +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------------- -[[5713,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -Created 32000 atoms - Time spent = 0.00256546 secs -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: half, newton off, cut 8.45 - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Setting up Verlet run ... - Unit style : metal - Current step : 0 - Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 21.26 | 21.26 | 21.26 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 7118.0584 129712.25 - 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.69522 on 1 procs for 100 steps with 32000 atoms - -Performance: 3.206 ns/day, 7.487 hours/ns, 37.103 timesteps/s -99.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 2.3655 | 2.3655 | 2.3655 | 0.0 | 87.77 -Neigh | 0.28659 | 0.28659 | 0.28659 | 0.0 | 10.63 -Comm | 0.0061924 | 0.0061924 | 0.0061924 | 0.0 | 0.23 -Output | 0.00034901 | 0.00034901 | 0.00034901 | 0.0 | 0.01 -Modify | 0.025061 | 0.025061 | 0.025061 | 0.0 | 0.93 -Other | | 0.01157 | | | 0.43 - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 19911 ave 19911 max 19911 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2370499 -Ave neighs/atom = 74.0781 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:02 diff --git a/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 b/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 deleted file mode 100644 index c8d5faeb20..0000000000 --- a/examples/kim/log.11Jul2018.kim.lj.newton-off.ubuntu.4 +++ /dev/null @@ -1,74 +0,0 @@ --------------------------------------------------------------------------- -[[5673,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms - Time spent = 0.00215514 secs -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: half, newton off, cut 8.45 - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Setting up Verlet run ... - Unit style : metal - Current step : 0 - Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 8.528 | 8.528 | 8.528 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 7118.0584 129712.25 - 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 3.06157 on 4 procs for 100 steps with 32000 atoms - -Performance: 2.822 ns/day, 8.504 hours/ns, 32.663 timesteps/s -24.4% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.9964 | 2.0369 | 2.084 | 2.5 | 66.53 -Neigh | 0.25048 | 0.27467 | 0.29605 | 3.1 | 8.97 -Comm | 0.66611 | 0.71603 | 0.74496 | 3.6 | 23.39 -Output | 0.00048383 | 0.00070085 | 0.00098836 | 0.0 | 0.02 -Modify | 0.0064885 | 0.0065907 | 0.006806 | 0.2 | 0.22 -Other | | 0.02664 | | | 0.87 - -Nlocal: 8000 ave 8018 max 7967 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 9131 ave 9164 max 9113 min -Histogram: 2 0 0 1 0 0 0 0 0 1 -Neighs: 630904 ave 632094 max 628209 min -Histogram: 1 0 0 0 0 0 0 1 0 2 - -Total # of neighbors = 2523614 -Ave neighs/atom = 78.8629 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:03 diff --git a/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 b/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 deleted file mode 100644 index 21af1a6299..0000000000 --- a/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.1 +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------------- -[[5690,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -Created 32000 atoms - Time spent = 0.00258302 secs -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: half, newton off, cut 8.45 - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Setting up Verlet run ... - Unit style : metal - Current step : 0 - Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 20.87 | 20.87 | 20.87 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 7118.0584 129712.25 - 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.7052 on 1 procs for 100 steps with 32000 atoms - -Performance: 3.194 ns/day, 7.514 hours/ns, 36.966 timesteps/s -99.6% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 2.3715 | 2.3715 | 2.3715 | 0.0 | 87.67 -Neigh | 0.28386 | 0.28386 | 0.28386 | 0.0 | 10.49 -Comm | 0.012808 | 0.012808 | 0.012808 | 0.0 | 0.47 -Output | 0.00033716 | 0.00033716 | 0.00033716 | 0.0 | 0.01 -Modify | 0.02349 | 0.02349 | 0.02349 | 0.0 | 0.87 -Other | | 0.01317 | | | 0.49 - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 19911 ave 19911 max 19911 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2370499 -Ave neighs/atom = 74.0781 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:02 diff --git a/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 b/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 deleted file mode 100644 index 1214436d4d..0000000000 --- a/examples/kim/log.11Jul2018.kim.lj.newton-on.ubuntu.4 +++ /dev/null @@ -1,74 +0,0 @@ --------------------------------------------------------------------------- -[[5682,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms - Time spent = 0.00322684 secs -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:955) -WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:959) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 8.45 - ghost atom cutoff = 8.45 - binsize = 4.225, bins = 21 21 21 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: half, newton off, cut 8.45 - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Setting up Verlet run ... - Unit style : metal - Current step : 0 - Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 8.263 | 8.263 | 8.263 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 6290.8194 0 7118.0584 129712.25 - 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 3.1366 on 4 procs for 100 steps with 32000 atoms - -Performance: 2.755 ns/day, 8.713 hours/ns, 31.882 timesteps/s -23.7% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.3641 | 1.4213 | 1.4783 | 3.5 | 45.31 -Neigh | 0.25408 | 0.27714 | 0.29697 | 3.2 | 8.84 -Comm | 1.3588 | 1.4045 | 1.4806 | 4.0 | 44.78 -Output | 0.00055232 | 0.00072915 | 0.00087484 | 0.0 | 0.02 -Modify | 0.0061178 | 0.0062019 | 0.0062811 | 0.1 | 0.20 -Other | | 0.02673 | | | 0.85 - -Nlocal: 8000 ave 8018 max 7967 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 9131 ave 9164 max 9113 min -Histogram: 2 0 0 1 0 0 0 0 0 1 -Neighs: 630904 ave 632094 max 628209 min -Histogram: 1 0 0 0 0 0 0 1 0 2 - -Total # of neighbors = 2523614 -Ave neighs/atom = 78.8629 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:03 diff --git a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.1 similarity index 56% rename from examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 rename to examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.1 index bf5864cb08..0b67cc1ccb 100644 --- a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.1 +++ b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.1 @@ -1,22 +1,11 @@ --------------------------------------------------------------------------- -[[6124,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00263722 secs + Time spent = 0.00307703 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 20.37 | 20.37 | 20.37 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.59913 on 1 procs for 100 steps with 32000 atoms +Loop time of 2.58348 on 1 procs for 100 steps with 32000 atoms -Performance: 3.324 ns/day, 7.220 hours/ns, 38.474 timesteps/s -99.4% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.344 ns/day, 7.176 hours/ns, 38.707 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.2753 | 2.2753 | 2.2753 | 0.0 | 87.54 -Neigh | 0.28456 | 0.28456 | 0.28456 | 0.0 | 10.95 -Comm | 0.0055908 | 0.0055908 | 0.0055908 | 0.0 | 0.22 -Output | 0.00034594 | 0.00034594 | 0.00034594 | 0.0 | 0.01 -Modify | 0.023011 | 0.023011 | 0.023011 | 0.0 | 0.89 -Other | | 0.01037 | | | 0.40 +Pair | 2.2621 | 2.2621 | 2.2621 | 0.0 | 87.56 +Neigh | 0.28294 | 0.28294 | 0.28294 | 0.0 | 10.95 +Comm | 0.0057185 | 0.0057185 | 0.0057185 | 0.0 | 0.22 +Output | 0.00010109 | 0.00010109 | 0.00010109 | 0.0 | 0.00 +Modify | 0.023396 | 0.023396 | 0.023396 | 0.0 | 0.91 +Other | | 0.009175 | | | 0.36 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.4 similarity index 55% rename from examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 rename to examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.4 index 7f51d447fd..e2ee8e39bb 100644 --- a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-off.ubuntu.4 +++ b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.4 @@ -1,22 +1,11 @@ --------------------------------------------------------------------------- -[[6116,1],1]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00125703 secs + Time spent = 0.000934124 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 8.013 | 8.013 | 8.013 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.99901 on 4 procs for 100 steps with 32000 atoms +Loop time of 0.76167 on 4 procs for 100 steps with 32000 atoms -Performance: 2.881 ns/day, 8.331 hours/ns, 33.344 timesteps/s -24.4% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 11.343 ns/day, 2.116 hours/ns, 131.290 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.3704 | 1.4012 | 1.439 | 2.3 | 46.72 -Neigh | 0.252 | 0.27028 | 0.28236 | 2.2 | 9.01 -Comm | 0.66355 | 0.73942 | 0.82223 | 6.5 | 24.66 -Output | 0.0037821 | 0.0090774 | 0.016142 | 5.1 | 0.30 -Modify | 0.0058855 | 0.019317 | 0.044855 | 11.4 | 0.64 -Other | | 0.5597 | | | 18.66 +Pair | 0.65549 | 0.6589 | 0.66089 | 0.3 | 86.51 +Neigh | 0.075691 | 0.075959 | 0.07641 | 0.1 | 9.97 +Comm | 0.0073049 | 0.007397 | 0.0074785 | 0.1 | 0.97 +Output | 5.6982e-05 | 0.00014746 | 0.00024986 | 0.0 | 0.02 +Modify | 0.0068338 | 0.0068703 | 0.0068941 | 0.0 | 0.90 +Other | | 0.0124 | | | 1.63 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 @@ -63,4 +52,4 @@ Total # of neighbors = 2523614 Ave neighs/atom = 78.8629 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:03 +Total wall time: 0:00:00 diff --git a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.1 similarity index 56% rename from examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 rename to examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.1 index 7be22a7f60..91731438de 100644 --- a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.1 +++ b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.1 @@ -1,22 +1,11 @@ --------------------------------------------------------------------------- -[[5635,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00226572 secs + Time spent = 0.00311494 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.26274 on 1 procs for 100 steps with 32000 atoms +Loop time of 2.22646 on 1 procs for 100 steps with 32000 atoms -Performance: 3.818 ns/day, 6.285 hours/ns, 44.194 timesteps/s -99.0% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.881 ns/day, 6.185 hours/ns, 44.914 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.0589 | 2.0589 | 2.0589 | 0.0 | 90.99 -Neigh | 0.15362 | 0.15362 | 0.15362 | 0.0 | 6.79 -Comm | 0.012277 | 0.012277 | 0.012277 | 0.0 | 0.54 -Output | 0.0003387 | 0.0003387 | 0.0003387 | 0.0 | 0.01 -Modify | 0.02416 | 0.02416 | 0.02416 | 0.0 | 1.07 -Other | | 0.01346 | | | 0.59 +Pair | 2.0344 | 2.0344 | 2.0344 | 0.0 | 91.38 +Neigh | 0.14575 | 0.14575 | 0.14575 | 0.0 | 6.55 +Comm | 0.01127 | 0.01127 | 0.01127 | 0.0 | 0.51 +Output | 0.000103 | 0.000103 | 0.000103 | 0.0 | 0.00 +Modify | 0.024057 | 0.024057 | 0.024057 | 0.0 | 1.08 +Other | | 0.01083 | | | 0.49 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.4 similarity index 55% rename from examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 rename to examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.4 index d910afbbc2..92eb8ba8bc 100644 --- a/examples/kim/log.11Jul2018.kim.lj.lmp.newton-on.ubuntu.4 +++ b/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.4 @@ -1,22 +1,11 @@ --------------------------------------------------------------------------- -[[5659,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00213171 secs + Time spent = 0.000946045 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -37,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 7.632 | 7.632 | 7.632 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.44628 on 4 procs for 100 steps with 32000 atoms +Loop time of 0.639437 on 4 procs for 100 steps with 32000 atoms -Performance: 3.532 ns/day, 6.795 hours/ns, 40.878 timesteps/s -24.2% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 13.512 ns/day, 1.776 hours/ns, 156.388 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.98717 | 1.0434 | 1.1582 | 6.6 | 42.65 -Neigh | 0.10195 | 0.12588 | 0.15258 | 5.2 | 5.15 -Comm | 1.1525 | 1.2449 | 1.3061 | 5.1 | 50.89 -Output | 0.0005828 | 0.00075188 | 0.00087256 | 0.0 | 0.03 -Modify | 0.0057955 | 0.0059132 | 0.006044 | 0.1 | 0.24 -Other | | 0.02542 | | | 1.04 +Pair | 0.55655 | 0.55752 | 0.55833 | 0.1 | 87.19 +Neigh | 0.040557 | 0.040752 | 0.041148 | 0.1 | 6.37 +Comm | 0.024693 | 0.025886 | 0.026853 | 0.5 | 4.05 +Output | 4.6015e-05 | 5.1558e-05 | 6.0081e-05 | 0.0 | 0.01 +Modify | 0.0088108 | 0.0089263 | 0.0090554 | 0.1 | 1.40 +Other | | 0.006306 | | | 0.99 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 @@ -63,4 +52,4 @@ Total # of neighbors = 2126875 Ave neighs/atom = 66.4648 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:02 +Total wall time: 0:00:00 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 b/examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 new file mode 100644 index 0000000000..c25368b917 --- /dev/null +++ b/examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 @@ -0,0 +1,59 @@ +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.00450015 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 28.51 | 28.51 | 28.51 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 3.35585 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.575 ns/day, 9.322 hours/ns, 29.799 timesteps/s +99.2% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.9239 | 2.9239 | 2.9239 | 0.0 | 87.13 +Neigh | 0.38492 | 0.38492 | 0.38492 | 0.0 | 11.47 +Comm | 0.0072038 | 0.0072038 | 0.0072038 | 0.0 | 0.21 +Output | 0.00010204 | 0.00010204 | 0.00010204 | 0.0 | 0.00 +Modify | 0.028316 | 0.028316 | 0.028316 | 0.0 | 0.84 +Other | | 0.01146 | | | 0.34 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 4.25375e+06 ave 4.25375e+06 max 4.25375e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 b/examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 new file mode 100644 index 0000000000..c8c52d6e09 --- /dev/null +++ b/examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 @@ -0,0 +1,65 @@ +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00106215 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 10.05 | 10.05 | 10.05 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 0.930494 on 4 procs for 100 steps with 32000 atoms + +Performance: 9.285 ns/day, 2.585 hours/ns, 107.470 timesteps/s +99.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.80926 | 0.81195 | 0.81464 | 0.3 | 87.26 +Neigh | 0.089949 | 0.092688 | 0.095287 | 0.8 | 9.96 +Comm | 0.007302 | 0.0074284 | 0.0075471 | 0.1 | 0.80 +Output | 0.00012898 | 0.00014371 | 0.00016093 | 0.0 | 0.02 +Modify | 0.011517 | 0.011761 | 0.011959 | 0.2 | 1.26 +Other | | 0.006522 | | | 0.70 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 1.06344e+06 ave 1.06594e+06 max 1.05881e+06 min +Histogram: 1 0 0 0 0 0 1 0 0 2 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 b/examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 new file mode 100644 index 0000000000..eec26307ac --- /dev/null +++ b/examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 @@ -0,0 +1,59 @@ +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.0030508 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 28.12 | 28.12 | 28.12 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.97001 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.909 ns/day, 8.250 hours/ns, 33.670 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.5982 | 2.5982 | 2.5982 | 0.0 | 87.48 +Neigh | 0.32516 | 0.32516 | 0.32516 | 0.0 | 10.95 +Comm | 0.012059 | 0.012059 | 0.012059 | 0.0 | 0.41 +Output | 0.000103 | 0.000103 | 0.000103 | 0.0 | 0.00 +Modify | 0.023878 | 0.023878 | 0.023878 | 0.0 | 0.80 +Other | | 0.01058 | | | 0.36 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 4.25375e+06 ave 4.25375e+06 max 4.25375e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 b/examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 new file mode 100644 index 0000000000..6c0da32ba4 --- /dev/null +++ b/examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 @@ -0,0 +1,65 @@ +LAMMPS (24 Oct 2018) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.000946999 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 9.789 | 9.789 | 9.789 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 0.891065 on 4 procs for 100 steps with 32000 atoms + +Performance: 9.696 ns/day, 2.475 hours/ns, 112.225 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.75777 | 0.75864 | 0.75996 | 0.1 | 85.14 +Neigh | 0.088332 | 0.088883 | 0.089737 | 0.2 | 9.97 +Comm | 0.027187 | 0.02829 | 0.029602 | 0.6 | 3.17 +Output | 4.9114e-05 | 5.4777e-05 | 6.6042e-05 | 0.0 | 0.01 +Modify | 0.0088358 | 0.0089488 | 0.0091376 | 0.1 | 1.00 +Other | | 0.00625 | | | 0.70 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 1.06344e+06 ave 1.06594e+06 max 1.05881e+06 min +Histogram: 1 0 0 0 0 0 1 0 0 2 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/lib/kim/.gitignore b/lib/kim/.gitignore index c1f57fe64c..bfd4b35d87 100644 --- a/lib/kim/.gitignore +++ b/lib/kim/.gitignore @@ -1,3 +1,2 @@ -/Makefile.KIM_DIR -/Makefile.KIM_Config +/kim-prefix.txt /installed-kim-api-* diff --git a/lib/kim/Install.py b/lib/kim/Install.py index 815827b645..b1dcee1a36 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -21,7 +21,7 @@ Syntax from lib dir: python Install.py -b -v version -a kim-name specify one or more options, order does not matter -v = version of KIM API library to use - default = kim-api-v2.0.0-beta.2 (current as of November 2018) + default = kim-api-v2.0.0-beta.3 (current as of December 2018) -b = download and build base KIM API library with example Models this will delete any previous installation in the current folder -n = do NOT download and build base KIM API library. @@ -36,9 +36,9 @@ specify one or more options, order does not matter Examples: make lib-kim args="-b" # install KIM API lib with only example models -make lib-kim args="-a Glue_Ercolessi_Adams_Al__MO_324507536345_002" # Ditto plus one model +make lib-kim args="-a EAM_ErcolessiAdams_1994_Al__MO_324507536345_002" # Ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models -make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_003" # only add one model or model driver +make lib-kim args="-n -a EAM_Dynamo_Ackland_2003_W__MO_141627196590_005" # only add one model or model driver See the list of KIM model drivers here: https://openkim.org/kim-items/model-drivers/alphabetical @@ -109,7 +109,7 @@ nargs = len(args) if nargs == 0: error() thisdir = os.environ['PWD'] -version = "kim-api-v2.0.0-beta.2" +version = "kim-api-v2-2.0.0-beta.3" buildflag = False everythingflag = False From 540026ca00d4b637e54a3d3892cdf9979a86688b Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 16 Dec 2018 15:53:51 -0600 Subject: [PATCH 42/49] Update CMakeLists.txt to avoid merge conflicts --- cmake/CMakeLists.txt | 203 +++++++++++++++++++++++++++++++++---------- 1 file changed, 159 insertions(+), 44 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 4abbeb4732..1936b50a56 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -11,6 +11,10 @@ get_filename_component(LAMMPS_LIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE) get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUTE) +# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "default install path" FORCE ) +endif() # To avoid conflicts with the conventional Makefile build system, we build everything here file(GLOB LIB_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp) @@ -75,6 +79,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) #release comes with -O3 by default set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) +string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) # check for files auto-generated by make-based buildsystem # this is fast, so check for it all the time @@ -171,8 +176,9 @@ set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF - USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SCAFACOS USER-SMD USER-SMTBQ - USER-SPH USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM) + USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC USER-SCAFACOS + USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK + USER-QUIP USER-QMMM) set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU) set(OTHER_PACKAGES CORESHELL QEQ) foreach(PKG ${DEFAULT_PACKAGES}) @@ -215,7 +221,7 @@ else() endif() -set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS size limit") +set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) @@ -303,7 +309,7 @@ pkg_depends(USER-SCAFACOS MPI) find_package(OpenMP QUIET) option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND}) -if(BUILD_OMP OR PKG_USER-OMP OR PKG_KOKKOS OR PKG_USER-INTEL) +if(BUILD_OMP OR PKG_KOKKOS OR PKG_USER-INTEL) find_package(OpenMP REQUIRED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") @@ -421,16 +427,30 @@ if(WITH_FFMPEG) add_definitions(-DLAMMPS_FFMPEG) endif() +if(BUILD_SHARED_LIBS) + set(CONFIGURE_REQUEST_PIC "--with-pic") + set(CMAKE_REQUEST_PIC "-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}") + set(CUDA_REQUEST_PIC "-Xcompiler ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") +else() + set(CONFIGURE_REQUEST_PIC) + set(CMAKE_REQUEST_PIC) + set(CUDA_REQUEST_PIC) +endif() + + if(PKG_VORONOI) - option(DOWNLOAD_VORO "Download voro++ (instead of using the system's one)" OFF) + option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" OFF) if(DOWNLOAD_VORO) + message(STATUS "Voro++ download requested - we will build our own") include(ExternalProject) if(BUILD_SHARED_LIBS) - set(VORO_BUILD_OPTIONS "CFLAGS=-fPIC") + set(VORO_BUILD_CFLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}}") else() - set(VORO_BUILD_OPTIONS) + set(VORO_BUILD_CFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}}") endif() + string(APPEND VORO_BUILD_CFLAGS ${CMAKE_CXX_FLAGS}) + set(VORO_BUILD_OPTIONS CXX=${CMAKE_CXX_COMPILER} CFLAGS=${VORO_BUILD_CFLAGS}) ExternalProject_Add(voro_build URL http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz @@ -444,7 +464,7 @@ if(PKG_VORONOI) else() find_package(VORO) if(NOT VORO_FOUND) - message(FATAL_ERROR "VORO not found, help CMake to find it by setting VORO_LIBRARY and VORO_INCLUDE_DIR, or set DOWNLOAD_VORO=ON to download it") + message(FATAL_ERROR "Voro++ library not found. Help CMake to find it by setting VORO_LIBRARY and VORO_INCLUDE_DIR, or set DOWNLOAD_VORO=ON to download it") endif() endif() include_directories(${VORO_INCLUDE_DIRS}) @@ -452,26 +472,26 @@ if(PKG_VORONOI) endif() if(PKG_LATTE) - option(DOWNLOAD_LATTE "Download latte (instead of using the system's one)" OFF) + option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" OFF) if(DOWNLOAD_LATTE) if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7") endif() - message(STATUS "LATTE not found - we will build our own") + message(STATUS "LATTE download requested - we will build our own") include(ExternalProject) ExternalProject_Add(latte_build URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz URL_MD5 85ac414fdada2d04619c8f936344df14 SOURCE_SUBDIR cmake - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} - ) + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= ${CMAKE_REQUEST_PIC} + ) ExternalProject_get_property(latte_build INSTALL_DIR) set(LATTE_LIBRARIES ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/liblatte.a) list(APPEND LAMMPS_DEPS latte_build) else() find_package(LATTE) if(NOT LATTE_FOUND) - message(FATAL_ERROR "LATTE not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it") + message(FATAL_ERROR "LATTE library not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it") endif() endif() list(APPEND LAMMPS_LINK_LIBS ${LATTE_LIBRARIES} ${LAPACK_LIBRARIES}) @@ -479,24 +499,22 @@ endif() if(PKG_USER-SCAFACOS) find_package(GSL REQUIRED) - option(DOWNLOAD_SCAFACOS "Download ScaFaCoS (instead of using the system's one)" OFF) + option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" OFF) if(DOWNLOAD_SCAFACOS) + message(STATUS "ScaFaCoS download requested - we will build our own") include(ExternalProject) ExternalProject_Add(scafacos_build URL https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz URL_MD5 bd46d74e3296bd8a444d731bb10c1738 - CONFIGURE_COMMAND /configure --prefix= - --disable-doc + CONFIGURE_COMMAND /configure --prefix= --disable-doc --enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m - --with-internal-fftw - --with-internal-pfft - --with-internal-pnfft - $<$:--with-pic> + --with-internal-fftw --with-internal-pfft + --with-internal-pnfft ${CONFIGURE_REQUEST_PIC} FC=${CMAKE_MPI_Fortran_COMPILER} CXX=${CMAKE_MPI_CXX_COMPILER} CC=${CMAKE_MPI_C_COMPILER} F77= - ) + ) ExternalProject_get_property(scafacos_build INSTALL_DIR) set(SCAFACOS_BUILD_DIR ${INSTALL_DIR}) set(SCAFACOS_INCLUDE_DIRS ${SCAFACOS_BUILD_DIR}/include) @@ -528,6 +546,54 @@ if(PKG_USER-SCAFACOS) include_directories(${SCAFACOS_INCLUDE_DIRS}) endif() +if(PKG_USER-PLUMED) + find_package(GSL REQUIRED) + set(PLUMED_MODE "static" CACHE STRING "Linkage mode for Plumed2 library") + set(PLUMED_MODE_VALUES static shared runtime) + set_property(CACHE PLUMED_MODE PROPERTY STRINGS ${PLUMED_MODE_VALUES}) + validate_option(PLUMED_MODE PLUMED_MODE_VALUES) + string(TOUPPER ${PLUMED_MODE} PLUMED_MODE) + + option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" OFF) + if(DOWNLOAD_PLUMED) + message(STATUS "PLUMED download requested - we will build our own") + include(ExternalProject) + ExternalProject_Add(plumed_build + URL https://github.com/plumed/plumed2/releases/download/v2.4.3/plumed-src-2.4.3.tgz + URL_MD5 b1be7c48971627febc11c61b70767fc5 + BUILD_IN_SOURCE 1 + CONFIGURE_COMMAND /configure --prefix= ${CONFIGURE_REQUEST_PIC}) + ExternalProject_get_property(plumed_build INSTALL_DIR) + set(PLUMED_INSTALL_DIR ${INSTALL_DIR}) + list(APPEND LAMMPS_DEPS plumed_build) + if(PLUMED_MODE STREQUAL "STATIC") + add_definitions(-D__PLUMED_WRAPPER_CXX=1) + list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/plumed/obj/kernel.o + "${PLUMED_INSTALL_DIR}/lib/plumed/obj/PlumedStatic.o" ${GSL_LIBRARIES} ${CMAKE_DL_LIBS}) + elseif(PLUMED_MODE STREQUAL "SHARED") + list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/libplumed.so ${CMAKE_DL_LIBS}) + elseif(PLUMED_MODE STREQUAL "RUNTIME") + add_definitions(-D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_DEFAULT_KERNEL=${PLUMED_INSTALL_DIR}/lib/libplumedKernel.so) + list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/libplumedWrapper.a -rdynamic ${CMAKE_DL_LIBS}) + endif() + set(PLUMED_INCLUDE_DIRS "${PLUMED_INSTALL_DIR}/include") + else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(PLUMED plumed REQUIRED) + if(PLUMED_MODE STREQUAL "STATIC") + add_definitions(-D__PLUMED_WRAPPER_CXX=1) + include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.static) + elseif(PLUMED_MODE STREQUAL "SHARED") + include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared) + elseif(PLUMED_MODE STREQUAL "RUNTIME") + add_definitions(-D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel.so) + include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime) + endif() + list(APPEND LAMMPS_LINK_LIBS ${PLUMED_LOAD}) + endif() + include_directories(${PLUMED_INCLUDE_DIRS}) +endif() + if(PKG_USER-MOLFILE) add_library(molfile INTERFACE) target_include_directories(molfile INTERFACE ${LAMMPS_LIB_SOURCE_DIR}/molfile) @@ -543,8 +609,9 @@ if(PKG_USER-NETCDF) endif() if(PKG_USER-SMD) - option(DOWNLOAD_EIGEN3 "Download Eigen3 (instead of using the system's one)" OFF) + option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF) if(DOWNLOAD_EIGEN3) + message(STATUS "Eigen3 download requested - we will build our own") include(ExternalProject) ExternalProject_Add(Eigen3_build URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz @@ -584,8 +651,9 @@ if(PKG_USER-VTK) endif() if(PKG_KIM) - option(DOWNLOAD_KIM "Download kim-api (instead of using the system's one)" OFF) + option(DOWNLOAD_KIM "Download KIM-API v2 from OpenKIM instead of using an already installed one" OFF) if(DOWNLOAD_KIM) + message(STATUS "KIM-API v2 download requested - we will build our own") enable_language(C) enable_language(Fortran) include(ExternalProject) @@ -606,7 +674,7 @@ if(PKG_KIM) else() find_package(KIM-API-V2) if(NOT KIM-API-V2_FOUND) - message(FATAL_ERROR "KIM not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") + message(FATAL_ERROR "KIM-API v2 not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") endif() endif() list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}") @@ -619,12 +687,7 @@ if(PKG_MESSAGE) ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) - if(BUILD_SHARED_LIBS) - add_library(cslib SHARED ${cslib_SOURCES}) - else() - add_library(cslib STATIC ${cslib_SOURCES}) - endif() - + add_library(cslib STATIC ${cslib_SOURCES}) if(BUILD_MPI) target_compile_definitions(cslib PRIVATE -DMPI_YES) set_target_properties(cslib PROPERTIES OUTPUT_NAME "csmpi") @@ -649,10 +712,10 @@ endif() if(PKG_MSCG) find_package(GSL REQUIRED) - option(DOWNLOAD_MSCG "Download latte (instead of using the system's one)" OFF) + option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" OFF) if(DOWNLOAD_MSCG) if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR - message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7") + message(FATAL_ERROR "For downlading MSCG you need at least cmake-3.7") endif() include(ExternalProject) if(NOT LAPACK_FOUND) @@ -662,7 +725,7 @@ if(PKG_MSCG) URL https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz URL_MD5 8c45e269ee13f60b303edd7823866a91 SOURCE_SUBDIR src/CMake - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} ${EXTRA_MSCG_OPTS} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS} BUILD_COMMAND make mscg INSTALL_COMMAND "" ) ExternalProject_get_property(mscg_build BINARY_DIR) @@ -710,7 +773,7 @@ set(MATH_LIBRARIES "m" CACHE STRING "math library") mark_as_advanced( MATH_LIBRARIES ) include(CheckLibraryExists) if (CMAKE_VERSION VERSION_LESS "3.4") - enable_language(C) # check_library_exists isn't supported without a c compiler before v3.4 + enable_language(C) # check_library_exists isn't supported without a C compiler before v3.4 endif() # RB: disabled this check because it breaks with KOKKOS CUDA enabled #foreach(FUNC sin cos) @@ -748,6 +811,13 @@ foreach(PKG ${DEFAULT_PACKAGES}) endif() endforeach() +# packages that need defines set +foreach(PKG MPIIO) + if(PKG_${PKG}) + add_definitions(-DLMP_${PKG}) + endif() +endforeach() + # dedicated check for entire contents of accelerator packages foreach(PKG ${ACCEL_PACKAGES}) set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG}) @@ -776,7 +846,7 @@ foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD if(PKG_LIB STREQUAL awpmd) target_include_directories(awpmd PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact ${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include) elseif(PKG_LIB STREQUAL h5md) - target_include_directories(h5md PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/h5md/include) + target_include_directories(h5md PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/h5md/include ${HDF5_INCLUDE_DIRS}) elseif(PKG_LIB STREQUAL colvars) target_compile_options(colvars PRIVATE -DLEPTON) target_include_directories(colvars PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton/include) @@ -792,6 +862,9 @@ if(PKG_USER-AWPMD) endif() if(PKG_USER-ATC) + if(LAMMPS_SIZES STREQUAL BIGBIG) + message(FATAL_ERROR "The USER-ATC Package is not compatible with -DLAMMPS_BIGBIG") + endif() target_link_libraries(atc ${LAPACK_LIBRARIES}) endif() @@ -799,6 +872,7 @@ if(PKG_USER-H5MD) find_package(HDF5 REQUIRED) target_link_libraries(h5md ${HDF5_LIBRARIES}) target_include_directories(h5md PRIVATE ${HDF5_INCLUDE_DIRS}) + include_directories(${HDF5_INCLUDE_DIRS}) endif() @@ -884,6 +958,20 @@ if(PKG_USER-OMP) include_directories(${USER-OMP_SOURCES_DIR}) endif() +# Fix rigid/meso requires RIGID to be installed +if(PKG_USER-SDPD) + set(USER-SDPD_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-SDPD) + + get_property(hlist GLOBAL PROPERTY FIX) + if(NOT PKG_RIGID) + list(REMOVE_ITEM hlist ${USER-SDPD_SOURCES_DIR}/fix_rigid_meso.h) + list(REMOVE_ITEM LIB_SOURCES ${USER-SDPD_SOURCES_DIR}/fix_rigid_meso.cpp) + endif() + set_property(GLOBAL PROPERTY FIX "${hlist}") + + include_directories(${USER-SDPD_SOURCES_DIR}) +endif() + if(PKG_KOKKOS) set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos) set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos) @@ -961,7 +1049,7 @@ if(PKG_USER-INTEL) endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) - message(FATAL_ERROR "USER-INTEL is needed at least 2016 intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}") + message(FATAL_ERROR "USER-INTEL needs at least a 2016 intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}") endif() if(NOT BUILD_OMP) @@ -1061,11 +1149,11 @@ if(PKG_GPU) find_package(CUDA REQUIRED) find_program(BIN2C bin2c) if(NOT BIN2C) - message(FATAL_ERROR "Couldn't find bin2c, use -DBIN2C helping cmake to find it.") + message(FATAL_ERROR "Could not find bin2c, use -DBIN2C=/path/to/bin2c to help cmake finding it.") endif() option(CUDPP_OPT "Enable CUDPP_OPT" ON) - set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM architecture (e.g. sm_60)") + set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)") file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu) list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu) @@ -1078,11 +1166,39 @@ if(PKG_GPU) file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu) endif() - cuda_compile_cubin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS - -DUNIX -O3 -Xptxas -v --use_fast_math -DNV_KERNEL -DUCL_CUDADR -arch=${GPU_ARCH} -D_${GPU_PREC_SETTING}) + # build arch/gencode commands for nvcc based on CUDA toolkit version and use choice + # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture + set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH} ") + # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0 + if((CUDA_VERSION VERSION_GREATER "3.1") AND (CUDA_VERSION VERSION_LESS "9.0")) + string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_20,code=[sm_20,compute_20] ") + endif() + # Kepler (GPU Arch 3.x) is supported by CUDA 5 and later + if(CUDA_VERSION VERSION_GREATER "4.9") + string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35] ") + endif() + # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later + if(CUDA_VERSION VERSION_GREATER "5.9") + string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] ") + endif() + # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later + if(CUDA_VERSION VERSION_GREATER "7.9") + string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] ") + endif() + # Volta (GPU Arch 7.0) is supported by CUDA 9 and later + if(CUDA_VERSION VERSION_GREATER "8.9") + string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_70,code=[sm_70,compute_70] ") + endif() + # Turing (GPU Arch 7.5) is supported by CUDA 10 and later + if(CUDA_VERSION VERSION_GREATER "9.9") + string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_75,code=[sm_75,compute_75] ") + endif() - cuda_compile(GPU_OBJS ${GPU_LIB_CUDPP_CU} OPTIONS $<$:-Xcompiler=-fPIC> - -DUNIX -O3 -Xptxas -v --use_fast_math -DUCL_CUDADR -arch=${GPU_ARCH} -D_${GPU_PREC_SETTING}) + cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS + -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING}) + + cuda_compile(GPU_OBJS ${GPU_LIB_CUDPP_CU} OPTIONS ${CUDA_REQUEST_PIC} + -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING}) foreach(CU_OBJ ${GPU_GEN_OBJS}) get_filename_component(CU_NAME ${CU_OBJ} NAME_WE) @@ -1351,7 +1467,6 @@ foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES} ${OTHER_PACKAGES}) endif() endforeach() -string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) get_directory_property(CPPFLAGS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) include(FeatureSummary) feature_summary(DESCRIPTION "The following packages have been found:" WHAT PACKAGES_FOUND) @@ -1382,7 +1497,7 @@ endif() if(CMAKE_EXE_LINKER_FLAGS) message(STATUS "Linker flags: Executable ${CMAKE_EXE_LINKER_FLAGS}") - endif() +endif() if(BUILD_SHARED_LIBS) message(STATUS "Shared libraries ${CMAKE_SHARED_LINKER_FLAGS}") else() From a9b0fb9e9d42fd7f54ee0d36426562eec96c3dc4 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Sun, 3 Feb 2019 12:43:48 -0600 Subject: [PATCH 43/49] Some adjustments to kim Install.py --- lib/kim/Install.py | 165 +++++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 88 deletions(-) diff --git a/lib/kim/Install.py b/lib/kim/Install.py index e7e2128f48..544fe2b65d 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -1,46 +1,43 @@ #!/usr/bin/env python -# install.py tool to download, compile, and setup the kim-api library -# used to automate the steps described in the README file in this dir +""" +Install.py tool to download, compile, and setup the kim-api library +used to automate the steps described in the README file in this dir +""" from __future__ import print_function -import sys,os,re,subprocess,shutil +import sys, os, subprocess, shutil +from argparse import ArgumentParser + sys.path.append('..') -from install_helpers import error,fullpath,which,geturl +from install_helpers import fullpath, geturl + +parser = ArgumentParser(prog='Install.py', + description="LAMMPS library build wrapper script") + +# settings + +thisdir = fullpath('.') +version = "kim-api-v2-2.0.0-beta.3" # help message -help = """ -Syntax from src dir: make lib-kim args="-b -v version -a kim-name" +HELP = """ +Syntax from src dir: make lib-kim args="-b -v version -a kim-name" or: make lib-kim args="-b -a everything" or: make lib-kim args="-n -a kim-name" - or: make lib-kim args="-p /home/bob/kim -a kim-name" -Syntax from lib dir: python Install.py -b -v version -a kim-name + or: make lib-kim args="-p /usr/local/open-kim -a kim-name" +Syntax from lib dir: python Install.py -b -v version -a kim-name or: python Install.py -b -a everything or: python Install.py -n -a kim-name - or: python Install.py -p /home/bob/kim -a kim-name - -specify one or more options, order does not matter - - -v = version of KIM API library to use - default = kim-api-v2.0.0-beta.3 (current as of December 2018) - -b = download and build base KIM API library with example Models - this will delete any previous installation in the current folder - -n = do NOT download and build base KIM API library. - Use an existing installation - -p = specify install prefix of KIM API installation (implies -n) - -a = add single KIM model or model driver with kim-name - to existing KIM API lib (see example below). - If kim-name = everything, then rebuild KIM API library with - *all* available OpenKIM Models (make take a long time). - -vv = be more verbose about what is happening while the script runs + or: python Install.py -p /usr/local/open-kim -a kim-name Examples: make lib-kim args="-b" # install KIM API lib with only example models -make lib-kim args="-a EAM_ErcolessiAdams_1994_Al__MO_324507536345_002" # Ditto plus one model +make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # Ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models -make lib-kim args="-n -a EAM_Dynamo_Ackland_2003_W__MO_141627196590_005" # only add one model or model driver +make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # only add one model or model driver See the list of KIM model drivers here: https://openkim.org/kim-items/model-drivers/alphabetical @@ -53,62 +50,49 @@ https://openkim.org/kim-api in the "What is in the KIM API source package?" section """ -# parse args +pgroup = parser.add_mutually_exclusive_group() +pgroup.add_argument("-b", "--build", action="store_true", + help="download and build base KIM API library with example Models.") +pgroup.add_argument("-n", "--nobuild", action="store_true", + help="use the previously downloaded and compiled base KIM API.") +pgroup.add_argument("-p", "--path", + help="specify location of existing KIM API installation.") +parser.add_argument("-v", "--version", default=version, + help="set version of KIM API library to download and build (default: %s)" % version) +parser.add_argument("-a", "--add", + help="add single KIM model or model driver. If adding 'everything', then all available OpenKIM models are added (may take a long time)") +parser.add_argument("-vv", "--verbose", action="store_true", + help="be more verbose about is happening while this script runs") -args = sys.argv[1:] -nargs = len(args) -if nargs == 0: error(help=help) +args = parser.parse_args() -thisdir = fullpath('.') -version = "kim-api-v2-2.0.0-beta.3" +# print help message and exit, if neither build nor path options are given +if not args.build and not args.path and not args.nobuild: + parser.print_help() + sys.exit(HELP) -buildflag = False +buildflag = args.build +pathflag = args.path is not None +addflag = args.add is not None +addmodelname = args.add everythingflag = False -addflag = False -verboseflag = False -pathflag = False +if addflag and addmodelname == "everything": + everythingflag = True + buildflag = True +verboseflag = args.verbose -iarg = 0 -while iarg < len(args): - if args[iarg] == "-v": - if iarg+2 > len(args): error(help=help) - version = args[iarg+1] - iarg += 2 - elif args[iarg] == "-b": - buildflag = True - iarg += 1 - elif args[iarg] == "-n": - buildflag = False - iarg += 1 - elif args[iarg] == "-p": - if iarg+2 > len(args): error(help=help) - kimdir = fullpath(args[iarg+1]) - pathflag = True - buildflag = False - iarg += 2 - elif args[iarg] == "-a": - addflag = True - if iarg+2 > len(args): error(help=help) - addmodelname = args[iarg+1] - if addmodelname == "everything": - buildflag = True - everythingflag = True - addflag = False - iarg += 2 - elif args[iarg] == "-vv": - verboseflag = True - iarg += 1 - else: error(help=help) +if pathflag: + buildflag = False + kimdir = args.path + if not os.path.isdir(kimdir): + sys.exit("KIM API path %s does not exist" % kimdir) + kimdir = fullpath(kimdir) url = "https://s3.openkim.org/kim-api/%s.txz" % version # set KIM API directory if pathflag: - if not os.path.isdir(kimdir): - print("\nkim-api is not installed at %s" % kimdir) - error(help=help) - # configure LAMMPS to use existing kim-api installation with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: pffile.write("%s" % kimdir) @@ -116,6 +100,8 @@ if pathflag: print("Created %s/kim-prefix.txt\n using %s" % (thisdir,kimdir)) else: kimdir = os.path.join(os.path.abspath(thisdir), "installed-" + version) + if args.nobuild and not os.path.isdir(kimdir): + sys.exit("Cannot use -n/--nobuild without first building the KIM API with -b") # download KIM tarball, unpack, build KIM if buildflag: @@ -136,10 +122,10 @@ if buildflag: # download entire kim-api tarball print("Downloading kim-api tarball ...") - geturl(url,"%s/%s.txz" % (thisdir,version)) + geturl(url, "%s/%s.txz" % (thisdir, version)) print("Unpacking kim-api tarball ...") - cmd = 'cd "%s"; rm -rf "%s"; tar -xJvf %s.txz' % (thisdir,version,version) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + cmd = 'cd "%s"; rm -rf "%s"; tar -xJvf %s.txz' % (thisdir, version, version) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) # configure kim-api @@ -150,29 +136,32 @@ if buildflag: # build kim-api print("Building kim-api ...") - cmd = 'cd "%s/%s/build" && make' % (thisdir,version) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print(txt.decode("UTF-8")) + cmd = 'cd "%s/%s/build" && make' % (thisdir, version) + txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + if verboseflag: + print(txt.decode("UTF-8")) # install kim-api print("Installing kim-api ...") - cmd = 'cd "%s/%s/build" && make install' % (thisdir,version) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print(txt.decode("UTF-8")) + cmd = 'cd "%s/%s/build" && make install' % (thisdir, version) + txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + if verboseflag: + print(txt.decode("UTF-8")) # remove source files print("Removing kim-api source and build files ...") - cmd = 'cd "%s"; rm -rf %s; rm -rf %s.txz' % (thisdir,version,version) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + cmd = 'cd "%s"; rm -rf %s; rm -rf %s.txz' % (thisdir, version, version) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) # add all OpenKIM models, if desired if everythingflag: print("Adding all OpenKIM models, this will take a while ...") cmd = '%s/bin/kim-api-v2-collections-management install system OpenKIM' % (kimdir) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print(txt.decode("UTF-8")) + txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + if verboseflag: + print(txt.decode("UTF-8")) # add single OpenKIM model if addflag: @@ -183,10 +172,10 @@ if addflag: kimdir = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if not os.path.isdir(kimdir): - print("\nkim-api is not installed") - error(help=help) + sys.exit("\nkim-api is not installed") # download single model cmd = '%s/bin/kim-api-v2-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print (txt.decode("UTF-8")) + txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + if verboseflag: + print(txt.decode("UTF-8")) From 927dc262b21f048576fe5de7ea1c1214c3654f4d Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 6 Feb 2019 23:41:45 -0600 Subject: [PATCH 44/49] Update CMake & Install.py for KIM API v2 --- cmake/CMakeLists.txt | 4 ++-- lib/kim/Install.py | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index ae2510c68b..ffef5d07c5 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -663,8 +663,8 @@ if(PKG_KIM) enable_language(Fortran) include(ExternalProject) ExternalProject_Add(kim_build - URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.0-beta.3.txz - URL_MD5 67c103a00e84865848d004837262c76e + URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.0.txz + URL_MD5 1ff8f563ad5991f7a2a25b35a13d7308 BINARY_DIR build CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/lib/kim/Install.py b/lib/kim/Install.py index 544fe2b65d..e2465eec85 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -18,7 +18,7 @@ parser = ArgumentParser(prog='Install.py', # settings thisdir = fullpath('.') -version = "kim-api-v2-2.0.0-beta.3" +version = "kim-api-v2-2.0.0" # help message @@ -35,19 +35,15 @@ Syntax from lib dir: python Install.py -b -v version -a kim-name Examples: make lib-kim args="-b" # install KIM API lib with only example models -make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # Ditto plus one model +make lib-kim args="-b -a EAM_ErcolessiAdams_1994_Al__MO_324507536345_002" # Ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models -make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # only add one model or model driver +make lib-kim args="-n -a EAM_Dynamo_Ackland_2003_W__MO_141627196590_005" # only add one model or model driver See the list of KIM model drivers here: https://openkim.org/kim-items/model-drivers/alphabetical See the list of all KIM models here: https://openkim.org/kim-items/models/by-model-drivers - -See the list of example KIM models included by default here: -https://openkim.org/kim-api -in the "What is in the KIM API source package?" section """ pgroup = parser.add_mutually_exclusive_group() From 6068a719ff4d6641a5f703594da83b7d8fadcf65 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Wed, 6 Feb 2019 23:53:47 -0600 Subject: [PATCH 45/49] Updated example/kim/log.* files --- ... log.06Feb2019.in.kim.lj.lmp.newton-off.1} | 24 +++++++++---------- ... log.06Feb2019.in.kim.lj.lmp.newton-off.4} | 22 ++++++++--------- ...> log.06Feb2019.in.kim.lj.lmp.newton-on.1} | 20 ++++++++-------- ...> log.06Feb2019.in.kim.lj.lmp.newton-on.4} | 22 ++++++++--------- ...1 => log.06Feb2019.in.kim.lj.newton-off.1} | 22 ++++++++--------- ...4 => log.06Feb2019.in.kim.lj.newton-off.4} | 22 ++++++++--------- ....1 => log.06Feb2019.in.kim.lj.newton-on.1} | 22 ++++++++--------- ....4 => log.06Feb2019.in.kim.lj.newton-on.4} | 22 ++++++++--------- 8 files changed, 88 insertions(+), 88 deletions(-) rename examples/kim/{log.12Dec2018.in.kim.lj.lmp.newton-off.1 => log.06Feb2019.in.kim.lj.lmp.newton-off.1} (71%) rename examples/kim/{log.12Dec2018.in.kim.lj.lmp.newton-off.4 => log.06Feb2019.in.kim.lj.lmp.newton-off.4} (71%) rename examples/kim/{log.12Dec2018.in.kim.lj.lmp.newton-on.1 => log.06Feb2019.in.kim.lj.lmp.newton-on.1} (74%) rename examples/kim/{log.12Dec2018.in.kim.lj.lmp.newton-on.4 => log.06Feb2019.in.kim.lj.lmp.newton-on.4} (71%) rename examples/kim/{log.12Dec2018.in.kim.lj.newton-off.1 => log.06Feb2019.in.kim.lj.newton-off.1} (75%) rename examples/kim/{log.12Dec2018.in.kim.lj.newton-off.4 => log.06Feb2019.in.kim.lj.newton-off.4} (80%) rename examples/kim/{log.12Dec2018.in.kim.lj.newton-on.1 => log.06Feb2019.in.kim.lj.newton-on.1} (75%) rename examples/kim/{log.12Dec2018.in.kim.lj.newton-on.4 => log.06Feb2019.in.kim.lj.newton-on.4} (80%) diff --git a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.1 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.1 similarity index 71% rename from examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.1 rename to examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.1 index 0b67cc1ccb..5925fd750d 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.1 +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.1 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00307703 secs + Time spent = 0.004499 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -26,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 20.37 | 20.37 | 20.37 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.58348 on 1 procs for 100 steps with 32000 atoms +Loop time of 2.92885 on 1 procs for 100 steps with 32000 atoms -Performance: 3.344 ns/day, 7.176 hours/ns, 38.707 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 2.950 ns/day, 8.136 hours/ns, 34.143 timesteps/s +99.1% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.2621 | 2.2621 | 2.2621 | 0.0 | 87.56 -Neigh | 0.28294 | 0.28294 | 0.28294 | 0.0 | 10.95 -Comm | 0.0057185 | 0.0057185 | 0.0057185 | 0.0 | 0.22 -Output | 0.00010109 | 0.00010109 | 0.00010109 | 0.0 | 0.00 -Modify | 0.023396 | 0.023396 | 0.023396 | 0.0 | 0.91 -Other | | 0.009175 | | | 0.36 +Pair | 2.5638 | 2.5638 | 2.5638 | 0.0 | 87.54 +Neigh | 0.31935 | 0.31935 | 0.31935 | 0.0 | 10.90 +Comm | 0.006833 | 0.006833 | 0.006833 | 0.0 | 0.23 +Output | 0.000107 | 0.000107 | 0.000107 | 0.0 | 0.00 +Modify | 0.027806 | 0.027806 | 0.027806 | 0.0 | 0.95 +Other | | 0.01091 | | | 0.37 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -52,4 +52,4 @@ Total # of neighbors = 2370499 Ave neighs/atom = 74.0781 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:02 +Total wall time: 0:00:03 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.4 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.4 similarity index 71% rename from examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.4 rename to examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.4 index e2ee8e39bb..c1ca108c7b 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-off.4 +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.4 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.000934124 secs + Time spent = 0.001039 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -26,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 8.013 | 8.013 | 8.013 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 0.76167 on 4 procs for 100 steps with 32000 atoms +Loop time of 0.778581 on 4 procs for 100 steps with 32000 atoms -Performance: 11.343 ns/day, 2.116 hours/ns, 131.290 timesteps/s -99.7% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 11.097 ns/day, 2.163 hours/ns, 128.439 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.65549 | 0.6589 | 0.66089 | 0.3 | 86.51 -Neigh | 0.075691 | 0.075959 | 0.07641 | 0.1 | 9.97 -Comm | 0.0073049 | 0.007397 | 0.0074785 | 0.1 | 0.97 -Output | 5.6982e-05 | 0.00014746 | 0.00024986 | 0.0 | 0.02 -Modify | 0.0068338 | 0.0068703 | 0.0068941 | 0.0 | 0.90 -Other | | 0.0124 | | | 1.63 +Pair | 0.65171 | 0.65891 | 0.67656 | 1.3 | 84.63 +Neigh | 0.07924 | 0.079548 | 0.07997 | 0.1 | 10.22 +Comm | 0.006755 | 0.0069015 | 0.007072 | 0.2 | 0.89 +Output | 4.6e-05 | 9.725e-05 | 0.000203 | 0.0 | 0.01 +Modify | 0.006841 | 0.006941 | 0.007015 | 0.1 | 0.89 +Other | | 0.02618 | | | 3.36 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.1 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.1 similarity index 74% rename from examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.1 rename to examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.1 index 91731438de..53555743d7 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.1 +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.1 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00311494 secs + Time spent = 0.003479 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -26,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.22646 on 1 procs for 100 steps with 32000 atoms +Loop time of 2.17978 on 1 procs for 100 steps with 32000 atoms -Performance: 3.881 ns/day, 6.185 hours/ns, 44.914 timesteps/s +Performance: 3.964 ns/day, 6.055 hours/ns, 45.876 timesteps/s 99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.0344 | 2.0344 | 2.0344 | 0.0 | 91.38 -Neigh | 0.14575 | 0.14575 | 0.14575 | 0.0 | 6.55 -Comm | 0.01127 | 0.01127 | 0.01127 | 0.0 | 0.51 -Output | 0.000103 | 0.000103 | 0.000103 | 0.0 | 0.00 -Modify | 0.024057 | 0.024057 | 0.024057 | 0.0 | 1.08 -Other | | 0.01083 | | | 0.49 +Pair | 1.9892 | 1.9892 | 1.9892 | 0.0 | 91.26 +Neigh | 0.14506 | 0.14506 | 0.14506 | 0.0 | 6.65 +Comm | 0.011049 | 0.011049 | 0.011049 | 0.0 | 0.51 +Output | 9.1e-05 | 9.1e-05 | 9.1e-05 | 0.0 | 0.00 +Modify | 0.02347 | 0.02347 | 0.02347 | 0.0 | 1.08 +Other | | 0.01094 | | | 0.50 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.4 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.4 similarity index 71% rename from examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.4 rename to examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.4 index 92eb8ba8bc..f0fdf66193 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.lmp.newton-on.4 +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.4 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.000946045 secs + Time spent = 0.000919 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -26,20 +26,20 @@ Per MPI rank memory allocation (min/avg/max) = 7.632 | 7.632 | 7.632 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 0.639437 on 4 procs for 100 steps with 32000 atoms +Loop time of 0.63515 on 4 procs for 100 steps with 32000 atoms -Performance: 13.512 ns/day, 1.776 hours/ns, 156.388 timesteps/s -99.7% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 13.603 ns/day, 1.764 hours/ns, 157.443 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.55655 | 0.55752 | 0.55833 | 0.1 | 87.19 -Neigh | 0.040557 | 0.040752 | 0.041148 | 0.1 | 6.37 -Comm | 0.024693 | 0.025886 | 0.026853 | 0.5 | 4.05 -Output | 4.6015e-05 | 5.1558e-05 | 6.0081e-05 | 0.0 | 0.01 -Modify | 0.0088108 | 0.0089263 | 0.0090554 | 0.1 | 1.40 -Other | | 0.006306 | | | 0.99 +Pair | 0.55365 | 0.5566 | 0.55868 | 0.2 | 87.63 +Neigh | 0.041495 | 0.0418 | 0.04211 | 0.1 | 6.58 +Comm | 0.019086 | 0.021075 | 0.023898 | 1.2 | 3.32 +Output | 4.4e-05 | 5.025e-05 | 6e-05 | 0.0 | 0.01 +Modify | 0.009315 | 0.0093595 | 0.009422 | 0.0 | 1.47 +Other | | 0.006263 | | | 0.99 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.1 similarity index 75% rename from examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 rename to examples/kim/log.06Feb2019.in.kim.lj.newton-off.1 index c25368b917..0ab258fe0d 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.newton-off.1 +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.1 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00450015 secs + Time spent = 0.003446 secs WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) Neighbor list info ... @@ -28,20 +28,20 @@ Per MPI rank memory allocation (min/avg/max) = 28.51 | 28.51 | 28.51 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 3.35585 on 1 procs for 100 steps with 32000 atoms +Loop time of 3.01669 on 1 procs for 100 steps with 32000 atoms -Performance: 2.575 ns/day, 9.322 hours/ns, 29.799 timesteps/s -99.2% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 2.864 ns/day, 8.380 hours/ns, 33.149 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.9239 | 2.9239 | 2.9239 | 0.0 | 87.13 -Neigh | 0.38492 | 0.38492 | 0.38492 | 0.0 | 11.47 -Comm | 0.0072038 | 0.0072038 | 0.0072038 | 0.0 | 0.21 -Output | 0.00010204 | 0.00010204 | 0.00010204 | 0.0 | 0.00 -Modify | 0.028316 | 0.028316 | 0.028316 | 0.0 | 0.84 -Other | | 0.01146 | | | 0.34 +Pair | 2.6562 | 2.6562 | 2.6562 | 0.0 | 88.05 +Neigh | 0.31903 | 0.31903 | 0.31903 | 0.0 | 10.58 +Comm | 0.00634 | 0.00634 | 0.00634 | 0.0 | 0.21 +Output | 9.1e-05 | 9.1e-05 | 9.1e-05 | 0.0 | 0.00 +Modify | 0.024723 | 0.024723 | 0.024723 | 0.0 | 0.82 +Other | | 0.01032 | | | 0.34 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.4 similarity index 80% rename from examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 rename to examples/kim/log.06Feb2019.in.kim.lj.newton-off.4 index c8c52d6e09..c17ea6afb7 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.newton-off.4 +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.4 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00106215 secs + Time spent = 0.000921 secs WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) @@ -34,20 +34,20 @@ Per MPI rank memory allocation (min/avg/max) = 10.05 | 10.05 | 10.05 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 0.930494 on 4 procs for 100 steps with 32000 atoms +Loop time of 0.890192 on 4 procs for 100 steps with 32000 atoms -Performance: 9.285 ns/day, 2.585 hours/ns, 107.470 timesteps/s -99.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 9.706 ns/day, 2.473 hours/ns, 112.335 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.80926 | 0.81195 | 0.81464 | 0.3 | 87.26 -Neigh | 0.089949 | 0.092688 | 0.095287 | 0.8 | 9.96 -Comm | 0.007302 | 0.0074284 | 0.0075471 | 0.1 | 0.80 -Output | 0.00012898 | 0.00014371 | 0.00016093 | 0.0 | 0.02 -Modify | 0.011517 | 0.011761 | 0.011959 | 0.2 | 1.26 -Other | | 0.006522 | | | 0.70 +Pair | 0.77867 | 0.77906 | 0.7794 | 0.0 | 87.52 +Neigh | 0.087831 | 0.088176 | 0.088805 | 0.1 | 9.91 +Comm | 0.006358 | 0.0065898 | 0.006815 | 0.3 | 0.74 +Output | 4.9e-05 | 5.975e-05 | 6.8e-05 | 0.0 | 0.01 +Modify | 0.010265 | 0.010429 | 0.010678 | 0.2 | 1.17 +Other | | 0.005874 | | | 0.66 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.1 similarity index 75% rename from examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 rename to examples/kim/log.06Feb2019.in.kim.lj.newton-on.1 index eec26307ac..59d018e12a 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.newton-on.1 +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.1 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.0030508 secs + Time spent = 0.003089 secs WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) Neighbor list info ... @@ -28,20 +28,20 @@ Per MPI rank memory allocation (min/avg/max) = 28.12 | 28.12 | 28.12 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 2.97001 on 1 procs for 100 steps with 32000 atoms +Loop time of 3.05849 on 1 procs for 100 steps with 32000 atoms -Performance: 2.909 ns/day, 8.250 hours/ns, 33.670 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 2.825 ns/day, 8.496 hours/ns, 32.696 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.5982 | 2.5982 | 2.5982 | 0.0 | 87.48 -Neigh | 0.32516 | 0.32516 | 0.32516 | 0.0 | 10.95 -Comm | 0.012059 | 0.012059 | 0.012059 | 0.0 | 0.41 -Output | 0.000103 | 0.000103 | 0.000103 | 0.0 | 0.00 -Modify | 0.023878 | 0.023878 | 0.023878 | 0.0 | 0.80 -Other | | 0.01058 | | | 0.36 +Pair | 2.6786 | 2.6786 | 2.6786 | 0.0 | 87.58 +Neigh | 0.33105 | 0.33105 | 0.33105 | 0.0 | 10.82 +Comm | 0.012602 | 0.012602 | 0.012602 | 0.0 | 0.41 +Output | 9.5e-05 | 9.5e-05 | 9.5e-05 | 0.0 | 0.00 +Modify | 0.024858 | 0.024858 | 0.024858 | 0.0 | 0.81 +Other | | 0.01132 | | | 0.37 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 diff --git a/examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.4 similarity index 80% rename from examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 rename to examples/kim/log.06Feb2019.in.kim.lj.newton-on.4 index 6c0da32ba4..da8c9f0faa 100644 --- a/examples/kim/log.12Dec2018.in.kim.lj.newton-on.4 +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.4 @@ -1,11 +1,11 @@ -LAMMPS (24 Oct 2018) +LAMMPS (1 Feb 2019) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) using 1 OpenMP thread(s) per MPI task Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.000946999 secs + Time spent = 0.000893 secs WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) @@ -34,20 +34,20 @@ Per MPI rank memory allocation (min/avg/max) = 9.789 | 9.789 | 9.789 Mbytes Step Temp E_pair E_mol TotEng Press 0 200 6290.8194 0 7118.0584 129712.25 100 95.179725 6718.814 0 7112.496 133346.59 -Loop time of 0.891065 on 4 procs for 100 steps with 32000 atoms +Loop time of 0.903182 on 4 procs for 100 steps with 32000 atoms -Performance: 9.696 ns/day, 2.475 hours/ns, 112.225 timesteps/s -99.8% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 9.566 ns/day, 2.509 hours/ns, 110.720 timesteps/s +99.6% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.75777 | 0.75864 | 0.75996 | 0.1 | 85.14 -Neigh | 0.088332 | 0.088883 | 0.089737 | 0.2 | 9.97 -Comm | 0.027187 | 0.02829 | 0.029602 | 0.6 | 3.17 -Output | 4.9114e-05 | 5.4777e-05 | 6.6042e-05 | 0.0 | 0.01 -Modify | 0.0088358 | 0.0089488 | 0.0091376 | 0.1 | 1.00 -Other | | 0.00625 | | | 0.70 +Pair | 0.76173 | 0.76349 | 0.76597 | 0.2 | 84.53 +Neigh | 0.088773 | 0.088938 | 0.089074 | 0.0 | 9.85 +Comm | 0.032018 | 0.03452 | 0.03638 | 0.9 | 3.82 +Output | 4e-05 | 4.425e-05 | 5.2e-05 | 0.0 | 0.00 +Modify | 0.009278 | 0.0093917 | 0.009528 | 0.1 | 1.04 +Other | | 0.006797 | | | 0.75 Nlocal: 8000 ave 8018 max 7967 min Histogram: 1 0 0 0 0 0 1 0 0 2 From e95cf4e9176ca92b769e250e2c02f069a8b790d3 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 14 Feb 2019 13:38:28 -0600 Subject: [PATCH 46/49] Some various doc updates for kim-api support --- cmake/Modules/FindKIM-API-V2.cmake | 5 ----- doc/src/pair_kim.txt | 6 +++--- lib/kim/README | 16 ++++++++-------- src/KIM/pair_kim.cpp | 2 +- src/KIM/pair_kim.h | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/cmake/Modules/FindKIM-API-V2.cmake b/cmake/Modules/FindKIM-API-V2.cmake index 0cc947e139..6ca6e068df 100644 --- a/cmake/Modules/FindKIM-API-V2.cmake +++ b/cmake/Modules/FindKIM-API-V2.cmake @@ -28,11 +28,6 @@ # Ryan S. Elliott # -# -# Release: This file is part of the kim-api.git repository. -# - - # - Find KIM-API-V2 # # sets standard pkg_check_modules variables plus: diff --git a/doc/src/pair_kim.txt b/doc/src/pair_kim.txt index 0c05913117..67ab0b6c07 100644 --- a/doc/src/pair_kim.txt +++ b/doc/src/pair_kim.txt @@ -48,8 +48,8 @@ building LAMMPS. See the examples/kim dir for an input script that uses a KIM model (potential) for Lennard-Jones. Note, for this example input script, the example models -shipped with with kim-api package must be installed. See the "Making -LAMMPS"_Section_start.html#start_3 section and the ./lib/kim/README for details +shipped with with kim-api package must be installed. See the "Build +package"_Build_package.html section and the ./lib/kim/README for details on how to build LAMMSPS with the kim-api and how to install the example models. :line @@ -115,7 +115,7 @@ LAMMPS was built with that package. See the "Build package"_Build_package.html doc page for more info. This current version of pair_style kim is compatible with the -kim-api package version 2.0.0-beta.2 and higher. +kim-api package version 2.0.0 and higher. [Related commands:] diff --git a/lib/kim/README b/lib/kim/README index 7cf8f9bb7d..0e51a30870 100644 --- a/lib/kim/README +++ b/lib/kim/README @@ -20,17 +20,17 @@ Instructions: 1. Configure lammps for use with the kim-api library installed in this directory # replace X.Y.Z as appropriate here and below -$ printf "${PWD}/installed-kim-api-vX.Y.Z" > ./kim-prefix.txt +$ printf "${PWD}/installed-kim-api-vX-X.Y.Z" > ./kim-prefix.txt 2. Download and unpack the kim-api -$ wget http://s3.openkim.org/kim-api/kim-api-vX.Y.Z.txz -$ tar zxvf kim-api-vX.Y.Z.txz +$ wget http://s3.openkim.org/kim-api/kim-api-vX-X.Y.Z.txz +$ tar zxvf kim-api-vX-X.Y.Z.txz # configure the kim-api -$ cd kim-api-vX.Y.Z +$ cd kim-api-vX-X.Y.Z $ mkdir build && cd build -$ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-vX.Y.Z +$ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-vX-X.Y.Z 3. Build and install the kim-api and model @@ -40,13 +40,13 @@ $ make install 4. Remove source and build files $ cd ../../ -$ rm -rf kim-api-vX.Y.Z -$ rm -rf kim-api-vX.Y.Z.txz +$ rm -rf kim-api-vX-X.Y.Z +$ rm -rf kim-api-vX-X.Y.Z.txz 5. To add items do the following (replace the kim item name with your desired value) -$ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-vX-activate +$ source ${PWD}/kim-api-vX-X.Y.Z/bin/kim-api-vX-activate $ kim-api-vX-collections-management install system Pair_Johnson_Fe__MO_857282754307_002 diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 6981b028b2..a4517b848c 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -50,7 +50,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2.0.0-beta.2 (and newer) package + Designed for use with the kim-api-v2-2.0.0 (and newer) package ------------------------------------------------------------------------- */ #include diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index a23d5cd317..a6f882347d 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -50,7 +50,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v2.0.0-beta.2 (and newer) package + Designed for use with the kim-api-v2-2.0.0 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS From c193a9aee902a8a5f7eac683d04be3051fb377fe Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Thu, 14 Feb 2019 19:28:18 -0600 Subject: [PATCH 47/49] Updated Errors_messages.txt & false_positives.txt --- doc/src/Errors_messages.txt | 2 -- doc/utils/sphinx-config/false_positives.txt | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/Errors_messages.txt b/doc/src/Errors_messages.txt index dab46874fb..fb5003e602 100644 --- a/doc/src/Errors_messages.txt +++ b/doc/src/Errors_messages.txt @@ -10179,8 +10179,6 @@ valid. :dd Self-explanatory. :dd -{Unrecognized virial argument in pair_style command} :dt - {Unsupported mixing rule in kspace_style ewald/disp} :dt Only geometric mixing is supported. :dd diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 5844dd3454..b76ec11f8d 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1384,6 +1384,7 @@ libfftw libgcc libgpu libjpeg +libkim liblammps Liblammps liblink From afa50ab61a4fc4511dd3bce2ab8b955c20f6e27c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 15 Feb 2019 02:21:07 -0500 Subject: [PATCH 48/49] update pathspec when linking KIM API from downloaded archive --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b40c9aaeb2..c49dcfae71 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -674,7 +674,7 @@ if(PKG_KIM) ) ExternalProject_get_property(kim_build INSTALL_DIR) set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) - set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/lib/libkim-api-v2.2${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api-v2${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LAMMPS_DEPS kim_build) else() find_package(KIM-API-V2) From c2725f5a49a3368885a467ac9bbbba8c278a4c53 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 15 Feb 2019 03:53:09 -0500 Subject: [PATCH 49/49] forward build type setting to compiling downloaded KIM API --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c49dcfae71..30c8171f28 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -670,7 +670,7 @@ if(PKG_KIM) -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} -DCMAKE_INSTALL_PREFIX= - -DCMAKE_BUILD_TYPE=Release + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ) ExternalProject_get_property(kim_build INSTALL_DIR) set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2)