How to run MrBayes on a Linux cluster
2
1
Entering edit mode
5.6 years ago
friist ▴ 30

I have set up a little prototype Linux cluster consisting of two laptops using mpich_3.3-a2 and after a couple of dud installs and some trouble shooting managed to get it to run the test programs cpi and hellow that are included in the examples folder in mpich.

That's all well and good but really wanted to apply it to some bioinformatics packages and there's nowhere better to start than with MrBayes.

I first created a mrbayes environment using conda:

conda create -n mrbayes_env mrbayes

Then navigated into the mrbayes_env folder and executed this command:

(base) fusc@hp-ubuntu:~/miniconda3/envs/mrbayes_env/bin$
>> mpiexec -n 6 -f /home/fusc/mpich/hosts ./mb

That certainly fired up mrbayes, but instead of it running across 6 CPUs I ended up with six instances of mrbayes, which kind of defeats the purpose.

Is there a Dummies set of instructions for running MrBayes on a Linux cluster out there somewhere that I can dip into for some hints? Any help will be greatly appreciated.

-TEF

mpiexec mrbayes linux cluster • 8.9k views
ADD COMMENT
0
Entering edit mode

Should you not instead of navigate to the env folder activate the environment? Like:

conda activate mrbayes_env
ADD REPLY
0
Entering edit mode

Yes, you're right about that, silly mistake. I did try that but it didn't make any difference as to getting MrBayes to run on multiple CPUs, even when I tried mb-mpi.

For that I needed to compile the MrBayes source code and enable mpi in the configure step. I've posted what I did below.

ADD REPLY
3
Entering edit mode
5.6 years ago
h.mon 35k

This is how the MPI version of MrBayes is supposed to work, check the documentation:

Compiling and Running the Parallel Version of MrBayes

ADD COMMENT
1
Entering edit mode

That worked rather well. Here's what I did:

First cloned the latest MrBayes repository using git:

$ git clone https://github.com/NBISweden/MrBayes.git

Navigated into the MrBayes folder created by git, then eneabled parallelization:

$ env MPICC="/home/fusc/mpich/bin/mpicc" ./configure --with-mpi

Followed by:

$ make && sudo make install

Fired up MrBayes inside the folder containing my nexus sequence alignment:

(base) fusc@hp-ubuntu:~/MrBayes_analysis/Linux_cluster_test_run$
>> mpiexec -np 6 mb

At the moment I've got a newish 4xCPU HP laptop and an old 2xCPU HP laptop that I've strung together on this cluster, hence the np=6. Not an ideal configuration but it'll do for now. Nevertheless resulted in the desired outcome:

                      MrBayes 3.2.7a x86_64

                  (Bayesian Analysis of Phylogeny)

                         (Parallel version)
                     (6 processors available)

          Distributed under the GNU General Public License


           Type "help" or "help <command>" for information
                 on the commands that are available.

               Type "about" for authorship and general
                   information about the program.
  

MrBayes >

Test run a 209 species protein nexus file:

MrBayes > exe 209_C12_6-5-19.nex

....and we're off to the races... The nexus file is available on request.

ADD REPLY
0
Entering edit mode

Sweet. I suspected I'd have to compile it from source to work with mpi. I'll give that a go. Thanks!

ADD REPLY
2
Entering edit mode
3.0 years ago

When you want to install and run MrBayes through conda the code should be like this:

conda create -n mrbayes_env mrbayes
conda activate mrbayes_env
mpiexec -np 4 mb-mpi
ADD COMMENT

Login before adding your answer.

Traffic: 2670 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6