|
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 |
/* start at 1 as slurmstepd will take task 0 */ |
| 1302 |
static uint32_t taskid = 1; |
| 1303 |
/* mutex to protect taskid as this function is threaded */ |
| 1304 |
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; |
| 1301 |
extern_pid_t *extern_pid; |
1305 |
extern_pid_t *extern_pid; |
| 1302 |
jobacct_id_t jobacct_id; |
1306 |
jobacct_id_t jobacct_id; |
| 1303 |
|
1307 |
|
|
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 |
1321 |
/* 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 |
1322 |
* waits until the parent pid is added, before letting the parent spawn |
| 1319 |
* any children. */ |
1323 |
* any children. */ |
| 1320 |
jobacct_id.taskid = job->nodeid; /* Treat node ID as global task ID */ |
1324 |
slurm_mutex_lock(&mutex); |
|
|
1325 |
jobacct_id.taskid = taskid++; /* give unique task id per external PID tree */ |
| 1326 |
slurm_mutex_unlock(&mutex); |
| 1321 |
jobacct_id.nodeid = job->nodeid; |
1327 |
jobacct_id.nodeid = job->nodeid; |
| 1322 |
jobacct_id.job = job; |
1328 |
jobacct_id.job = job; |
| 1323 |
|
1329 |
|
| 1324 |
- |
|
|