CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Python code for SLURM type scheduler

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2017, 13:07
Post Python code for SLURM type scheduler
  #1
Member
 
Tom
Join Date: Apr 2017
Posts: 50
Rep Power: 9
tom.opt is on a distinguished road
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
tom.opt is offline   Reply With Quote

Reply

Tags
hpc, hpc cluster, python, slurm


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 13:56.