Merge remote-tracking branch 'lammps-ro/master' into lammps-icms

Resolved Conflicts:
	doc/Manual.html
	doc/Manual.txt
	src/atom_map.cpp
This commit is contained in:
Axel Kohlmeyer
2014-04-04 06:18:57 -04:00
9 changed files with 79 additions and 15 deletions

View File

@ -1,7 +1,7 @@
<HTML>
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="31 Mar 2014 version">
<META NAME="docnumber" CONTENT="2 Apr 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -22,7 +22,7 @@
<CENTER><H3>LAMMPS-ICMS Documentation
</H3></CENTER>
<CENTER><H4>31 Mar 2014 version
<CENTER><H4>2 Apr 2014 version
</H4></CENTER>
<H4>Version info:
</H4>

View File

@ -1,7 +1,7 @@
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="31 Mar 2014 version">
<META NAME="docnumber" CONTENT="2 Apr 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -19,7 +19,7 @@
<H1></H1>
LAMMPS-ICMS Documentation :c,h3
31 Mar 2014 version :c,h4
2 Apr 2014 version :c,h4
Version info: :h4

View File

@ -682,7 +682,7 @@ void Finish::end(int flag)
}
}
// find a non-skip neighbor list containing half the pairwise interactions
// find a non-skip neighbor list containing half pairwise interactions
// count neighbors in that list for stats purposes
// allow it to be Kokkos neigh list as well
@ -729,6 +729,7 @@ void Finish::end(int flag)
// find a non-skip neighbor list containing full pairwise interactions
// count neighbors in that list for stats purposes
// allow it to be Kokkos neigh list as well
for (m = 0; m < neighbor->old_nrequest; m++) {
if (neighbor->old_requests[m]->full &&

View File

@ -24,6 +24,12 @@
using namespace LAMMPS_NS;
// allocate space for static class variable
// prototype for non-class function
int *Irregular::proc_recv_copy;
int compare_standalone(const void *, const void *);
#define BUFFACTOR 1.5
#define BUFMIN 1000
#define BUFEXTRA 1000
@ -247,7 +253,7 @@ int Irregular::migrate_check()
return total # of doubles I will recv (not including self)
------------------------------------------------------------------------- */
int Irregular::create_atom(int n, int *sizes, int *proclist)
int Irregular::create_atom(int n, int *sizes, int *proclist, int sort)
{
int i;
@ -358,6 +364,33 @@ int Irregular::create_atom(int n, int *sizes, int *proclist)
nrecvsize += length_recv[i];
}
// sort proc_recv and num_recv by proc ID if requested
// useful for debugging to insure reproducible ordering of received atoms
// invoke by adding final arg = 1 to create_atom() call in migrate_atoms()
if (sort) {
int *order = new int[nrecv];
int *proc_recv_ordered = new int[nrecv];
int *length_recv_ordered = new int[nrecv];
for (i = 0; i < nrecv; i++) order[i] = i;
proc_recv_copy = proc_recv;
qsort(order,nrecv,sizeof(int),compare_standalone);
int j;
for (i = 0; i < nrecv; i++) {
j = order[i];
proc_recv_ordered[i] = proc_recv[j];
length_recv_ordered[i] = length_recv[j];
}
memcpy(proc_recv,proc_recv_ordered,nrecv*sizeof(int));
memcpy(length_recv,length_recv_ordered,nrecv*sizeof(int));
delete [] order;
delete [] proc_recv_ordered;
delete [] length_recv_ordered;
}
// barrier to insure all MPI_ANY_SOURCE messages are received
// else another proc could proceed to exchange_atom() and send to me
@ -388,6 +421,21 @@ int Irregular::create_atom(int n, int *sizes, int *proclist)
return nrecvsize;
}
/* ----------------------------------------------------------------------
comparison function invoked by qsort()
accesses static class member proc_recv_copy, set before call to qsort()
------------------------------------------------------------------------- */
int compare_standalone(const void *iptr, const void *jptr)
{
int i = *((int *) iptr);
int j = *((int *) jptr);
int *proc_recv = Irregular::proc_recv_copy;
if (proc_recv[i] < proc_recv[j]) return -1;
if (proc_recv[i] > proc_recv[j]) return 1;
return 0;
}
/* ----------------------------------------------------------------------
communicate atoms via PlanAtom
sendbuf = list of atoms to send

View File

@ -20,6 +20,11 @@ namespace LAMMPS_NS {
class Irregular : protected Pointers {
public:
// static variable across all Irregular objects, for qsort callback
static int *proc_recv_copy;
Irregular(class LAMMPS *);
~Irregular();
void migrate_atoms();
@ -82,7 +87,7 @@ class Irregular : protected Pointers {
PlanAtom *aplan;
PlanData *dplan;
int create_atom(int, int *, int *);
int create_atom(int, int *, int *, int sort = 0);
void exchange_atom(double *, int *, double *);
void destroy_atom();
int coord2proc(double *, int &, int &, int &);
@ -95,6 +100,7 @@ class Irregular : protected Pointers {
}
#endif
/* ERROR/WARNING messages:
*/

View File

@ -1480,16 +1480,26 @@ void Neighbor::build_one(int i)
error->one(FLERR,"Too many local+ghost atoms for neighbor list");
// when occasional list built, LAMMPS can crash if atoms have moved too far
// why is this?, give warning if this is the case
// why is this? maybe b/c this list is derived from some now out-of-date list?
// give warning if this is the case
// no easy workaround b/c all neighbor lists really need to be rebuilt
// solution is for input script to check more often for rebuild
// only check_distance if running a simulation, not between simulations
// comment out for now
// is sometimes giving warning when there is no issue
// e.g. when a variable uses a fix with an occasional neigh list
// at the beginning of a timestep (e.g. fix move) where
// all neigh lists are about to be re-built anyway
/*
int flag = 0;
if (dist_check && update->whichflag) flag = check_distance();
if (flag && me == 0)
if (flag && me == 0) {
printf("BUILD ONE ERROR: %ld\n",update->ntimestep);
error->warning(FLERR,"Building an occasional neighbor list when "
"atoms may have moved too far");
}
*/
(this->*pair_build[i])(lists[i]);
}

View File

@ -242,8 +242,7 @@ void ReadRestart::command(int narg, char **arg)
coord[1] >= sublo[1] && coord[1] < subhi[1] &&
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
m += avec->unpack_restart(&buf[m]);
}
else m += static_cast<int> (buf[m]);
} else m += static_cast<int> (buf[m]);
}
}

View File

@ -247,7 +247,7 @@ void Update::set_units(const char *style)
force->ftm2v = 1.0;
force->mv2d = 1.0;
force->nktv2p = 1.0;
force->qqr2e = 8.9876e30;
force->qqr2e = 8.987556e6;
force->qe2f = 1.0;
force->vxmu2f = 1.0;
force->xxt2kmu = 1.0;
@ -262,13 +262,13 @@ void Update::set_units(const char *style)
neighbor->skin = 0.1;
} else if (strcmp(style,"nano") == 0) {
force->boltz = 0.013806503;
force->boltz = 0.013806504;
force->hplanck = 6.62606896e-4;
force->mvv2e = 1.0;
force->ftm2v = 1.0;
force->mv2d = 1.0;
force->nktv2p = 1.0;
force->qqr2e = 8.9876e39;
force->qqr2e = 230.7078669;
force->qe2f = 1.0;
force->vxmu2f = 1.0;
force->xxt2kmu = 1.0;

View File

@ -1 +1 @@
#define LAMMPS_VERSION "31 Mar 2014"
#define LAMMPS_VERSION "2 Apr 2014"