Difference between revisions of "Rocky R Prime"
From NIMBioS
Line 24: | Line 24: | ||
=== Slurm submission script === | === Slurm submission script === | ||
<pre> | |||
#!/bin/bash | |||
#SBATCH --job-name=R_PRIME ### Job Name | |||
#SBATCH --output=R_prime_%j.out ### File in which to store job output | |||
#SBATCH --time=00:10:00 ### Wall clock time limit in Days-HH:MM:SS | |||
#SBATCH --nodes=1 ### Node count required for the job | |||
#SBATCH --ntasks-per-node=1 ### Number of tasks to be launched per Node | |||
#SBATCH --mem-per-cpu=2G | |||
#SBATCH --cpus-per-task=40 | |||
module load R/4.2.1-foss-2022a | |||
date | |||
R --version | |||
time Rscript R_prime_serial.R | |||
date | |||
time Rscript R_prime_parallel.R | |||
date | |||
time Rscript R_prime_parallel_fast.R | |||
date | |||
</pre> | |||
== Running the Prime Number example == | == Running the Prime Number example == |
Revision as of 19:54, 6 April 2023
Insert example here
Prime Number example code
R serial script
library(foreach) registerDoSeq() library(doParallel) registerDoParallel(40)
R parallel script
library(foreach) library(doParallel) registerDoParallel(40)
Slurm submission script
#!/bin/bash #SBATCH --job-name=R_PRIME ### Job Name #SBATCH --output=R_prime_%j.out ### File in which to store job output #SBATCH --time=00:10:00 ### Wall clock time limit in Days-HH:MM:SS #SBATCH --nodes=1 ### Node count required for the job #SBATCH --ntasks-per-node=1 ### Number of tasks to be launched per Node #SBATCH --mem-per-cpu=2G #SBATCH --cpus-per-task=40 module load R/4.2.1-foss-2022a date R --version time Rscript R_prime_serial.R date time Rscript R_prime_parallel.R date time Rscript R_prime_parallel_fast.R date