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

This commit is contained in:
sjplimp
2010-08-27 15:07:29 +00:00
parent 3dfd2c2676
commit 74dc0a552b
3 changed files with 23 additions and 25 deletions

View File

@ -24,21 +24,19 @@ You can then build either driver code with a compile line something
like this, which includes paths to the LAMMPS library interface, MPI,
and FFTW.
This builds the C driver with the LAMMPS library using a C compiler:
gcc -I/home/sjplimp/tools/mpich/include -I/home/sjplimp/lammps/new2 \
-L/home/sjplimp/lammps/new2 -L/home/sjplimp/tools/mpich/lib \
-L/home/sjplimp/tools/fftw/lib c_driver.c \
-llmp_g++ -lfftw -lmpich -lstdc++ -o c_driver
This builds the C++ driver with the LAMMPS library using a C++ compiler:
g++ -I/home/sjplimp/tools/mpich/include -I/home/sjplimp/lammps/new2 \
-L/home/sjplimp/lammps/new2 -L/home/sjplimp/tools/mpich/lib \
-L/home/sjplimp/tools/fftw/lib c++_driver.cpp \
-llmp_g++ -lfftw -lmpich -o c++_driver
g++ -I/home/sjplimp/lammps/src -c c++_driver.cpp
g++ -L/home/sjplimp/lammps/src c++_driver.o \
-llmp_g++ -lfftw -lmpich -lpthread -o c++_driver
You then run c_driver or c++_driver on a parallel machine on some
This builds the C driver with the LAMMPS library using a C compiler:
gcc -I/home/sjplimp/lammps/src -c c_driver.cpp
gcc -L/home/sjplimp/lammps/src c_driver.o \
-llmp_g++ -lfftw -lmpich -lpthread -lstdc++ -o c_driver
You then run c++_driver or c_driver on a parallel machine on some
number of processors Q with 2 arguments:
mpirun -np Q c_driver P in.lj

View File

@ -11,11 +11,11 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
// umbrella = simple example of how an umbrella program
// can invoke LAMMPS as a library on some subset of procs
// Syntax: umbrella P in.lammps
// c++_driver = simple example of how an umbrella program
// can invoke LAMMPS as a library on some subset of procs
// Syntax: c++_driver P in.lammps
// P = # of procs to run LAMMPS on
// must be <= # of procs the umbrella code itself runs on
// must be <= # of procs the driver code itself runs on
// in.lammps = LAMMPS input script
// See README for compilation instructions
@ -33,13 +33,13 @@ using namespace LAMMPS_NS;
int main(int narg, char **arg)
{
// setup MPI and various communicators
// umbrella is all procs in MPI_COMM_WORLD
// driver runs on all procs in MPI_COMM_WORLD
// comm_lammps only has 1st P procs (could be all or any subset)
MPI_Init(&narg,&arg);
if (narg != 3) {
printf("Syntax: umbrella P in.lammps\n");
printf("Syntax: c++_driver P in.lammps\n");
exit(1);
}
@ -72,7 +72,7 @@ int main(int narg, char **arg)
}
// run the input script thru LAMMPS one line at a time until end-of-file
// umbrella proc 0 reads a line, Bcasts it to all procs
// driver proc 0 reads a line, Bcasts it to all procs
// (could just send it to proc 0 of comm_lammps and let it Bcast)
// all LAMMPS procs call input->one() on the line

View File

@ -11,11 +11,11 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* umbrella = simple example of how an umbrella program
/* c_driver = simple example of how an umbrella program
can invoke LAMMPS as a library on some subset of procs
Syntax: umbrella P in.lammps
Syntax: c_driver P in.lammps
P = # of procs to run LAMMPS on
must be <= # of procs the umbrella code itself runs on
must be <= # of procs the driver code itself runs on
in.lammps = LAMMPS input script
See README for compilation instructions */
@ -28,13 +28,13 @@
int main(int narg, char **arg)
{
/* setup MPI and various communicators
umbrella is all procs in MPI_COMM_WORLD
driver runs on all procs in MPI_COMM_WORLD
comm_lammps only has 1st P procs (could be all or any subset) */
MPI_Init(&narg,&arg);
if (narg != 3) {
printf("Syntax: umbrella P in.lammps\n");
printf("Syntax: c_driver P in.lammps\n");
exit(1);
}
@ -67,7 +67,7 @@ int main(int narg, char **arg)
}
/* run the input script thru LAMMPS one line at a time until end-of-file
umbrella proc 0 reads a line, Bcasts it to all procs
driver proc 0 reads a line, Bcasts it to all procs
(could just send it to proc 0 of comm_lammps and let it Bcast)
all LAMMPS procs call lammps_command() on the line */