-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPCD10Cr_continue_sims_20211005_using_gnu_parallel.sh
executable file
·34 lines (30 loc) · 2.47 KB
/
APCD10Cr_continue_sims_20211005_using_gnu_parallel.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#SBATCH --job-name="continueParallel-2021-10-05"
#SBATCH --mail-type=TIME_LIMIT_90,ARRAY_TASKS,FAIL
#SBATCH [email protected]
#SBATCH --account=def-jonmee # replace this with your supervisors account
#SBATCH --ntasks-per-node=2 # add this line to make sure that SLURM uses multiple nodes
#SBATCH --ntasks=26 # number of processes
#SBATCH --mem-per-cpu=9G # memory; default unit is megabytes
#SBATCH --time=03-12:00:00 # time (DD-HH:MM:SS)
# NOTE: R needs to be loaded.
module load gcc/9.3.0 r/4.1.0
# NOTE: Generate the command-lines that GNU parallel will use to launch
# processes, as well as run `sed` on the *out_Muts.txt and *out_indFitness.txt
# files, and deleting the very last saveState file, and backing up all three files.
## TODO: rename file and get rid of the directory component
R CMD BATCH --vanilla ~/continueSimulations/continueSimulations-2021-10-05-partOne.R ~/continueSimulations/continueSimulations-2021-10-05-partOne.Rout
# NOTE: If GNU parallel completes successfully, ie all of the processes it
# spawns exist successfully, the second R process in this job will move the
# completed output to '~/scratch/Output/completeOutput/'.
scontrol show hostname > ~/continueSimulations/node_list_${SLURM_JOB_ID}
parallel --jobs ${SLURM_NTASKS_PER_NODE} --sshloginfile ~/continueSimulations/node_list_${SLURM_JOB_ID} --workdir ${PWD} --joblog ~/continueSimulations/continueGNUParallel.log < ~/continueSimulations/commandLinesFile-continueSimulations-2021-10-12.txt && R CMD BATCH --vanilla ~/continueSimulations/continueSimulations-2021-10-05-partTwo.R ~/continueSimulations/continueSimulations-2021-10-05-partTwo.Rout
# Copyright 2021 Bryce Carson
# Author: Bryce Carson <[email protected]>
# URL: https://github.com/bryce-carson/APCD10Cr_Carson_2022
#
# APCD10Cr_continue_sims_20211005_using_gnu_parallel.sh is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# APCD10Cr_continue_sims_20211005_using_gnu_parallel.sh is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.