# Openmpi support

**URL:** <https://community.openpbs.org/t/openmpi-support/1396>\
**Category:** Users/Site Administrators\
**Created:** [January 14, 2019, 3:17am UTC](https://community.openpbs.org/t/openmpi-support/1396 "2019-01-14T03:17:17Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [January 14, 2019, 8:38pm UTC](https://community.openpbs.org/t/openmpi-support/1396/5 "2019-01-14T20:38:21Z")

</div>

- @mkaro suggestion - recommended

> [@liuxiaopiao](#):
>
> Before i didn’t compile openmpi with tm option, I still could run mpirun hostname inside pbs script, so I would like to have one golden way to check after I build openmpi with tm option to see if it is working fine with pbs cluster.

You can run openmpi with PBS Pro without compiling with PBS TM option, but it will be loose integration and the communication and process launch will be via ssh and upon job deletion (job clean up is not correct) , zombie process might be created which needs to be cleaned up manually (Otherwise, pbs\_attach would also help ) and usage data respect to each of the processes is not accounted.

If you use the MPI compiled with PBS TM , then the spawned processes are tightly controlled by PBS mom, proper accounting of the usage and job cleanup is guarantied.

**How to compile?**

> #wget [https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2](https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2)  
> #bzip2 -d openmpi-4.0.0.tar.bz2  
> #tar -xvf openmpi-4.0.0.tar  
> #cd openmpi-4.0.0  
> #export LD\_LIBRARY\_PATH=/opt/pbs/lib:$LD\_LIBRARY\_PATH  
> #export LDFLAGS=“-L/opt/pbs/lib -lpbs -lpthread -lcrypto”  
> #./configure --prefix=/path/to/shared/openmpi400 --with-tm=/opt/pbs/default --enable-mpi-interface-warning --enable-shared --enable-static --enable-cxx-exceptions  
> #make; make install

**How to run ?**  
#!/bin/bash  
#PBS -N pbs-openmpi-sh  
#PBS -l select=2:ncpus=4:mpiprocs=4  
#PBS -l place=scatter  
/opt/openmpi400/bin/mpirun -np `cat $PBS_NODEFILE | wc -l` /bin/hostname

```
qsub pbs-openmpi.sh

```

---

_[View the full topic](https://community.openpbs.org/t/openmpi-support/1396)._
