git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15387 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -105,6 +105,7 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg)
|
||||
// print summary of settings
|
||||
|
||||
if (comm->me == 0) {
|
||||
#if defined(_OPENMP)
|
||||
const char * const nmode = _neighbor ? "multi-threaded" : "serial";
|
||||
|
||||
if (screen) {
|
||||
@ -118,6 +119,10 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg)
|
||||
fprintf(logfile,"set %d OpenMP thread(s) per MPI task\n", nthreads);
|
||||
fprintf(logfile,"using %s neighbor list subroutines\n", nmode);
|
||||
}
|
||||
#else
|
||||
error->warning(FLERR,"OpenMP support not enabled during compilation; "
|
||||
"using 1 thread only.");
|
||||
#endif
|
||||
}
|
||||
|
||||
// allocate list for per thread accumulator manager class instances
|
||||
|
||||
@ -87,7 +87,8 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp)
|
||||
} else if (getenv("OMP_NUM_THREADS") == NULL) {
|
||||
nthreads = 1;
|
||||
if (me == 0)
|
||||
error->warning(FLERR,"OMP_NUM_THREADS environment is not set.");
|
||||
error->warning(FLERR,"OMP_NUM_THREADS environment is not set. "
|
||||
"Defaulting to 1 thread.");
|
||||
} else {
|
||||
nthreads = omp_get_max_threads();
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ void ComputeCentroAtom::compute_peratom()
|
||||
double rsq = delx*delx + dely*dely + delz*delz;
|
||||
pairs[n++] = rsq;
|
||||
|
||||
if (rsq < rsq2)
|
||||
if (rsq < rsq2) {
|
||||
if (rsq < rsq1) {
|
||||
rsq2 = rsq1;
|
||||
MathExtra::copy3(r1, r2);
|
||||
@ -283,6 +283,7 @@ void ComputeCentroAtom::compute_peratom()
|
||||
rsq2 = rsq;
|
||||
MathExtra::sub3(x[jj],x[kk],r2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -264,7 +264,8 @@ void Info::command(int narg, char **arg)
|
||||
}
|
||||
fprintf(out,"Nprocs = %d, Nthreads = %d\n",
|
||||
comm->nprocs, comm->nthreads);
|
||||
fprintf(out,"Processor grid = %d x %d x %d\n",comm->procgrid[0],
|
||||
if (domain->box_exist)
|
||||
fprintf(out,"Processor grid = %d x %d x %d\n",comm->procgrid[0],
|
||||
comm->procgrid[1], comm->procgrid[2]);
|
||||
}
|
||||
|
||||
|
||||
@ -164,12 +164,13 @@ void PairDPD::compute(int eflag, int vflag)
|
||||
|
||||
void PairDPD::allocate()
|
||||
{
|
||||
int i,j;
|
||||
allocated = 1;
|
||||
int n = atom->ntypes;
|
||||
|
||||
memory->create(setflag,n+1,n+1,"pair:setflag");
|
||||
for (int i = 1; i <= n; i++)
|
||||
for (int j = i; j <= n; j++)
|
||||
for (i = 1; i <= n; i++)
|
||||
for (j = i; j <= n; j++)
|
||||
setflag[i][j] = 0;
|
||||
|
||||
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
||||
@ -178,6 +179,9 @@ void PairDPD::allocate()
|
||||
memory->create(a0,n+1,n+1,"pair:a0");
|
||||
memory->create(gamma,n+1,n+1,"pair:gamma");
|
||||
memory->create(sigma,n+1,n+1,"pair:sigma");
|
||||
for (i = 0; i <= atom->ntypes; i++)
|
||||
for (j = 0; j <= atom->ntypes; j++)
|
||||
sigma[i][j] = gamma[i][j] = 0.0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
|
||||
void WriteCoeff::command(int narg, char **arg)
|
||||
{
|
||||
if (domain->box_exist == 0)
|
||||
error->all(FLERR,"write_coeff command before simulation box is defined");
|
||||
error->all(FLERR,"Write_coeff command before simulation box is defined");
|
||||
|
||||
if (narg != 1) error->all(FLERR,"Illegal write_coeff command");
|
||||
|
||||
@ -43,6 +43,9 @@ void WriteCoeff::command(int narg, char **arg)
|
||||
strcpy(file,"tmp.");
|
||||
strcat(file,arg[0]);
|
||||
|
||||
// initialize relevant styles
|
||||
force->init();
|
||||
|
||||
if (comm->me == 0) {
|
||||
char str[256], coeff[256];
|
||||
FILE *one = fopen(file,"wb+");
|
||||
@ -52,7 +55,6 @@ void WriteCoeff::command(int narg, char **arg)
|
||||
}
|
||||
|
||||
if (force->pair && force->pair->writedata) {
|
||||
force->pair->init();
|
||||
fprintf(one,"# pair_style %s\npair_coeff\n",force->pair_style);
|
||||
force->pair->write_data_all(one);
|
||||
fprintf(one,"end\n");
|
||||
@ -68,12 +70,14 @@ void WriteCoeff::command(int narg, char **arg)
|
||||
fprintf(one,"end\n");
|
||||
}
|
||||
if (force->dihedral && force->dihedral->writedata) {
|
||||
fprintf(one,"# dihedral_style %s\ndihedral_coeff\n",force->dihedral_style);
|
||||
fprintf(one,"# dihedral_style %s\ndihedral_coeff\n",
|
||||
force->dihedral_style);
|
||||
force->dihedral->write_data(one);
|
||||
fprintf(one,"end\n");
|
||||
}
|
||||
if (force->improper && force->improper->writedata) {
|
||||
fprintf(one,"# improper_style %s\nimproper_coeff\n",force->improper_style);
|
||||
fprintf(one,"# improper_style %s\nimproper_coeff\n",
|
||||
force->improper_style);
|
||||
force->improper->write_data(one);
|
||||
fprintf(one,"end\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user