@@ -1537,6 +1537,9 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
15371537 ORTE_ERROR_LOG (ORTE_ERR_NOT_FOUND );
15381538 return ORTE_ERR_NOT_FOUND ;
15391539 }
1540+ if (NULL == daemons -> map ) {
1541+ daemons -> map = OBJ_NEW (orte_job_map_t );
1542+ }
15401543 map = daemons -> map ;
15411544
15421545 /* if this job is being launched against a fixed DVM, then there is
@@ -1552,8 +1555,7 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
15521555 * the virtual machine unless specifically requested to do so
15531556 */
15541557 if (ORTE_JOBID_INVALID != jdata -> originator .jobid ) {
1555- OBJ_CONSTRUCT (& nodes , opal_list_t );
1556- if (NULL == daemons -> map ) {
1558+ if (0 == map -> num_nodes ) {
15571559 OPAL_OUTPUT_VERBOSE ((5 , orte_plm_base_framework .framework_output ,
15581560 "%s plm:base:setup_vm creating map" ,
15591561 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME )));
@@ -1562,16 +1564,15 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
15621564 * are obviously already here! The ess will already
15631565 * have assigned our node to us.
15641566 */
1565- daemons -> map = OBJ_NEW (orte_job_map_t );
15661567 node = (orte_node_t * )opal_pointer_array_get_item (orte_node_pool , 0 );
1567- opal_pointer_array_add (daemons -> map -> nodes , (void * )node );
1568- ++ (daemons -> map -> num_nodes );
1568+ opal_pointer_array_add (map -> nodes , (void * )node );
1569+ ++ (map -> num_nodes );
15691570 /* maintain accounting */
15701571 OBJ_RETAIN (node );
15711572 /* mark that this is from a singleton */
15721573 singleton = true;
15731574 }
1574- map = daemons -> map ;
1575+ OBJ_CONSTRUCT ( & nodes , opal_list_t ) ;
15751576 for (i = 1 ; i < orte_node_pool -> size ; i ++ ) {
15761577 if (NULL == (node = (orte_node_t * )opal_pointer_array_get_item (orte_node_pool , i ))) {
15771578 continue ;
@@ -1618,16 +1619,6 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
16181619 */
16191620 if (orte_get_attribute (& daemons -> attributes , ORTE_JOB_NO_VM , NULL , OPAL_BOOL )) {
16201621 OBJ_CONSTRUCT (& nodes , opal_list_t );
1621- if (NULL == daemons -> map ) {
1622- OPAL_OUTPUT_VERBOSE ((5 , orte_plm_base_framework .framework_output ,
1623- "%s plm:base:setup_vm creating map" ,
1624- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME )));
1625- /* this is the first time thru, so the vm is just getting
1626- * defined - create a map for it
1627- */
1628- daemons -> map = OBJ_NEW (orte_job_map_t );
1629- }
1630- map = daemons -> map ;
16311622 /* loop across all nodes and include those that have
16321623 * num_procs > 0 && no daemon already on them
16331624 */
@@ -1685,23 +1676,21 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
16851676 goto process ;
16861677 }
16871678
1688- if (NULL == daemons -> map ) {
1679+ if (0 == map -> num_nodes ) {
16891680 OPAL_OUTPUT_VERBOSE ((5 , orte_plm_base_framework .framework_output ,
16901681 "%s plm:base:setup_vm creating map" ,
16911682 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME )));
16921683 /* this is the first time thru, so the vm is just getting
1693- * defined - create a map for it and put us in as we
1684+ * defined - put us in as we
16941685 * are obviously already here! The ess will already
16951686 * have assigned our node to us.
16961687 */
1697- daemons -> map = OBJ_NEW (orte_job_map_t );
16981688 node = (orte_node_t * )opal_pointer_array_get_item (orte_node_pool , 0 );
1699- opal_pointer_array_add (daemons -> map -> nodes , (void * )node );
1700- ++ (daemons -> map -> num_nodes );
1689+ opal_pointer_array_add (map -> nodes , (void * )node );
1690+ ++ (map -> num_nodes );
17011691 /* maintain accounting */
17021692 OBJ_RETAIN (node );
17031693 }
1704- map = daemons -> map ;
17051694
17061695 /* zero-out the number of new daemons as we will compute this
17071696 * each time we are called
0 commit comments