@@ -440,6 +440,7 @@ def getweight(tid):
440440
441441# update the resource estimates of a workflow based on resources given via JSON
442442def update_resource_estimates (workflow , resource_json ):
443+ # the resource_dict here is generated by tool o2dpg_sim_metrics.py json-stat
443444 resource_dict = load_json (resource_json )
444445 stages = workflow ["stages" ]
445446
@@ -455,17 +456,18 @@ def update_resource_estimates(workflow, resource_json):
455456 new_resources = resource_dict [name ]
456457
457458 # memory
458- newmem = new_resources .get ("mem " , None )
459+ newmem = new_resources .get ("pss" , {}). get ( "max " , None )
459460 if newmem is not None :
460461 oldmem = task ["resources" ]["mem" ]
461462 actionlogger .info ("Updating mem estimate for " + task ["name" ] + " from " + str (oldmem ) + " to " + str (newmem ))
462463 task ["resources" ]["mem" ] = newmem
463464
464465 # cpu
465- newcpu = new_resources .get ("cpu" , None )
466+ newcpu = new_resources .get ("cpu" , {}). get ( "mean" , None )
466467 if newcpu is not None :
467468 oldcpu = task ["resources" ]["cpu" ]
468469 rel_cpu = task ["resources" ]["relative_cpu" ]
470+ # TODO: No longer sure about this since we inject numbers from actually measured workloads
469471 if rel_cpu is not None :
470472 # respect the relative CPU settings
471473 # By default, the CPU value in the workflow is already scaled if relative_cpu is given.
@@ -597,7 +599,7 @@ def __init__(self, tid, name, cpu, cpu_relative, mem, resource_boundaries):
597599 # sampled resources of this
598600 self .cpu_sampled = None
599601 self .mem_sampled = None
600- # Set these after a task has finished to compute new estomates for related tasks
602+ # Set these after a task has finished to compute new estimates for related tasks
601603 self .walltime = None
602604 self .cpu_taken = None
603605 self .mem_taken = None
0 commit comments