Skip to content

Commit fb71569

Browse files
committed
EH: CS-186 show task concurrency in qstat -j job_id
1 parent a5793f1 commit fb71569

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

source/clients/common/ocs_client_job.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,11 +575,15 @@ void cull_show_job(const lListElem *job, int flags, bool show_binding) {
575575
}
576576

577577
if (lGetPosViaElem(job, JB_ja_structure, SGE_NO_ABORT) >= 0) {
578-
u_long32 start, end, step;
579-
580-
job_get_submit_task_ids(job, &start, &end, &step);
581-
if (job_is_array(job))
578+
if (job_is_array(job)) {
579+
u_long32 start, end, step;
580+
job_get_submit_task_ids(job, &start, &end, &step);
582581
printf("job-array tasks: " sge_u32 "-" sge_u32 ":" sge_u32 "\n", start, end, step);
582+
u_long32 task_concurrency = lGetUlong(job, JB_ja_task_concurrency);
583+
if (task_concurrency > 0) {
584+
printf("task_concurrency: " sge_u32 "\n", task_concurrency);
585+
}
586+
}
583587
}
584588

585589
if (lGetPosViaElem(job, JB_context, SGE_NO_ABORT) >= 0)

source/libs/sched/sge_job_schedd.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,17 +741,14 @@ void split_jobs(lList **job_list, u_long32 max_aj_instances,
741741
max_aj_instances > 0) {
742742
u_long32 task_concurrency = lGetUlong(job, JB_ja_task_concurrency);
743743
u_long32 max_aj_conc_instances = max_aj_instances;
744-
if(task_concurrency > 0 && task_concurrency < max_aj_instances)
745-
{
744+
if (task_concurrency > 0 && task_concurrency < max_aj_instances) {
746745
max_aj_conc_instances = task_concurrency;
747746
}
748747
excluded_n_h_ids = n_h_ids;
749748
n_h_ids = nullptr;
750749
if (task_instances < max_aj_conc_instances) {
751750
u_long32 allowed_instances = max_aj_conc_instances - task_instances;
752-
753-
range_list_move_first_n_ids(&excluded_n_h_ids, nullptr, &n_h_ids,
754-
allowed_instances);
751+
range_list_move_first_n_ids(&excluded_n_h_ids, nullptr, &n_h_ids, allowed_instances);
755752
}
756753
target_for_ids = SPLIT_PENDING_EXCLUDED_INSTANCES;
757754
target_ids = excluded_n_h_ids;

source/libs/sgeobj/sge_job.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3525,7 +3525,7 @@ job_verify_submitted_job(lListElem *job, lList **answer_list)
35253525
if (ret) {
35263526
ret = object_verify_double_null(job, answer_list, JB_wtcontr);
35273527
}
3528-
/* JB_ja_task_concurrency must be nullptr */
3528+
// JB_ja_task_concurrency may only be given for array jobs
35293529
if (ret) {
35303530
u_long32 task_concurrency = lGetUlong(job, JB_ja_task_concurrency);
35313531
if (task_concurrency > 0 && !job_is_array(job)) {

0 commit comments

Comments
 (0)