5
$\begingroup$

I compiled MrBayes v3.2.7 from github, with the configuration options ./configure --without-beagle --enable-mpi. The program is called mb.

I tried one of the included example files "sceloporus.nex". I find that if I run mb sceloporus.nex, then it appears to make progress, and writes files to disk.

I used MPI with 1 core, and it behaves as before, making progress, writing files to disk.

But if I run with more than 1 core, using MPI, with mpirun -np 2 mb sceloporus.nex, then it only makes it through some of the analysis setup, doesn't write any files to disk, and just hangs. If I look at top, I see activity on the number of cores I specified. I finally had to manually terminate the program.

Is there something I should be doing differently to have MrBayes properly run in parallel?

Here is a copy of my terminal from these 3 attempts:

[ptitle@iu mbTest]$ ls
sceloporus.nex
[ptitle@iu mbTest]$ ~/MrBayes/src/mb sceloporus.nex 


                            MrBayes pre-3.2.7 x86_64

                      (Bayesian Analysis of Phylogeny)

                             (Parallel version)
                         (1 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.



   Executing file "sceloporus.nex"
   DOS line termination
   Longest line length = 1632
   Parsing file
   Expecting NEXUS formatted file
   Reading data block
      Allocated taxon set
      Allocated matrix
      Defining new matrix with 123 taxa and 1606 characters
      Data is Dna
      Missing data coded as ?
      Gaps coded as -
      Taxon   1 -> AZYuJAS289
      Taxon   2 -> AZYuJAS290
      Taxon   3 -> AZlaJAS294
      Taxon   4 -> AZcoTBP271
      Taxon   5 -> AZcoGM1054
      Taxon   6 -> AZcoDGM994
      Taxon   7 -> AZgiP26438
      Taxon   8 -> AZgrGM1012
      Taxon   9 -> AZgrGM1013
      Taxon  10 -> AZgrGM1024
      Taxon  11 -> AZlaDGM856
      Taxon  12 -> AZmaDGM984
      Taxon  13 -> AZmaDGM992
      Taxon  14 -> AZmaRM4401
      Taxon  15 -> AZmaRM4402
      Taxon  16 -> AZmaRM4403
      Taxon  17 -> AZmoGM1045
      Taxon  18 -> AZmoDGM492
      Taxon  19 -> AZmoDGM699
      Taxon  20 -> AZmoDGM704
      Taxon  21 -> AZmoRM4394
      Taxon  22 -> AZpiKWS238
      Taxon  23 -> AZyuDGM826
      Taxon  24 -> AZyuDGM838
      Taxon  25 -> AZyuDGM852
      Taxon  26 -> AZyuDGM858
      Taxon  27 -> AZyuDGM865
      Taxon  28 -> CAfrP25750
      Taxon  29 -> CAimDGM534
      Taxon  30 -> CAimDGM558
      Taxon  31 -> CAimDGM694
      Taxon  32 -> CAimKWS170
      Taxon  33 -> CAinCRF530
      Taxon  34 -> CAinoDGM74
      Taxon  35 -> CAinCRF529
      Taxon  36 -> CAkeDS2SP7
      Taxon  37 -> CAkeP26556
      Taxon  38 -> CAla78323
      Taxon  39 -> CAlaDAW220
      Taxon  40 -> CAlaM14610
      Taxon  41 -> CAlaM23289
      Taxon  42 -> CAmoJQR132
      Taxon  43 -> CArvJOS138
      Taxon  44 -> CArvESA441
      Taxon  45 -> CAsaBUR167
      Taxon  46 -> CAsaMCFMAG
      Taxon  47 -> CAsarnMCC
      Taxon  48 -> CAsa150079
      Taxon  49 -> CAsa150088
      Taxon  50 -> CAsa179886
      Taxon  51 -> CAsaM19838
      Taxon  52 -> CAsdDGM691
      Taxon  53 -> CAsdDGM748
      Taxon  54 -> CAsdSWT701
      Taxon  55 -> MXBCDGM474
      Taxon  56 -> MXBCDGM475
      Taxon  57 -> MXBCDGM486
      Taxon  58 -> MXchRM4860
      Taxon  59 -> MXduA83134
      Taxon  60 -> MXsoM14488
      Taxon  61 -> MXsoP26449
      Taxon  62 -> MXso210345
      Taxon  63 -> NMdoTWR230
      Taxon  64 -> NMedDGM938
      Taxon  65 -> NMhiU48819
      Taxon  66 -> NMluGM947
      Taxon  67 -> NMluDGM948
      Taxon  68 -> NMsiDGM891
      Taxon  69 -> NMsoDGM900
      Taxon  70 -> NMsoDGM904
      Taxon  71 -> NMsoDGM905
      Taxon  72 -> NMvaDGM924
      Taxon  73 -> NVchDGM612
      Taxon  74 -> NVch162077
      Taxon  75 -> NVclDGM296
      Taxon  76 -> NVclDGM678
      Taxon  77 -> NVesDGM210
      Taxon  78 -> NVlyDGM610
      Taxon  79 -> NVwaDGM608
      Taxon  80 -> UTemGM1058
      Taxon  81 -> UTgrDGM156
      Taxon  82 -> UTgrDGM169
      Taxon  83 -> UTgrDGM175
      Taxon  84 -> UTkaGM1034
      Taxon  85 -> UTsnDM142
      Taxon  86 -> UTsnDG043
      Taxon  87 -> UTsnnDGM645
      Taxon  88 -> UTwsGM261
      Taxon  89 -> UTwsGM263
      Taxon  90 -> UTwsnDGM751
      Taxon  91 -> UTwsJRM4437
      Taxon  92 -> hunsiM376
      Taxon  93 -> hunsiM377
      Taxon  94 -> hunsiRWM619
      Taxon  95 -> lickGM378
      Taxon  96 -> lineatulus
      Taxon  97 -> orcuOM14377
      Taxon  98 -> orcuOM14453
      Taxon  99 -> orcuOM14673
      Taxon 100 -> orcuRWM798
      Taxon 101 -> orcuS201108
      Taxon 102 -> orcuS201124
      Taxon 103 -> zostZ16290
      Taxon 104 -> zosV161292
      Taxon 105 -> zosV161293
      Taxon 106 -> zosV161311
      Taxon 107 -> zosWM1890
      Taxon 108 -> zosGM364
      Taxon 109 -> zosGM365
      Taxon 110 -> zosGM387
      Taxon 111 -> zosGM393
      Taxon 112 -> zosRO332
      Taxon 113 -> zosOM37006
      Taxon 114 -> zosWM1601
      Taxon 115 -> clarkii
      Taxon 116 -> edwardti80
      Taxon 117 -> smaragdnus
      Taxon 118 -> graciosus
      Taxon 119 -> grammicus
      Taxon 120 -> maculosus
      Taxon 121 -> bicanthlis
      Taxon 122 -> torquatus
      Taxon 123 -> variabilis
      Successfully read matrix
      Setting default partition (does not divide up characters)
      Setting model defaults
      Seed (for generating default start values) = 1544128156
      Setting output file names to "sceloporus.nex.run<i>.<p|t>"
   Exiting data block
   Reading mrbayes block
      Excluding character(s)
      Setting Nst to 6
      Setting Rates to Gamma
      Successfully set likelihood model parameters
      Setting Brlenspr to Unconstrained:GammaDir(1.00,1.0000,0.70,0.50)
      Successfully set prior model parameters
      Setting number of generations to 5000000
      Running Markov chain
      MCMC stamp = 9284864458
      Seed = 753696747
      Swapseed = 1544128156
      Model settings:

         Data not partitioned --
            Datatype  = DNA
            Nucmodel  = 4by4
            Nst       = 6
                        Substitution rates, expressed as proportions
                        of the rate sum, have a Dirichlet prior
                        (1.00,1.00,1.00,1.00,1.00,1.00)
            Covarion  = No
            # States  = 4
                        State frequencies have a Dirichlet prior
                        (1.00,1.00,1.00,1.00)
            Rates     = Gamma
                        The distribution is approximated using 4 categories.
                        Shape parameter is exponentially
                        distributed with parameter (1.00).

      Active parameters: 

         Parameters
         ---------------------
         Revmat              1
         Statefreq           2
         Shape               3
         Ratemultiplier      4
         Topology            5
         Brlens              6
         ---------------------

         1 --  Parameter  = Revmat
               Type       = Rates of reversible rate matrix
               Prior      = Dirichlet(1.00,1.00,1.00,1.00,1.00,1.00)

         2 --  Parameter  = Pi
               Type       = Stationary state frequencies
               Prior      = Dirichlet

         3 --  Parameter  = Alpha
               Type       = Shape of scaled gamma distribution of site rates
               Prior      = Exponential(1.00)

         4 --  Parameter  = Ratemultiplier
               Type       = Partition-specific rate multiplier
               Prior      = Fixed(1.0)

         5 --  Parameter  = Tau
               Type       = Topology
               Prior      = All topologies equally probable a priori
               Subparam.  = V

         6 --  Parameter  = V
               Type       = Branch lengths
               Prior      = Unconstrained:GammaDir(1.0,1.0000,0.7,0.5)


      Number of chains per MPI processor = 8

      The MCMC sampler will use the following moves:
         With prob.  Chain will use move
            0.94 %   Dirichlet(Revmat)
            0.94 %   Slider(Revmat)
            0.94 %   Dirichlet(Pi)
            0.94 %   Slider(Pi)
            1.89 %   Multiplier(Alpha)
            9.43 %   ExtSPR(Tau,V)
            9.43 %   ExtTBR(Tau,V)
            9.43 %   NNI(Tau,V)
            9.43 %   ParsSPR(Tau,V)
           37.74 %   Multiplier(V)
           13.21 %   Nodeslider(V)
            5.66 %   TLMultiplier(V)

      Division 1 has 624 unique site patterns
      Initializing conditional likelihoods
      Using standard FMA likelihood calculator for division 1 (single-precision)

      Initial log likelihoods and log prior probs for run 1:
         Chain 1 -- -38239.042144 -- 53.554896
         Chain 2 -- -37743.352685 -- 53.554896
         Chain 3 -- -38049.750737 -- 53.554896
         Chain 4 -- -38759.582835 -- 53.554896

      Initial log likelihoods and log prior probs for run 2:
         Chain 1 -- -38348.591921 -- 53.554896
         Chain 2 -- -39602.594468 -- 53.554896
         Chain 3 -- -38874.065643 -- 53.554896
         Chain 4 -- -39227.723762 -- 53.554896


      Using a relative burnin of 25.0 % for diagnostics

      Chain results (5000000 generations requested):

         0 -- [-38239.042] (-37743.353) (-38049.751) (-38759.583) * [-38348.592] (-39602.594) (-38874.066) (-39227.724) (...0 remote chains...) 
^C
[ptitle@iu mbTest]$ ls
sceloporus.nex  sceloporus.nex.mcmc  sceloporus.nex.run1.p  sceloporus.nex.run1.t  sceloporus.nex.run2.p  sceloporus.nex.run2.t
[ptitle@iu mbTest]$ mpirun -np 1 ~/MrBayes/src/mb sceloporus.nex 


                            MrBayes pre-3.2.7 x86_64

                      (Bayesian Analysis of Phylogeny)

                             (Parallel version)
                         (1 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.



   Executing file "sceloporus.nex"
   DOS line termination
   Longest line length = 1632
   Parsing file
   Expecting NEXUS formatted file
   Reading data block
      Allocated taxon set
      Allocated matrix
      Defining new matrix with 123 taxa and 1606 characters
      Data is Dna
      Missing data coded as ?
      Gaps coded as -
      Taxon   1 -> AZYuJAS289
      Taxon   2 -> AZYuJAS290
      Taxon   3 -> AZlaJAS294
      Taxon   4 -> AZcoTBP271
      Taxon   5 -> AZcoGM1054
      Taxon   6 -> AZcoDGM994
      Taxon   7 -> AZgiP26438
      Taxon   8 -> AZgrGM1012
      Taxon   9 -> AZgrGM1013
      Taxon  10 -> AZgrGM1024
      Taxon  11 -> AZlaDGM856
      Taxon  12 -> AZmaDGM984
      Taxon  13 -> AZmaDGM992
      Taxon  14 -> AZmaRM4401
      Taxon  15 -> AZmaRM4402
      Taxon  16 -> AZmaRM4403
      Taxon  17 -> AZmoGM1045
      Taxon  18 -> AZmoDGM492
      Taxon  19 -> AZmoDGM699
      Taxon  20 -> AZmoDGM704
      Taxon  21 -> AZmoRM4394
      Taxon  22 -> AZpiKWS238
      Taxon  23 -> AZyuDGM826
      Taxon  24 -> AZyuDGM838
      Taxon  25 -> AZyuDGM852
      Taxon  26 -> AZyuDGM858
      Taxon  27 -> AZyuDGM865
      Taxon  28 -> CAfrP25750
      Taxon  29 -> CAimDGM534
      Taxon  30 -> CAimDGM558
      Taxon  31 -> CAimDGM694
      Taxon  32 -> CAimKWS170
      Taxon  33 -> CAinCRF530
      Taxon  34 -> CAinoDGM74
      Taxon  35 -> CAinCRF529
      Taxon  36 -> CAkeDS2SP7
      Taxon  37 -> CAkeP26556
      Taxon  38 -> CAla78323
      Taxon  39 -> CAlaDAW220
      Taxon  40 -> CAlaM14610
      Taxon  41 -> CAlaM23289
      Taxon  42 -> CAmoJQR132
      Taxon  43 -> CArvJOS138
      Taxon  44 -> CArvESA441
      Taxon  45 -> CAsaBUR167
      Taxon  46 -> CAsaMCFMAG
      Taxon  47 -> CAsarnMCC
      Taxon  48 -> CAsa150079
      Taxon  49 -> CAsa150088
      Taxon  50 -> CAsa179886
      Taxon  51 -> CAsaM19838
      Taxon  52 -> CAsdDGM691
      Taxon  53 -> CAsdDGM748
      Taxon  54 -> CAsdSWT701
      Taxon  55 -> MXBCDGM474
      Taxon  56 -> MXBCDGM475
      Taxon  57 -> MXBCDGM486
      Taxon  58 -> MXchRM4860
      Taxon  59 -> MXduA83134
      Taxon  60 -> MXsoM14488
      Taxon  61 -> MXsoP26449
      Taxon  62 -> MXso210345
      Taxon  63 -> NMdoTWR230
      Taxon  64 -> NMedDGM938
      Taxon  65 -> NMhiU48819
      Taxon  66 -> NMluGM947
      Taxon  67 -> NMluDGM948
      Taxon  68 -> NMsiDGM891
      Taxon  69 -> NMsoDGM900
      Taxon  70 -> NMsoDGM904
      Taxon  71 -> NMsoDGM905
      Taxon  72 -> NMvaDGM924
      Taxon  73 -> NVchDGM612
      Taxon  74 -> NVch162077
      Taxon  75 -> NVclDGM296
      Taxon  76 -> NVclDGM678
      Taxon  77 -> NVesDGM210
      Taxon  78 -> NVlyDGM610
      Taxon  79 -> NVwaDGM608
      Taxon  80 -> UTemGM1058
      Taxon  81 -> UTgrDGM156
      Taxon  82 -> UTgrDGM169
      Taxon  83 -> UTgrDGM175
      Taxon  84 -> UTkaGM1034
      Taxon  85 -> UTsnDM142
      Taxon  86 -> UTsnDG043
      Taxon  87 -> UTsnnDGM645
      Taxon  88 -> UTwsGM261
      Taxon  89 -> UTwsGM263
      Taxon  90 -> UTwsnDGM751
      Taxon  91 -> UTwsJRM4437
      Taxon  92 -> hunsiM376
      Taxon  93 -> hunsiM377
      Taxon  94 -> hunsiRWM619
      Taxon  95 -> lickGM378
      Taxon  96 -> lineatulus
      Taxon  97 -> orcuOM14377
      Taxon  98 -> orcuOM14453
      Taxon  99 -> orcuOM14673
      Taxon 100 -> orcuRWM798
      Taxon 101 -> orcuS201108
      Taxon 102 -> orcuS201124
      Taxon 103 -> zostZ16290
      Taxon 104 -> zosV161292
      Taxon 105 -> zosV161293
      Taxon 106 -> zosV161311
      Taxon 107 -> zosWM1890
      Taxon 108 -> zosGM364
      Taxon 109 -> zosGM365
      Taxon 110 -> zosGM387
      Taxon 111 -> zosGM393
      Taxon 112 -> zosRO332
      Taxon 113 -> zosOM37006
      Taxon 114 -> zosWM1601
      Taxon 115 -> clarkii
      Taxon 116 -> edwardti80
      Taxon 117 -> smaragdnus
      Taxon 118 -> graciosus
      Taxon 119 -> grammicus
      Taxon 120 -> maculosus
      Taxon 121 -> bicanthlis
      Taxon 122 -> torquatus
      Taxon 123 -> variabilis
      Successfully read matrix
      Setting default partition (does not divide up characters)
      Setting model defaults
      Seed (for generating default start values) = 1544128192
      Setting output file names to "sceloporus.nex.run<i>.<p|t>"
   Exiting data block
   Reading mrbayes block
      Excluding character(s)
      Setting Nst to 6
      Setting Rates to Gamma
      Successfully set likelihood model parameters
      Setting Brlenspr to Unconstrained:GammaDir(1.00,1.0000,0.70,0.50)
      Successfully set prior model parameters
      Setting number of generations to 5000000
      Running Markov chain
      MCMC stamp = 9909051894
      Seed = 1261289135
      Swapseed = 1544128192
      Model settings:

         Data not partitioned --
            Datatype  = DNA
            Nucmodel  = 4by4
            Nst       = 6
                        Substitution rates, expressed as proportions
                        of the rate sum, have a Dirichlet prior
                        (1.00,1.00,1.00,1.00,1.00,1.00)
            Covarion  = No
            # States  = 4
                        State frequencies have a Dirichlet prior
                        (1.00,1.00,1.00,1.00)
            Rates     = Gamma
                        The distribution is approximated using 4 categories.
                        Shape parameter is exponentially
                        distributed with parameter (1.00).

      Active parameters: 

         Parameters
         ---------------------
         Revmat              1
         Statefreq           2
         Shape               3
         Ratemultiplier      4
         Topology            5
         Brlens              6
         ---------------------

         1 --  Parameter  = Revmat
               Type       = Rates of reversible rate matrix
               Prior      = Dirichlet(1.00,1.00,1.00,1.00,1.00,1.00)

         2 --  Parameter  = Pi
               Type       = Stationary state frequencies
               Prior      = Dirichlet

         3 --  Parameter  = Alpha
               Type       = Shape of scaled gamma distribution of site rates
               Prior      = Exponential(1.00)

         4 --  Parameter  = Ratemultiplier
               Type       = Partition-specific rate multiplier
               Prior      = Fixed(1.0)

         5 --  Parameter  = Tau
               Type       = Topology
               Prior      = All topologies equally probable a priori
               Subparam.  = V

         6 --  Parameter  = V
               Type       = Branch lengths
               Prior      = Unconstrained:GammaDir(1.0,1.0000,0.7,0.5)


      Number of chains per MPI processor = 8

      The MCMC sampler will use the following moves:
         With prob.  Chain will use move
            0.94 %   Dirichlet(Revmat)
            0.94 %   Slider(Revmat)
            0.94 %   Dirichlet(Pi)
            0.94 %   Slider(Pi)
            1.89 %   Multiplier(Alpha)
            9.43 %   ExtSPR(Tau,V)
            9.43 %   ExtTBR(Tau,V)
            9.43 %   NNI(Tau,V)
            9.43 %   ParsSPR(Tau,V)
           37.74 %   Multiplier(V)
           13.21 %   Nodeslider(V)
            5.66 %   TLMultiplier(V)

      Division 1 has 624 unique site patterns
      Initializing conditional likelihoods
      Using standard FMA likelihood calculator for division 1 (single-precision)

      Initial log likelihoods and log prior probs for run 1:
         Chain 1 -- -39098.978535 -- 53.554896
         Chain 2 -- -38054.044640 -- 53.554896
         Chain 3 -- -39425.015629 -- 53.554896
         Chain 4 -- -40157.756230 -- 53.554896

      Initial log likelihoods and log prior probs for run 2:
         Chain 1 -- -40084.553712 -- 53.554896
         Chain 2 -- -39002.725314 -- 53.554896
         Chain 3 -- -38719.752582 -- 53.554896
         Chain 4 -- -39156.129424 -- 53.554896


      Using a relative burnin of 25.0 % for diagnostics

      Chain results (5000000 generations requested):

         0 -- [-39098.979] (-38054.045) (-39425.016) (-40157.756) * [-40084.554] (-39002.725) (-38719.753) (-39156.129) (...0 remote chains...) 
^C[ptitle@iu mbTest]$ mpirun -np 2 ~/MrBayes/src/mb sceloporus.nex 


                            MrBayes pre-3.2.7 x86_64

                      (Bayesian Analysis of Phylogeny)

                             (Parallel version)
                         (2 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.



   Executing file "sceloporus.nex"
   DOS line termination
   Longest line length = 1632
   Parsing file
   Expecting NEXUS formatted file
   Reading data block
      Allocated taxon set
      Allocated matrix
      Defining new matrix with 123 taxa and 1606 characters
      Data is Dna
      Missing data coded as ?
      Gaps coded as -
      Taxon   1 -> AZYuJAS289
      Taxon   2 -> AZYuJAS290
      Taxon   3 -> AZlaJAS294
      Taxon   4 -> AZcoTBP271
      Taxon   5 -> AZcoGM1054
      Taxon   6 -> AZcoDGM994
      Taxon   7 -> AZgiP26438
      Taxon   8 -> AZgrGM1012
      Taxon   9 -> AZgrGM1013
      Taxon  10 -> AZgrGM1024
^C[ptitle@iu mbTest]$ 
$\endgroup$
0
1
$\begingroup$

It is not trivial getting MB to run in parallel because from my experience it required privileges that regular uses didn't have. I did this via MPI but ran it across a cluster in superuser mode.

Essentially, this was not a consequence of MB, but of the coarse grain parallel processing.

It is certainly worth parallelizing MB because each chain can be run on a different node and avoids RAM bottlenecks on complex models and big data sets. For example, 8 chains can be run, ensuring convergence quickly by running each chain on a separate node.

$\endgroup$
2
  • 1
    $\begingroup$ Interesting, so this might be an MPI permissions issue then. I will run this by the university IT folks and see if they can help me figure this out. I'll report back. $\endgroup$
    – Pascal
    Dec 17 '18 at 15:05
  • $\begingroup$ This seems to most likely have been an issue with mpi on my system, rather than with MrBayes, and this now works for me, although I'm not sure what changed. $\endgroup$
    – Pascal
    Jan 17 '19 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.