This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to run MrBayes with google VMs?

Hi, I have been trying to run MrBayes with Google VMs. But it runs not faster but slower than my mid-range PC. How may I resolve this? I need to run MrBayes rapidly, I have tried running with MPI but still very slow. These are some information about my data.

begin data;
   dimensions ntax= 188 nchar= 4814;
   format datatype=dna missing=? gap=- matchchar=.;
   matrix


begin mrbayes;
  charset SSU = 1-1061;
  charset LSU = 1062-2004;
  charset TEF11stpos = 2005-2969\3;
  charset TEF12ndpos = 2006-2969\3;
  charset TEF13rdpos = 2007-2969\3;
  charset RPB11stpos = 2970-3730\3;
  charset RPB12ndpos = 2971-3730\3;
  charset RPB13rdpos = 2972-3730\3;
  charset RPB21stpos = 3731-4814\3;
  charset RPB22ndpos = 3732-4814\3;
  charset RPB23rdpos = 3733-4814\3;
partition partition-by-codon=11: SSU,LSU,TEF11stpos,TEF12ndpos,TEF13rdpos,RPB11stpos,RPB12ndpos,RPB13rdpos,RPB21stpos,RPB22ndpos,RPB23rdpos;
set partition=partition-by-codon;
lset applyto=(1,4) nst=6 rates=invgamma;
lset applyto=(2,3,5,6,7,8,9,10,11) nst=6 rates=invgamma;
prset applyto=(2,3,5,6,7,8,9,10,11) statefreqpr=fixed(empirical);
unlink revmat=(all) statefreq=(all) shape=(all);
prset applyto=(all) ratepr=variable;
mcmcp ngen=10000000 printfreq=1000 samplefreq=1000 relburnin=yes burninfrac=0.2;
mcmcp nchains=4 nswaps=4 savebrlens=yes temp=0.1;
mcmcp nruns=2 diagnfreq=5000 diagnstat=maxstddev;
mcmc;

Thanks a lot.

Jeremiah

mrbayes vms google

1 answer

  • how many cpus do you have on the google VMs
  • did you talk this through with an AI like Gemini ?

Did you enable mpi properly when compiling ? Did you compile yourself (advisable) or get a single threaded version elsewhere?

cd mrbayes-src/
./configure --enable-mpi=yes --with-beagle=yes
make -j 4

If you have 16 threads available - use top or htop to check the VM is using 2+ threads when running

mcmc nruns=2 nchains=8

Hi Colin,

Good day.

Thanks for your reply. I am actually very new to this. I have talked to Gemini and followed the step-by-step guide provided. I think i did compile it myself according to what Gemini instructed. I have also enabled mpi and beagle. I am getting slow response and plenty of repetitions. I am not sure why. The VM i have selected is C3D, it has 16 vCPUs, i have checked, that would equal to 8 cores.

enter image description here

enter image description here

Jeremiah

Ok, specifics from the tool do not matter - to optimize, show us the htop and top results (these are linux commands) while mrbayes is running. You can also show gemini these results and ask if mrbayes is running in parallel. Or post here. It should show something like 800% or 1600%, not 100% cpu usage on top if running on 8 or 16 cores.

To use all 16cpus try to optimize for 16 threads, not 8 as you suggest.

Thanks for your reply. I have tried to run it with 16 cores and adjusted my .nex file to nruns=2 nchains=8, now matching the number of cores. This is the htop results. I have asked Gemini , it seems to be running fine without bottlenecking issue. It appears to be running faster than before but according to the remaining time, it still requires more than 130 hours to complete the process, which i find to still be quite slow. Btw, for everyone's information i have changed the VM to C2D with more than 100 ram as the 64 ram VM i selected priorly could not run. enter image description here

managed to identify the issue, apparently running with executable "mb-mpi" directed it to run as 16 serial binaries (which explained the repetitions issue i faced before). now i changed the executable to "mb" only that omits the other 15 binaries and only run as single MPI enabled run utilising 16 cores. Now the time is shortened to 17 hours and runs much faster than before. But have to check priorly whether the mb installed has mpi enabled, that i checked using "./src/mb -v".

enter image description here

Thanks for pointing out some of the issues and also introducing me to htop, that really help a lot.

Jeremiah

Log in to answer this question.