Zhiguang Huo (Caleb)
Monday September 10, 2018
You can transfer files between your local computer and hiperGator
## open interactive R session
srun --account=phc6068 --qos=phc6068 -c 1 --mem=8gb --time=04:00:00 --pty bash -i
module load R ## load R
R
## do the following on hiperGator
getwd()
dir()
head(cars)
mycars <- cars
write.csv(mycars, "mycars.csv")
dir()
module load ufrc ## otherwise, hiperGator is not stable
module load gui
## at your home directory, or anywhere you are able to write
launch_gui_session -a phc6068 -m 12 -p 1 --time=04:00:00 -n --module rstudio/1.1.453 -e rstudio
xpra_list_sessions
cd '/drives/c/Program Files/Xpra' ## make sure xpra is executable (here by setting working directory)
./xpra attach ssh:zhuo@i21a-s3.rc.ufl.edu:3049 ## an example, you need your own code
#!/bin/sh
#SBATCH --job-name=serial_job_test # Job name
#SBATCH --account=phc6068 # your own sponser or account from this class
#SBATCH --qos=phc6068 # your own sponser or account from this class
#SBATCH --mail-type=ALL # Mail events
#SBATCH --mail-user=xx@xx.xx # Where to send mail
#SBATCH --ntasks=1 # Run on a single CPU
#SBATCH --mem=12gb # Memory limit
#SBATCH --time=04:00:00 # Time: hrs:min:sec
#SBATCH --output=serial_test_%j.out # Output and error log
pwd; hostname; date
module load R
echo "Running save cars script on a single CPU core"
R CMD BATCH saveCars.R ## make sure saveCars.R is at your current working directory
## R --no-save --quiet --slave < saveCars.R ## alternative way
date
cd /ufrc/phc6068/share/zhuo/testR
sbatch saveCars.slurm ## submit job
cd /ufrc/phc6068/share/zhuo/testR
cat serial_test_25280301.out ## you may have your own log file name
head serial_test_25280301.out ## you may have your own log file name
more serial_test_25280301.out ## you may have your own log file name
cd /ufrc/phc6068/share/zhuo/testR
cat saveCars.Rout
cd /ufrc/phc6068/share/zhuo/testR
cat mycars.csv
cp /ufrc/phc6068/share/zhuo/testR/saveCars.R
#!/bin/sh
#SBATCH --job-name=serial_job_test # Job name
#SBATCH --account=phc6068 # your own sponser or account from this class
#SBATCH --qos=phc6068 # your own sponser or account from this class
#SBATCH --mail-type=ALL # Mail events
#SBATCH --mail-user=xx@xx.xx # Where to send mail
#SBATCH --ntasks=1 # Run on a single CPU
#SBATCH --mem=12gb # Memory limit
#SBATCH --time=04:00:00 # Time: hrs:min:sec
#SBATCH --output=serial_test_%j.out # Output and error log
pwd; hostname; date
module load R
echo "Running save cars script on a single CPU core"
R --no-save --quiet --slave --args 1 < saveCarsArgs.R
date
cd /ufrc/phc6068/share/zhuo/testR2
sbatch saveCarsArgs.slurm ## submit job
cd /ufrc/phc6068/share/zhuo/testR2
cat serial_test_25280860.out ## you may have your own log file name
R --no-save --quiet --slave --args 1 < saveCarsArgs.R
cd /ufrc/phc6068/share/zhuo/testR2
cat arg1.csv
#!/bin/sh
#SBATCH --job-name=serial_job_test # Job name
#SBATCH --account=phc6068 # your own sponser or account from this class
#SBATCH --qos=phc6068 # your own sponser or account from this class
#SBATCH --mail-type=ALL # Mail events
#SBATCH --mail-user=xx@xx.xx # Where to send mail
#SBATCH --ntasks=1 # Run on a single CPU
#SBATCH --mem=12gb # Memory limit
#SBATCH --time=04:00:00 # Time: hrs:min:sec
#SBATCH --output=serial_test_%j.out # Output and error log
pwd; hostname; date
module load R
for i in {2..10}
do
echo "Running save cars" $i
R --no-save --quiet --slave --args $i < saveCarsArgs.R
done
date
cd /ufrc/phc6068/share/zhuo/testR3
sbatch saveCarsArgsLoops.slurm ## submit a loop job