MrBayes: Difference between revisions

409 bytes added ,  4 months ago
copy editing
(copy editing)
(copy editing)
Line 96: Line 96:


== Checkpointing == <!--T:23-->
== Checkpointing == <!--T:23-->
For users needing very long runs of MrBayes, we suggest you break up the work into several small jobs rather than one very long job. Long jobs have are more likely to be interrupted a hardware failure or a maintenance outage. Fortunately, MrBayes has a built-in mechanism for creating checkpoints, where progress can be saved from one job and continued in a subsequent job.
If you need very long runs of MrBayes, we suggest you break up the work into several small jobs rather than one very long job. Long jobs have are more likely to be interrupted a hardware failure or a maintenance outage. Fortunately, MrBayes has a mechanism for creating checkpoints, in which progress can be saved from one job and continued in a subsequent job.
 
Here is an example of how to split a calculation into two Slurm jobs which will run one after the other.  Create two files, <code>job1.nex</code> and <code>job2.nex</code>, as shown below.  Notice that the key difference between them is the presence of the <code>append</code> keyword in the second.


<!--T:24-->
<!--T:24-->
1. Create the first script (job).
{{File
{{File
   |name=job1.nex
   |name=job1.nex
Line 113: Line 114:


<!--T:26-->
<!--T:26-->
2. Create a second script (job).
{{File
{{File
   |name=job2.nex
   |name=job2.nex
Line 127: Line 127:


<!--T:28-->
<!--T:28-->
3. Create the submission script to run the smaller jobs
Then create a job script. This example is a job array, which means that one script and
one <code>sbatch</code> command will be sufficient to launch two Slurm jobs, and therefore
both parts of the calculation.  See [[Job arrays]] for more about the <code>--array</code>
directive and the <code>$SLURM_ARRAY_TASK_ID</code> variable used here.
 
{{File
{{File
   |name=submit-mrbayes-cp.sh
   |name=submit-mrbayes-cp.sh
Line 141: Line 145:
<!--T:29-->
<!--T:29-->
module load gcc mrbayes/3.2.7
module load gcc mrbayes/3.2.7
<!--T:30-->
cd $SCRATCH  
cd $SCRATCH  
<!--T:31-->
# Copy one of the example locally on the local storage
cp -v $EBROOTMRBAYES/share/examples/mrbayes/primates.nex .
cp -v $EBROOTMRBAYES/share/examples/mrbayes/primates.nex .


<!--T:32-->
# Run using $SLURM_NTASKS
srun mb job${SLURM_ARRAY_TASK_ID}.nex
srun mb job${SLURM_ARRAY_TASK_ID}.nex
}}
}}


<!--T:33-->
<!--T:33-->
4. Submit the jobs
The example can be submitted with
{{Command|sbatch submit-mrbayes-cp.sh}}
{{Command|sbatch submit-mrbayes-cp.sh}}
</translate>
</translate>
Bureaucrats, cc_docs_admin, cc_staff
2,879

edits