Skip to content

Submitting Multiple Jobs Simultaneously

  • Make a copy of the job script multi_seq.sb and name it multi_sim.sb
  • Edit multi_sim.sb to simultaneously run python_script.py and r_script.R Be sure to update the resources required to run multi_sim.sb if necessary.
  • Submit job to compute node

    Answer  

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    #Make a copy of the job script multi_seq.sb and name it multi-sim.sb
    cp multi_seq.sb multi_sim.sb

    #Edit multi_sim.sb to simultaneously run python_script.py and r_script.R
    gedit multi_sim.sb
    python3 python_script.py&
    Rscript r_script.R&
    wait

    #Note: Be sure to use “&” (otherwise run in sequential) and “wait” (otherwise job exit immediately)
    #Be sure to update the resources required to run multi-sim.sb if necessary. Note, the number of nodes/cores requested should be the sum of the nodes/cores needed to run each job. In this case since each job uses one node and one core. Requesting one node is sufficient.

    #Submit job to compute node. Type the following at the command line:
    sbatch multi_sim.sb