View | Details | Raw Unified | Return to ticket 8656 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/slurmd/slurmstepd/req.c (-2 / +6 lines)
Lines 1298-1303 static void *_wait_extern_pid(void *args) Link Here
1298
1298
1299
static int _handle_add_extern_pid_internal(stepd_step_rec_t *job, pid_t pid)
1299
static int _handle_add_extern_pid_internal(stepd_step_rec_t *job, pid_t pid)
1300
{
1300
{
1301
	static uint32_t taskid = 0;
1302
	/* mutex to protect taskid as this function is threaded */
1303
	static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
1301
	extern_pid_t *extern_pid;
1304
	extern_pid_t *extern_pid;
1302
	jobacct_id_t jobacct_id;
1305
	jobacct_id_t jobacct_id;
1303
1306
Lines 1317-1323 static int _handle_add_extern_pid_internal(stepd_step_rec_t *job, pid_t pid) Link Here
1317
	/* track pid: add outside of the below thread so that the pam module
1320
	/* track pid: add outside of the below thread so that the pam module
1318
	 * waits until the parent pid is added, before letting the parent spawn
1321
	 * waits until the parent pid is added, before letting the parent spawn
1319
	 * any children. */
1322
	 * any children. */
1320
	jobacct_id.taskid = job->nodeid; /* Treat node ID as global task ID */
1323
	slurm_mutex_lock(&mutex);
1324
	jobacct_id.taskid = taskid++; /* give unique task id per external PID tree */
1325
	slurm_mutex_unlock(&mutex);
1321
	jobacct_id.nodeid = job->nodeid;
1326
	jobacct_id.nodeid = job->nodeid;
1322
	jobacct_id.job = job;
1327
	jobacct_id.job = job;
1323
1328
1324
- 

Return to ticket 8656