Simpatico
v1.10
|
2.2.4 Configuring MPI (Prev) 2.2.6 Generating html documentation (Next)
As a first step, compile the single-processor versions of the mcSim and mdSim programs. Because these programs are standard C++ with no external dependencies, they usually compile with no difficulties. After setting environment variables, running the setup script (see above), and making required changes in the configuration, simply cd to the simpatico/ root directory and then enter:
This will compile a large number of *.cpp files from util/, simp/ and mcMd/ subdirectories of the simpatico/src/ directory, placing corresponding object (*.o) and dependency (*.d) files in the simpatico/bld/serial directory, and then install executable files named mcSim and mdSim in the simpatico/bin directory.
The mdPp post-processor program is also a single-processor program that you can compile before attempting to compile any parallel programs. To do so, cd to the simpatico/ root directory and enter:
This will compile code in src/tools directory, place *.o and *.d files in the simpatico/bld/serial/tools directory and install an executable named mdPp in the simpatico/bin directory.
To compile the ddSim parallel MD program, after make sure your environment is set up correctly to compile MPI programs, simply enter
from the simpatico/ root directory. If successful, this will build the program in the simpatico/bld/parallel directory tree and install an executable named ddSim in the simpatico/bin directory.
Multi-processor versions of mcSim and mdSim can be used to run:
To compile multi-processor versions of mcSim and mdSim, enter:
from the simpatico/ root directory. This should create executable files named mcSim_m and mdSim_m in the simpatico/bin/ directory. The suffix "_m" on these executable names denotes "MPI", and is used to distinguish multi-processor versions of the mcSim and mdSim executables from single processor versions.
To peform an in-source build of a program, one may simply invoke the make utility from the src/ directory rather than from the simpatico/ directory, using the same makefile target name as that used to compile the same program when make is invoked from the simpatico/ directory. Thus for example, to peform an in-source compilation of mcSim and mdSim, one may simply invoke "make mcMd" from the src/ directory.
Simpatico allows the user to build several programs that do not use MPI (the mcSim, mdSim and mdPp programs) as well as several parallel programs that do (the ddSim, mcSim_m and dSim_m programs). Both sets of programs use the same C++ classes but are compiled with different compiler options. All source code used by any MPI program must be compiled with MPI enabled in the makefile system, by defining UTI_MPI in the main configuration file. Enabling MPI in the makefile system causes causes the compiler to be passed an option ("-D UTIL_MPI") that enables conditional compilation of segments of code that use MPI. All source code used by serial programs is compiled with MPI disabled, and is thus compiled without the compiler option that enables conditional compilation of these segments of code.
When a user compiles a program or programs by invoking "make" from the root of the src/ directory with an appropriate target, the "recipes" defined in the main makefile include a command to enable or disable MPI, as appropriate, before compiling. Thus, for example, the sequence of commands invoked by the "make mcMd" command starts with a command "./configure -m0" that uses the configure script to disable MPI, while the commands invoked by the "make ddMd" or make mcMd-mpi" commands start with a command "./configure -m1" that enables MPI. When compiling by invoking make from the src/ directory, one thus does not half to manually enable or disable MPI before compiling.
Simpatico's use of conditional compilation to compile MPI-enabled and MPI-disabled versions of a common set of source files does, however, complicate any attempt to work simultaneously on parallel and serial programs using the same build directory. The build system for out-of-source-builds avoids any resulting complexity by using different build directories (bld/parallel and bld/serial) for building serial and parallel programs. When a user compiles in-source, however, enabling or disabling MPI can force the build system to recompile a large number of source files that are shared by parallel and serial codes. For example example, if a user invokes "make mcMd" from the src/ directory to compile mcSim and mdSim in source, and then invokes "make ddMd" from the same directory to compile "ddSim", the build system will disable MPI before attempting to build mcSim and mdSim and disable MPI before attempting to compile ddSim. This will force the build system to recompile all of the source files that are used by both sets of programs when compiling ddSim, and produce object files that overwrite the versions created when compiling the serial programs. Enabling or disabling MPI thus forces the build system to rebuild all files from scratch. A clean rebuild of any of the simpatico programs generally takes a few minutes. To avoid having to constantly rebuild all of the code, users should thus avoid frequently enabling and disabling MPI, or switching between work on parallel and serial programs, when compiling in source. This problem does not arise when compiling out-of-source, because of the use of separate build directories for serial and parallel code.
2.2.4 Configuring MPI (Prev) 2.2 Compiling (Up) 2.2.6 Generating html documentation (Next)