From 48335dd872c68c82a5f08734d673335ca491baa6 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 5 Jan 2024 17:24:06 +0100 Subject: [PATCH] Fix for path joining in events --- collectors/slurmJobDetector.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/collectors/slurmJobDetector.go b/collectors/slurmJobDetector.go index 7a3de93..e43a686 100644 --- a/collectors/slurmJobDetector.go +++ b/collectors/slurmJobDetector.go @@ -409,13 +409,15 @@ func (m *SlurmJobDetector) NewJobEvent(uid, jobid uint64, timestamp time.Time, o "type-id": fmt.Sprintf("%d", jobid), } userdir := fmt.Sprintf("uid_%d", uid) - jobdir := fmt.Sprintf("job_%d", uid) + jobdir := fmt.Sprintf("job_%d", jobid) // Fill job JSON with data from cgroup var md SlurmJobMetadata job_cpus_file := filepath.Join(cpuset_base, userdir, jobdir, "cpuset.effective_cpus") + cclog.ComponentDebug(m.name, job_cpus_file) job_cpus, err := os.ReadFile(job_cpus_file) if err == nil { + cclog.ComponentDebug(m.name, string(job_cpus)) md.Cpus = ExpandList(string(job_cpus)) } job_mems_file := filepath.Join(cpuset_base, userdir, jobdir, "cpuset.effective_mems")