[slurm-users] Sbatch python question

Walls, Mitchell miwalls at siue.edu
Sat Mar 13 22:14:29 UTC 2021


Are you using '#!/usr/bin/env python'? That could make a difference as an example:
#!/usr/bin/env python3
#SBATCH --job-name=Python

from time import sleep

sleep(1)
print("done")

________________________________________
From: slurm-users <slurm-users-bounces at lists.schedmd.com> on behalf of Walters, Richard I ERDC-RDE-ITL-MS Contractor <Richard.I.Walters at erdc.dren.mil>
Sent: Saturday, March 13, 2021 3:19 PM
To: slurm-users at lists.schedmd.com
Subject: [slurm-users] Sbatch python question


First, I'm new to slurm, I'm used to PBS Pro.  But we're getting a new system, and they still configuring it.  I'm a pioneer user for this new system.  I'm trying to submit an sbatch job with a python script (not the usual bash or csh script).  This scrips works with qsub for PBS Pro; so  basically trying to convert parts of it for slurm.


%>. sbatch my_submit_script.py


Question:


Why does slurm fail my python file when I attempt to import a subcomponent of a python package?  Seems that I am forced to import the entire package.


For example, when I attempt


```from time import sleep```



the script will fail, whereas


```import time```


works?


 Is this a slurm, python configuration issue ?  Or does slurm's python integration have a problem with importing subcomponents of a package in python ?





More information about the slurm-users mailing list