|
[Sponsors] |
April 23, 2017, 13:07 |
Python code for SLURM type scheduler
|
#1 |
Member
Tom
Join Date: Apr 2017
Posts: 50
Rep Power: 9 |
Hi People,
I'm looking for some help with the SLURM system. I am trying to submit CFD optimisation jobs to an HPC rig which used to use SGE but now has switched to SLURM. I've adapted most of my python code for the scheduler file from SGE to SLURM but have encountered difficulties adapting the code which is reading the job queue. I'm posting bellow the SGE version of this code. Your help would be greatly appreciated. #!/usr/bin/python import os import time from xml.dom import minidom import util import sys def read_job_queue(): qstat = os.popen('qstat -xml') xmlstr = qstat.read() jobs = {} xmldoc = minidom.parseString(xmlstr) for j in xmldoc.getElementsByTagName('job_list'): name = j.getElementsByTagName('JB_name')[0].firstChild.data state = j.attributes['state'].value jobs[name] = state return jobs |
|
Tags |
hpc, hpc cluster, python, slurm |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
wallHeatFlux utility for an incompressible case | Mr.Jingles | OpenFOAM Post-Processing | 67 | April 6, 2023 04:25 |
Modified pimpleFoam solver to MRFPimpleFoam solver | hiuluom | OpenFOAM Programming & Development | 12 | June 14, 2015 22:22 |
Boundary Conditions | MtnRunBeachBum | OpenFOAM Pre-Processing | 1 | April 30, 2015 17:33 |
LES supersonic free jet | martyn88 | OpenFOAM | 22 | April 17, 2015 07:00 |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |