commit/galaxy-central: natefoo: Fix slurm job post-mortem for `clusters` functionality added to slurm-drmaa (and currently in use on usegalaxy.org).
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ba1447685bc2/ Changeset: ba1447685bc2 Branch: stable User: natefoo Date: 2014-10-22 22:00:15+00:00 Summary: Fix slurm job post-mortem for `clusters` functionality added to slurm-drmaa (and currently in use on usegalaxy.org). Affected #: 1 file diff -r d1e1beeb532239250396dd8fbdc0156508c6744e -r ba1447685bc2470cb545612450b6364057b6d8c5 lib/galaxy/jobs/runners/slurm.py --- a/lib/galaxy/jobs/runners/slurm.py +++ b/lib/galaxy/jobs/runners/slurm.py @@ -19,13 +19,20 @@ def _complete_terminal_job( self, ajs, drmaa_state, **kwargs ): def __get_jobinfo(): - p = subprocess.Popen( ( 'scontrol', '-o', 'show', 'job', ajs.job_id ), stdout=subprocess.PIPE, stderr=subprocess.PIPE ) + job_id = ajs.job_id + cmd = [ 'scontrol', '-o' ] + if '.' in ajs.job_id: + # custom slurm-drmaa-with-cluster-support job id syntax + job_id, cluster = ajs.job_id.split('.', 1) + cmd.extend( [ '-M', cluster ] ) + cmd.extend( [ 'show', 'job', job_id ] ) + p = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) stdout, stderr = p.communicate() if p.returncode != 0: # Will need to be more clever here if this message is not consistent if stderr == 'slurm_load_jobs error: Invalid job id specified\n': return dict( JobState='NOT_FOUND' ) - raise Exception( '`scontrol -o show job %s` returned %s, stderr: %s' % ( ajs.job_id, p.returncode, stderr ) ) + raise Exception( '`%s` returned %s, stderr: %s' % ( ' '.join( cmd ), p.returncode, stderr ) ) return dict( [ out_param.split( '=', 1 ) for out_param in stdout.split() ] ) if drmaa_state == self.drmaa_job_states.FAILED: try: Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org