Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Q. I want to run a large number of R scripts submitted to the cluster, but there are too many to submit individually.

A.  Several ways to do this. If they all use similar resources ( memory, cores, time) and aren't dependant on each other, a bash script to submit jobs works great. Here's an example. Note that this will work for other applications ( Matlab) that can process scripts. Just make appropriate changes. 

...

sbatch -p batch -c 8 --mem=10000 --time=10:00:00 --output=RT_SET_1.R.out --error=RT_SET_1.R.err --mail-type=ALL --mail-user=dlapoi01 --wrap='R --no-save < RT_SET_1.R'
sbatch -p batch -c 8 --mem=10000 --time=10:00:00 --output=RT_SET_2.R.out --error=RT_SET_2.R.err --mail-type=ALL --mail-user=dlapoi01 --wrap='R --no-save < RT_SET_2.R'
sbatch -p batch -c 8 --mem=10000 --time=10:00:00 --output=RT_SET_3.R.out --error=RT_SET_3.R.err --mail-type=ALL --mail-user=dlapoi01 --wrap='R --no-save < RT_SET_3.R'
sbatch -p batch -c 8 --mem=10000 --time=10:00:00 --output=RT_SET_4.R.out --error=RT_SET_4.R.err --mail-type=ALL --mail-user=dlapoi01 --wrap='R --no-save < RT_SET_4.R'

 

 

Q. How do I install python modules locally?

A.  First, load the module for the python version ( e.g. 2.7) that you intend to use. That way the system managed module are loaded.

...

Then create a local directory tree to store the modules ( ~/lib/python2.7/site-packages).  Append a modified PYTHONPATH to your .bash_profile and source it. This is only need needed for the first time that this is done. 

...