R programming - submitting jobs on a multiple node linux cluster using PBS

前端 未结 3 1477
谎友^
谎友^ 2021-01-17 16:26

I am running R on a multiple node Linux cluster. I would like to run my analysis on R using scripts or batch mode without using parallel computing software such as MPI or sn

3条回答
  •  既然无缘
    2021-01-17 16:55

    This problem seems very well suited for use of GNU parallel. GNU parallel has an excellent tutorial here. I'm not familiar with pbsdsh, and I'm new to HPC, but to me it looks like pbsdsh serves a similar purpose as GNU parallel. I'm also not familiar with launching R from the command line with arguments, but here is my guess at how your PBS file would look:

    #!/bin/sh
    #PBS -l nodes=6:ppn=2
    #PBS -l walltime=00:05:00
    #PBS -l arch=x86_64
    ...
    parallel -j2 --env $PBS_O_WORKDIR --sshloginfile $PBS_NODEFILE \
      Rscript myscript.R {} :::: infilelist.txt
    

    where infilelist.txt lists the data files you want to process, e.g.:

    inputdata01.dat
    inputdata02.dat
    ...
    inputdata12.dat
    

    Your myscript.R would access the command line argument to load and process the specified input file.

    My main purpose with this answer is to point out the availability of GNU parallel, which came about after the original question was posted. Hopefully someone else can provide a more tangible example. Also, I am still wobbly with my usage of parallel, for example, I'm unsure of the -j2 option. (See my related question.)

提交回复
热议问题