potfit wiki

open source force-matching

User Tools

Site Tools


compiling:mpi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
compiling:mpi [2020/05/14 15:53]
daniel created
compiling:mpi [2020/05/14 16:24] (current)
daniel
Line 3: Line 3:
 ---- ----
  
 +//potfit// does support all common MPI implementations for parallel execution. While the build process for an MPI-enabled build is almost the same as a regular build, there are some minor differences you should be aware of.
  
 +===== Basics =====
 +
 +In order to enable MPI support in //potfit// the ''--enable-mpi'' command line option needs to be specified. It will always be assumed that there is an ''mpicc'' command which knows how to handle the current environment properly. 
 +
 +<wrap round warning 595px center>
 +When using ''--enable-mpi'' you cannot specify a compiler with the ''--check-c-compiler'' flag!
 +</wrap>
 +
 +A command to compile //potfit// with MPI support might look like this:
 +
 +<code>./waf configure -i pair -m apot --enable-mpi</code>
 +
 +Usually you should see output similar to this:
 +
 +<code>
 +Checking for 'icc' (C compiler)          : not found 
 +Checking for 'clang' (C compiler)        : not found 
 +Checking for 'gcc' (C compiler)          : mpicc 
 +</code>
 +
 +All enabled options will also be listed on the summary of the configuration stage:
 +
 +<code>
 +potfit has been configured with the following options:
 +potential model      = apot
 +interaction          = pair
 +math library         = mkl
 +options              = mpi
 +</code>
 +
 +===== Selecting the MPI compiler =====
 +
 +The selection of the MPI compiler depends on your MPI implementation. For [[https://www.open-mpi.org/|Open MPI]] this behavior is controlled through environment variables, like ''OMPI_CC'', ''OMPI_CFLAGS'' and ''OMPI_LDFLAGS''.
 +
 +To switch the compiler you can use this command (OpenMPI):
 +
 +
 +<code>OMPI_CC="clang" ./waf configure -i pair -m apot --enable-mpi</code>
 +
 +Checking the output, you should see that the ''mpicc'' command has now been identified as a clang compiler:
 +
 +<code>
 +Checking for 'icc' (C compiler)          : not found 
 +Checking for 'clang' (C compiler)        : mpicc
 +</code>
 +
 +To make sure the same value of the environment variables are used for all steps of the //potfit// compilation process please export the variable using you shell.
compiling/mpi.1589464439.txt.gz ยท Last modified: 2020/05/14 15:53 by daniel