Skip to content

Commit

Permalink
Merge pull request #267 from jpwhite4/job_uniq2_withfixes
Browse files Browse the repository at this point in the history
Cherry pick #265 into v2 branch
  • Loading branch information
jpwhite4 committed Jun 22, 2023
2 parents 7c81feb + 0793600 commit 325645e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/supremm/xdmodaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ def __init__(self, resource_id, config):
SELECT
jf.`job_id` AS `job_id`,
jf.`resource_id` AS `resource_id`,
COALESCE(jf.`local_job_id_raw`, jf.`local_jobid`) AS `local_job_id`,
CASE
WHEN jf.`local_job_id_raw` IS NULL THEN IF(jf.`local_job_array_index` = -1, jf.`local_jobid`, CONCAT(jf.`local_jobid`, '_', jf.`local_job_array_index`))
WHEN sj.`source_format` = 'slurm' THEN jf.`local_job_id_raw`
ELSE IF(jf.`local_job_array_index` = -1, jf.`local_jobid`, CONCAT(jf.`local_jobid`, '_', jf.`local_job_array_index`))
END AS `job_uniq_id`,
jf.`local_jobid` AS `local_job_id`,
jf.`local_job_array_index` AS `local_job_array_index`,
jf.`local_job_id_raw` AS `local_job_id_raw`,
jf.`start_time_ts` AS `start_time`,
jf.`end_time_ts` AS `end_time`,
jf.`submit_time_ts` AS `submit`,
Expand Down Expand Up @@ -70,7 +77,14 @@ def __init__(self, resource_id, config):
SELECT
jf.`job_id` as `job_id`,
jf.`resource_id` as `resource_id`,
COALESCE(jf.`local_job_id_raw`, jf.`local_jobid`) as `local_job_id`,
CASE
WHEN jf.`local_job_id_raw` IS NULL THEN IF(jf.`local_job_array_index` = -1, jf.`local_jobid`, CONCAT(jf.`local_jobid`, '_', jf.`local_job_array_index`))
WHEN sj.`source_format` = 'slurm' THEN jf.`local_job_id_raw`
ELSE IF(jf.`local_job_array_index` = -1, jf.`local_jobid`, CONCAT(jf.`local_jobid`, '_', jf.`local_job_array_index`))
END AS `job_uniq_id`,
jf.`local_jobid` AS `local_job_id`,
jf.`local_job_array_index` AS `local_job_array_index`,
jf.`local_job_id_raw` AS `local_job_id_raw`,
jf.`start_time_ts` as `start_time`,
jf.`end_time_ts` as `end_time`,
jf.`submit_time_ts` as `submit`,
Expand Down Expand Up @@ -280,7 +294,7 @@ def executequery(self, query, data):
jobpk = record['job_id']
del record['job_id']
record['host_list'] = hostlist
job = Job(jobpk, str(record['local_job_id']), record)
job = Job(jobpk, str(record['job_uniq_id']), record)
job.set_nodes(hostlist)
job.set_rawarchives(hostarchives)

Expand Down

0 comments on commit 325645e

Please sign in to comment.