git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5793 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2011-03-16 20:03:49 +00:00
parent 8dad49156d
commit 09c391fb2d
80 changed files with 391 additions and 365 deletions

View File

@ -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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("quat")) bytes += nmax*4 * sizeof(double);
if (atom->memcheck("angmom")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("quat")) bytes += memory->usage(quat,nmax,4);
if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3);
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
return bytes;
}

View File

@ -57,7 +57,7 @@ class AtomVecEllipsoid : public AtomVec {
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
return bytes;
}

View File

@ -52,7 +52,7 @@ class AtomVecColloid : public AtomVec {
void data_atom(double *, int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -869,22 +869,22 @@ int AtomVecDipole::data_vel_hybrid(int m, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("q")) bytes += nmax * sizeof(double);
if (atom->memcheck("mu")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
if (atom->memcheck("mu")) bytes += memory->usage(mu,nmax,3);
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
return bytes;
}

View File

@ -56,7 +56,7 @@ class AtomVecDipole : public AtomVec {
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -1009,23 +1009,23 @@ int AtomVecGranular::data_vel_hybrid(int m, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("radius")) bytes += nmax * sizeof(double);
if (atom->memcheck("density")) bytes += nmax * sizeof(double);
if (atom->memcheck("rmass")) bytes += nmax * sizeof(double);
if (atom->memcheck("omega")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("torque")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("radius")) bytes += memory->usage(radius,nmax);
if (atom->memcheck("density")) bytes += memory->usage(density,nmax);
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
return bytes;
}

View File

@ -58,7 +58,7 @@ class AtomVecGranular : public AtomVec {
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
double PI;

View File

@ -20,7 +20,6 @@ KSpaceStyle(pppm,PPPM)
#ifndef LMP_PPPM_H
#define LMP_PPPM_H
#include "lmptype.h"
#include "kspace.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ FixStyle(qeq/comb,FixQEQComb)
#ifndef LMP_FIX_QEQ_COMB_H
#define LMP_FIX_QEQ_COMB_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -11,7 +11,6 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "stdlib.h"
#include "atom_vec_angle.h"
#include "atom.h"
@ -795,37 +794,38 @@ int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
if (atom->memcheck("special"))
bytes += memory->usage(special,nmax,atom->maxspecial);
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
if (atom->memcheck("bond_type"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("bond_atom"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
if (atom->memcheck("bond_type"))
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
if (atom->memcheck("bond_atom"))
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
if (atom->memcheck("num_angle")) bytes += nmax * sizeof(int);
if (atom->memcheck("angle_type"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom1"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom2"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom3"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
if (atom->memcheck("angle_type"))
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom1"))
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom2"))
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom3"))
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
return bytes;
}

View File

@ -50,7 +50,7 @@ class AtomVecAngle : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -752,27 +752,28 @@ int AtomVecBond::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
if (atom->memcheck("special"))
bytes += memory->usage(special,nmax,atom->maxspecial);
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
if (atom->memcheck("bond_type"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("bond_atom"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
if (atom->memcheck("bond_type"))
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
if (atom->memcheck("bond_atom"))
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
return bytes;
}

View File

@ -50,7 +50,7 @@ class AtomVecBond : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -963,62 +963,63 @@ int AtomVecFull::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("q")) bytes += nmax * sizeof(double);
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
if (atom->memcheck("special"))
bytes += memory->usage(special,nmax,atom->maxspecial);
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
if (atom->memcheck("bond_type"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("bond_atom"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
if (atom->memcheck("bond_type"))
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
if (atom->memcheck("bond_atom"))
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
if (atom->memcheck("num_angle")) bytes += nmax * sizeof(int);
if (atom->memcheck("angle_type"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom1"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom2"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom3"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
if (atom->memcheck("angle_type"))
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom1"))
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom2"))
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom3"))
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
if (atom->memcheck("num_dihedral")) bytes += nmax * sizeof(int);
if (atom->memcheck("dihedral_type"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom1"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom2"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom3"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom4"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("num_dihedral")) bytes += memory->usage(num_dihedral,nmax);
if (atom->memcheck("dihedral_type"))
bytes += memory->usage(dihedral_type,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom1"))
bytes += memory->usage(dihedral_atom1,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom2"))
bytes += memory->usage(dihedral_atom2,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom3"))
bytes += memory->usage(dihedral_atom3,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom4"))
bytes += memory->usage(dihedral_atom4,nmax,atom->dihedral_per_atom);
if (atom->memcheck("num_improper")) bytes += nmax * sizeof(int);
if (atom->memcheck("improper_type"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom1"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom2"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom3"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom4"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("num_improper")) bytes += memory->usage(num_improper,nmax);
if (atom->memcheck("improper_type"))
bytes += memory->usage(improper_type,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom1"))
bytes += memory->usage(improper_atom1,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom2"))
bytes += memory->usage(improper_atom2,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom3"))
bytes += memory->usage(improper_atom3,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom4"))
bytes += memory->usage(improper_atom4,nmax,atom->improper_per_atom);
return bytes;
}

View File

@ -50,7 +50,7 @@ class AtomVecFull : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -944,61 +944,62 @@ int AtomVecMolecular::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("molecule")) bytes += nmax * sizeof(int);
if (atom->memcheck("nspecial")) bytes += nmax*3 * sizeof(int);
if (atom->memcheck("special")) bytes += nmax*atom->maxspecial * sizeof(int);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
if (atom->memcheck("special"))
bytes += memory->usage(special,nmax,atom->maxspecial);
if (atom->memcheck("num_bond")) bytes += nmax * sizeof(int);
if (atom->memcheck("bond_type"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("bond_atom"))
bytes += nmax*atom->bond_per_atom * sizeof(int);
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
if (atom->memcheck("bond_type"))
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
if (atom->memcheck("bond_atom"))
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
if (atom->memcheck("num_angle")) bytes += nmax * sizeof(int);
if (atom->memcheck("angle_type"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom1"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom2"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("angle_atom3"))
bytes += nmax*atom->angle_per_atom * sizeof(int);
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
if (atom->memcheck("angle_type"))
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom1"))
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom2"))
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom3"))
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
if (atom->memcheck("num_dihedral")) bytes += nmax * sizeof(int);
if (atom->memcheck("dihedral_type"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom1"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom2"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom3"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("dihedral_atom4"))
bytes += nmax*atom->dihedral_per_atom * sizeof(int);
if (atom->memcheck("num_dihedral")) bytes += memory->usage(num_dihedral,nmax);
if (atom->memcheck("dihedral_type"))
bytes += memory->usage(dihedral_type,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom1"))
bytes += memory->usage(dihedral_atom1,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom2"))
bytes += memory->usage(dihedral_atom2,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom3"))
bytes += memory->usage(dihedral_atom3,nmax,atom->dihedral_per_atom);
if (atom->memcheck("dihedral_atom4"))
bytes += memory->usage(dihedral_atom4,nmax,atom->dihedral_per_atom);
if (atom->memcheck("num_improper")) bytes += nmax * sizeof(int);
if (atom->memcheck("improper_type"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom1"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom2"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom3"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("improper_atom4"))
bytes += nmax*atom->improper_per_atom * sizeof(int);
if (atom->memcheck("num_improper")) bytes += memory->usage(num_improper,nmax);
if (atom->memcheck("improper_type"))
bytes += memory->usage(improper_type,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom1"))
bytes += memory->usage(improper_atom1,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom2"))
bytes += memory->usage(improper_atom2,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom3"))
bytes += memory->usage(improper_atom3,nmax,atom->improper_per_atom);
if (atom->memcheck("improper_atom4"))
bytes += memory->usage(improper_atom4,nmax,atom->improper_per_atom);
return bytes;
}

View File

@ -50,7 +50,7 @@ class AtomVecMolecular : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -798,23 +798,23 @@ int AtomVecPeri::data_atom_hybrid(int nlocal, char **values)
return # of bytes of allocated memory
------------------------------------------------------------------------- */
double AtomVecPeri::memory_usage()
bigint AtomVecPeri::memory_usage()
{
double bytes = 0.0;
if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
if (atom->memcheck("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("vfrac")) bytes += nmax * sizeof(double);
if (atom->memcheck("density")) bytes += nmax * sizeof(double);
if (atom->memcheck("rmass")) bytes += nmax * sizeof(double);
if (atom->memcheck("s0")) bytes += nmax * sizeof(double);
if (atom->memcheck("x0")) bytes += nmax*3 * sizeof(double);
bigint bytes = 0;
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
if (atom->memcheck("vfrac")) bytes += memory->usage(vfrac,nmax);
if (atom->memcheck("density")) bytes += memory->usage(density,nmax);
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
if (atom->memcheck("s0")) bytes += memory->usage(s0,nmax);
if (atom->memcheck("x0")) bytes += memory->usage(x0,nmax,3);
return bytes;
}

View File

@ -52,7 +52,7 @@ class AtomVecPeri : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -20,7 +20,6 @@ FixStyle(reax/bonds,FixReaxBonds)
#ifndef LMP_FIX_REAX_BONDS_H
#define LMP_FIX_REAX_BONDS_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -20,7 +20,6 @@ FixStyle(EVENT/PRD,FixEventPRD)
#ifndef LMP_FIX_EVENT_PRD_H
#define LMP_FIX_EVENT_PRD_H
#include "lmptype.h"
#include "fix_event.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ FixStyle(EVENT/TAD,FixEventTAD)
#ifndef LMP_FIX_EVENT_TAD_H
#define LMP_FIX_EVENT_TAD_H
#include "lmptype.h"
#include "fix_event.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ FixStyle(wall/srd,FixWallSRD)
#ifndef LMP_FIX_WALL_SRD_H
#define LMP_FIX_WALL_SRD_H
#include "lmptype.h"
#include "fix.h"
namespace LAMMPS_NS {

View File

@ -22,6 +22,7 @@
support for groups
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "math.h"
#include "stdio.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
------------------------------------------------------------------------- */
double DumpXTC::memory_usage()
bigint DumpXTC::memory_usage()
{
double bytes = Dump::memory_usage();
bytes += 3*natoms * sizeof(float);
bigint bytes = Dump::memory_usage();
bytes += memory->usage(coords,natoms*3);
return bytes;
}

View File

@ -52,7 +52,7 @@ class DumpXTC : public Dump {
int count();
void pack(int *);
void write_data(int, double *);
double memory_usage();
bigint memory_usage();
void write_frame();
};

View File

@ -1612,21 +1612,25 @@ void *Atom::extract(char *name)
add in global to local mapping storage
------------------------------------------------------------------------- */
double Atom::memory_usage()
bigint Atom::memory_usage()
{
memlength = DELTA_MEMSTR;
memory->create(memstr,memlength,"atom:memstr");
memstr[0] = '\0';
bigint bytes = avec->memory_usage();
memory->destroy(memstr);
double bytes = avec->memory_usage();
if (map_style == 1)
bytes += map_tag_max * sizeof(int);
bytes += memory->usage(map_array,map_tag_max+1);
else if (map_style == 2) {
bytes += map_nbucket*sizeof(int);
bytes += map_nhash*sizeof(HashElem);
}
if (maxnext) {
bytes += memory->usage(next,maxnext);
bytes += memory->usage(permute,maxnext);
}
memory->destroy(memstr);
return bytes;
}

View File

@ -14,7 +14,6 @@
#ifndef LMP_ATOM_H
#define LMP_ATOM_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {
@ -160,7 +159,7 @@ class Atom : protected Pointers {
void *extract(char *);
double memory_usage();
bigint memory_usage();
int memcheck(const char *);
// functions for global to local ID mapping

View File

@ -78,7 +78,7 @@ class AtomVec : protected Pointers {
virtual void data_vel(int, char **);
virtual int data_vel_hybrid(int, char **) {return 0;}
virtual double memory_usage() = 0;
virtual bigint memory_usage() = 0;
protected:
int nmax; // local copy of atom->nmax

View File

@ -619,17 +619,17 @@ void AtomVecAtomic::data_atom(double *coord, int imagetmp, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
return bytes;
}

View File

@ -48,7 +48,7 @@ class AtomVecAtomic : public AtomVec {
int unpack_restart(double *);
void create_atom(int, double *);
void data_atom(double *, int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -673,19 +673,19 @@ int AtomVecCharge::data_atom_hybrid(int nlocal, char **values)
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("type")) bytes += nmax * sizeof(int);
if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
if (atom->memcheck("image")) bytes += nmax * sizeof(int);
if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
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;
}

View File

@ -50,7 +50,7 @@ class AtomVecCharge : public AtomVec {
void create_atom(int, double *);
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -842,9 +842,9 @@ void AtomVecHybrid::data_vel(int m, char **values)
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();
return bytes;
}

View File

@ -55,7 +55,7 @@ class AtomVecHybrid : public AtomVec {
void data_atom(double *, int, char **);
int data_atom_hybrid(int, char **) {return 0;}
void data_vel(int, char **);
double memory_usage();
bigint memory_usage();
private:
int *tag,*type,*mask,*image;

View File

@ -15,6 +15,7 @@
Contributing author (triclinic) : Pieter in 't Veld (SNL)
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "math.h"
#include "string.h"
@ -75,11 +76,11 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp)
maxswap = 6;
allocate_swap(maxswap);
sendlist = (int **) memory->smalloc(maxswap*sizeof(int *),"sendlist");
memory->create(maxsendlist,maxswap,"maxsendlist");
sendlist = (int **) memory->smalloc(maxswap*sizeof(int *),"comm:sendlist");
maxsendlist = new int[maxswap];
for (int i = 0; i < maxswap; i++) {
maxsendlist[i] = BUFMIN;
memory->create(sendlist[i],BUFMIN,"sendlist[i]");
memory->create(sendlist[i],BUFMIN,"comm:sendlist[i]");
}
maxforward_fix = maxreverse_fix = 0;
@ -98,9 +99,9 @@ Comm::~Comm()
memory->destroy(cutghostmulti);
}
memory->destroy(maxsendlist);
if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]);
memory->sfree(sendlist);
delete [] maxsendlist;
memory->destroy(buf_send);
memory->destroy(buf_recv);
@ -1280,13 +1281,12 @@ void Comm::set(int narg, char **arg)
return # of bytes of allocated memory
------------------------------------------------------------------------- */
double Comm::memory_usage()
bigint Comm::memory_usage()
{
double bytes = 0.0;
for (int i = 0; i < nswap; i++) bytes += maxsendlist[i] * sizeof(int);
bytes += maxsend * sizeof(double);
bytes += maxrecv * sizeof(double);
bigint bytes = 0;
for (int i = 0; i < nswap; i++)
bytes += memory->usage(sendlist[i],maxsendlist[i]);
bytes += memory->usage(buf_send,maxsend+BUFEXTRA);
bytes += memory->usage(buf_recv,maxrecv);
return bytes;
}

View File

@ -53,7 +53,7 @@ class Comm : protected Pointers {
void reverse_comm_compute(class Compute *); // reverse comm from a Compute
void set(int, char **); // set communication style
double memory_usage();
bigint memory_usage();
private:
int style; // single vs multi-type comm

View File

@ -14,7 +14,6 @@
#ifndef LMP_COMPUTE_H
#define LMP_COMPUTE_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ ComputeStyle(reduce,ComputeReduce)
#ifndef LMP_COMPUTE_REDUCE_H
#define LMP_COMPUTE_REDUCE_H
#include "lmptype.h"
#include "compute.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ ComputeStyle(reduce/region,ComputeReduceRegion)
#ifndef LMP_COMPUTE_REDUCE_REGION_H
#define LMP_COMPUTE_REDUCE_REGION_H
#include "lmptype.h"
#include "compute_reduce.h"
namespace LAMMPS_NS {

View File

@ -710,15 +710,15 @@ void Dump::modify_params(int narg, char **arg)
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 (sortcol == 0) bytes += maxids * sizeof(int); // ids
bytes += maxsort*size_one * sizeof(double); // bufsort
if (sortcol == 0) bytes += maxsort * sizeof(int); // idsort
bytes += maxsort * sizeof(int); // index
bytes += maxproc * sizeof(int); // proclist
if (sortcol == 0) bytes += memory->usage(ids,maxids);
bytes += memory->usage(bufsort,size_one*maxsort);
if (sortcol == 0) bytes += memory->usage(idsort,maxsort);
bytes += memory->usage(index,maxsort);
bytes += memory->usage(proclist,maxproc);
if (irregular) bytes += irregular->memory_usage();
}
return bytes;

View File

@ -14,7 +14,6 @@
#ifndef LMP_DUMP_H
#define LMP_DUMP_H
#include "lmptype.h"
#include "stdio.h"
#include "pointers.h"
@ -38,7 +37,7 @@ class Dump : protected Pointers {
void init();
virtual void write();
void modify_params(int, char **);
virtual double memory_usage();
virtual bigint memory_usage();
protected:
int me,nprocs; // proc info

View File

@ -1456,12 +1456,12 @@ int DumpCustom::modify_param(int narg, char **arg)
return # of bytes of allocated memory in buf, choose, variable arrays
------------------------------------------------------------------------- */
double DumpCustom::memory_usage()
bigint DumpCustom::memory_usage()
{
double bytes = Dump::memory_usage();
bytes += maxlocal * sizeof(int);
bytes += maxlocal * sizeof(double);
bytes += maxlocal * nvariable * sizeof(double);
bigint bytes = Dump::memory_usage();
bytes += memory->usage(choose,maxlocal);
bytes += memory->usage(dchoose,maxlocal);
bytes += memory->usage(vbuf,nvariable,maxlocal);
return bytes;
}

View File

@ -74,7 +74,7 @@ class DumpCustom : public Dump {
int count();
void pack(int *);
virtual void write_data(int, double *);
double memory_usage();
bigint memory_usage();
void parse_fields(int, char **);
int add_compute(char *);

View File

@ -279,10 +279,10 @@ int DumpDCD::modify_param(int narg, char **arg)
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();
bytes += 3*natoms * sizeof(float);
bigint bytes = Dump::memory_usage();
bytes += memory->usage(coords,natoms*3);
return bytes;
}

View File

@ -45,7 +45,7 @@ class DumpDCD : public Dump {
void pack(int *);
void write_data(int, double *);
int modify_param(int, char **);
double memory_usage();
bigint memory_usage();
void write_frame();
void write_dcd_header(const char *);

View File

@ -14,7 +14,6 @@
#ifndef LMP_FIX_H
#define LMP_FIX_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ FixStyle(ave/atom,FixAveAtom)
#ifndef LMP_FIX_AVE_ATOM_H
#define LMP_FIX_AVE_ATOM_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -20,7 +20,6 @@ FixStyle(ave/correlate,FixAveCorrelate)
#ifndef LMP_FIX_AVE_CORRELATE_H
#define LMP_FIX_AVE_CORRELATE_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -20,7 +20,6 @@ FixStyle(ave/histo,FixAveHisto)
#ifndef LMP_FIX_AVE_HISTO_H
#define LMP_FIX_AVE_HISTO_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -20,7 +20,6 @@ FixStyle(ave/spatial,FixAveSpatial)
#ifndef LMP_FIX_AVE_SPATIAL_H
#define LMP_FIX_AVE_SPATIAL_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -20,7 +20,6 @@ FixStyle(ave/time,FixAveTime)
#ifndef LMP_FIX_AVE_TIME_H
#define LMP_FIX_AVE_TIME_H
#include "lmptype.h"
#include "stdio.h"
#include "fix.h"

View File

@ -20,7 +20,6 @@ FixStyle(dt/reset,FixDtReset)
#ifndef LMP_FIX_DT_RESET_H
#define LMP_FIX_DT_RESET_H
#include "lmptype.h"
#include "fix.h"
namespace LAMMPS_NS {

View File

@ -20,7 +20,6 @@ FixStyle(shake,FixShake)
#ifndef LMP_FIX_SHAKE_H
#define LMP_FIX_SHAKE_H
#include "lmptype.h"
#include "fix.h"
namespace LAMMPS_NS {

View File

@ -11,6 +11,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"
@ -523,14 +524,14 @@ int Force::inumeric(char *str)
memory usage of force classes
------------------------------------------------------------------------- */
double Force::memory_usage()
bigint Force::memory_usage()
{
double bytes = 0.0;
if (pair) bytes += pair->memory_usage();
if (bond) bytes += bond->memory_usage();
if (angle) bytes += angle->memory_usage();
if (dihedral) bytes += dihedral->memory_usage();
if (improper) bytes += improper->memory_usage();
if (kspace) bytes += kspace->memory_usage();
bigint bytes = 0;
if (pair) bytes += static_cast<bigint> (pair->memory_usage());
if (bond) bytes += static_cast<bigint> (bond->memory_usage());
if (angle) bytes += static_cast<bigint> (angle->memory_usage());
if (dihedral) bytes += static_cast<bigint> (dihedral->memory_usage());
if (improper) bytes += static_cast<bigint> (improper->memory_usage());
if (kspace) bytes += static_cast<bigint> (kspace->memory_usage());
return bytes;
}

View File

@ -87,7 +87,7 @@ class Force : protected Pointers {
void bounds(char *, int, int &, int &);
double numeric(char *);
int inumeric(char *);
double memory_usage();
bigint memory_usage();
};
}

View File

@ -14,7 +14,6 @@
#ifndef LMP_GROUP_H
#define LMP_GROUP_H
#include "lmptype.h"
#include "stdio.h"
#include "pointers.h"

View File

@ -14,7 +14,6 @@
#ifndef LMP_INTEGRATE_H
#define LMP_INTEGRATE_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {
@ -29,7 +28,7 @@ class Integrate : protected Pointers {
virtual void run(int) = 0;
virtual void cleanup() {}
virtual void reset_dt() {}
virtual double memory_usage() {return 0.0;}
virtual bigint memory_usage() {return 0;}
protected:
int eflag,vflag; // flags for energy/virial computation

View File

@ -11,6 +11,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "mpi.h"
#include "stdlib.h"
#include "string.h"
@ -673,9 +674,9 @@ void Irregular::grow_recv(int n)
return # of bytes of allocated memory
------------------------------------------------------------------------- */
double Irregular::memory_usage()
bigint Irregular::memory_usage()
{
double bytes = maxsend * sizeof(double);
bytes += maxrecv * sizeof(double);
bigint bytes = memory->usage(buf_send,maxsend);
bytes += memory->usage(buf_recv,maxrecv);
return bytes;
}

View File

@ -26,7 +26,7 @@ class Irregular : protected Pointers {
int create_data(int, int *);
void exchange_data(char *, int, char *);
void destroy_data();
double memory_usage();
bigint memory_usage();
private:
int me,nprocs;

View File

@ -14,7 +14,6 @@
#ifndef LMP_LAMMPS_H
#define LMP_LAMMPS_H
#include "mpi.h"
#include "stdio.h"
namespace LAMMPS_NS {

View File

@ -14,7 +14,6 @@
#ifndef LMP_MEMORY_H
#define LMP_MEMORY_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {
@ -68,8 +67,9 @@ class Memory : protected Pointers {
/* ----------------------------------------------------------------------
NOTE: to avoid code bloat, only use these for int,double,float,char
otherwise, just use smalloc,srealloc,sfree
to avoid code bloat, only use these for int,double,float,char
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);
}
/* ----------------------------------------------------------------------
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;
}
};
}

View File

@ -14,7 +14,6 @@
#ifndef LMP_MIN_H
#define LMP_MIN_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {
@ -37,7 +36,7 @@ class Min : protected Pointers {
void run(int);
void cleanup();
int request(class Pair *, int, double);
double memory_usage() {return 0.0;}
virtual bigint memory_usage() {return 0;}
void modify_params(int, char **);
double fnorm_sqr();
double fnorm_inf();

View File

@ -11,6 +11,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "stdio.h"
#include "string.h"
#include "modify.h"
@ -1102,10 +1103,12 @@ void Modify::list_init_compute()
return # of bytes of allocated memory from all fixes
------------------------------------------------------------------------- */
double Modify::memory_usage()
bigint Modify::memory_usage()
{
double bytes = 0.0;
for (int i = 0; i < nfix; i++) bytes += fix[i]->memory_usage();
for (int i = 0; i < ncompute; i++) bytes += compute[i]->memory_usage();
bigint bytes = 0;
for (int i = 0; i < nfix; i++)
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;
}

View File

@ -14,7 +14,6 @@
#ifndef LMP_MODIFY_H
#define LMP_MODIFY_H
#include "lmptype.h"
#include "stdio.h"
#include "pointers.h"
@ -96,7 +95,7 @@ class Modify : protected Pointers {
int read_restart(FILE *);
void restart_deallocate();
double memory_usage();
bigint memory_usage();
private:

View File

@ -11,6 +11,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "neigh_list.h"
#include "atom.h"
#include "comm.h"
@ -136,7 +137,7 @@ void NeighList::stencil_allocate(int smax, int style)
if (smax > maxstencil) {
maxstencil = smax;
memory->destroy(stencil);
memory->create(stencil,smax,"neighlist:stencil");
memory->create(stencil,maxstencil,"neighlist:stencil");
}
} else {
@ -156,8 +157,10 @@ void NeighList::stencil_allocate(int smax, int style)
for (i = 1; i <= n; i++) {
memory->destroy(stencil_multi[i]);
memory->destroy(distsq_multi[i]);
memory->create(stencil_multi[i],smax,"neighlist:stencil_multi");
memory->create(distsq_multi[i],smax,"neighlist:distsq_multi");
memory->create(stencil_multi[i],maxstencil_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
------------------------------------------------------------------------- */
double NeighList::memory_usage()
bigint NeighList::memory_usage()
{
double bytes = 0.0;
bytes += 2 * maxlocal * sizeof(int);
bigint bytes = 0;
bytes += memory->usage(ilist,maxlocal);
bytes += memory->usage(numneigh,maxlocal);
bytes += maxlocal * sizeof(int *);
bytes += maxpage*pgsize * sizeof(int);
bytes += memory->usage(pages,maxpage,pgsize);
if (dnum) {
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) {
bytes += atom->ntypes * maxstencil_multi * sizeof(int);
bytes += atom->ntypes * maxstencil_multi * sizeof(double);
bytes += memory->usage(stencil_multi,atom->ntypes,maxstencil_multi);
bytes += memory->usage(distsq_multi,atom->ntypes,maxstencil_multi);
}
return bytes;

View File

@ -77,7 +77,7 @@ class NeighList : protected Pointers {
int **add_pages(); // add pages to neigh list
void copy_skip_info(int *, int **); // copy skip info from a neigh request
void print_attributes(); // debug routine
double memory_usage();
bigint memory_usage();
private:
int maxlocal; // size of allocated atom arrays

View File

@ -1645,22 +1645,22 @@ int Neighbor::exclusion(int i, int j, int itype, int jtype,
return # of bytes of allocated memory
------------------------------------------------------------------------- */
double Neighbor::memory_usage()
bigint Neighbor::memory_usage()
{
double bytes = 0.0;
bytes += maxhold*3 * sizeof(double);
bigint bytes = 0;
bytes += memory->usage(xhold,maxhold,3);
if (style != NSQ) {
bytes += maxbin * sizeof(int);
bytes += maxhead * sizeof(int);
bytes += memory->usage(bins,maxbin);
bytes += memory->usage(binhead,maxhead);
}
for (int i = 0; i < nlist; i++) bytes += lists[i]->memory_usage();
bytes += maxbond*3 * sizeof(int);
bytes += maxangle*4 * sizeof(int);
bytes += maxdihedral*5 * sizeof(int);
bytes += maximproper*5 * sizeof(int);
bytes += memory->usage(bondlist,maxbond,3);
bytes += memory->usage(anglelist,maxangle,4);
bytes += memory->usage(dihedrallist,maxdihedral,5);
bytes += memory->usage(improperlist,maximproper,5);
return bytes;
}

View File

@ -71,7 +71,7 @@ class Neighbor : protected Pointers {
void build_one(int); // create a single neighbor list
void set(int, char **); // set neighbor style and skin distance
void modify_params(int, char**); // modify parameters that control builds
double memory_usage();
bigint memory_usage();
private:
int me,nprocs;

View File

@ -517,19 +517,19 @@ void Output::create_restart(int narg, char **arg)
/* ----------------------------------------------------------------------
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()
{
double bytes = 0.0;
bigint bytes = 0;
bytes += atom->memory_usage();
bytes += neighbor->memory_usage();
bytes += comm->memory_usage();
bytes += update->memory_usage();
bytes += force->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;

View File

@ -14,7 +14,6 @@
#ifndef LMP_OUTPUT_H
#define LMP_OUTPUT_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {

View File

@ -21,6 +21,7 @@
#ifndef LMP_POINTERS_H
#define LMP_POINTERS_H
#include "lmptype.h"
#include "mpi.h"
#include "lammps.h"

View File

@ -20,7 +20,6 @@ CommandStyle(read_restart,ReadRestart)
#ifndef LMP_READ_RESTART_H
#define LMP_READ_RESTART_H
#include "lmptype.h"
#include "stdio.h"
#include "pointers.h"

View File

@ -14,7 +14,6 @@
#ifndef LMP_REGION_H
#define LMP_REGION_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {

View File

@ -35,8 +35,8 @@
#include "modify.h"
#include "compute.h"
#include "fix_respa.h"
#include "memory.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;

View File

@ -14,7 +14,6 @@
#ifndef LMP_THERMO_H
#define LMP_THERMO_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {

View File

@ -14,7 +14,6 @@
#ifndef LMP_UNIVERSE_H
#define LMP_UNIVERSE_H
#include "mpi.h"
#include "stdio.h"
#include "pointers.h"

View File

@ -11,6 +11,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "string.h"
#include "stdlib.h"
#include "update.h"
@ -287,9 +288,9 @@ void Update::reset_timestep(int narg, char **arg)
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();
else if (whichflag == 2) bytes += minimize->memory_usage();
return bytes;

View File

@ -14,7 +14,6 @@
#ifndef LMP_UPDATE_H
#define LMP_UPDATE_H
#include "lmptype.h"
#include "pointers.h"
namespace LAMMPS_NS {
@ -52,7 +51,7 @@ class Update : protected Pointers {
void create_integrate(int, char **);
void create_minimize(int, char **);
void reset_timestep(int, char **);
double memory_usage();
bigint memory_usage();
};
}

View File

@ -20,7 +20,6 @@ CommandStyle(write_restart,WriteRestart)
#ifndef LMP_WRITE_RESTART_H
#define LMP_WRITE_RESTART_H
#include "lmptype.h"
#include "stdio.h"
#include "pointers.h"