diff --git a/examples/couple/README b/examples/couple/README index f766505788..d9d787bd7c 100644 --- a/examples/couple/README +++ b/examples/couple/README @@ -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 diff --git a/examples/couple/c++_driver.cpp b/examples/couple/c++_driver.cpp index 4b59e61575..ff78e49657 100644 --- a/examples/couple/c++_driver.cpp +++ b/examples/couple/c++_driver.cpp @@ -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 diff --git a/examples/couple/c_driver.c b/examples/couple/c_driver.c index b219beb608..5b80815160 100644 --- a/examples/couple/c_driver.c +++ b/examples/couple/c_driver.c @@ -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 */