git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5793 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -879,24 +879,24 @@ int AtomVecEllipsoid::data_vel_hybrid(int m, char **values)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecEllipsoid::memory_usage()
|
bigint AtomVecEllipsoid::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("quat")) bytes += nmax*4 * sizeof(double);
|
if (atom->memcheck("quat")) bytes += memory->usage(quat,nmax,4);
|
||||||
if (atom->memcheck("angmom")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3);
|
||||||
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class AtomVecEllipsoid : public AtomVec {
|
|||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -729,23 +729,23 @@ int AtomVecColloid::data_vel_hybrid(int m, char **values)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecColloid::memory_usage()
|
bigint AtomVecColloid::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
|
||||||
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class AtomVecColloid : public AtomVec {
|
|||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -869,22 +869,22 @@ int AtomVecDipole::data_vel_hybrid(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecDipole::memory_usage()
|
bigint AtomVecDipole::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("q")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
|
||||||
if (atom->memcheck("mu")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("mu")) bytes += memory->usage(mu,nmax,3);
|
||||||
if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
|
||||||
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class AtomVecDipole : public AtomVec {
|
|||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -1009,23 +1009,23 @@ int AtomVecGranular::data_vel_hybrid(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecGranular::memory_usage()
|
bigint AtomVecGranular::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("radius")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("radius")) bytes += memory->usage(radius,nmax);
|
||||||
if (atom->memcheck("density")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("density")) bytes += memory->usage(density,nmax);
|
||||||
if (atom->memcheck("rmass")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
|
||||||
if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
|
||||||
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class AtomVecGranular : public AtomVec {
|
|||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
int data_vel_hybrid(int, char **);
|
int data_vel_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double PI;
|
double PI;
|
||||||
|
|||||||
@ -20,7 +20,6 @@ KSpaceStyle(pppm,PPPM)
|
|||||||
#ifndef LMP_PPPM_H
|
#ifndef LMP_PPPM_H
|
||||||
#define LMP_PPPM_H
|
#define LMP_PPPM_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "kspace.h"
|
#include "kspace.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(qeq/comb,FixQEQComb)
|
|||||||
#ifndef LMP_FIX_QEQ_COMB_H
|
#ifndef LMP_FIX_QEQ_COMB_H
|
||||||
#define LMP_FIX_QEQ_COMB_H
|
#define LMP_FIX_QEQ_COMB_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "atom_vec_angle.h"
|
#include "atom_vec_angle.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
@ -795,37 +794,38 @@ int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecAngle::memory_usage()
|
bigint AtomVecAngle::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
|
||||||
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
|
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
|
||||||
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
|
if (atom->memcheck("special"))
|
||||||
|
bytes += memory->usage(special,nmax,atom->maxspecial);
|
||||||
|
|
||||||
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
|
||||||
if (atom->memcheck("bond_type"))
|
if (atom->memcheck("bond_type"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
|
||||||
if (atom->memcheck("bond_atom"))
|
if (atom->memcheck("bond_atom"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_angle")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
|
||||||
if (atom->memcheck("angle_type"))
|
if (atom->memcheck("angle_type"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom1"))
|
if (atom->memcheck("angle_atom1"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom2"))
|
if (atom->memcheck("angle_atom2"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom3"))
|
if (atom->memcheck("angle_atom3"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class AtomVecAngle : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -752,27 +752,28 @@ int AtomVecBond::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecBond::memory_usage()
|
bigint AtomVecBond::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
|
||||||
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
|
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
|
||||||
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
|
if (atom->memcheck("special"))
|
||||||
|
bytes += memory->usage(special,nmax,atom->maxspecial);
|
||||||
|
|
||||||
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
|
||||||
if (atom->memcheck("bond_type"))
|
if (atom->memcheck("bond_type"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
|
||||||
if (atom->memcheck("bond_atom"))
|
if (atom->memcheck("bond_atom"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class AtomVecBond : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -963,62 +963,63 @@ int AtomVecFull::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecFull::memory_usage()
|
bigint AtomVecFull::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("q")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
|
||||||
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
|
||||||
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
|
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
|
||||||
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
|
if (atom->memcheck("special"))
|
||||||
|
bytes += memory->usage(special,nmax,atom->maxspecial);
|
||||||
|
|
||||||
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
|
||||||
if (atom->memcheck("bond_type"))
|
if (atom->memcheck("bond_type"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
|
||||||
if (atom->memcheck("bond_atom"))
|
if (atom->memcheck("bond_atom"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_angle")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
|
||||||
if (atom->memcheck("angle_type"))
|
if (atom->memcheck("angle_type"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom1"))
|
if (atom->memcheck("angle_atom1"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom2"))
|
if (atom->memcheck("angle_atom2"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom3"))
|
if (atom->memcheck("angle_atom3"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_dihedral")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_dihedral")) bytes += memory->usage(num_dihedral,nmax);
|
||||||
if (atom->memcheck("dihedral_type"))
|
if (atom->memcheck("dihedral_type"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_type,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom1"))
|
if (atom->memcheck("dihedral_atom1"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom1,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom2"))
|
if (atom->memcheck("dihedral_atom2"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom2,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom3"))
|
if (atom->memcheck("dihedral_atom3"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom3,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom4"))
|
if (atom->memcheck("dihedral_atom4"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom4,nmax,atom->dihedral_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_improper")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_improper")) bytes += memory->usage(num_improper,nmax);
|
||||||
if (atom->memcheck("improper_type"))
|
if (atom->memcheck("improper_type"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_type,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom1"))
|
if (atom->memcheck("improper_atom1"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom1,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom2"))
|
if (atom->memcheck("improper_atom2"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom2,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom3"))
|
if (atom->memcheck("improper_atom3"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom3,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom4"))
|
if (atom->memcheck("improper_atom4"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom4,nmax,atom->improper_per_atom);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class AtomVecFull : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -944,61 +944,62 @@ int AtomVecMolecular::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecMolecular::memory_usage()
|
bigint AtomVecMolecular::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
|
||||||
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
|
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
|
||||||
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
|
if (atom->memcheck("special"))
|
||||||
|
bytes += memory->usage(special,nmax,atom->maxspecial);
|
||||||
|
|
||||||
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
|
||||||
if (atom->memcheck("bond_type"))
|
if (atom->memcheck("bond_type"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
|
||||||
if (atom->memcheck("bond_atom"))
|
if (atom->memcheck("bond_atom"))
|
||||||
bytes += nmax*atom->bond_per_atom * sizeof(int);
|
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_angle")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
|
||||||
if (atom->memcheck("angle_type"))
|
if (atom->memcheck("angle_type"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom1"))
|
if (atom->memcheck("angle_atom1"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom2"))
|
if (atom->memcheck("angle_atom2"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
|
||||||
if (atom->memcheck("angle_atom3"))
|
if (atom->memcheck("angle_atom3"))
|
||||||
bytes += nmax*atom->angle_per_atom * sizeof(int);
|
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_dihedral")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_dihedral")) bytes += memory->usage(num_dihedral,nmax);
|
||||||
if (atom->memcheck("dihedral_type"))
|
if (atom->memcheck("dihedral_type"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_type,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom1"))
|
if (atom->memcheck("dihedral_atom1"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom1,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom2"))
|
if (atom->memcheck("dihedral_atom2"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom2,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom3"))
|
if (atom->memcheck("dihedral_atom3"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom3,nmax,atom->dihedral_per_atom);
|
||||||
if (atom->memcheck("dihedral_atom4"))
|
if (atom->memcheck("dihedral_atom4"))
|
||||||
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
|
bytes += memory->usage(dihedral_atom4,nmax,atom->dihedral_per_atom);
|
||||||
|
|
||||||
if (atom->memcheck("num_improper")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("num_improper")) bytes += memory->usage(num_improper,nmax);
|
||||||
if (atom->memcheck("improper_type"))
|
if (atom->memcheck("improper_type"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_type,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom1"))
|
if (atom->memcheck("improper_atom1"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom1,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom2"))
|
if (atom->memcheck("improper_atom2"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom2,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom3"))
|
if (atom->memcheck("improper_atom3"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom3,nmax,atom->improper_per_atom);
|
||||||
if (atom->memcheck("improper_atom4"))
|
if (atom->memcheck("improper_atom4"))
|
||||||
bytes += nmax*atom->improper_per_atom * sizeof(int);
|
bytes += memory->usage(improper_atom4,nmax,atom->improper_per_atom);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class AtomVecMolecular : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -798,23 +798,23 @@ int AtomVecPeri::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecPeri::memory_usage()
|
bigint AtomVecPeri::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("vfrac")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("vfrac")) bytes += memory->usage(vfrac,nmax);
|
||||||
if (atom->memcheck("density")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("density")) bytes += memory->usage(density,nmax);
|
||||||
if (atom->memcheck("rmass")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
|
||||||
if (atom->memcheck("s0")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("s0")) bytes += memory->usage(s0,nmax);
|
||||||
if (atom->memcheck("x0")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x0")) bytes += memory->usage(x0,nmax,3);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class AtomVecPeri : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(reax/bonds,FixReaxBonds)
|
|||||||
#ifndef LMP_FIX_REAX_BONDS_H
|
#ifndef LMP_FIX_REAX_BONDS_H
|
||||||
#define LMP_FIX_REAX_BONDS_H
|
#define LMP_FIX_REAX_BONDS_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(EVENT/PRD,FixEventPRD)
|
|||||||
#ifndef LMP_FIX_EVENT_PRD_H
|
#ifndef LMP_FIX_EVENT_PRD_H
|
||||||
#define LMP_FIX_EVENT_PRD_H
|
#define LMP_FIX_EVENT_PRD_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "fix_event.h"
|
#include "fix_event.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(EVENT/TAD,FixEventTAD)
|
|||||||
#ifndef LMP_FIX_EVENT_TAD_H
|
#ifndef LMP_FIX_EVENT_TAD_H
|
||||||
#define LMP_FIX_EVENT_TAD_H
|
#define LMP_FIX_EVENT_TAD_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "fix_event.h"
|
#include "fix_event.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(wall/srd,FixWallSRD)
|
|||||||
#ifndef LMP_FIX_WALL_SRD_H
|
#ifndef LMP_FIX_WALL_SRD_H
|
||||||
#define LMP_FIX_WALL_SRD_H
|
#define LMP_FIX_WALL_SRD_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
support for groups
|
support for groups
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
@ -304,10 +305,10 @@ int DumpXTC::modify_param(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory in buf and global coords array
|
return # of bytes of allocated memory in buf and global coords array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double DumpXTC::memory_usage()
|
bigint DumpXTC::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = Dump::memory_usage();
|
bigint bytes = Dump::memory_usage();
|
||||||
bytes += 3*natoms * sizeof(float);
|
bytes += memory->usage(coords,natoms*3);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class DumpXTC : public Dump {
|
|||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
void write_frame();
|
void write_frame();
|
||||||
};
|
};
|
||||||
|
|||||||
12
src/atom.cpp
12
src/atom.cpp
@ -1612,21 +1612,25 @@ void *Atom::extract(char *name)
|
|||||||
add in global to local mapping storage
|
add in global to local mapping storage
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Atom::memory_usage()
|
bigint Atom::memory_usage()
|
||||||
{
|
{
|
||||||
memlength = DELTA_MEMSTR;
|
memlength = DELTA_MEMSTR;
|
||||||
memory->create(memstr,memlength,"atom:memstr");
|
memory->create(memstr,memlength,"atom:memstr");
|
||||||
memstr[0] = '\0';
|
memstr[0] = '\0';
|
||||||
|
bigint bytes = avec->memory_usage();
|
||||||
|
memory->destroy(memstr);
|
||||||
|
|
||||||
double bytes = avec->memory_usage();
|
|
||||||
if (map_style == 1)
|
if (map_style == 1)
|
||||||
bytes += map_tag_max * sizeof(int);
|
bytes += memory->usage(map_array,map_tag_max+1);
|
||||||
else if (map_style == 2) {
|
else if (map_style == 2) {
|
||||||
bytes += map_nbucket*sizeof(int);
|
bytes += map_nbucket*sizeof(int);
|
||||||
bytes += map_nhash*sizeof(HashElem);
|
bytes += map_nhash*sizeof(HashElem);
|
||||||
}
|
}
|
||||||
|
if (maxnext) {
|
||||||
|
bytes += memory->usage(next,maxnext);
|
||||||
|
bytes += memory->usage(permute,maxnext);
|
||||||
|
}
|
||||||
|
|
||||||
memory->destroy(memstr);
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_ATOM_H
|
#ifndef LMP_ATOM_H
|
||||||
#define LMP_ATOM_H
|
#define LMP_ATOM_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
@ -160,7 +159,7 @@ class Atom : protected Pointers {
|
|||||||
|
|
||||||
void *extract(char *);
|
void *extract(char *);
|
||||||
|
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
int memcheck(const char *);
|
int memcheck(const char *);
|
||||||
|
|
||||||
// functions for global to local ID mapping
|
// functions for global to local ID mapping
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class AtomVec : protected Pointers {
|
|||||||
virtual void data_vel(int, char **);
|
virtual void data_vel(int, char **);
|
||||||
virtual int data_vel_hybrid(int, char **) {return 0;}
|
virtual int data_vel_hybrid(int, char **) {return 0;}
|
||||||
|
|
||||||
virtual double memory_usage() = 0;
|
virtual bigint memory_usage() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int nmax; // local copy of atom->nmax
|
int nmax; // local copy of atom->nmax
|
||||||
|
|||||||
@ -619,17 +619,17 @@ void AtomVecAtomic::data_atom(double *coord, int imagetmp, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecAtomic::memory_usage()
|
bigint AtomVecAtomic::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class AtomVecAtomic : public AtomVec {
|
|||||||
int unpack_restart(double *);
|
int unpack_restart(double *);
|
||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -673,19 +673,19 @@ int AtomVecCharge::data_atom_hybrid(int nlocal, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecCharge::memory_usage()
|
bigint AtomVecCharge::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
|
||||||
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
|
||||||
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
|
||||||
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
|
||||||
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
|
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
|
||||||
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
|
||||||
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
|
||||||
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
|
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
|
||||||
|
|
||||||
if (atom->memcheck("q")) bytes += nmax * sizeof(double);
|
if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class AtomVecCharge : public AtomVec {
|
|||||||
void create_atom(int, double *);
|
void create_atom(int, double *);
|
||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **);
|
int data_atom_hybrid(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
@ -842,9 +842,9 @@ void AtomVecHybrid::data_vel(int m, char **values)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double AtomVecHybrid::memory_usage()
|
bigint AtomVecHybrid::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
for (int k = 0; k < nstyles; k++) bytes += styles[k]->memory_usage();
|
for (int k = 0; k < nstyles; k++) bytes += styles[k]->memory_usage();
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class AtomVecHybrid : public AtomVec {
|
|||||||
void data_atom(double *, int, char **);
|
void data_atom(double *, int, char **);
|
||||||
int data_atom_hybrid(int, char **) {return 0;}
|
int data_atom_hybrid(int, char **) {return 0;}
|
||||||
void data_vel(int, char **);
|
void data_vel(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int *tag,*type,*mask,*image;
|
int *tag,*type,*mask,*image;
|
||||||
|
|||||||
22
src/comm.cpp
22
src/comm.cpp
@ -15,6 +15,7 @@
|
|||||||
Contributing author (triclinic) : Pieter in 't Veld (SNL)
|
Contributing author (triclinic) : Pieter in 't Veld (SNL)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
@ -75,11 +76,11 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
maxswap = 6;
|
maxswap = 6;
|
||||||
allocate_swap(maxswap);
|
allocate_swap(maxswap);
|
||||||
|
|
||||||
sendlist = (int **) memory->smalloc(maxswap*sizeof(int *),"sendlist");
|
sendlist = (int **) memory->smalloc(maxswap*sizeof(int *),"comm:sendlist");
|
||||||
memory->create(maxsendlist,maxswap,"maxsendlist");
|
maxsendlist = new int[maxswap];
|
||||||
for (int i = 0; i < maxswap; i++) {
|
for (int i = 0; i < maxswap; i++) {
|
||||||
maxsendlist[i] = BUFMIN;
|
maxsendlist[i] = BUFMIN;
|
||||||
memory->create(sendlist[i],BUFMIN,"sendlist[i]");
|
memory->create(sendlist[i],BUFMIN,"comm:sendlist[i]");
|
||||||
}
|
}
|
||||||
|
|
||||||
maxforward_fix = maxreverse_fix = 0;
|
maxforward_fix = maxreverse_fix = 0;
|
||||||
@ -98,9 +99,9 @@ Comm::~Comm()
|
|||||||
memory->destroy(cutghostmulti);
|
memory->destroy(cutghostmulti);
|
||||||
}
|
}
|
||||||
|
|
||||||
memory->destroy(maxsendlist);
|
|
||||||
if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]);
|
if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]);
|
||||||
memory->sfree(sendlist);
|
memory->sfree(sendlist);
|
||||||
|
delete [] maxsendlist;
|
||||||
|
|
||||||
memory->destroy(buf_send);
|
memory->destroy(buf_send);
|
||||||
memory->destroy(buf_recv);
|
memory->destroy(buf_recv);
|
||||||
@ -1280,13 +1281,12 @@ void Comm::set(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Comm::memory_usage()
|
bigint Comm::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
|
for (int i = 0; i < nswap; i++)
|
||||||
for (int i = 0; i < nswap; i++) bytes += maxsendlist[i] * sizeof(int);
|
bytes += memory->usage(sendlist[i],maxsendlist[i]);
|
||||||
bytes += maxsend * sizeof(double);
|
bytes += memory->usage(buf_send,maxsend+BUFEXTRA);
|
||||||
bytes += maxrecv * sizeof(double);
|
bytes += memory->usage(buf_recv,maxrecv);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class Comm : protected Pointers {
|
|||||||
void reverse_comm_compute(class Compute *); // reverse comm from a Compute
|
void reverse_comm_compute(class Compute *); // reverse comm from a Compute
|
||||||
|
|
||||||
void set(int, char **); // set communication style
|
void set(int, char **); // set communication style
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int style; // single vs multi-type comm
|
int style; // single vs multi-type comm
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_COMPUTE_H
|
#ifndef LMP_COMPUTE_H
|
||||||
#define LMP_COMPUTE_H
|
#define LMP_COMPUTE_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ ComputeStyle(reduce,ComputeReduce)
|
|||||||
#ifndef LMP_COMPUTE_REDUCE_H
|
#ifndef LMP_COMPUTE_REDUCE_H
|
||||||
#define LMP_COMPUTE_REDUCE_H
|
#define LMP_COMPUTE_REDUCE_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ ComputeStyle(reduce/region,ComputeReduceRegion)
|
|||||||
#ifndef LMP_COMPUTE_REDUCE_REGION_H
|
#ifndef LMP_COMPUTE_REDUCE_REGION_H
|
||||||
#define LMP_COMPUTE_REDUCE_REGION_H
|
#define LMP_COMPUTE_REDUCE_REGION_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "compute_reduce.h"
|
#include "compute_reduce.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
14
src/dump.cpp
14
src/dump.cpp
@ -710,15 +710,15 @@ void Dump::modify_params(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Dump::memory_usage()
|
bigint Dump::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = maxbuf*size_one * sizeof(double); // buf
|
bigint bytes = memory->usage(buf,size_one*maxbuf);
|
||||||
if (sort_flag) {
|
if (sort_flag) {
|
||||||
if (sortcol == 0) bytes += maxids * sizeof(int); // ids
|
if (sortcol == 0) bytes += memory->usage(ids,maxids);
|
||||||
bytes += maxsort*size_one * sizeof(double); // bufsort
|
bytes += memory->usage(bufsort,size_one*maxsort);
|
||||||
if (sortcol == 0) bytes += maxsort * sizeof(int); // idsort
|
if (sortcol == 0) bytes += memory->usage(idsort,maxsort);
|
||||||
bytes += maxsort * sizeof(int); // index
|
bytes += memory->usage(index,maxsort);
|
||||||
bytes += maxproc * sizeof(int); // proclist
|
bytes += memory->usage(proclist,maxproc);
|
||||||
if (irregular) bytes += irregular->memory_usage();
|
if (irregular) bytes += irregular->memory_usage();
|
||||||
}
|
}
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_DUMP_H
|
#ifndef LMP_DUMP_H
|
||||||
#define LMP_DUMP_H
|
#define LMP_DUMP_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ class Dump : protected Pointers {
|
|||||||
void init();
|
void init();
|
||||||
virtual void write();
|
virtual void write();
|
||||||
void modify_params(int, char **);
|
void modify_params(int, char **);
|
||||||
virtual double memory_usage();
|
virtual bigint memory_usage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int me,nprocs; // proc info
|
int me,nprocs; // proc info
|
||||||
|
|||||||
@ -1456,12 +1456,12 @@ int DumpCustom::modify_param(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory in buf, choose, variable arrays
|
return # of bytes of allocated memory in buf, choose, variable arrays
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double DumpCustom::memory_usage()
|
bigint DumpCustom::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = Dump::memory_usage();
|
bigint bytes = Dump::memory_usage();
|
||||||
bytes += maxlocal * sizeof(int);
|
bytes += memory->usage(choose,maxlocal);
|
||||||
bytes += maxlocal * sizeof(double);
|
bytes += memory->usage(dchoose,maxlocal);
|
||||||
bytes += maxlocal * nvariable * sizeof(double);
|
bytes += memory->usage(vbuf,nvariable,maxlocal);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class DumpCustom : public Dump {
|
|||||||
int count();
|
int count();
|
||||||
void pack(int *);
|
void pack(int *);
|
||||||
virtual void write_data(int, double *);
|
virtual void write_data(int, double *);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
void parse_fields(int, char **);
|
void parse_fields(int, char **);
|
||||||
int add_compute(char *);
|
int add_compute(char *);
|
||||||
|
|||||||
@ -279,10 +279,10 @@ int DumpDCD::modify_param(int narg, char **arg)
|
|||||||
return # of bytes of allocated memory in buf and global coords array
|
return # of bytes of allocated memory in buf and global coords array
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double DumpDCD::memory_usage()
|
bigint DumpDCD::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = Dump::memory_usage();
|
bigint bytes = Dump::memory_usage();
|
||||||
bytes += 3*natoms * sizeof(float);
|
bytes += memory->usage(coords,natoms*3);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class DumpDCD : public Dump {
|
|||||||
void pack(int *);
|
void pack(int *);
|
||||||
void write_data(int, double *);
|
void write_data(int, double *);
|
||||||
int modify_param(int, char **);
|
int modify_param(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
void write_frame();
|
void write_frame();
|
||||||
void write_dcd_header(const char *);
|
void write_dcd_header(const char *);
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_FIX_H
|
#ifndef LMP_FIX_H
|
||||||
#define LMP_FIX_H
|
#define LMP_FIX_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(ave/atom,FixAveAtom)
|
|||||||
#ifndef LMP_FIX_AVE_ATOM_H
|
#ifndef LMP_FIX_AVE_ATOM_H
|
||||||
#define LMP_FIX_AVE_ATOM_H
|
#define LMP_FIX_AVE_ATOM_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(ave/correlate,FixAveCorrelate)
|
|||||||
#ifndef LMP_FIX_AVE_CORRELATE_H
|
#ifndef LMP_FIX_AVE_CORRELATE_H
|
||||||
#define LMP_FIX_AVE_CORRELATE_H
|
#define LMP_FIX_AVE_CORRELATE_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(ave/histo,FixAveHisto)
|
|||||||
#ifndef LMP_FIX_AVE_HISTO_H
|
#ifndef LMP_FIX_AVE_HISTO_H
|
||||||
#define LMP_FIX_AVE_HISTO_H
|
#define LMP_FIX_AVE_HISTO_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(ave/spatial,FixAveSpatial)
|
|||||||
#ifndef LMP_FIX_AVE_SPATIAL_H
|
#ifndef LMP_FIX_AVE_SPATIAL_H
|
||||||
#define LMP_FIX_AVE_SPATIAL_H
|
#define LMP_FIX_AVE_SPATIAL_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(ave/time,FixAveTime)
|
|||||||
#ifndef LMP_FIX_AVE_TIME_H
|
#ifndef LMP_FIX_AVE_TIME_H
|
||||||
#define LMP_FIX_AVE_TIME_H
|
#define LMP_FIX_AVE_TIME_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(dt/reset,FixDtReset)
|
|||||||
#ifndef LMP_FIX_DT_RESET_H
|
#ifndef LMP_FIX_DT_RESET_H
|
||||||
#define LMP_FIX_DT_RESET_H
|
#define LMP_FIX_DT_RESET_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ FixStyle(shake,FixShake)
|
|||||||
#ifndef LMP_FIX_SHAKE_H
|
#ifndef LMP_FIX_SHAKE_H
|
||||||
#define LMP_FIX_SHAKE_H
|
#define LMP_FIX_SHAKE_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "ctype.h"
|
#include "ctype.h"
|
||||||
@ -523,14 +524,14 @@ int Force::inumeric(char *str)
|
|||||||
memory usage of force classes
|
memory usage of force classes
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Force::memory_usage()
|
bigint Force::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
if (pair) bytes += pair->memory_usage();
|
if (pair) bytes += static_cast<bigint> (pair->memory_usage());
|
||||||
if (bond) bytes += bond->memory_usage();
|
if (bond) bytes += static_cast<bigint> (bond->memory_usage());
|
||||||
if (angle) bytes += angle->memory_usage();
|
if (angle) bytes += static_cast<bigint> (angle->memory_usage());
|
||||||
if (dihedral) bytes += dihedral->memory_usage();
|
if (dihedral) bytes += static_cast<bigint> (dihedral->memory_usage());
|
||||||
if (improper) bytes += improper->memory_usage();
|
if (improper) bytes += static_cast<bigint> (improper->memory_usage());
|
||||||
if (kspace) bytes += kspace->memory_usage();
|
if (kspace) bytes += static_cast<bigint> (kspace->memory_usage());
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class Force : protected Pointers {
|
|||||||
void bounds(char *, int, int &, int &);
|
void bounds(char *, int, int &, int &);
|
||||||
double numeric(char *);
|
double numeric(char *);
|
||||||
int inumeric(char *);
|
int inumeric(char *);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_GROUP_H
|
#ifndef LMP_GROUP_H
|
||||||
#define LMP_GROUP_H
|
#define LMP_GROUP_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_INTEGRATE_H
|
#ifndef LMP_INTEGRATE_H
|
||||||
#define LMP_INTEGRATE_H
|
#define LMP_INTEGRATE_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
@ -29,7 +28,7 @@ class Integrate : protected Pointers {
|
|||||||
virtual void run(int) = 0;
|
virtual void run(int) = 0;
|
||||||
virtual void cleanup() {}
|
virtual void cleanup() {}
|
||||||
virtual void reset_dt() {}
|
virtual void reset_dt() {}
|
||||||
virtual double memory_usage() {return 0.0;}
|
virtual bigint memory_usage() {return 0;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int eflag,vflag; // flags for energy/virial computation
|
int eflag,vflag; // flags for energy/virial computation
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
@ -673,9 +674,9 @@ void Irregular::grow_recv(int n)
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Irregular::memory_usage()
|
bigint Irregular::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = maxsend * sizeof(double);
|
bigint bytes = memory->usage(buf_send,maxsend);
|
||||||
bytes += maxrecv * sizeof(double);
|
bytes += memory->usage(buf_recv,maxrecv);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class Irregular : protected Pointers {
|
|||||||
int create_data(int, int *);
|
int create_data(int, int *);
|
||||||
void exchange_data(char *, int, char *);
|
void exchange_data(char *, int, char *);
|
||||||
void destroy_data();
|
void destroy_data();
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int me,nprocs;
|
int me,nprocs;
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_LAMMPS_H
|
#ifndef LMP_LAMMPS_H
|
||||||
#define LMP_LAMMPS_H
|
#define LMP_LAMMPS_H
|
||||||
|
|
||||||
#include "mpi.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
44
src/memory.h
44
src/memory.h
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_MEMORY_H
|
#ifndef LMP_MEMORY_H
|
||||||
#define LMP_MEMORY_H
|
#define LMP_MEMORY_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
@ -68,8 +67,9 @@ class Memory : protected Pointers {
|
|||||||
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
NOTE: to avoid code bloat, only use these for int,double,float,char
|
to avoid code bloat, only use these for int,double,float,char
|
||||||
otherwise, just use smalloc,srealloc,sfree
|
not for int* or double** or arbitrary structs
|
||||||
|
in those cases, just use smalloc,srealloc,sfree directly
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -397,6 +397,44 @@ class Memory : protected Pointers {
|
|||||||
sfree_new(array[0]);
|
sfree_new(array[0]);
|
||||||
sfree_new(array);
|
sfree_new(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
memory usage of arrays, including pointers
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
template <typename TYPE>
|
||||||
|
bigint usage(TYPE *array, int n)
|
||||||
|
{
|
||||||
|
bigint bytes = sizeof(TYPE) * n;
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename TYPE>
|
||||||
|
bigint usage(TYPE **array, int n1, int n2)
|
||||||
|
{
|
||||||
|
bigint bytes = sizeof(TYPE) * n1*n2;
|
||||||
|
bytes += sizeof(TYPE *) * n1;
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename TYPE>
|
||||||
|
bigint usage(TYPE ***array, int n1, int n2, int n3)
|
||||||
|
{
|
||||||
|
bigint bytes = sizeof(TYPE) * n1*n2*n3;
|
||||||
|
bytes += sizeof(TYPE *) * n1*n2;
|
||||||
|
bytes += sizeof(TYPE **) * n1;
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename TYPE>
|
||||||
|
bigint usage(TYPE ****array, int n1, int n2, int n3, int n4)
|
||||||
|
{
|
||||||
|
bigint bytes = sizeof(TYPE) * n1*n2*n3*n4;
|
||||||
|
bytes += sizeof(TYPE *) * n1*n2*n3;
|
||||||
|
bytes += sizeof(TYPE **) * n1*n2;
|
||||||
|
bytes += sizeof(TYPE ***) * n1;
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_MIN_H
|
#ifndef LMP_MIN_H
|
||||||
#define LMP_MIN_H
|
#define LMP_MIN_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
@ -37,7 +36,7 @@ class Min : protected Pointers {
|
|||||||
void run(int);
|
void run(int);
|
||||||
void cleanup();
|
void cleanup();
|
||||||
int request(class Pair *, int, double);
|
int request(class Pair *, int, double);
|
||||||
double memory_usage() {return 0.0;}
|
virtual bigint memory_usage() {return 0;}
|
||||||
void modify_params(int, char **);
|
void modify_params(int, char **);
|
||||||
double fnorm_sqr();
|
double fnorm_sqr();
|
||||||
double fnorm_inf();
|
double fnorm_inf();
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -1102,10 +1103,12 @@ void Modify::list_init_compute()
|
|||||||
return # of bytes of allocated memory from all fixes
|
return # of bytes of allocated memory from all fixes
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Modify::memory_usage()
|
bigint Modify::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
for (int i = 0; i < nfix; i++) bytes += fix[i]->memory_usage();
|
for (int i = 0; i < nfix; i++)
|
||||||
for (int i = 0; i < ncompute; i++) bytes += compute[i]->memory_usage();
|
bytes += static_cast<bigint> (fix[i]->memory_usage());
|
||||||
|
for (int i = 0; i < ncompute; i++)
|
||||||
|
bytes += static_cast<bigint> (compute[i]->memory_usage());
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_MODIFY_H
|
#ifndef LMP_MODIFY_H
|
||||||
#define LMP_MODIFY_H
|
#define LMP_MODIFY_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
@ -96,7 +95,7 @@ class Modify : protected Pointers {
|
|||||||
int read_restart(FILE *);
|
int read_restart(FILE *);
|
||||||
void restart_deallocate();
|
void restart_deallocate();
|
||||||
|
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "neigh_list.h"
|
#include "neigh_list.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
@ -136,7 +137,7 @@ void NeighList::stencil_allocate(int smax, int style)
|
|||||||
if (smax > maxstencil) {
|
if (smax > maxstencil) {
|
||||||
maxstencil = smax;
|
maxstencil = smax;
|
||||||
memory->destroy(stencil);
|
memory->destroy(stencil);
|
||||||
memory->create(stencil,smax,"neighlist:stencil");
|
memory->create(stencil,maxstencil,"neighlist:stencil");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -156,8 +157,10 @@ void NeighList::stencil_allocate(int smax, int style)
|
|||||||
for (i = 1; i <= n; i++) {
|
for (i = 1; i <= n; i++) {
|
||||||
memory->destroy(stencil_multi[i]);
|
memory->destroy(stencil_multi[i]);
|
||||||
memory->destroy(distsq_multi[i]);
|
memory->destroy(distsq_multi[i]);
|
||||||
memory->create(stencil_multi[i],smax,"neighlist:stencil_multi");
|
memory->create(stencil_multi[i],maxstencil_multi,
|
||||||
memory->create(distsq_multi[i],smax,"neighlist:distsq_multi");
|
"neighlist:stencil_multi");
|
||||||
|
memory->create(distsq_multi[i],maxstencil_multi,
|
||||||
|
"neighlist:distsq_multi");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -247,22 +250,23 @@ void NeighList::print_attributes()
|
|||||||
if stencilflag = 0, maxstencil * maxstencil_multi will also be 0
|
if stencilflag = 0, maxstencil * maxstencil_multi will also be 0
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double NeighList::memory_usage()
|
bigint NeighList::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
bytes += 2 * maxlocal * sizeof(int);
|
bytes += memory->usage(ilist,maxlocal);
|
||||||
|
bytes += memory->usage(numneigh,maxlocal);
|
||||||
bytes += maxlocal * sizeof(int *);
|
bytes += maxlocal * sizeof(int *);
|
||||||
bytes += maxpage*pgsize * sizeof(int);
|
bytes += memory->usage(pages,maxpage,pgsize);
|
||||||
|
|
||||||
if (dnum) {
|
if (dnum) {
|
||||||
bytes += maxlocal * sizeof(double *);
|
bytes += maxlocal * sizeof(double *);
|
||||||
bytes += dnum * maxpage*pgsize * sizeof(double);
|
bytes += memory->usage(dpages,maxpage,dnum*pgsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxstencil) bytes += maxstencil * sizeof(int);
|
if (maxstencil) bytes += memory->usage(stencil,maxstencil);
|
||||||
if (maxstencil_multi) {
|
if (maxstencil_multi) {
|
||||||
bytes += atom->ntypes * maxstencil_multi * sizeof(int);
|
bytes += memory->usage(stencil_multi,atom->ntypes,maxstencil_multi);
|
||||||
bytes += atom->ntypes * maxstencil_multi * sizeof(double);
|
bytes += memory->usage(distsq_multi,atom->ntypes,maxstencil_multi);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
@ -77,7 +77,7 @@ class NeighList : protected Pointers {
|
|||||||
int **add_pages(); // add pages to neigh list
|
int **add_pages(); // add pages to neigh list
|
||||||
void copy_skip_info(int *, int **); // copy skip info from a neigh request
|
void copy_skip_info(int *, int **); // copy skip info from a neigh request
|
||||||
void print_attributes(); // debug routine
|
void print_attributes(); // debug routine
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int maxlocal; // size of allocated atom arrays
|
int maxlocal; // size of allocated atom arrays
|
||||||
|
|||||||
@ -1645,22 +1645,22 @@ int Neighbor::exclusion(int i, int j, int itype, int jtype,
|
|||||||
return # of bytes of allocated memory
|
return # of bytes of allocated memory
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Neighbor::memory_usage()
|
bigint Neighbor::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
bytes += maxhold*3 * sizeof(double);
|
bytes += memory->usage(xhold,maxhold,3);
|
||||||
|
|
||||||
if (style != NSQ) {
|
if (style != NSQ) {
|
||||||
bytes += maxbin * sizeof(int);
|
bytes += memory->usage(bins,maxbin);
|
||||||
bytes += maxhead * sizeof(int);
|
bytes += memory->usage(binhead,maxhead);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nlist; i++) bytes += lists[i]->memory_usage();
|
for (int i = 0; i < nlist; i++) bytes += lists[i]->memory_usage();
|
||||||
|
|
||||||
bytes += maxbond*3 * sizeof(int);
|
bytes += memory->usage(bondlist,maxbond,3);
|
||||||
bytes += maxangle*4 * sizeof(int);
|
bytes += memory->usage(anglelist,maxangle,4);
|
||||||
bytes += maxdihedral*5 * sizeof(int);
|
bytes += memory->usage(dihedrallist,maxdihedral,5);
|
||||||
bytes += maximproper*5 * sizeof(int);
|
bytes += memory->usage(improperlist,maximproper,5);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class Neighbor : protected Pointers {
|
|||||||
void build_one(int); // create a single neighbor list
|
void build_one(int); // create a single neighbor list
|
||||||
void set(int, char **); // set neighbor style and skin distance
|
void set(int, char **); // set neighbor style and skin distance
|
||||||
void modify_params(int, char**); // modify parameters that control builds
|
void modify_params(int, char**); // modify parameters that control builds
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int me,nprocs;
|
int me,nprocs;
|
||||||
|
|||||||
@ -517,19 +517,19 @@ void Output::create_restart(int narg, char **arg)
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
sum and print memory usage
|
sum and print memory usage
|
||||||
is only memory on proc 0, not averaged across procs
|
result is only memory on proc 0, not averaged across procs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Output::memory_usage()
|
void Output::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
bytes += atom->memory_usage();
|
bytes += atom->memory_usage();
|
||||||
bytes += neighbor->memory_usage();
|
bytes += neighbor->memory_usage();
|
||||||
bytes += comm->memory_usage();
|
bytes += comm->memory_usage();
|
||||||
bytes += update->memory_usage();
|
bytes += update->memory_usage();
|
||||||
bytes += force->memory_usage();
|
bytes += force->memory_usage();
|
||||||
bytes += modify->memory_usage();
|
bytes += modify->memory_usage();
|
||||||
for (int i = 0; i < ndump; i++) bytes += dump[i]->memory_usage();
|
for (int i = 0; i < ndump; i++) dump[i]->memory_usage();
|
||||||
|
|
||||||
double mbytes = bytes/1024.0/1024.0;
|
double mbytes = bytes/1024.0/1024.0;
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_OUTPUT_H
|
#ifndef LMP_OUTPUT_H
|
||||||
#define LMP_OUTPUT_H
|
#define LMP_OUTPUT_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
#ifndef LMP_POINTERS_H
|
#ifndef LMP_POINTERS_H
|
||||||
#define LMP_POINTERS_H
|
#define LMP_POINTERS_H
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "lammps.h"
|
#include "lammps.h"
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ CommandStyle(read_restart,ReadRestart)
|
|||||||
#ifndef LMP_READ_RESTART_H
|
#ifndef LMP_READ_RESTART_H
|
||||||
#define LMP_READ_RESTART_H
|
#define LMP_READ_RESTART_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_REGION_H
|
#ifndef LMP_REGION_H
|
||||||
#define LMP_REGION_H
|
#define LMP_REGION_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -35,8 +35,8 @@
|
|||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
#include "fix_respa.h"
|
#include "fix_respa.h"
|
||||||
#include "memory.h"
|
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_THERMO_H
|
#ifndef LMP_THERMO_H
|
||||||
#define LMP_THERMO_H
|
#define LMP_THERMO_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_UNIVERSE_H
|
#ifndef LMP_UNIVERSE_H
|
||||||
#define LMP_UNIVERSE_H
|
#define LMP_UNIVERSE_H
|
||||||
|
|
||||||
#include "mpi.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "lmptype.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
@ -287,9 +288,9 @@ void Update::reset_timestep(int narg, char **arg)
|
|||||||
memory usage of update and integrate/minimize
|
memory usage of update and integrate/minimize
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double Update::memory_usage()
|
bigint Update::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
bigint bytes = 0;
|
||||||
if (whichflag == 1) bytes += integrate->memory_usage();
|
if (whichflag == 1) bytes += integrate->memory_usage();
|
||||||
else if (whichflag == 2) bytes += minimize->memory_usage();
|
else if (whichflag == 2) bytes += minimize->memory_usage();
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#ifndef LMP_UPDATE_H
|
#ifndef LMP_UPDATE_H
|
||||||
#define LMP_UPDATE_H
|
#define LMP_UPDATE_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
@ -52,7 +51,7 @@ class Update : protected Pointers {
|
|||||||
void create_integrate(int, char **);
|
void create_integrate(int, char **);
|
||||||
void create_minimize(int, char **);
|
void create_minimize(int, char **);
|
||||||
void reset_timestep(int, char **);
|
void reset_timestep(int, char **);
|
||||||
double memory_usage();
|
bigint memory_usage();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,6 @@ CommandStyle(write_restart,WriteRestart)
|
|||||||
#ifndef LMP_WRITE_RESTART_H
|
#ifndef LMP_WRITE_RESTART_H
|
||||||
#define LMP_WRITE_RESTART_H
|
#define LMP_WRITE_RESTART_H
|
||||||
|
|
||||||
#include "lmptype.h"
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user