Bureaucrats, cc_docs_admin, cc_staff
2,879
edits
(copy editing) |
(copy editing) |
||
Line 96: | Line 96: | ||
== Checkpointing == <!--T:23--> | == Checkpointing == <!--T:23--> | ||
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--> | ||
{{File | {{File | ||
|name=job1.nex | |name=job1.nex | ||
Line 113: | Line 114: | ||
<!--T:26--> | <!--T:26--> | ||
{{File | {{File | ||
|name=job2.nex | |name=job2.nex | ||
Line 127: | Line 127: | ||
<!--T:28--> | <!--T:28--> | ||
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 | ||
cd $SCRATCH | cd $SCRATCH | ||
cp -v $EBROOTMRBAYES/share/examples/mrbayes/primates.nex . | cp -v $EBROOTMRBAYES/share/examples/mrbayes/primates.nex . | ||
srun mb job${SLURM_ARRAY_TASK_ID}.nex | srun mb job${SLURM_ARRAY_TASK_ID}.nex | ||
}} | }} | ||
<!--T:33--> | <!--T:33--> | ||
The example can be submitted with | |||
{{Command|sbatch submit-mrbayes-cp.sh}} | {{Command|sbatch submit-mrbayes-cp.sh}} | ||
</translate> | </translate> |