Skip to content
Snippets Groups Projects
Commit 04549a47 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Free the individual task argv arrays only when multi-prog

is in use.
parent 463c28e5
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,7 @@ static void _array_free(char ***array); ...@@ -67,6 +67,7 @@ static void _array_free(char ***array);
static void _srun_info_destructor(void *arg); static void _srun_info_destructor(void *arg);
static void _job_init_task_info(slurmd_job_t *job, uint32_t *gtid, static void _job_init_task_info(slurmd_job_t *job, uint32_t *gtid,
char *ifname, char *ofname, char *efname); char *ifname, char *ofname, char *efname);
static void _task_info_destroy(slurmd_task_info_t *t, uint16_t multi_prog);
static struct passwd * static struct passwd *
_pwd_create(uid_t uid) _pwd_create(uid_t uid)
...@@ -468,7 +469,7 @@ job_destroy(slurmd_job_t *job) ...@@ -468,7 +469,7 @@ job_destroy(slurmd_job_t *job)
_pwd_destroy(job->pwd); _pwd_destroy(job->pwd);
for (i = 0; i < job->ntasks; i++) for (i = 0; i < job->ntasks; i++)
task_info_destroy(job->task[i]); _task_info_destroy(job->task[i], job->multi_prog);
list_destroy(job->sruns); list_destroy(job->sruns);
xfree(job->envtp); xfree(job->envtp);
xfree(job->node_name); xfree(job->node_name);
...@@ -584,13 +585,14 @@ task_info_create(int taskid, int gtaskid, ...@@ -584,13 +585,14 @@ task_info_create(int taskid, int gtaskid,
} }
void static void
task_info_destroy(slurmd_task_info_t *t) _task_info_destroy(slurmd_task_info_t *t, uint16_t multi_prog)
{ {
slurm_mutex_lock(&t->mutex); slurm_mutex_lock(&t->mutex);
slurm_mutex_unlock(&t->mutex); slurm_mutex_unlock(&t->mutex);
slurm_mutex_destroy(&t->mutex); slurm_mutex_destroy(&t->mutex);
/* xfree(t->argv); This is a pointer to job->argv if (multi_prog) {
* which has already been cleared */ xfree(t->argv);
} /* otherwise, t->argv is a pointer to job->argv */
xfree(t); xfree(t);
} }
...@@ -209,6 +209,4 @@ void srun_info_destroy(struct srun_info *srun); ...@@ -209,6 +209,4 @@ void srun_info_destroy(struct srun_info *srun);
slurmd_task_info_t * task_info_create(int taskid, int gtaskid, slurmd_task_info_t * task_info_create(int taskid, int gtaskid,
char *ifname, char *ofname, char *efname); char *ifname, char *ofname, char *efname);
void task_info_destroy(slurmd_task_info_t *t);
#endif /* !_SLURMSTEPD_JOB_H */ #endif /* !_SLURMSTEPD_JOB_H */
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