R: Difference between revisions

Jump to navigation Jump to search
46 bytes added ,  6 years ago
replace source tags with File template
(Removed the spaces before each line of code (for copy-pasting) and added 2 lines to the R script to get rid of error messages.)
(replace source tags with File template)
Line 128: Line 128:


  <!--T:32-->
  <!--T:32-->
<source lang="r">
{{File
  |name=test.R
  |lang="r"
  |contents=
#Tell all slaves to return a message identifying themselves.
#Tell all slaves to return a message identifying themselves.
library("Rmpi")
library("Rmpi")
Line 145: Line 148:
mpi.close.Rslaves()
mpi.close.Rslaves()
mpi.quit()
mpi.quit()
</source>
}}


<!--T:33-->
<!--T:33-->
Line 151: Line 154:


  <!--T:34-->
  <!--T:34-->
<source lang="bash">
{{File
  |name=job.sh
  |lang="bash"
  |contents=
#!/bin/bash
#!/bin/bash
#SBATCH --account=def-ppomorsk # replace this with your own account
#SBATCH --account=def-someacct  # replace this with your own account
#SBATCH --ntasks=5              # number of MPI processes
#SBATCH --ntasks=5              # number of MPI processes
#SBATCH --mem-per-cpu=2048M      # memory; default unit is megabytes
#SBATCH --mem-per-cpu=2048M      # memory; default unit is megabytes
Line 161: Line 167:
export R_LIBS=~/local/R_libs/
export R_LIBS=~/local/R_libs/
mpirun -np 1 R CMD BATCH test.R test.txt
mpirun -np 1 R CMD BATCH test.R test.txt
</source>
}}


<!--T:35-->
<!--T:35-->
Bureaucrats, cc_docs_admin, cc_staff
2,918

edits

Navigation menu