add comment to explain using the LAMMPS_LIB_MPI define in example

This commit is contained in:
Axel Kohlmeyer
2020-10-09 11:50:53 -04:00
parent 84c9fcf6e9
commit 078f931393
2 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,7 @@ a problem when the communicator that would be passed is different from
``MPI_COMM_WORLD``. Otherwise calling :cpp:func:`lammps_open_no_mpi`
will work just as well. To make :cpp:func:`lammps_open` available,
you need to compile the code with ``-DLAMMPS_LIB_MPI`` or add the line
``#define LAMMPS_LIB_MPI 1`` before ``#include "library.h"``.
``#define LAMMPS_LIB_MPI`` before ``#include "library.h"``.
Please note the ``mpi.h`` file must usually be the same (and thus the
MPI library in use) for the LAMMPS code and library and the calling code.

View File

@ -32,8 +32,10 @@ Below is a short example using some of these functions.
.. code-block:: C
/* define to make the otherwise hidden prototype for "lammps_open()" visible */
#define LAMMPS_LIB_MPI
#include "library.h"
#include <mpi.h>
#include <stdio.h>