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

This commit is contained in:
sjplimp
2014-05-13 15:23:26 +00:00
parent 6c06a66ae7
commit d8258f7328
4 changed files with 1966 additions and 0 deletions

1537
src/comm_brick.cpp Normal file

File diff suppressed because it is too large Load Diff

164
src/comm_brick.h Normal file
View File

@ -0,0 +1,164 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_COMM_BRICK_H
#define LMP_COMM_BRICK_H
#include "comm.h"
namespace LAMMPS_NS {
class CommBrick : public Comm {
public:
CommBrick(class LAMMPS *);
virtual ~CommBrick();
virtual void init();
virtual void setup(); // setup 3d comm pattern
virtual void forward_comm(int dummy = 0); // forward comm of atom coords
virtual void reverse_comm(); // reverse comm of forces
virtual void exchange(); // move atoms to new procs
virtual void borders(); // setup list of atoms to comm
virtual void forward_comm_pair(class Pair *); // forward comm from a Pair
virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair
virtual void forward_comm_fix(class Fix *); // forward comm from a Fix
virtual void reverse_comm_fix(class Fix *); // reverse comm from a Fix
virtual void forward_comm_variable_fix(class Fix *); // variable-size variant
virtual void reverse_comm_variable_fix(class Fix *); // variable-size variant
virtual void forward_comm_compute(class Compute *); // forward from a Compute
virtual void reverse_comm_compute(class Compute *); // reverse from a Compute
virtual void forward_comm_dump(class Dump *); // forward comm from a Dump
virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump
void forward_comm_array(int, double **); // forward comm of array
int exchange_variable(int, double *, double *&); // exchange on neigh stencil
virtual bigint memory_usage();
protected:
int nswap; // # of swaps to perform = sum of maxneed
int recvneed[3][2]; // # of procs away I recv atoms from
int sendneed[3][2]; // # of procs away I send atoms to
int maxneed[3]; // max procs away any proc needs, per dim
int triclinic; // 0 if domain is orthog, 1 if triclinic
int maxswap; // max # of swaps memory is allocated for
int size_forward; // # of per-atom datums in forward comm
int size_reverse; // # of datums in reverse comm
int size_border; // # of datums in forward border comm
int *sendnum,*recvnum; // # of atoms to send/recv in each swap
int *sendproc,*recvproc; // proc to send/recv to/from at each swap
int *size_forward_recv; // # of values to recv in each forward comm
int *size_reverse_send; // # to send in each reverse comm
int *size_reverse_recv; // # to recv in each reverse comm
double *slablo,*slabhi; // bounds of slab to send at each swap
double **multilo,**multihi; // bounds of slabs for multi-type swap
double **cutghostmulti; // cutghost on a per-type basis
int *pbc_flag; // general flag for sending atoms thru PBC
int **pbc; // dimension flags for PBC adjustments
int comm_x_only,comm_f_only; // 1 if only exchange x,f in for/rev comm
int map_style; // non-0 if global->local mapping is done
int *firstrecv; // where to put 1st recv atom in each swap
int **sendlist; // list of atoms to send in each swap
int *maxsendlist; // max size of send list for each swap
double *buf_send; // send buffer for all comm
double *buf_recv; // recv buffer for all comm
int maxsend,maxrecv; // current size of send/recv buffer
int maxforward,maxreverse; // max # of datums in forward/reverse comm
int maxexchange; // max # of datums/atom in exchange comm
int bufextra; // extra space beyond maxsend in send buffer
int updown(int, int, int, double, int, double *);
// compare cutoff to procs
virtual void grow_send(int, int); // reallocate send buffer
virtual void grow_recv(int); // free/allocate recv buffer
virtual void grow_list(int, int); // reallocate one sendlist
virtual void grow_swap(int); // grow swap and multi arrays
virtual void allocate_swap(int); // allocate swap arrays
virtual void allocate_multi(int); // allocate multi arrays
virtual void free_swap(); // free swap arrays
virtual void free_multi(); // free multi arrays
};
}
#endif
/* ERROR/WARNING messages:
W: OMP_NUM_THREADS environment is not set.
This environment variable must be set appropriately to use the
USER-OMP pacakge.
E: Bad grid of processors
The 3d grid of processors defined by the processors command does not
match the number of processors LAMMPS is being run on.
E: Processor count in z must be 1 for 2d simulation
Self-explanatory.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Invalid group in communicate command
Self-explanatory.
E: Communicate group != atom_modify first group
Self-explanatory.
E: Invalid cutoff in communicate command
Specified cutoff must be >= 0.0.
E: Specified processors != physical processors
The 3d grid of processors defined by the processors command does not
match the number of processors LAMMPS is being run on.
E: Cannot use processors part command without using partitions
See the command-line -partition switch.
E: Invalid partitions in processors part command
Valid partitions are numbered 1 to N and the sender and receiver
cannot be the same partition.
E: Sending partition in processors part command is already a sender
Cannot specify a partition to be a sender twice.
E: Receiving partition in processors part command is already a receiver
Cannot specify a partition to be a receiver twice.
E: Processors grid numa and map style are incompatible
Using numa for gstyle in the processors command requires using
cart for the map option.
E: Processors part option and grid style are incompatible
Cannot use gstyle numa or custom with the part option.
*/

210
src/comm_tiled.cpp Normal file
View File

@ -0,0 +1,210 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "lmptype.h"
#include "comm_tiled.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{SINGLE,MULTI}; // same as in Comm
/* ---------------------------------------------------------------------- */
CommTiled::CommTiled(LAMMPS *lmp) : Comm(lmp)
{
style = 1;
layout = 0;
error->all(FLERR,"Comm_style tiled is not yet supported");
}
/* ---------------------------------------------------------------------- */
CommTiled::~CommTiled()
{
}
/* ---------------------------------------------------------------------- */
void CommTiled::init()
{
}
/* ----------------------------------------------------------------------
setup spatial-decomposition communication patterns
function of neighbor cutoff(s) & cutghostuser & current box size
single mode sets slab boundaries (slablo,slabhi) based on max cutoff
multi mode sets type-dependent slab boundaries (multilo,multihi)
------------------------------------------------------------------------- */
void CommTiled::setup()
{
}
/* ----------------------------------------------------------------------
forward communication of atom coords every timestep
other per-atom attributes may also be sent via pack/unpack routines
------------------------------------------------------------------------- */
void CommTiled::forward_comm(int dummy)
{
}
/* ----------------------------------------------------------------------
reverse communication of forces on atoms every timestep
other per-atom attributes may also be sent via pack/unpack routines
------------------------------------------------------------------------- */
void CommTiled::reverse_comm()
{
}
/* ----------------------------------------------------------------------
exchange: move atoms to correct processors
atoms exchanged with all 6 stencil neighbors
send out atoms that have left my box, receive ones entering my box
atoms will be lost if not inside some proc's box
can happen if atom moves outside of non-periodic bounary
or if atom moves more than one proc away
this routine called before every reneighboring
for triclinic, atoms must be in lamda coords (0-1) before exchange is called
------------------------------------------------------------------------- */
void CommTiled::exchange()
{
}
/* ----------------------------------------------------------------------
borders: list nearby atoms to send to neighboring procs at every timestep
one list is created for every swap that will be made
as list is made, actually do swaps
this does equivalent of a communicate, so don't need to explicitly
call communicate routine on reneighboring timestep
this routine is called before every reneighboring
for triclinic, atoms must be in lamda coords (0-1) before borders is called
------------------------------------------------------------------------- */
void CommTiled::borders()
{
}
/* ----------------------------------------------------------------------
forward communication invoked by a Pair
------------------------------------------------------------------------- */
void CommTiled::forward_comm_pair(Pair *pair)
{
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Pair
------------------------------------------------------------------------- */
void CommTiled::reverse_comm_pair(Pair *pair)
{
}
/* ----------------------------------------------------------------------
forward communication invoked by a Fix
n = constant number of datums per atom
------------------------------------------------------------------------- */
void CommTiled::forward_comm_fix(Fix *fix)
{
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Fix
n = constant number of datums per atom
------------------------------------------------------------------------- */
void CommTiled::reverse_comm_fix(Fix *fix)
{
}
/* ----------------------------------------------------------------------
forward communication invoked by a Fix
n = total datums for all atoms, allows for variable number/atom
------------------------------------------------------------------------- */
void CommTiled::forward_comm_variable_fix(Fix *fix)
{
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Fix
n = total datums for all atoms, allows for variable number/atom
------------------------------------------------------------------------- */
void CommTiled::reverse_comm_variable_fix(Fix *fix)
{
}
/* ----------------------------------------------------------------------
forward communication invoked by a Compute
------------------------------------------------------------------------- */
void CommTiled::forward_comm_compute(Compute *compute)
{
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Compute
------------------------------------------------------------------------- */
void CommTiled::reverse_comm_compute(Compute *compute)
{
}
/* ----------------------------------------------------------------------
forward communication invoked by a Dump
------------------------------------------------------------------------- */
void CommTiled::forward_comm_dump(Dump *dump)
{
}
/* ----------------------------------------------------------------------
reverse communication invoked by a Dump
------------------------------------------------------------------------- */
void CommTiled::reverse_comm_dump(Dump *dump)
{
}
/* ----------------------------------------------------------------------
forward communication of N values in array
------------------------------------------------------------------------- */
void CommTiled::forward_comm_array(int n, double **array)
{
}
/* ----------------------------------------------------------------------
exchange info provided with all 6 stencil neighbors
------------------------------------------------------------------------- */
int CommTiled::exchange_variable(int n, double *inbuf, double *&outbuf)
{
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint CommTiled::memory_usage()
{
bigint bytes = 0;
return bytes;
}

55
src/comm_tiled.h Normal file
View File

@ -0,0 +1,55 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_COMM_TILED_H
#define LMP_COMM_TILED_H
#include "comm.h"
namespace LAMMPS_NS {
class CommTiled : public Comm {
public:
CommTiled(class LAMMPS *);
virtual ~CommTiled();
void init();
void setup(); // setup comm pattern
void forward_comm(int dummy = 0); // forward comm of atom coords
void reverse_comm(); // reverse comm of forces
void exchange(); // move atoms to new procs
void borders(); // setup list of atoms to comm
void forward_comm_pair(class Pair *); // forward comm from a Pair
void reverse_comm_pair(class Pair *); // reverse comm from a Pair
void forward_comm_fix(class Fix *); // forward comm from a Fix
void reverse_comm_fix(class Fix *); // reverse comm from a Fix
void forward_comm_variable_fix(class Fix *); // variable-size variant
void reverse_comm_variable_fix(class Fix *); // variable-size variant
void forward_comm_compute(class Compute *); // forward from a Compute
void reverse_comm_compute(class Compute *); // reverse from a Compute
void forward_comm_dump(class Dump *); // forward comm from a Dump
void reverse_comm_dump(class Dump *); // reverse comm from a Dump
void forward_comm_array(int, double **); // forward comm of array
int exchange_variable(int, double *, double *&); // exchange on neigh stencil
bigint memory_usage();
};
}
#endif
/* ERROR/WARNING messages:
*/