cutghost is not used anyware; remove to plug memory leaks
This commit is contained in:
@ -107,17 +107,14 @@ void MLIAPDummyDescriptorKokkos<DeviceType>::init()
|
|||||||
double cut;
|
double cut;
|
||||||
cutmax = 0.0;
|
cutmax = 0.0;
|
||||||
memory->create(cutsq, nelements, nelements, "mliap/descriptor/dummy:cutsq");
|
memory->create(cutsq, nelements, nelements, "mliap/descriptor/dummy:cutsq");
|
||||||
memory->create(cutghost, nelements, nelements, "mliap/descriptor/dummy:cutghost");
|
|
||||||
for (int ielem = 0; ielem < nelements; ielem++) {
|
for (int ielem = 0; ielem < nelements; ielem++) {
|
||||||
// rcutfac set from python, is global cutoff for all elements
|
// rcutfac set from python, is global cutoff for all elements
|
||||||
cut = 2.0 * radelem[ielem] * rcutfac;
|
cut = 2.0 * radelem[ielem] * rcutfac;
|
||||||
if (cut > cutmax) cutmax = cut;
|
if (cut > cutmax) cutmax = cut;
|
||||||
cutsq[ielem][ielem] = cut * cut;
|
cutsq[ielem][ielem] = cut * cut;
|
||||||
cutghost[ielem][ielem] = cut * cut;
|
|
||||||
for (int jelem = ielem + 1; jelem < nelements; jelem++) {
|
for (int jelem = ielem + 1; jelem < nelements; jelem++) {
|
||||||
cut = (radelem[ielem] + radelem[jelem]) * rcutfac;
|
cut = (radelem[ielem] + radelem[jelem]) * rcutfac;
|
||||||
cutsq[ielem][jelem] = cutsq[jelem][ielem] = cut * cut;
|
cutsq[ielem][jelem] = cutsq[jelem][ielem] = cut * cut;
|
||||||
cutghost[ielem][jelem] = cutghost[jelem][ielem] = cut * cut;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
MLIAPDescriptor::MLIAPDescriptor(LAMMPS *lmp) :
|
MLIAPDescriptor::MLIAPDescriptor(LAMMPS *lmp) :
|
||||||
Pointers(lmp), ndescriptors(0), nelements(0), elements(nullptr), cutsq(nullptr),
|
Pointers(lmp), ndescriptors(0), nelements(0), elements(nullptr), cutsq(nullptr),
|
||||||
cutghost(nullptr), radelem(nullptr), wjelem(nullptr)
|
radelem(nullptr), wjelem(nullptr)
|
||||||
{
|
{
|
||||||
cutmax = 0.0;
|
cutmax = 0.0;
|
||||||
allocated_elements = 0;
|
allocated_elements = 0;
|
||||||
@ -38,7 +38,6 @@ MLIAPDescriptor::~MLIAPDescriptor()
|
|||||||
for (int i = 0; i < nelements; i++) delete[] elements[i];
|
for (int i = 0; i < nelements; i++) delete[] elements[i];
|
||||||
delete[] elements;
|
delete[] elements;
|
||||||
memory->destroy(cutsq);
|
memory->destroy(cutsq);
|
||||||
memory->destroy(cutghost);
|
|
||||||
memory->destroy(radelem);
|
memory->destroy(radelem);
|
||||||
memory->destroy(wjelem);
|
memory->destroy(wjelem);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,15 +29,14 @@ class MLIAPDescriptor : virtual protected Pointers {
|
|||||||
virtual void init() = 0;
|
virtual void init() = 0;
|
||||||
virtual double memory_usage();
|
virtual double memory_usage();
|
||||||
|
|
||||||
int ndescriptors; // number of descriptors
|
int ndescriptors; // number of descriptors
|
||||||
int nelements; // # of unique elements
|
int nelements; // # of unique elements
|
||||||
int allocated_elements; // is the element array allocated
|
int allocated_elements; // is the element array allocated
|
||||||
char **elements; // names of unique elements
|
char **elements; // names of unique elements
|
||||||
double **cutsq; // nelem x nelem rcutsq values
|
double **cutsq; // nelem x nelem rcutsq values
|
||||||
double **cutghost; // cutoff for each ghost pair
|
double cutmax; // maximum cutoff needed
|
||||||
double cutmax; // maximum cutoff needed
|
double *radelem; // element radii
|
||||||
double *radelem; // element radii
|
double *wjelem; // elements weights
|
||||||
double *wjelem; // elements weights
|
|
||||||
protected:
|
protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -95,17 +95,14 @@ void MLIAPDummyDescriptor::init()
|
|||||||
double cut;
|
double cut;
|
||||||
cutmax = 0.0;
|
cutmax = 0.0;
|
||||||
memory->create(cutsq, nelements, nelements, "mliap/descriptor/dummy:cutsq");
|
memory->create(cutsq, nelements, nelements, "mliap/descriptor/dummy:cutsq");
|
||||||
memory->create(cutghost, nelements, nelements, "mliap/descriptor/dummy:cutghost");
|
|
||||||
for (int ielem = 0; ielem < nelements; ielem++) {
|
for (int ielem = 0; ielem < nelements; ielem++) {
|
||||||
// rcutfac set from python, is global cutoff for all elements
|
// rcutfac set from python, is global cutoff for all elements
|
||||||
cut = 2.0 * radelem[ielem] * rcutfac;
|
cut = 2.0 * radelem[ielem] * rcutfac;
|
||||||
if (cut > cutmax) cutmax = cut;
|
if (cut > cutmax) cutmax = cut;
|
||||||
cutsq[ielem][ielem] = cut * cut;
|
cutsq[ielem][ielem] = cut * cut;
|
||||||
cutghost[ielem][ielem] = cut * cut;
|
|
||||||
for (int jelem = ielem + 1; jelem < nelements; jelem++) {
|
for (int jelem = ielem + 1; jelem < nelements; jelem++) {
|
||||||
cut = (radelem[ielem] + radelem[jelem]) * rcutfac;
|
cut = (radelem[ielem] + radelem[jelem]) * rcutfac;
|
||||||
cutsq[ielem][jelem] = cutsq[jelem][ielem] = cut * cut;
|
cutsq[ielem][jelem] = cutsq[jelem][ielem] = cut * cut;
|
||||||
cutghost[ielem][jelem] = cutghost[jelem][ielem] = cut * cut;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,6 @@ PairMLIAP::~PairMLIAP()
|
|||||||
if (allocated) {
|
if (allocated) {
|
||||||
memory->destroy(setflag);
|
memory->destroy(setflag);
|
||||||
memory->destroy(cutsq);
|
memory->destroy(cutsq);
|
||||||
memory->destroy(cutghost);
|
|
||||||
memory->destroy(map);
|
memory->destroy(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,7 +124,6 @@ void PairMLIAP::allocate()
|
|||||||
|
|
||||||
memory->create(setflag,n+1,n+1,"pair:setflag");
|
memory->create(setflag,n+1,n+1,"pair:setflag");
|
||||||
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
||||||
memory->create(cutghost,n+1,n+1,"pair:cutghost");
|
|
||||||
memory->create(map,n+1,"pair:map");
|
memory->create(map,n+1,"pair:map");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,7 +359,6 @@ double PairMLIAP::init_one(int i, int j)
|
|||||||
"All pair coeffs are not set. Status\n" + Info::get_pair_coeff_status(lmp));
|
"All pair coeffs are not set. Status\n" + Info::get_pair_coeff_status(lmp));
|
||||||
|
|
||||||
double cutmax = sqrt(descriptor->cutsq[map[i]][map[j]]);
|
double cutmax = sqrt(descriptor->cutsq[map[i]][map[j]]);
|
||||||
cutghost[i][j] = cutghost[j][i] = 2.0 * cutmax + neighbor->skin;
|
|
||||||
return cutmax;
|
return cutmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,7 +373,6 @@ double PairMLIAP::memory_usage()
|
|||||||
int n = atom->ntypes+1;
|
int n = atom->ntypes+1;
|
||||||
bytes += (double)n*n*sizeof(int); // setflag
|
bytes += (double)n*n*sizeof(int); // setflag
|
||||||
bytes += (double)n*n*sizeof(int); // cutsq
|
bytes += (double)n*n*sizeof(int); // cutsq
|
||||||
bytes += (double)n*n*sizeof(int); // cutghost
|
|
||||||
bytes += (double)n*sizeof(int); // map
|
bytes += (double)n*sizeof(int); // map
|
||||||
bytes += descriptor->memory_usage(); // Descriptor object
|
bytes += descriptor->memory_usage(); // Descriptor object
|
||||||
bytes += model->memory_usage(); // Model object
|
bytes += model->memory_usage(); // Model object
|
||||||
|
|||||||
Reference in New Issue
Block a user