Skip to content
Snippets Groups Projects
Commit b38e718d authored by Alejandro Sanchez's avatar Alejandro Sanchez
Browse files

Do not process jobacct's with same taskid when calling prec_extra.


The prec_extra callback is only available with jobacct_gather/cgroup.
Extern steps in this configuration might have jobacct's with the same
taskid and it's wrong accounting for repeated usage.

Bug 8656.

Co-authored by: Nate Rini <nate@schedmd.com>
Signed-off-by: default avatarDanny Auble <da@schedmd.com>
parent 31fe43e9
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@ documents those changes that are of interest to users and administrators.
-- jobacct_gather/linux - Don't count memory on tasks that have already
finished.
-- Fix 19.05/20.02 batch steps talking with a 20.11 slurmctld.
-- jobacct_gather/common - Do not process jobacct's with same taskid when
calling prec_extra.
 
* Changes in Slurm 20.11.2
==========================
......
......@@ -937,6 +937,7 @@ extern void jag_common_poll_data(
{
/* Update the data */
uint64_t total_job_mem = 0, total_job_vsize = 0;
uint32_t last_taskid = NO_VAL;
ListIterator itr;
jag_prec_t *prec = NULL, tmp_prec;
struct jobacctinfo *jobacct = NULL;
......@@ -990,9 +991,13 @@ extern void jag_common_poll_data(
* make sure we call it once per task, so call it here as we
* iterate through the tasks instead of in get_precs.
*/
if (callbacks->prec_extra)
(*(callbacks->prec_extra))(prec, jobacct->id.taskid);
if (callbacks->prec_extra) {
if (last_taskid == jobacct->id.taskid)
continue;
last_taskid = jobacct->id.taskid;
(*(callbacks->prec_extra))(prec, jobacct->id.taskid);
}
#if _DEBUG
info("pid:%u ppid:%u rss:%"PRIu64" B",
prec->pid, prec->ppid,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment