For the same example, using a **hybrid** approach, here is a definition file. The important change is that the environment sets the OMPI variables to use the openmpi version within the container:
cd /tmp/ompi && wget -O openmpi-$OMPI_VERSION.tar.bz2 $OMPI_URL && tar -xjf openmpi-$OMPI_VERSION.tar.bz2
# Compile and install
cd /tmp/ompi/openmpi-$OMPI_VERSION && ./configure --enable-orterun-prefix-by-default --with-pmix=/usr/lib/x86_64-linux-gnu/pmix/ --prefix=$OMPI_DIR && make install
# Set env variables so we can compile our application
In addition to using a hybrid approach, the mpi_hello_world application is compiled as part of the "post" section of the .def file using the command "make". This required modifying the "files" section to include the source (.c) and the makefile.
The correspond slurm script:
```
#!/bin/bash
#SBATCH --ntasks=4 ## number of MPI tasks
#SBATCH --cpus-per-task=1 ## number of cores per task
Further testing of the MPI container could include a multi-node slurm script, and an MPI program that utilizes more MPI features (such as sending messages between tasks).