diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index 0ed374bd17b1b0167792832b1eb500a50d3babcf..caac2fc59d0aa5f025db36c050cf586fdd011ed1 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -1055,7 +1055,11 @@ typedef struct job_info { char *features; /* comma separated list of required features */ char *gres; /* comma separated list of generic resources */ uint32_t group_id; /* group job sumitted as */ +#ifdef USE_LOADLEVELER + char *job_id; /* job ID */ +#else uint32_t job_id; /* job ID */ +#endif uint16_t job_state; /* state of the job, see enum job_states */ char *licenses; /* licenses required by the job */ uint32_t max_cpus; /* maximum number of cpus usable by job */ @@ -1329,7 +1333,11 @@ typedef struct { char *ckpt_dir; /* path to store checkpoint image files */ uint16_t ckpt_interval; /* checkpoint interval in minutes */ char *gres; /* generic resources required */ +#ifdef USE_LOADLEVELER + char *job_id; /* job ID */ +#else uint32_t job_id; /* job ID */ +#endif char *name; /* name of job step */ char *network; /* network specs for job step */ char *nodes; /* list of nodes allocated to job_step */ @@ -1377,8 +1385,12 @@ typedef struct { } job_step_stat_t; typedef struct { - uint32_t job_id; - List stats_list; /* List of job_step_stat_t *'s */ +#ifdef USE_LOADLEVELER + char *job_id; /* job ID */ +#else + uint32_t job_id; /* job ID */ +#endif + List stats_list; /* List of job_step_stat_t *'s */ uint32_t step_id; } job_step_stat_response_msg_t; diff --git a/src/api/job_info.c b/src/api/job_info.c index 6bf5761eccd6b18a7ff7923595791655c48646cb..aaf247cf2b310db34c5165f1ff94ff97076f6ddb 100644 --- a/src/api/job_info.c +++ b/src/api/job_info.c @@ -168,8 +168,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) } /****** Line 1 ******/ +#ifdef USE_LOADLEVELER + snprintf(tmp_line, sizeof(tmp_line), + "JobId=%s Name=%s", job_ptr->job_id, job_ptr->name); +#else snprintf(tmp_line, sizeof(tmp_line), "JobId=%u Name=%s", job_ptr->job_id, job_ptr->name); +#endif out = xstrdup(tmp_line); if (one_liner) xstrcat(out, " "); diff --git a/src/api/job_step_info.c b/src/api/job_step_info.c index cc22d0a7006d7204484ac3160ac2358ce244fe37..3d46a5ca615a65c49d0c702bd2f858f82f424afc 100644 --- a/src/api/job_step_info.c +++ b/src/api/job_step_info.c @@ -148,10 +148,17 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, else secs2time_str ((time_t)job_step_ptr->time_limit * 60, limit_str, sizeof(limit_str)); +#ifdef USE_LOADLEVELER + snprintf(tmp_line, sizeof(tmp_line), + "StepId=%s.%u UserId=%u StartTime=%s TimeLimit=%s", + job_step_ptr->job_id, job_step_ptr->step_id, + job_step_ptr->user_id, time_str, limit_str); +#else snprintf(tmp_line, sizeof(tmp_line), "StepId=%u.%u UserId=%u StartTime=%s TimeLimit=%s", job_step_ptr->job_id, job_step_ptr->step_id, job_step_ptr->user_id, time_str, limit_str); +#endif out = xstrdup(tmp_line); if (one_liner) xstrcat(out, " "); @@ -316,9 +323,9 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id, xassert(resp); - if(!node_list) { - if(!(step_layout = - slurm_job_step_layout_get(job_id, step_id))) { + if (!node_list) { + if (!(step_layout = + slurm_job_step_layout_get(job_id, step_id))) { rc = errno; error("slurm_job_step_stat: " "problem getting step_layout for %u.%u: %s", @@ -328,7 +335,7 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id, node_list = step_layout->node_list; } - if(!*resp) { + if (!*resp) { resp_out = xmalloc(sizeof(job_step_stat_response_msg_t)); *resp = resp_out; created = 1; @@ -342,16 +349,18 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id, slurm_msg_t_init(&req_msg); memset(&req, 0, sizeof(job_step_id_msg_t)); - resp_out->job_id = req.job_id = job_id; +#ifndef USE_LOADLEVELER + resp_out->job_id = req.job_id = job_id; +#endif resp_out->step_id = req.step_id = step_id; req_msg.msg_type = REQUEST_JOB_STEP_STAT; req_msg.data = &req; - if(!(ret_list = slurm_send_recv_msgs(node_list, &req_msg, 0, false))) { + if (!(ret_list = slurm_send_recv_msgs(node_list, &req_msg, 0, false))) { error("slurm_job_step_stat: got an error no list returned"); rc = SLURM_ERROR; - if(created) { + if (created) { slurm_job_step_stat_response_msg_free(resp_out); *resp = NULL; } @@ -359,10 +368,10 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id, } itr = list_iterator_create(ret_list); - while((ret_data_info = list_next(itr))) { + while ((ret_data_info = list_next(itr))) { switch (ret_data_info->type) { case RESPONSE_JOB_STEP_STAT: - if(!resp_out->stats_list) + if (!resp_out->stats_list) resp_out->stats_list = list_create( slurm_free_job_step_stat); list_push(resp_out->stats_list, @@ -390,7 +399,7 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id, list_iterator_destroy(itr); list_destroy(ret_list); - if(resp_out->stats_list) + if (resp_out->stats_list) list_sort(resp_out->stats_list, (ListCmpF)_sort_stats_by_name); cleanup: slurm_step_layout_destroy(step_layout); diff --git a/src/api/signal.c b/src/api/signal.c index 4ea0934e203dc56c1d8dfd8b0c97108b20624760..2605c0cf4c38265db23055897908b893e1c416dd 100644 --- a/src/api/signal.c +++ b/src/api/signal.c @@ -126,7 +126,9 @@ static int _signal_job_step(const job_step_info_t *step, int rc = SLURM_SUCCESS; /* same remote procedure call for each node */ +#ifndef USE_LOADLEVELER rpc.job_id = step->job_id; +#endif rpc.job_step_id = step->step_id; rpc.signal = (uint32_t)signal; rc = _local_send_recv_rc_msgs(allocation->node_list, @@ -188,7 +190,9 @@ static int _terminate_job_step(const job_step_info_t *step, /* * Send REQUEST_TERMINATE_TASKS to all nodes of the step */ +#ifndef USE_LOADLEVELER rpc.job_id = step->job_id; +#endif rpc.job_step_id = step->step_id; rpc.signal = (uint32_t)-1; /* not used by slurmd */ rc = _local_send_recv_rc_msgs(allocation->node_list, @@ -277,8 +281,12 @@ slurm_signal_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) goto fail; } for (i = 0; i < step_info->job_step_count; i++) { - if (step_info->job_steps[i].job_id == job_id - && step_info->job_steps[i].step_id == step_id) { +#ifdef USE_LOADLEVELER + if (0 && +#else + if ((step_info->job_steps[i].job_id == job_id) && +#endif + (step_info->job_steps[i].step_id == step_id)) { rc = _signal_job_step(&step_info->job_steps[i], alloc_info, signal); save_errno = rc; @@ -373,8 +381,12 @@ slurm_terminate_job_step (uint32_t job_id, uint32_t step_id) goto fail; } for (i = 0; i < step_info->job_step_count; i++) { - if (step_info->job_steps[i].job_id == job_id - && step_info->job_steps[i].step_id == step_id) { +#ifdef USE_LOADLEVELER + if (0 && +#else + if ((step_info->job_steps[i].job_id == job_id) && +#endif + (step_info->job_steps[i].step_id == step_id)) { rc = _terminate_job_step(&step_info->job_steps[i], alloc_info); save_errno = errno; diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index 2ee574f1a8891233150f44e7c07b46277fc6a967..696b4d71045c76b12830acd51b4ea006e91e85f9 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -3898,7 +3898,9 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, char *node_inx_str; if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { +#ifndef USE_LOADLEVELER safe_unpack32(&step->job_id, buffer); +#endif safe_unpack32(&step->step_id, buffer); safe_unpack16(&step->ckpt_interval, buffer); safe_unpack32(&step->user_id, buffer); @@ -3927,7 +3929,9 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, buffer, protocol_version)) goto unpack_error; } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { +#ifndef USE_LOADLEVELER safe_unpack32(&step->job_id, buffer); +#endif safe_unpack32(&step->step_id, buffer); safe_unpack16(&step->ckpt_interval, buffer); safe_unpack32(&step->user_id, buffer); @@ -3953,7 +3957,9 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, xfree(node_inx_str); } } else { +#ifndef USE_LOADLEVELER safe_unpack32(&step->job_id, buffer); +#endif safe_unpack32(&step->step_id, buffer); safe_unpack16(&step->ckpt_interval, buffer); safe_unpack32(&step->user_id, buffer); @@ -4075,7 +4081,9 @@ _unpack_job_info_members(job_info_t * job, Buf buffer, if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { safe_unpack32(&job->assoc_id, buffer); +#ifndef USE_LOADLEVELER safe_unpack32(&job->job_id, buffer); +#endif safe_unpack32(&job->user_id, buffer); safe_unpack32(&job->group_id, buffer); @@ -4187,7 +4195,9 @@ _unpack_job_info_members(job_info_t * job, Buf buffer, } } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { safe_unpack32(&job->assoc_id, buffer); +#ifndef USE_LOADLEVELER safe_unpack32(&job->job_id, buffer); +#endif safe_unpack32(&job->user_id, buffer); safe_unpack32(&job->group_id, buffer); @@ -4295,7 +4305,9 @@ _unpack_job_info_members(job_info_t * job, Buf buffer, } } else if (protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { safe_unpack32(&job->assoc_id, buffer); +#ifndef USE_LOADLEVELER safe_unpack32(&job->job_id, buffer); +#endif safe_unpack32(&job->user_id, buffer); safe_unpack32(&job->group_id, buffer); diff --git a/src/scancel/scancel.c b/src/scancel/scancel.c index 7e8920ff3f598c2fb4ac15c519a26f16c88a2ebe..f7a2fd195dd4d664042243cb021b245f61135e29 100644 --- a/src/scancel/scancel.c +++ b/src/scancel/scancel.c @@ -189,8 +189,10 @@ _verify_job_ids (void) for (j = 0; j < opt.job_cnt; j++ ) { for (i = 0; i < job_buffer_ptr->record_count; i++) { +#ifndef USE_LOADLEVELER if (job_ptr[i].job_id == opt.job_id[j]) break; +#endif } if (((job_ptr[i].job_state >= JOB_COMPLETE) || (i >= job_buffer_ptr->record_count)) && @@ -328,8 +330,10 @@ _filter_job_records (void) if (opt.job_cnt == 0) continue; for (j = 0; j < opt.job_cnt; j++) { +#ifndef USE_LOADLEVELER if (job_ptr[i].job_id == opt.job_id[j]) break; +#endif } if (j >= opt.job_cnt) { /* not found */ job_ptr[i].job_id = 0; @@ -360,9 +364,10 @@ _cancel_jobs_by_state(uint16_t job_state) * included a step id */ if (opt.job_cnt) { for (j = 0; j < opt.job_cnt; j++ ) { +#ifndef USE_LOADLEVELER if (job_ptr[i].job_id != opt.job_id[j]) continue; - +#endif if (opt.interactive && (_confirmation(i, opt.step_id[j]) == 0)) continue; @@ -370,7 +375,9 @@ _cancel_jobs_by_state(uint16_t job_state) cancel_info = (job_cancel_info_t *) xmalloc(sizeof(job_cancel_info_t)); +#ifndef USE_LOADLEVELER cancel_info->job_id = job_ptr[i].job_id; +#endif cancel_info->sig = opt.signal; cancel_info->num_active_threads = &num_active_threads; @@ -414,7 +421,9 @@ _cancel_jobs_by_state(uint16_t job_state) cancel_info = (job_cancel_info_t *) xmalloc(sizeof(job_cancel_info_t)); +#ifndef USE_LOADLEVELER cancel_info->job_id = job_ptr[i].job_id; +#endif cancel_info->sig = opt.signal; cancel_info->num_active_threads = &num_active_threads; cancel_info->num_active_threads_lock = @@ -602,6 +611,17 @@ _confirmation (int i, uint32_t step_id) job_ptr = job_buffer_ptr->job_array ; while (1) { +#ifdef USE_LOADLEVELER + if (step_id == SLURM_BATCH_SCRIPT) { + printf ("Cancel job_id=%s name=%s partition=%s [y/n]? ", + job_ptr[i].job_id, job_ptr[i].name, + job_ptr[i].partition); + } else { + printf ("Cancel step_id=%s.%u name=%s partition=%s [y/n]? ", + job_ptr[i].job_id, step_id, job_ptr[i].name, + job_ptr[i].partition); + } +#else if (step_id == SLURM_BATCH_SCRIPT) { printf ("Cancel job_id=%u name=%s partition=%s [y/n]? ", job_ptr[i].job_id, job_ptr[i].name, @@ -611,7 +631,7 @@ _confirmation (int i, uint32_t step_id) job_ptr[i].job_id, step_id, job_ptr[i].name, job_ptr[i].partition); } - +#endif if (fgets(in_line, sizeof(in_line), stdin) == NULL) continue; if ((in_line[0] == 'y') || (in_line[0] == 'Y')) diff --git a/src/squeue/print.c b/src/squeue/print.c index e020fbcbd2ad26b502b8e104fa2f59cb04abb9a3..475c7976322ecbb1a74f12698a6ad5e58af5dbac 100644 --- a/src/squeue/print.c +++ b/src/squeue/print.c @@ -313,7 +313,11 @@ int _print_job_job_id(job_info_t * job, int width, bool right, char* suffix) _print_str("JOBID", width, right, true); else { char id[FORMAT_STRING_SIZE]; +#ifdef USE_LOADLEVELER + snprintf(id, FORMAT_STRING_SIZE, "%s", job->job_id); +#else snprintf(id, FORMAT_STRING_SIZE, "%u", job->job_id); +#endif _print_str(id, width, right, true); } if (suffix) @@ -1191,8 +1195,13 @@ int _print_step_id(job_step_info_t * step, int width, bool right, char* suffix) if (step == NULL) /* Print the Header instead */ _print_str("STEPID", width, right, true); else { +#ifdef USE_LOADLEVELER + snprintf(id, FORMAT_STRING_SIZE, "%s.%u", step->job_id, + step->step_id); +#else snprintf(id, FORMAT_STRING_SIZE, "%u.%u", step->job_id, step->step_id); +#endif _print_str(id, width, right, true); } if (suffix) @@ -1373,10 +1382,12 @@ static int _filter_job(job_info_t * job) filter = 1; iterator = list_iterator_create(params.job_list); while ((job_id = list_next(iterator))) { +#ifndef USE_LOADLEVELER if (*job_id == job->job_id) { filter = 0; break; } +#endif } list_iterator_destroy(iterator); if (filter == 1) @@ -1519,10 +1530,12 @@ static int _filter_step(job_step_info_t * step) filter = 1; iterator = list_iterator_create(params.job_list); while ((job_id = list_next(iterator))) { +#ifndef USE_LOADLEVELER if (*job_id == step->job_id) { filter = 0; break; } +#endif } list_iterator_destroy(iterator); if (filter == 1) @@ -1547,7 +1560,11 @@ static int _filter_step(job_step_info_t * step) filter = 1; iterator = list_iterator_create(params.step_list); while ((job_step_id = list_next(iterator))) { +#ifdef USE_LOADLEVELER + if (0 && +#else if ((job_step_id->job_id == step->job_id) && +#endif (job_step_id->step_id == step->step_id)) { filter = 0; break;