Parameter sweeps on a HPC cluster

I have a mathematica *.wl file set up, such that there are a couple of parameters defined in the beginning, and, when run, it produces a few outputs. I can run this script on a Slurm-run HPC cluster and everything works fine.

Now to my question: I want to launch this *.wl script several times, each time with slightly different parameters defined in the beginning. And run the same script (with different initial parameters) in parallel. Running this file in parallel is no problem, however, how can I write a sbatch script such that the parameters in the beginning of the *.wl file are changed each time?

• Why not pass them as command line in your slurm script? That can be parsed out on the Mathematica side. This is what I do with my Mathematica jobs on my local neighborhood HPC. – b3m2a1 May 29 '19 at 1:56
• How would that work explicitly? – Nils May 29 '19 at 2:43
• Use \$CommandLine or whatever. Then when you call stuff in srun you can just supply different args just like calling a python script or similar. – b3m2a1 May 29 '19 at 2:45
• I use Mathematica's built-in parallelizaton for this (ParallelTable and such). Let me know if you need some guidance on how to set this up on a cluster. – Szabolcs May 29 '19 at 8:18
• Some guidance would be fantastic! – Nils May 29 '19 at 14:39