Skip to content

Commit

Permalink
Added Admin Comment field to Job Information Table
Browse files Browse the repository at this point in the history
  • Loading branch information
jitkang authored Nov 20, 2023
1 parent 326c244 commit 7ba9821
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions etc/slurm-mail/templates/job-table.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<td>Work dir:</td>
<td>$WORKDIR</td>
</tr>
<tr class="jobEnd">
<td>Admin Comment:</td>
<td>$ADMIN_COMMENT</td>
</tr>
<tr>
<td>Comment:</td>
<td>$COMMENT</td>
Expand Down
3 changes: 3 additions & 0 deletions src/slurmmail/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def __process_spool_file(
"WorkDir",
"Elapsed",
"ExitCode",
"AdminComment",
"Comment",
"Cluster",
"NodeList",
Expand Down Expand Up @@ -244,6 +245,7 @@ def __process_spool_file(
job = Job(options.datetime_format, job_id)

job.cluster = sacct_dict["Cluster"]
job.admin_comment = sacct_dict["AdminComment"]
job.comment = sacct_dict["Comment"]
job.cpus = int(sacct_dict["NCPUS"])
job.group = sacct_dict["Group"]
Expand Down Expand Up @@ -379,6 +381,7 @@ def __process_spool_file(
ELAPSED=str(timedelta(seconds=job.elapsed)),
EXIT_STATE=job.state,
EXIT_CODE=job.exit_code,
ADMIN_COMMENT=job.admin_comment,
COMMENT=job.comment,
MEMORY=job.requested_mem_str,
MAX_MEMORY=job.max_rss_str,
Expand Down
1 change: 1 addition & 0 deletions src/slurmmail/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(

self.array_id: Optional[int] = array_id
self.cluster: Optional[str] = None
self.admin_comment: Optional[str] = None
self.comment: Optional[str] = None
self.elapsed: Optional[int] = 0
self.exit_code: Optional[int] = None
Expand Down

0 comments on commit 7ba9821

Please sign in to comment.