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

Resolved Conflicts:
	doc/Manual.txt
This commit is contained in:
Axel Kohlmeyer
2016-01-26 18:18:44 +01:00
46 changed files with 113 additions and 71 deletions

View File

@ -135,7 +135,7 @@
<H1></H1><div class="section" id="lammps-documentation">
<h1>LAMMPS-ICMS Documentation<a class="headerlink" href="#lammps-documentation" title="Permalink to this headline"></a></h1>
<div class="section" id="jan-2016-version">
<h2>22 Jan 2016 version<a class="headerlink" href="#jan-2016-version" title="Permalink to this headline"></a></h2>
<h2>25 Jan 2016 version<a class="headerlink" href="#jan-2016-version" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="version-info">
<h2>Version info:<a class="headerlink" href="#version-info" title="Permalink to this headline"></a></h2>

View File

@ -1,7 +1,7 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="22 Jan 2016 version">
<META NAME="docnumber" CONTENT="25 Jan 2016 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>
@ -21,7 +21,7 @@
<H1></H1>
LAMMPS-ICMS Documentation :c,h3
22 Jan 2016 version :c,h4
25 Jan 2016 version :c,h4
Version info: :h4

View File

@ -211,7 +211,7 @@ sub-directories:</p>
</tr>
</tbody>
</table>
<p>Note that the <a class="reference external" href="download">download page</a> also has links to download
<p>Note that the <a class="reference external" href="http://lammps.sandia.gov/download.html">download page</a> also has links to download
Windows exectubles and installers, as well as pre-built executables
for a few specific Linux distributions. It also has instructions for
how to download/install LAMMPS for Macs (via Homebrew), and to
@ -241,7 +241,7 @@ launch a LAMMPS Windows executable on a Windows box.</p>
<p id="start-2-1"><strong>*Read this first:*</strong></p>
<p>If you want to avoid building LAMMPS yourself, read the preceeding
section about options available for downloading and installing
executables. Details are discussed on the <a class="reference external" href="download">download</a> page.</p>
executables. Details are discussed on the <a class="reference external" href="http://lammps.sandia.gov/download.html">download</a> page.</p>
<p>Building LAMMPS can be simple or not-so-simple. If all you need are
the default packages installed in LAMMPS, and MPI is already installed
on your machine, or you just want to run LAMMPS in serial, then you

View File

@ -53,6 +53,8 @@ how to download/install LAMMPS for Macs (via Homebrew), and to
download and update LAMMPS from SVN and Git repositories, which gives
you the same files that are in the download tarball.
:link(download,http://lammps.sandia.gov/download.html)
The Windows and Linux executables for serial or parallel only include
certain packages and bug-fixes/upgrades listed on "this
page"_http://lammps.sandia.gov/bug.html up to a certain date, as

View File

@ -253,3 +253,11 @@ void AtomKokkos::sync_modify(ExecutionSpace execution_space,
sync(execution_space,datamask_read);
modified(execution_space,datamask_modify);
}
AtomVec *AtomKokkos::new_avec(const char *style, int trysuffix, int &sflag)
{
AtomVec* avec = Atom::new_avec(style,trysuffix,sflag);
if (!avec->kokkosable)
error->all(FLERR,"KOKKOS package requires a kokkos enabled atom_style");
return avec;
}

View File

@ -61,6 +61,8 @@ class AtomKokkos : public Atom {
virtual void grow(unsigned int mask);
virtual void deallocate_topology();
void sync_modify(ExecutionSpace, unsigned int, unsigned int);
private:
class AtomVec *new_avec(const char *, int, int &);
};
template<class ViewType, class IndexView>

View File

@ -512,6 +512,8 @@ void CommKokkos::exchange_device()
k_exchange_copylist.modify<LMPHostType>();
k_exchange_copylist.sync<DeviceType>();
nsend = k_count.h_view(0);
if (nsend > maxsend) grow_send_kokkos(nsend,1);
nsend =
avec->pack_exchange_kokkos(k_count.h_view(0),k_buf_send,
k_exchange_sendlist,k_exchange_copylist,

View File

@ -35,6 +35,7 @@
using namespace LAMMPS_NS;
#define BONDDELTA 10000
#define LB_FACTOR 1.5
enum{IGNORE,WARN,ERROR}; // same as thermo.cpp
@ -44,6 +45,7 @@ template<class DeviceType>
NeighBondKokkos<DeviceType>::NeighBondKokkos(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = EMPTY_MASK;
@ -76,28 +78,35 @@ void NeighBondKokkos<DeviceType>::init_topology_kk() {
// 1st time allocation of topology lists
if (atom->molecular && atom->nbonds && maxbond == 0) {
memory->destroy(neighbor->bondlist);
if (nprocs == 1) maxbond = atom->nbonds;
else maxbond = static_cast<int> (LB_FACTOR * atom->nbonds / nprocs);
memory->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist");
}
if (atom->molecular && atom->nangles && maxangle == 0) {
memory->destroy(neighbor->anglelist);
if (nprocs == 1) maxangle = atom->nangles;
else maxangle = static_cast<int> (LB_FACTOR * atom->nangles / nprocs);
memory->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist");
}
if (atom->molecular && atom->ndihedrals && maxdihedral == 0) {
memory->destroy(neighbor->dihedrallist);
if (nprocs == 1) maxdihedral = atom->ndihedrals;
else maxdihedral = static_cast<int>
(LB_FACTOR * atom->ndihedrals / nprocs);
memory->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist");
}
if (atom->molecular && atom->nimpropers && maximproper == 0) {
memory->destroy(neighbor->improperlist);
if (nprocs == 1) maximproper = atom->nimpropers;
else maximproper = static_cast<int>
(LB_FACTOR * atom->nimpropers / nprocs);
memory->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist");
}
// set flags that determine which topology neighboring routines to use
// bonds,etc can only be broken for atom->molecular = 1, not 2
// SHAKE sets bonds and angles negative
// gcmc sets all bonds, angles, etc negative
// bond_quartic sets bonds to 0
// delete_bonds sets all interactions negative
@ -105,7 +114,8 @@ void NeighBondKokkos<DeviceType>::init_topology_kk() {
int bond_off = 0;
int angle_off = 0;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"shake") == 0)
if ((strcmp(modify->fix[i]->style,"shake") == 0)
|| (strcmp(modify->fix[i]->style,"rattle") == 0))
bond_off = angle_off = 1;
if (force->bond && force->bond_match("quartic")) bond_off = 1;
@ -143,6 +153,10 @@ void NeighBondKokkos<DeviceType>::init_topology_kk() {
}
}
for (i = 0; i < modify->nfix; i++)
if ((strcmp(modify->fix[i]->style,"gcmc") == 0))
bond_off = angle_off = dihedral_off = improper_off = 1;
// sync on/off settings across all procs
int on_or_off = bond_off;
@ -353,7 +367,7 @@ void NeighBondKokkos<DeviceType>::bond_partial()
k_fail_flag.template modify<LMPHostType>();
k_fail_flag.template sync<DeviceType>();
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondBondAll>(0,nlocal),*this,nmissing);
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondBondPartial>(0,nlocal),*this,nmissing);
DeviceType::fence();
k_nlist.template modify<DeviceType>();
@ -952,8 +966,6 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondDihedralCheck, const in
if (dx != dxstart || dy != dystart || dz != dzstart) flag = 1;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>

View File

@ -77,7 +77,7 @@ class NeighBondKokkos : protected Pointers {
unsigned int datamask_read,datamask_modify;
int maxbond,maxangle,maxdihedral,maximproper; // size of bond lists
int me;
int me,nprocs;
private:

View File

@ -518,7 +518,7 @@ void NeighborKokkos::setup_bins_kokkos(int i)
(this->*stencil_create[slist[i]])(lists_device[slist[i]],sx,sy,sz);
}
if (i < nslist-1) return;
//if (i < nslist-1) return; // this won't work if a non-kokkos neighbor list is last
if (maxhead > k_bins.d_view.dimension_0()) {
k_bins = DAT::tdual_int_2d("Neighbor::d_bins",maxhead,atoms_per_bin);

View File

@ -574,9 +574,9 @@ void PairSWKokkos<DeviceType>::init_style()
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairSWKokkos<DeviceType>::setup()
void PairSWKokkos<DeviceType>::setup_params()
{
PairSW::setup();
PairSW::setup_params();
// sync elem2param and params

View File

@ -106,7 +106,7 @@ class PairSWKokkos : public PairSW {
t_param_1d d_params;
virtual void setup();
virtual void setup_params();
void twobody(const Param&, const F_FLOAT&, F_FLOAT&, const int&, F_FLOAT&) const;
void threebody(const Param&, const Param&, const Param&, const F_FLOAT&, const F_FLOAT&, F_FLOAT *, F_FLOAT *,
F_FLOAT *, F_FLOAT *, const int&, F_FLOAT&) const;

View File

@ -118,9 +118,9 @@ void PairTersoffKokkos<DeviceType>::init_style()
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairTersoffKokkos<DeviceType>::setup()
void PairTersoffKokkos<DeviceType>::setup_params()
{
PairTersoff::setup();
PairTersoff::setup_params();
int i,j,k,m;
int n = atom->ntypes;

View File

@ -172,7 +172,7 @@ class PairTersoffKokkos : public PairTersoff {
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
void allocate();
void setup();
void setup_params();
protected:
void cleanup_copy();

View File

@ -117,9 +117,9 @@ void PairTersoffMODKokkos<DeviceType>::init_style()
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairTersoffMODKokkos<DeviceType>::setup()
void PairTersoffMODKokkos<DeviceType>::setup_params()
{
PairTersoffMOD::setup();
PairTersoffMOD::setup_params();
int i,j,k,m;
int n = atom->ntypes;

View File

@ -172,7 +172,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD {
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
void allocate();
void setup();
void setup_params();
protected:
void cleanup_copy();

View File

@ -128,9 +128,9 @@ void PairTersoffZBLKokkos<DeviceType>::init_style()
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairTersoffZBLKokkos<DeviceType>::setup()
void PairTersoffZBLKokkos<DeviceType>::setup_params()
{
PairTersoffZBL::setup();
PairTersoffZBL::setup_params();
int i,j,k,m;
int n = atom->ntypes;

View File

@ -172,7 +172,7 @@ class PairTersoffZBLKokkos : public PairTersoffZBL {
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
void allocate();
void setup();
void setup_params();
KOKKOS_INLINE_FUNCTION
double fermi_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;

View File

@ -487,7 +487,7 @@ void PairComb::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
n = atom->ntypes;
@ -772,7 +772,7 @@ void PairComb::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairComb::setup()
void PairComb::setup_params()
{
int i,j,k,m,n;

View File

@ -87,7 +87,7 @@ class PairComb : public Pair {
void allocate();
virtual void read_file(char *);
void setup();
void setup_params();
virtual void repulsive(Param *, double, double &, int,
double &, double, double);
double zeta(Param *, double, double, double *, double *);

View File

@ -229,7 +229,7 @@ void PairComb3::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
n = atom->ntypes;
@ -795,7 +795,7 @@ void PairComb3::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairComb3::setup()
void PairComb3::setup_params()
{
int i,j,k,m,n;

View File

@ -135,7 +135,7 @@ class PairComb3 : public Pair {
// initialization functions
void allocate();
void read_lib();
void setup();
void setup_params();
virtual void read_file(char *);
// cutoff functions

View File

@ -228,7 +228,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -399,7 +399,7 @@ void PairNb3bHarmonic::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairNb3bHarmonic::setup()
void PairNb3bHarmonic::setup_params()
{
int i,j,k,m,n;
double rtmp;

View File

@ -52,7 +52,7 @@ class PairNb3bHarmonic : public Pair {
void allocate();
void read_file(char *);
void setup();
void setup_params();
void twobody(Param *, double, double &, int, double &);
void threebody(Param *, Param *, Param *, double, double, double *, double *,
double *, double *, int, double &);

View File

@ -508,7 +508,7 @@ void PairPolymorphic::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -727,7 +727,7 @@ void PairPolymorphic::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairPolymorphic::setup()
void PairPolymorphic::setup_params()
{
int i,j,k,n;

View File

@ -278,7 +278,7 @@ class PairPolymorphic : public Pair {
void grab(FILE *, int, double *);
virtual void read_file(char *);
void setup();
void setup_params();
void write_tables(int);
void attractive(PairParameters *, TripletParameters *, double, double,

View File

@ -274,7 +274,7 @@ void PairSW::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -455,7 +455,7 @@ void PairSW::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairSW::setup()
void PairSW::setup_params()
{
int i,j,k,m,n;
double rtmp;

View File

@ -58,7 +58,7 @@ class PairSW : public Pair {
virtual void allocate();
void read_file(char *);
virtual void setup();
virtual void setup_params();
void twobody(Param *, double, double &, int, double &);
void threebody(Param *, Param *, Param *, double, double, double *, double *,
double *, double *, int, double &);

View File

@ -314,7 +314,7 @@ void PairTersoff::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -505,7 +505,7 @@ void PairTersoff::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairTersoff::setup()
void PairTersoff::setup_params()
{
int i,j,k,m,n;

View File

@ -62,7 +62,7 @@ class PairTersoff : public Pair {
virtual void allocate();
virtual void read_file(char *);
virtual void setup();
virtual void setup_params();
virtual void repulsive(Param *, double, double &, int, double &);
virtual double zeta(Param *, double, double, double *, double *);
virtual void force_zeta(Param *, double, double, double &,

View File

@ -185,7 +185,7 @@ void PairTersoffMOD::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairTersoffMOD::setup()
void PairTersoffMOD::setup_params()
{
int i,j,k,m,n;

View File

@ -31,7 +31,7 @@ class PairTersoffMOD : public PairTersoff {
protected:
void read_file(char *);
virtual void setup();
virtual void setup_params();
double zeta(Param *, double, double, double *, double *);
double ters_fc(double, Param *);

View File

@ -273,7 +273,7 @@ void PairVashishta::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -458,7 +458,7 @@ void PairVashishta::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairVashishta::setup()
void PairVashishta::setup_params()
{
int i,j,k,m,n;

View File

@ -57,7 +57,7 @@ class PairVashishta : public Pair {
virtual void allocate();
void read_file(char *);
void setup();
void setup_params();
void twobody(Param *, double, double &, int, double &);
void threebody(Param *, Param *, Param *, double, double, double *, double *,
double *, double *, int, double &);

View File

@ -801,7 +801,7 @@ void PairEDIP::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -993,7 +993,7 @@ void PairEDIP::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairEDIP::setup()
void PairEDIP::setup_params()
{
int i,j,k,m,n;
double rtmp;

View File

@ -103,7 +103,7 @@ class PairEDIP : public Pair {
void initGrids(void);
void read_file(char *);
void setup();
void setup_params();
};
}

View File

@ -773,7 +773,7 @@ void PairTersoffTable::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
// clear setflag since coeff() called once with I,J = * *
@ -970,7 +970,7 @@ void PairTersoffTable::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairTersoffTable::setup()
void PairTersoffTable::setup_params()
{
int i,j,k,m,n;

View File

@ -68,7 +68,7 @@ class PairTersoffTable : public Pair {
void allocate();
void read_file(char *);
void setup();
void setup_params();
// pre-loop coordination functions

View File

@ -195,7 +195,7 @@ class Atom : protected Pointers {
void settings(class Atom *);
void create_avec(const char *, int, char **, int);
class AtomVec *new_avec(const char *, int, int &);
virtual class AtomVec *new_avec(const char *, int, int &);
void init();
void setup();

View File

@ -29,6 +29,7 @@ class FixShearHistory : public Fix {
friend class Neighbor;
friend class PairGranHookeHistory;
friend class PairGranLine;
friend class PairGranTri;
public:
FixShearHistory(class LAMMPS *, int, char **);

View File

@ -34,10 +34,10 @@ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// 4th arg determines GLOBAL vs PERATOM values
// syntax: id group style global nrow ncol
// Nrow by Ncol array of global values
// Ncol=1 is vector, Nrow>1 is array
// Ncol = 1 is vector, Nrow > 1 is array
// syntax: id group style peratom 0/1 nvalue
// 0/1 flag = not-store or store peratom values in restart file
// nvalue = # of peratom values, N=1 is vector, N>1 is array
// nvalue = # of peratom values, N = 1 is vector, N > 1 is array
if (strcmp(arg[3],"global") == 0) flavor = GLOBAL;
else if (strcmp(arg[3],"peratom") == 0) flavor = PERATOM;

View File

@ -402,8 +402,12 @@ void Neighbor::init()
else exclude = 1;
if (nex_type) {
memory->destroy(ex_type);
memory->create(ex_type,n+1,n+1,"neigh:ex_type");
if (lmp->kokkos)
init_ex_type_kokkos(n);
else {
memory->destroy(ex_type);
memory->create(ex_type,n+1,n+1,"neigh:ex_type");
}
for (i = 1; i <= n; i++)
for (j = 1; j <= n; j++)
@ -419,10 +423,14 @@ void Neighbor::init()
}
if (nex_group) {
delete [] ex1_bit;
delete [] ex2_bit;
ex1_bit = new int[nex_group];
ex2_bit = new int[nex_group];
if (lmp->kokkos)
init_ex_bit_kokkos();
else {
delete [] ex1_bit;
delete [] ex2_bit;
ex1_bit = new int[nex_group];
ex2_bit = new int[nex_group];
}
for (i = 0; i < nex_group; i++) {
ex1_bit[i] = group->bitmask[ex1_group[i]];
@ -431,8 +439,12 @@ void Neighbor::init()
}
if (nex_mol) {
delete [] ex_mol_bit;
ex_mol_bit = new int[nex_mol];
if (lmp->kokkos)
init_ex_mol_bit_kokkos();
else {
delete [] ex_mol_bit;
ex_mol_bit = new int[nex_mol];
}
for (i = 0; i < nex_mol; i++)
ex_mol_bit[i] = group->bitmask[ex_mol_group[i]];

View File

@ -187,6 +187,9 @@ class Neighbor : protected Pointers {
virtual int init_lists_kokkos() {return 0;}
virtual void init_list_flags1_kokkos(int) {}
virtual void init_list_flags2_kokkos(int) {}
virtual void init_ex_type_kokkos(int) {}
virtual void init_ex_bit_kokkos() {}
virtual void init_ex_mol_bit_kokkos() {}
virtual void init_list_grow_kokkos(int) {}
virtual void build_kokkos(int) {}
virtual void setup_bins_kokkos(int) {}

View File

@ -174,7 +174,7 @@ void PairCoulStreitz::coeff(int narg, char **arg)
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
setup_params();
n = atom->ntypes;
// clear setflag since coeff() called once with I,J = * *
@ -353,7 +353,7 @@ void PairCoulStreitz::read_file(char *file)
/* ---------------------------------------------------------------------- */
void PairCoulStreitz::setup()
void PairCoulStreitz::setup_params()
{
int i,m,n;

View File

@ -69,7 +69,7 @@ class PairCoulStreitz : public Pair {
void allocate();
virtual void read_file(char *);
void setup();
void setup_params();
double self(Param *, double);
void coulomb_integral_wolf(double, double, double, double &, double &,
double &, double &);

View File

@ -1 +1 @@
#define LAMMPS_VERSION "22 Jan 2016"
#define LAMMPS_VERSION "25 Jan 2016"