I've written a python script that requires two arguments and works just fine when I run it on the command line with:
pythonscript.py arg1 arg2
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:
#!/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
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?