From 78d856e04c90a3753b1c096c72ef5508aa2a0ad1 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Thu, 8 Jan 2009 21:21:54 +0000 Subject: [PATCH] Release resources when a job is completed. This allows us to correctly count and load balance MPI-2 dynamic type of applications. This commit was SVN r20236. --- orte/mca/plm/base/plm_base_launch_support.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/orte/mca/plm/base/plm_base_launch_support.c b/orte/mca/plm/base/plm_base_launch_support.c index e324b42b63..62a12a96e3 100644 --- a/orte/mca/plm/base/plm_base_launch_support.c +++ b/orte/mca/plm/base/plm_base_launch_support.c @@ -1144,6 +1144,25 @@ void orte_plm_base_check_job_completed(orte_job_t *jdata) } } + /* Release the resources used by this job. */ + if( NULL != jdata->map ) { + int i, index; + orte_node_t* daemon; + orte_proc_t* proc; + orte_job_map_t* map; + + map = jdata->map; + for( index = 0; index < map->num_nodes; index++ ) { + daemon = opal_pointer_array_get_item( map->nodes, index ); + for( i = 0; i < daemon->num_procs; i++ ) { + proc = opal_pointer_array_get_item(daemon->procs, i); + if( (NULL != proc) && (proc->name.jobid == jdata->jobid) ) { + daemon->slots_inuse--; + } + } + } + } + /* check the resulting job state and notify the appropriate places */ if (ORTE_JOB_STATE_FAILED_TO_START == jdata->state) {