@@ -269,7 +269,6 @@ int utilization_add(lListElem *cr, u_long64 start_time, u_long64 duration, doubl
269269 lList *resource_diagram;
270270 lListElem *thiz, *prev, *start, *end;
271271 const char *name = lGetString (cr, RUE_name);
272- char level_char = CENTRY_LEVEL_TO_CHAR (level);
273272 u_long64 end_time;
274273 int nm;
275274 double util_prev;
@@ -299,7 +298,7 @@ int utilization_add(lListElem *cr, u_long64 start_time, u_long64 duration, doubl
299298 end_time = utilization_endtime (start_time, duration);
300299
301300 serf_record_entry (job_id, ja_taskid, (type!=nullptr )?type:" <unknown>" , start_time, end_time,
302- level_char , object_name, name, utilization);
301+ level , object_name, name, utilization);
303302
304303 /* ensure resource diagram is initialized */
305304 if (resource_diagram == nullptr ) {
@@ -705,14 +704,10 @@ int add_job_utilization(const sge_assignment_t *a, const char *type, bool for_jo
705704 a->job_id , a->ja_task_id , PE_TAG, lGetString (a->pe , PE_name), type, for_job_scheduling, false );
706705 }
707706
708- /* global */
709- rc_add_job_utilization (a->job , a->pe , a->ja_task_id , type, a->gep , a->centry_list , a->slots ,
710- EH_consumable_config_list, EH_resource_utilization, SGE_GLOBAL_NAME,
711- a->start , a->duration , GLOBAL_TAG, for_job_scheduling, true , true );
712-
713707 bool is_master_task = true ;
714708 const lListElem *gdil_ep;
715709 const char *last_eh_name = nullptr ;
710+ bool do_per_global_host_booking = true ;
716711 for_each_ep (gdil_ep, a->gdil ) {
717712 int slots = lGetUlong (gdil_ep, JG_slots);
718713 const char *eh_name = lGetHost (gdil_ep, JG_qhostname);
@@ -723,14 +718,20 @@ int add_job_utilization(const sge_assignment_t *a, const char *type, bool for_jo
723718 const lListElem *rqs = nullptr ;
724719 bool do_per_host_booking = host_do_per_host_booking (&last_eh_name, eh_name);
725720
726- /* hosts */
721+ // global
722+ // we really need to do it per gdil_ep, because we have to consider is_master_task and ign_sreq_on_mhost
723+ rc_add_job_utilization (a->job , a->pe , a->ja_task_id , type, a->gep , a->centry_list , slots,
724+ EH_consumable_config_list, EH_resource_utilization, SGE_GLOBAL_NAME,
725+ a->start , a->duration , GLOBAL_TAG, for_job_scheduling, is_master_task, do_per_global_host_booking);
726+
727+ // host
727728 if ((hep = host_list_locate (a->host_list , eh_name)) != nullptr ) {
728729 rc_add_job_utilization (a->job , a->pe , a->ja_task_id , type, hep, a->centry_list , slots,
729730 EH_consumable_config_list, EH_resource_utilization, eh_name, a->start ,
730731 a->duration , HOST_TAG, for_job_scheduling, is_master_task, do_per_host_booking);
731732 }
732733
733- /* queues */
734+ // queue
734735 if ((qep = qinstance_list_locate2 (a->queue_list , qname)) != nullptr ) {
735736 /*
736737 * The nullptr case happens in case of queues that were sorted out b/c they
@@ -767,6 +768,7 @@ int add_job_utilization(const sge_assignment_t *a, const char *type, bool for_jo
767768
768769 sge_free (&queue);
769770 is_master_task = false ;
771+ do_per_global_host_booking = false ;
770772 }
771773
772774 sge_dstring_free (&rue_name);
0 commit comments