Pass command line arguments via sbatch

后端 未结 6 1203
我寻月下人不归
我寻月下人不归 2021-01-31 02:44

Suppose that I have the following simple bash script which I want to submit to a batch server through SLURM:

#!/bin/bash

#SBATCH -o \"outFile\"$1\".txt\"
#SBATC         


        
6条回答
  •  野性不改
    2021-01-31 03:28

    This is an old question but I just stumbled into the same task and I think this solution is simpler:

    Let's say I have the variable $OUT_PATH in the bash script launch_analysis.bash and I want to pass this variable to task_0_generate_features.sl which is my SLURM file to send the computation to a batch server. I would have the following in launch_analysis.bash:

    `sbatch --export=OUT_PATH=$OUT_PATH task_0_generate_features.sl`
    

    Which is directly accessible in task_0_generate_features.sl

    In @Jason case we would have:

    sbatch -D `pwd` --export=hostname=$hostname exampleJob.sh
    

    Reference: Using Variables in SLURM Jobs

提交回复
热议问题