@@ -160,7 +160,7 @@ static pmix_status_t spawn_debugger(char *appspace)
160160 /* setup the debugger */
161161 PMIX_APP_CREATE (debugger , 1 );
162162 debugger [0 ].cmd = strdup ("./debuggerd" );
163- PMIX_ARGV_APPEND (debugger [0 ].argv , "./debuggerd" );
163+ PMIX_ARGV_APPEND (rc , debugger [0 ].argv , "./debuggerd" );
164164 getcwd (cwd , 1024 ); // point us to our current directory
165165 debugger [0 ].cwd = strdup (cwd );
166166 /* provide directives so the daemons go where we want, and
@@ -232,70 +232,16 @@ int main(int argc, char **argv)
232232 exit (1 );
233233 }
234234 }
235-
236- /* ****************************************************************/
237- /* we want to be able to detect that the PSRVR is up and running
238- * prior to attempting to connect to it. The code logic in ORTE
239- * actually supports such things, but unfortunately will emit
240- * error messages about the contact file missing before we can
241- * arrive at the point where retries can be done. So...let's
242- * setup the path to the contact file here, check to see if it
243- * exists, and then cycle a while if it doesn't. */
244-
245- if (NULL != (tdir = getenv ("PMIX_SERVER_TMPDIR" ))) {
246- sdir = strdup (tdir );
247- } else {
248- /* get the effective uid */
249- uid_t uid = geteuid ();
250-
251- /* look for the temp directory */
252- if (NULL == (str = getenv ("TMPDIR" ))) {
253- if (NULL == (str = getenv ("TEMP" ))) {
254- if (NULL == (str = getenv ("TMP" ))) {
255- str = "/tmp" ;
256- }
257- }
258- }
259- /* get the nodename */
260- gethostname (hostname , sizeof (hostname ));
261-
262- /* setup the directory */
263- asprintf (& sdir , "%s/ompi.%s.%lu/dvm" , str , hostname , (unsigned long )uid );
264- /* setup the contact name */
265- asprintf (& filename , "%s/contact.txt" , sdir );
266- if (NULL == filename ) {
267- fprintf (stderr , "OUT OF MEMORY\n" );
268- exit (1 );
269- }
270- }
271- /* check to see if the file exists - loop a few times if it
272- * doesn't, delaying between successive attempts */
273- n = 0 ;
274- while (n < DBGR_LOOP_LIMIT &&
275- 0 != access (filename , R_OK )) {
276- sleep (1 );
277- ++ n ;
278- }
279- /* if we still don't see the file, then give up */
280- if (0 != access (filename , R_OK )) {
281- fprintf (stderr , "PSRVR contact file %s not found - cannot continue\n" , filename );
282- exit (1 );
283- }
284- free (filename );
285-
286- /* init us - pass along the location of the contact file */
287- ninfo = 1 ;
288- PMIX_INFO_CREATE (info , ninfo );
289- PMIX_INFO_LOAD (& info [0 ], PMIX_SERVER_TMPDIR , sdir , PMIX_STRING );
290- free (sdir );
291-
235+ info = NULL ;
236+ ninfo = 0 ;
292237 if (PMIX_SUCCESS != (rc = PMIx_tool_init (& myproc , info , ninfo ))) {
293238 fprintf (stderr , "PMIx_tool_init failed: %d\n" , rc );
294239 exit (rc );
295240 }
296241 PMIX_INFO_FREE (info , ninfo );
297242
298243 fprintf (stderr , "Tool ns %s rank %d: Running\n" , myproc .nspace , myproc .rank );
244+ goto done ;
299245
300246 /* register a default event handler */
301247 active = -1 ;
@@ -338,8 +284,8 @@ int main(int argc, char **argv)
338284 * so we know if the RM can stop-on-exec, or only supports stop-in-init */
339285 nq = 1 ;
340286 PMIX_QUERY_CREATE (query , nq );
341- PMIX_ARGV_APPEND (query [0 ].keys , PMIX_QUERY_SPAWN_SUPPORT );
342- PMIX_ARGV_APPEND (query [0 ].keys , PMIX_QUERY_DEBUG_SUPPORT );
287+ PMIX_ARGV_APPEND (rc , query [0 ].keys , PMIX_QUERY_SPAWN_SUPPORT );
288+ PMIX_ARGV_APPEND (rc , query [0 ].keys , PMIX_QUERY_DEBUG_SUPPORT );
343289 /* setup the caddy to retrieve the data */
344290 myquery_data .info = NULL ;
345291 myquery_data .ninfo = 0 ;
@@ -404,7 +350,7 @@ int main(int argc, char **argv)
404350 PMIX_APP_CREATE (app , napps );
405351 /* setup the executable */
406352 app [0 ].cmd = strdup ("client" );
407- PMIX_ARGV_APPEND (app [0 ].argv , "./client" );
353+ PMIX_ARGV_APPEND (rc , app [0 ].argv , "./client" );
408354 getcwd (cwd , 1024 ); // point us to our current directory
409355 app [0 ].cwd = strdup (cwd );
410356 app [0 ].maxprocs = 2 ;
@@ -458,7 +404,7 @@ static int attach_to_running_job(char *nspace)
458404 * specified one exists */
459405 nq = 1 ;
460406 PMIX_QUERY_CREATE (query , nq );
461- PMIX_ARGV_APPEND (query [0 ].keys , PMIX_QUERY_NAMESPACES );
407+ PMIX_ARGV_APPEND (rc , query [0 ].keys , PMIX_QUERY_NAMESPACES );
462408
463409 q = (myquery_data_t * )malloc (sizeof (myquery_data_t ));
464410 q -> active = true;
0 commit comments