title: Passing arguments to a python script in a SLURM batch script
body: <p>I've written a python script that requires two arguments and works just fine when I run it on the command line with:  </p>
  
  <p><code>pythonscript.py arg1 arg2</code>  </p>
  
  <p>I need to run this in a SLURM batch script, but whenever I do I get an "illegal instruction" error and a core dump. This is an example of the script I'm using:</p>
  
  <pre><code>#!/bin/bash
  # Set your minimum acceptable walltime, format: day-hours:minutes:seconds
  #SBATCH --time=0-00:30:00
  
  # Set name of job shown in squeue
  #SBATCH --job-name pythonscript
  
  # Request CPU resources
  #SBATCH --ntasks=1
  #SBATCH --ntasks-per-node=1
  #SBATCH --cpus-per-task=1
  
  # Memory usage (MB)
  #SBATCH --mem-per-cpu=3000
  
  # Use modules to set the software environment
  module purge
  module load python/2.7.8-gcc
  
  pythonscript.py arg1 arg2
  </code></pre>
  
  <p>I've spent a lot of time trying to figure out exactly what is causing the core dumps, and this is what I've narrowed it down to. It only crashes when run from the batch script and only when I'm trying to run the script with arguments. When I modify it to run without arguments, it runs properly. Can anyone tell me how to pass these arguments to my python script within a SLURM script?</p>