@@ -485,8 +485,7 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
485485 }
486486 }
487487
488- if (!ORTE_PROC_IS_HNP &&
489- !orte_get_attribute (& jdata -> attributes , ORTE_JOB_FULLY_DESCRIBED , NULL , OPAL_BOOL )) {
488+ if (!orte_get_attribute (& jdata -> attributes , ORTE_JOB_FULLY_DESCRIBED , NULL , OPAL_BOOL )) {
490489 /* compute and save bindings of local children */
491490 if (ORTE_SUCCESS != (rc = orte_rmaps_base_compute_bindings (jdata ))) {
492491 ORTE_ERROR_LOG (rc );
@@ -535,11 +534,8 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
535534
536535static int setup_path (orte_app_context_t * app , char * * wdir )
537536{
538- int rc ;
537+ int rc = ORTE_SUCCESS ;
539538 char dir [MAXPATHLEN ];
540- char * * argvptr ;
541- char * pathenv = NULL , * mpiexec_pathenv = NULL ;
542- char * full_search ;
543539
544540 if (!orte_get_attribute (& app -> attributes , ORTE_APP_SSNDIR_CWD , NULL , OPAL_BOOL )) {
545541 /* Try to change to the app's cwd and check that the app
@@ -573,40 +569,6 @@ static int setup_path(orte_app_context_t *app, char **wdir)
573569 * wdir = NULL ;
574570 }
575571
576- /* Search for the OMPI_exec_path and PATH settings in the environment. */
577- for (argvptr = app -> env ; * argvptr != NULL ; argvptr ++ ) {
578- if (0 == strncmp ("OMPI_exec_path=" , * argvptr , 15 )) {
579- mpiexec_pathenv = * argvptr + 15 ;
580- }
581- if (0 == strncmp ("PATH=" , * argvptr , 5 )) {
582- pathenv = * argvptr + 5 ;
583- }
584- }
585-
586- /* If OMPI_exec_path is set (meaning --path was used), then create a
587- temporary environment to be used in the search for the executable.
588- The PATH setting in this temporary environment is a combination of
589- the OMPI_exec_path and PATH values. If OMPI_exec_path is not set,
590- then just use existing environment with PATH in it. */
591- if (NULL != mpiexec_pathenv ) {
592- argvptr = NULL ;
593- if (pathenv != NULL ) {
594- asprintf (& full_search , "%s:%s" , mpiexec_pathenv , pathenv );
595- } else {
596- asprintf (& full_search , "%s" , mpiexec_pathenv );
597- }
598- opal_setenv ("PATH" , full_search , true, & argvptr );
599- free (full_search );
600- } else {
601- argvptr = app -> env ;
602- }
603-
604- rc = orte_util_check_context_app (app , argvptr );
605- /* do not ERROR_LOG - it will be reported elsewhere */
606- if (NULL != mpiexec_pathenv ) {
607- opal_argv_free (argvptr );
608- }
609-
610572 CLEANUP :
611573 return rc ;
612574}
@@ -663,6 +625,9 @@ void orte_odls_base_spawn_proc(int fd, short sd, void *cbdata)
663625 int rc , i ;
664626 bool found ;
665627 orte_proc_state_t state ;
628+ char * * argvptr ;
629+ char * pathenv = NULL , * mpiexec_pathenv = NULL ;
630+ char * full_search ;
666631
667632 /* thread-protect common values */
668633 cd -> env = opal_argv_copy (app -> env );
@@ -694,6 +659,54 @@ void orte_odls_base_spawn_proc(int fd, short sd, void *cbdata)
694659 child -> rml_uri = NULL ;
695660 }
696661
662+ /* setup the rest of the environment with the proc-specific items - these
663+ * will be overwritten for each child
664+ */
665+ if (ORTE_SUCCESS != (rc = orte_schizo .setup_child (jobdat , child , app , & cd -> env ))) {
666+ ORTE_ERROR_LOG (rc );
667+ state = ORTE_PROC_STATE_FAILED_TO_LAUNCH ;
668+ goto errorout ;
669+ }
670+
671+ /* Search for the OMPI_exec_path and PATH settings in the environment. */
672+ for (argvptr = app -> env ; * argvptr != NULL ; argvptr ++ ) {
673+ if (0 == strncmp ("OMPI_exec_path=" , * argvptr , 15 )) {
674+ mpiexec_pathenv = * argvptr + 15 ;
675+ }
676+ if (0 == strncmp ("PATH=" , * argvptr , 5 )) {
677+ pathenv = * argvptr + 5 ;
678+ }
679+ }
680+
681+ /* If OMPI_exec_path is set (meaning --path was used), then create a
682+ temporary environment to be used in the search for the executable.
683+ The PATH setting in this temporary environment is a combination of
684+ the OMPI_exec_path and PATH values. If OMPI_exec_path is not set,
685+ then just use existing environment with PATH in it. */
686+ if (NULL != mpiexec_pathenv ) {
687+ argvptr = NULL ;
688+ if (pathenv != NULL ) {
689+ asprintf (& full_search , "%s:%s" , mpiexec_pathenv , pathenv );
690+ } else {
691+ asprintf (& full_search , "%s" , mpiexec_pathenv );
692+ }
693+ opal_setenv ("PATH" , full_search , true, & argvptr );
694+ free (full_search );
695+ } else {
696+ argvptr = app -> env ;
697+ }
698+
699+ rc = orte_util_check_context_app (app , argvptr );
700+ /* do not ERROR_LOG - it will be reported elsewhere */
701+ if (NULL != mpiexec_pathenv ) {
702+ opal_argv_free (argvptr );
703+ }
704+ if (ORTE_SUCCESS != rc ) {
705+ opal_output (0 , "%s:%d" , __FILE__ , __LINE__ );
706+ state = ORTE_PROC_STATE_FAILED_TO_LAUNCH ;
707+ goto errorout ;
708+ }
709+
697710 /* did the user request we display output in xterms? */
698711 if (NULL != orte_xterm && !ORTE_FLAG_TEST (jobdat , ORTE_JOB_FLAG_DEBUGGER_DAEMON )) {
699712 opal_list_item_t * nmitem ;
@@ -754,15 +767,6 @@ void orte_odls_base_spawn_proc(int fd, short sd, void *cbdata)
754767 cd -> argv = opal_argv_copy (app -> argv );
755768 }
756769
757- /* setup the rest of the environment with the proc-specific items - these
758- * will be overwritten for each child
759- */
760- if (ORTE_SUCCESS != (rc = orte_schizo .setup_child (jobdat , child , app , & cd -> env ))) {
761- ORTE_ERROR_LOG (rc );
762- state = ORTE_PROC_STATE_FAILED_TO_LAUNCH ;
763- goto errorout ;
764- }
765-
766770 /* if we are indexing the argv by rank, do so now */
767771 if (cd -> index_argv && !ORTE_FLAG_TEST (jobdat , ORTE_JOB_FLAG_DEBUGGER_DAEMON )) {
768772 char * param ;
0 commit comments