28
28
#include "opal/util/printf.h"
29
29
#include "opal/util/show_help.h"
30
30
#include "ompi/constants.h"
31
+ #include "3rd-party/prrte/include/prte.h"
31
32
32
- static char * find_prterun (void )
33
- {
34
- char * filename = NULL ;
35
- #if !OMPI_USING_INTERNAL_PRRTE
36
- char * prrte_prefix = NULL ;
37
- #endif
38
-
39
- /* 1) Did the user tell us exactly where to find prterun? */
40
- filename = getenv ("OMPI_PRTERUN" );
41
- if (NULL != filename ) {
42
- return filename ;
43
- }
44
-
45
- #if OMPI_USING_INTERNAL_PRRTE
46
- /* 2) If using internal PRRTE, use our bindir. Note that this
47
- * will obey OPAL_PREFIX and OPAL_DESTDIR */
48
- opal_asprintf (& filename , "%s%sprterun" , opal_install_dirs .bindir , OPAL_PATH_SEP );
49
- return filename ;
50
- #else
51
-
52
- /* 3) Look in ${PRTE_PREFIX}/bin */
53
- prrte_prefix = getenv ("PRTE_PREFIX" );
54
- if (NULL != prrte_prefix ) {
55
- opal_asprintf (& filename , "%s%sbin%sprterun" , prrte_prefix , OPAL_PATH_SEP , OPAL_PATH_SEP );
56
- return filename ;
57
- }
58
-
59
- /* 4) See if configure told us where to look, if set */
60
- #if defined(OMPI_PRTERUN_PATH )
61
- return strdup (OMPI_PRTERUN_PATH );
62
- #else
63
-
64
- /* 5) Use path search */
65
- filename = opal_find_absolute_path ("prterun" );
66
-
67
- return filename ;
68
- #endif
69
- #endif
70
- }
71
33
72
34
static void append_prefixes (char * * * out , const char * in )
73
35
{
@@ -119,10 +81,7 @@ static void setup_mca_prefixes(void)
119
81
int main (int argc , char * argv [])
120
82
{
121
83
char * opal_prefix = getenv ("OPAL_PREFIX" );
122
- char * full_prterun_path = NULL ;
123
- char * * prterun_args = NULL ;
124
84
int ret ;
125
- size_t i ;
126
85
127
86
ret = opal_init_util (& argc , & argv );
128
87
if (OMPI_SUCCESS != ret ) {
@@ -154,12 +113,6 @@ int main(int argc, char *argv[])
154
113
#endif
155
114
}
156
115
157
- full_prterun_path = find_prterun ();
158
- if (NULL == full_prterun_path ) {
159
- opal_show_help ("help-mpirun.txt" , "no-prterun-found" , 1 );
160
- exit (1 );
161
- }
162
-
163
116
/*
164
117
* set environment variable for our install location
165
118
* used within the OMPI prrte schizo component
@@ -171,24 +124,14 @@ int main(int argc, char *argv[])
171
124
// to Open MPI.
172
125
setup_mca_prefixes ();
173
126
174
- /* calling mpirun (and now prterun) with a full path has a special
175
- * meaning in terms of -prefix behavior, so copy that behavior
176
- * into prterun */
177
- if (opal_path_is_absolute (argv [0 ])) {
178
- opal_argv_append_nosize (& prterun_args , full_prterun_path );
179
- } else {
180
- opal_argv_append_nosize (& prterun_args , "prterun" );
127
+
128
+ ret = prte_launch (argc , argv );
129
+ if (OMPI_SUCCESS != ret ) {
130
+ opal_show_help ("help-mpirun.txt" , "prte-launch-failed" , 1 , strerror (errno ));
131
+ exit (1 );
181
132
}
182
133
183
- /* Copy all the mpirun arguments to prterun.
184
- * TODO: Need to handle --prefix rationally here. */
185
- for (i = 1 ; NULL != argv [i ]; i ++ ) {
186
- opal_argv_append_nosize (& prterun_args , argv [i ]);
187
- }
188
- ret = execv (full_prterun_path , prterun_args );
189
- opal_show_help ("help-mpirun.txt" , "prterun-exec-failed" ,
190
- 1 , full_prterun_path , strerror (errno ));
191
- exit (1 );
134
+ return 0 ;
192
135
}
193
136
194
137
/*
@@ -214,4 +157,4 @@ int main(int argc, char *argv[])
214
157
* Additional copyrights may follow
215
158
*
216
159
* $HEADER$
217
- */
160
+ */
0 commit comments