14
14
* reserved.
15
15
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
16
16
* Copyright (c) 2011 IBM Corporation. All rights reserved.
17
- * Copyright (c) 2014-2015 Intel Corporation. All rights reserved.
17
+ * Copyright (c) 2014 Intel Corporation. All rights reserved.
18
18
* Copyright (c) 2015 Research Organization for Information Science
19
19
* and Technology (RIST). All rights reserved.
20
20
* $COPYRIGHT$
@@ -339,8 +339,7 @@ static int setup_launch(int *argcptr, char ***argvptr,
339
339
int rc ;
340
340
int i , j ;
341
341
bool found ;
342
- char * lib_base , * bin_base ;
343
-
342
+
344
343
/* Figure out the basenames for the libdir and bindir. This
345
344
requires some explanation:
346
345
@@ -373,15 +372,6 @@ static int setup_launch(int *argcptr, char ***argvptr,
373
372
*/
374
373
argv = opal_argv_copy (rsh_agent_argv );
375
374
argc = opal_argv_count (rsh_agent_argv );
376
- /* if any ssh args were provided, now is the time to add them */
377
- if (NULL != mca_plm_rsh_component .ssh_args ) {
378
- char * * ssh_argv ;
379
- ssh_argv = opal_argv_split (mca_plm_rsh_component .ssh_args , ' ' );
380
- for (i = 0 ; NULL != ssh_argv [i ]; i ++ ) {
381
- opal_argv_append (& argc , & argv , ssh_argv [i ]);
382
- }
383
- opal_argv_free (ssh_argv );
384
- }
385
375
* node_name_index1 = argc ;
386
376
opal_argv_append (& argc , & argv , "<template>" );
387
377
@@ -441,23 +431,7 @@ static int setup_launch(int *argcptr, char ***argvptr,
441
431
orted_cmd = opal_argv_join_range (orted_argv , orted_index , opal_argv_count (orted_argv ), ' ' );
442
432
}
443
433
opal_argv_free (orted_argv ); /* done with this */
444
-
445
- /* if the user specified a path to pass, set it up now */
446
- value = opal_basename (opal_install_dirs .bindir );
447
- if (NULL != mca_plm_rsh_component .pass_path ) {
448
- asprintf (& bin_base , "%s:%s/%s" , mca_plm_rsh_component .pass_path , prefix_dir , value );
449
- } else {
450
- asprintf (& bin_base , "%s/%s" , prefix_dir , value );
451
- }
452
434
453
- /* if the user specified a library path to pass, set it up now */
454
- value = opal_basename (opal_install_dirs .libdir );
455
- if (NULL != mca_plm_rsh_component .pass_path ) {
456
- asprintf (& lib_base , "%s:%s/%s" , mca_plm_rsh_component .pass_libpath , prefix_dir , value );
457
- } else {
458
- asprintf (& lib_base , "%s/%s" , prefix_dir , value );
459
- }
460
-
461
435
/* we now need to assemble the actual cmd that will be executed - this depends
462
436
* upon whether or not a prefix directory is being used
463
437
*/
@@ -468,7 +442,9 @@ static int setup_launch(int *argcptr, char ***argvptr,
468
442
*/
469
443
char * opal_prefix = getenv ("OPAL_PREFIX" );
470
444
char * full_orted_cmd = NULL ;
445
+ char * lib_base , * bin_base ;
471
446
447
+ bin_base = opal_basename (opal_install_dirs .bindir );
472
448
473
449
if (NULL != orted_cmd ) {
474
450
if (0 == strcmp (orted_cmd , "orted" )) {
@@ -481,6 +457,8 @@ static int setup_launch(int *argcptr, char ***argvptr,
481
457
free (orted_cmd );
482
458
}
483
459
460
+ lib_base = opal_basename (opal_install_dirs .libdir );
461
+
484
462
if (ORTE_PLM_RSH_SHELL_SH == remote_shell ||
485
463
ORTE_PLM_RSH_SHELL_KSH == remote_shell ||
486
464
ORTE_PLM_RSH_SHELL_ZSH == remote_shell ||
@@ -490,14 +468,16 @@ static int setup_launch(int *argcptr, char ***argvptr,
490
468
* we have to insert the orted_prefix in the right place
491
469
*/
492
470
(void )asprintf (& final_cmd ,
493
- "%s%s%s PATH=%s:$PATH ; export PATH ; "
494
- "LD_LIBRARY_PATH=%s:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
495
- "DYLD_LIBRARY_PATH=%s:$DYLD_LIBRARY_PATH ; export DYLD_LIBRARY_PATH ; "
471
+ "%s%s%s PATH=%s/%s :$PATH ; export PATH ; "
472
+ "LD_LIBRARY_PATH=%s/%s :$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
473
+ "DYLD_LIBRARY_PATH=%s/%s :$DYLD_LIBRARY_PATH ; export DYLD_LIBRARY_PATH ; "
496
474
"%s %s" ,
497
475
(opal_prefix != NULL ? "OPAL_PREFIX=" : " " ),
498
476
(opal_prefix != NULL ? opal_prefix : " " ),
499
477
(opal_prefix != NULL ? " ; export OPAL_PREFIX;" : " " ),
500
- bin_base , lib_base , lib_base ,
478
+ prefix_dir , bin_base ,
479
+ prefix_dir , lib_base ,
480
+ prefix_dir , lib_base ,
501
481
(orted_prefix != NULL ? orted_prefix : " " ),
502
482
(full_orted_cmd != NULL ? full_orted_cmd : " " ));
503
483
} else if (ORTE_PLM_RSH_SHELL_TCSH == remote_shell ||
@@ -515,25 +495,28 @@ static int setup_launch(int *argcptr, char ***argvptr,
515
495
* we have to insert the orted_prefix in the right place
516
496
*/
517
497
(void )asprintf (& final_cmd ,
518
- "%s%s%s set path = ( %s $path ) ; "
498
+ "%s%s%s set path = ( %s/%s $path ) ; "
519
499
"if ( $?LD_LIBRARY_PATH == 1 ) "
520
500
"set OMPI_have_llp ; "
521
501
"if ( $?LD_LIBRARY_PATH == 0 ) "
522
- "setenv LD_LIBRARY_PATH %s ; "
502
+ "setenv LD_LIBRARY_PATH %s/%s ; "
523
503
"if ( $?OMPI_have_llp == 1 ) "
524
- "setenv LD_LIBRARY_PATH %s:$LD_LIBRARY_PATH ; "
504
+ "setenv LD_LIBRARY_PATH %s/%s :$LD_LIBRARY_PATH ; "
525
505
"if ( $?DYLD_LIBRARY_PATH == 1 ) "
526
506
"set OMPI_have_dllp ; "
527
507
"if ( $?DYLD_LIBRARY_PATH == 0 ) "
528
- "setenv DYLD_LIBRARY_PATH %s ; "
508
+ "setenv DYLD_LIBRARY_PATH %s/%s ; "
529
509
"if ( $?OMPI_have_dllp == 1 ) "
530
- "setenv DYLD_LIBRARY_PATH %s:$DYLD_LIBRARY_PATH ; "
510
+ "setenv DYLD_LIBRARY_PATH %s/%s :$DYLD_LIBRARY_PATH ; "
531
511
"%s %s" ,
532
512
(opal_prefix != NULL ? "setenv OPAL_PREFIX " : " " ),
533
513
(opal_prefix != NULL ? opal_prefix : " " ),
534
514
(opal_prefix != NULL ? " ;" : " " ),
535
- bin_base , lib_base , lib_base ,
536
- lib_base , lib_base ,
515
+ prefix_dir , bin_base ,
516
+ prefix_dir , lib_base ,
517
+ prefix_dir , lib_base ,
518
+ prefix_dir , lib_base ,
519
+ prefix_dir , lib_base ,
537
520
(orted_prefix != NULL ? orted_prefix : " " ),
538
521
(full_orted_cmd != NULL ? full_orted_cmd : " " ));
539
522
} else {
0 commit comments