2004-10-15 20:31:54 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 07:32:36 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-10-15 20:31:54 +04:00
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "orte_config.h"
|
2004-10-15 20:31:54 +04:00
|
|
|
|
|
|
|
#include <stdio.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_PWD_H
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <pwd.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <sys/param.h>
|
2007-04-01 20:16:54 +04:00
|
|
|
#endif /* HAVE_SYS_PARAM_H */
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <sys/types.h>
|
2007-04-01 20:16:54 +04:00
|
|
|
#endif /* HAVE_SYS_TYPES_H */
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <sys/stat.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <unistd.h>
|
2007-04-01 20:16:54 +04:00
|
|
|
#endif /* HAVE_UNISTD_H */
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <errno.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_DIRENT_H
|
2004-10-15 20:31:54 +04:00
|
|
|
#include <dirent.h>
|
2007-04-01 20:16:54 +04:00
|
|
|
#endif /* HAVE_DIRENT_H */
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_constants.h"
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/util/univ_info.h"
|
|
|
|
#include "orte/util/sys_info.h"
|
|
|
|
#include "orte/util/proc_info.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-07-04 05:59:52 +04:00
|
|
|
#include "opal/util/os_path.h"
|
2006-07-04 02:23:07 +04:00
|
|
|
#include "opal/util/os_dirpath.h"
|
2006-08-23 07:32:36 +04:00
|
|
|
#include "opal/util/basename.h"
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "orte/runtime/runtime.h"
|
2007-04-23 22:25:36 +04:00
|
|
|
#include "orte/runtime/params.h"
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/util/session_dir.h"
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*******************************
|
|
|
|
* Local function Declarations
|
|
|
|
*******************************/
|
|
|
|
static int orte_create_dir(char *directory);
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
static bool orte_dir_check_file(const char *root, const char *path);
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2005-12-12 23:04:00 +03:00
|
|
|
#ifdef __WINDOWS__
|
2005-01-20 03:03:23 +03:00
|
|
|
#define OMPI_DEFAULT_TMPDIR "C:\\TEMP"
|
2005-01-25 01:51:15 +03:00
|
|
|
#else
|
|
|
|
#define OMPI_DEFAULT_TMPDIR "/tmp"
|
|
|
|
#endif
|
2004-10-22 20:06:05 +04:00
|
|
|
|
2005-06-27 03:11:37 +04:00
|
|
|
#define OMPI_PRINTF_FIX_STRING(a) ((NULL == a) ? "(null)" : a)
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/****************************
|
|
|
|
* Funcationality
|
|
|
|
****************************/
|
|
|
|
/*
|
|
|
|
* Check and create the directory requested
|
|
|
|
*/
|
|
|
|
static int orte_create_dir(char *directory)
|
|
|
|
{
|
2007-04-01 20:16:54 +04:00
|
|
|
mode_t my_mode = S_IRWXU; /* I'm looking for full rights */
|
2006-06-29 01:03:31 +04:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* Sanity check before creating the directory with the proper mode,
|
|
|
|
* Make sure it doesn't exist already */
|
2006-07-04 02:23:07 +04:00
|
|
|
if( OPAL_ERR_NOT_FOUND != (ret = opal_os_dirpath_access(directory, my_mode)) ) {
|
|
|
|
/* Failure because opal_os_dirpath_access() indicated that either:
|
2006-06-29 01:03:31 +04:00
|
|
|
* - The directory exists and we can access it (no need to create it again),
|
2006-07-04 02:23:07 +04:00
|
|
|
* return OPAL_SUCCESS, or
|
|
|
|
* - don't have access rights, return OPAL_ERROR
|
2006-06-29 01:03:31 +04:00
|
|
|
*/
|
|
|
|
return(ret);
|
|
|
|
}
|
|
|
|
/* The directory doesn't exist so create it */
|
|
|
|
else {
|
2006-07-04 02:23:07 +04:00
|
|
|
return(opal_os_dirpath_create(directory, my_mode));
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Construct the fullpath to the session directory
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
orte_session_dir_get_name(char **fulldirpath,
|
2007-04-23 22:25:36 +04:00
|
|
|
char **return_prefix, /* This will come back as the valid tmp dir */
|
|
|
|
char **return_frontend,
|
2006-06-29 01:03:31 +04:00
|
|
|
char *usr, char *hostid,
|
|
|
|
char *batchid, char *univ,
|
|
|
|
char *job, char *proc) {
|
|
|
|
char *hostname = NULL,
|
|
|
|
*batchname = NULL,
|
|
|
|
*sessions = NULL,
|
|
|
|
*user = NULL,
|
2007-04-23 22:25:36 +04:00
|
|
|
*universe = NULL,
|
|
|
|
*prefix = NULL,
|
|
|
|
*frontend = NULL;
|
|
|
|
bool prefix_provided = false;
|
2006-06-29 01:03:31 +04:00
|
|
|
int exit_status = ORTE_SUCCESS;
|
|
|
|
|
|
|
|
/* Ensure that system info is set */
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_sys_info();
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* set the 'user' value
|
|
|
|
*/
|
|
|
|
if( NULL != usr) { /* User specified version */
|
|
|
|
user = strdup(usr);
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
else { /* check if it is set elsewhere */
|
|
|
|
if( NULL != orte_system_info.user)
|
|
|
|
user = strdup(orte_system_info.user);
|
|
|
|
else {
|
|
|
|
/* Couldn't find it, so fail */
|
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* set the 'hostname'
|
|
|
|
*/
|
|
|
|
if( NULL != hostid) { /* User specified version */
|
|
|
|
hostname = strdup(hostid);
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
else { /* check if it is set elsewhere */
|
|
|
|
if( NULL != orte_system_info.nodename)
|
|
|
|
hostname = strdup(orte_system_info.nodename);
|
|
|
|
else {
|
|
|
|
/* Couldn't find it, so fail */
|
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* set the 'batchid'
|
|
|
|
*/
|
|
|
|
if (NULL != batchid)
|
|
|
|
batchname = strdup(batchid);
|
|
|
|
else
|
|
|
|
batchname = strdup("0");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* set the 'universe'
|
|
|
|
*/
|
|
|
|
if( NULL != univ) { /* User specified version */
|
|
|
|
universe = strdup(univ);
|
|
|
|
}
|
|
|
|
else { /* check if it is set elsewhere */
|
2006-07-11 20:54:07 +04:00
|
|
|
if( NULL != orte_universe_info.name) {
|
2006-06-29 01:03:31 +04:00
|
|
|
universe = strdup(orte_universe_info.name);
|
2006-07-11 20:54:07 +04:00
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
else {
|
2006-07-11 20:54:07 +04:00
|
|
|
;/* Couldn't find it, so continue with caution */
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2006-07-11 20:54:07 +04:00
|
|
|
* Check: Can't give proc or job without universe
|
|
|
|
*/
|
|
|
|
if( NULL == universe &&
|
|
|
|
(NULL != proc ||
|
|
|
|
NULL != job) ) {
|
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check: Can't give a proc without a job and universe
|
2006-06-29 01:03:31 +04:00
|
|
|
*/
|
|
|
|
if( NULL == job &&
|
|
|
|
NULL != proc) {
|
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* get the front part of the session directory
|
|
|
|
* Will look something like:
|
|
|
|
* openmpi-sessions-USERNAME@HOSTNAME_BATCHID
|
|
|
|
*/
|
|
|
|
if (NULL != orte_process_info.top_session_dir) {
|
2007-04-23 22:25:36 +04:00
|
|
|
frontend = strdup(orte_process_info.top_session_dir);
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
else { /* If not set then construct it */
|
2007-04-23 22:25:36 +04:00
|
|
|
if (0 > asprintf(&frontend, "openmpi-sessions-%s@%s_%s", user, hostname, batchname)) {
|
2006-06-29 01:03:31 +04:00
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Construct the session directory
|
|
|
|
*/
|
|
|
|
/* If we were given a 'proc' then we can construct it fully into:
|
|
|
|
* openmpi-sessions-USERNAME@HOSTNAME_BATCHID/UNIVERSE/JOBID/PROC
|
|
|
|
*/
|
|
|
|
if( NULL != proc) {
|
2007-04-23 22:25:36 +04:00
|
|
|
sessions = opal_os_path( false, frontend, universe, job, proc, NULL );
|
2006-08-23 07:32:36 +04:00
|
|
|
if( NULL == sessions ) {
|
2006-06-29 01:03:31 +04:00
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* If we were given a 'job' then we can construct it partially into:
|
|
|
|
* openmpi-sessions-USERNAME@HOSTNAME_BATCHID/UNIVERSE/JOBID
|
|
|
|
*/
|
|
|
|
else if(NULL != job) {
|
2007-04-23 22:25:36 +04:00
|
|
|
sessions = opal_os_path( false, frontend, universe, job, NULL );
|
2006-08-23 07:32:36 +04:00
|
|
|
if( NULL == sessions ) {
|
2006-06-29 01:03:31 +04:00
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* If we were given neither then we can construct it partially into:
|
|
|
|
* openmpi-sessions-USERNAME@HOSTNAME_BATCHID/UNIVERSE
|
|
|
|
*/
|
2006-07-11 20:54:07 +04:00
|
|
|
else if(NULL != universe) {
|
2007-04-23 22:25:36 +04:00
|
|
|
sessions = opal_os_path( false, frontend, universe, NULL );
|
2006-08-23 07:32:36 +04:00
|
|
|
if( NULL == sessions ) {
|
2006-06-29 01:03:31 +04:00
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
2006-07-11 20:54:07 +04:00
|
|
|
/* If we were not given 'universe' then we can construct it into:
|
|
|
|
* openmpi-sessions-USERNAME@HOSTNAME_BATCHID
|
|
|
|
*/
|
|
|
|
else {
|
|
|
|
if (0 > asprintf(&sessions, "%s",
|
2007-04-23 22:25:36 +04:00
|
|
|
frontend) ) {
|
2006-07-11 20:54:07 +04:00
|
|
|
exit_status = ORTE_ERROR;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If the user specified an invalid prefix, or no prefix at all
|
|
|
|
* we need to keep looking
|
|
|
|
*/
|
|
|
|
if( NULL != *fulldirpath) {
|
|
|
|
free(*fulldirpath);
|
|
|
|
*fulldirpath = NULL;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2007-04-23 22:25:36 +04:00
|
|
|
if( NULL != return_prefix && NULL != *return_prefix) { /* use the user specified one, if available */
|
|
|
|
prefix = strdup(*return_prefix);
|
|
|
|
prefix_provided = true;
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
/* Try to find a proper alternative prefix */
|
|
|
|
else if (NULL != orte_process_info.tmpdir_base) { /* stored value */
|
2007-04-23 22:25:36 +04:00
|
|
|
prefix = strdup(orte_process_info.tmpdir_base);
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
else if( NULL != getenv("OMPI_PREFIX_ENV") ) { /* OMPI Environment var */
|
2007-04-23 22:25:36 +04:00
|
|
|
prefix = strdup(getenv("OMPI_PREFIX_ENV"));
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
else if( NULL != getenv("TMPDIR") ) { /* General Environment var */
|
2007-04-23 22:25:36 +04:00
|
|
|
prefix = strdup(getenv("TMPDIR"));
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
else if( NULL != getenv("TMP") ) { /* Another general environment var */
|
2007-04-23 22:25:36 +04:00
|
|
|
prefix = strdup(getenv("TMP"));
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
else { /* ow. just use the default tmp directory */
|
2007-04-23 22:25:36 +04:00
|
|
|
prefix = strdup(OMPI_DEFAULT_TMPDIR);
|
2006-06-29 01:03:31 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Construct the absolute final path
|
|
|
|
*/
|
2007-04-23 22:25:36 +04:00
|
|
|
*fulldirpath = opal_os_path(false, prefix, sessions, NULL);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the frontend and prefix, if user requested we do so
|
|
|
|
*/
|
|
|
|
if (NULL != return_frontend) {
|
|
|
|
*return_frontend = strdup(frontend);
|
|
|
|
}
|
|
|
|
if (!prefix_provided && NULL != return_prefix) {
|
|
|
|
*return_prefix = strdup(prefix);
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
cleanup:
|
|
|
|
if(NULL != hostname)
|
|
|
|
free(hostname);
|
|
|
|
if(NULL != batchname)
|
|
|
|
free(batchname);
|
|
|
|
if(NULL != sessions)
|
|
|
|
free(sessions);
|
|
|
|
if(NULL != user)
|
|
|
|
free(user);
|
|
|
|
if(NULL != universe)
|
|
|
|
free(universe);
|
2007-04-23 22:25:36 +04:00
|
|
|
if (NULL != prefix) free(prefix);
|
|
|
|
if (NULL != frontend) free(frontend);
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
return exit_status;
|
|
|
|
}
|
2005-03-19 02:58:36 +03:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Construct the session directory and create it if necessary
|
|
|
|
*/
|
|
|
|
int orte_session_dir(bool create,
|
|
|
|
char *prefix, char *usr, char *hostid,
|
|
|
|
char *batchid, char *univ, char *job, char *proc)
|
|
|
|
{
|
|
|
|
char *fulldirpath = NULL,
|
|
|
|
*frontend = NULL,
|
|
|
|
*sav = NULL;
|
|
|
|
int return_code = ORTE_SUCCESS, rtn;
|
|
|
|
/* This indicates if the prefix was set, and so if it fails then we
|
|
|
|
* should try with the default prefixes.*/
|
|
|
|
bool dbl_check_prefix = false;
|
2006-07-04 02:23:07 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
if( NULL != prefix)
|
|
|
|
dbl_check_prefix = true;
|
|
|
|
|
|
|
|
try_again:
|
|
|
|
/*
|
|
|
|
* If the first attempt at the path creation failed, try with a null
|
|
|
|
* prefix. unless the original prefix was null, then we fail.
|
|
|
|
*/
|
|
|
|
if(!dbl_check_prefix && /* an indicator that we are trying a second time */
|
|
|
|
NULL != prefix) {
|
|
|
|
free(prefix);
|
|
|
|
prefix = NULL;
|
2005-03-19 02:58:36 +03:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Get the session directory full name
|
|
|
|
* First try it with the specified prefix.
|
|
|
|
*/
|
|
|
|
if( ORTE_SUCCESS != ( rtn = orte_session_dir_get_name(&fulldirpath,
|
|
|
|
&prefix,
|
|
|
|
&frontend,
|
|
|
|
usr, hostid,
|
|
|
|
batchid, univ, job,
|
|
|
|
proc) ) ) {
|
|
|
|
return_code = rtn;
|
|
|
|
/*
|
|
|
|
* If the first attempt at the path creation failed, try with a null
|
|
|
|
* prefix. unless the original prefix was null, then we fail :(
|
|
|
|
*/
|
|
|
|
if(dbl_check_prefix) {
|
|
|
|
dbl_check_prefix = false;
|
|
|
|
goto try_again;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Now that we have the full path, go ahead and create it if necessary
|
|
|
|
*/
|
|
|
|
if( create ) {
|
|
|
|
if( ORTE_SUCCESS != (rtn = orte_create_dir(fulldirpath) ) ) {
|
|
|
|
return_code = rtn;
|
|
|
|
|
|
|
|
if(dbl_check_prefix) {
|
|
|
|
dbl_check_prefix = false;
|
|
|
|
goto try_again;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* if we are not creating, then just verify that the path is OK
|
|
|
|
*/
|
|
|
|
else {
|
2006-07-04 02:23:07 +04:00
|
|
|
if( ORTE_SUCCESS != (rtn = opal_os_dirpath_access(fulldirpath, 0) )) {
|
2006-06-29 01:03:31 +04:00
|
|
|
/* It is not valid so we give up and return an error */
|
|
|
|
return_code = rtn;
|
|
|
|
|
|
|
|
if(dbl_check_prefix) {
|
|
|
|
dbl_check_prefix = false;
|
|
|
|
goto try_again;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-03-19 02:58:36 +03:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
return_code = ORTE_SUCCESS;
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* If we are creating the directory tree, the overwrite the
|
|
|
|
* global structure fields
|
|
|
|
*/
|
|
|
|
if (create) {
|
2005-03-19 02:58:36 +03:00
|
|
|
if (NULL != orte_process_info.tmpdir_base) {
|
|
|
|
free(orte_process_info.tmpdir_base);
|
|
|
|
orte_process_info.tmpdir_base = NULL;
|
|
|
|
}
|
|
|
|
if (NULL != orte_process_info.top_session_dir) {
|
|
|
|
free(orte_process_info.top_session_dir);
|
|
|
|
orte_process_info.top_session_dir = NULL;
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Update some of the global structures if they are empty
|
|
|
|
*/
|
|
|
|
if (NULL == orte_process_info.tmpdir_base)
|
|
|
|
orte_process_info.tmpdir_base = strdup(prefix);
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
if (NULL == orte_process_info.top_session_dir)
|
|
|
|
orte_process_info.top_session_dir = strdup(frontend);
|
|
|
|
|
2004-10-15 20:31:54 +04:00
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Set the process session directory
|
|
|
|
*/
|
2004-10-15 20:31:54 +04:00
|
|
|
if (NULL != proc) {
|
2005-03-19 02:58:36 +03:00
|
|
|
if (create) { /* overwrite if creating */
|
|
|
|
if (NULL != orte_process_info.proc_session_dir) {
|
2006-06-29 01:03:31 +04:00
|
|
|
free(orte_process_info.proc_session_dir);
|
|
|
|
orte_process_info.proc_session_dir = NULL;
|
2005-03-19 02:58:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (NULL == orte_process_info.proc_session_dir) {
|
|
|
|
orte_process_info.proc_session_dir = strdup(fulldirpath);
|
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
|
|
|
|
/* Strip off last part of directory structure */
|
2006-08-23 07:32:36 +04:00
|
|
|
sav = opal_dirname(fulldirpath);
|
2006-06-29 01:03:31 +04:00
|
|
|
free(fulldirpath);
|
2006-08-23 07:32:36 +04:00
|
|
|
fulldirpath = sav;
|
2006-06-29 01:03:31 +04:00
|
|
|
sav = NULL;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Set the job session directory
|
|
|
|
*/
|
2004-10-15 20:31:54 +04:00
|
|
|
if (NULL != job) {
|
2005-03-19 02:58:36 +03:00
|
|
|
if (create) { /* overwrite if creating */
|
|
|
|
if (NULL != orte_process_info.job_session_dir) {
|
2006-06-29 01:03:31 +04:00
|
|
|
free(orte_process_info.job_session_dir);
|
|
|
|
orte_process_info.job_session_dir = NULL;
|
2005-03-19 02:58:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (NULL == orte_process_info.job_session_dir) {
|
|
|
|
orte_process_info.job_session_dir = strdup(fulldirpath);
|
|
|
|
}
|
2006-06-29 01:03:31 +04:00
|
|
|
|
|
|
|
/* Strip off last part of directory structure */
|
2006-08-23 07:32:36 +04:00
|
|
|
sav = opal_dirname(fulldirpath);
|
2006-06-29 01:03:31 +04:00
|
|
|
free(fulldirpath);
|
2006-08-23 07:32:36 +04:00
|
|
|
fulldirpath = sav;
|
2006-06-29 01:03:31 +04:00
|
|
|
sav = NULL;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
/*
|
|
|
|
* Set the universe session directory
|
|
|
|
*/
|
2004-10-15 20:31:54 +04:00
|
|
|
if (create) { /* overwrite if creating */
|
2005-03-19 02:58:36 +03:00
|
|
|
if (NULL != orte_process_info.universe_session_dir) {
|
|
|
|
free(orte_process_info.universe_session_dir);
|
|
|
|
orte_process_info.universe_session_dir = NULL;
|
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
if (NULL == orte_process_info.universe_session_dir) {
|
|
|
|
orte_process_info.universe_session_dir = strdup(fulldirpath);
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "procdir: %s",
|
2005-06-27 03:11:37 +04:00
|
|
|
OMPI_PRINTF_FIX_STRING(orte_process_info.proc_session_dir));
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "jobdir: %s",
|
2005-06-27 03:11:37 +04:00
|
|
|
OMPI_PRINTF_FIX_STRING(orte_process_info.job_session_dir));
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "unidir: %s",
|
2005-06-27 03:11:37 +04:00
|
|
|
OMPI_PRINTF_FIX_STRING(orte_process_info.universe_session_dir));
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "top: %s",
|
2005-06-27 03:11:37 +04:00
|
|
|
OMPI_PRINTF_FIX_STRING(orte_process_info.top_session_dir));
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "tmp: %s",
|
2005-06-27 03:11:37 +04:00
|
|
|
OMPI_PRINTF_FIX_STRING(orte_process_info.tmpdir_base));
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 01:03:31 +04:00
|
|
|
cleanup:
|
|
|
|
if(NULL != fulldirpath)
|
2004-10-15 20:31:54 +04:00
|
|
|
free(fulldirpath);
|
2006-06-29 01:03:31 +04:00
|
|
|
if(NULL != frontend)
|
|
|
|
free(frontend);
|
|
|
|
if(NULL != sav)
|
|
|
|
free(sav);
|
|
|
|
|
2004-10-15 20:31:54 +04:00
|
|
|
return return_code;
|
|
|
|
}
|
|
|
|
|
2006-02-16 03:16:22 +03:00
|
|
|
/*
|
2006-06-29 01:03:31 +04:00
|
|
|
* A job has aborted - so force cleanup of the session directory
|
2006-02-16 03:16:22 +03:00
|
|
|
*/
|
|
|
|
int
|
|
|
|
orte_session_dir_cleanup(orte_jobid_t jobid)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
char *tmp;
|
Bring in the generalized xcast communication system along with the correspondingly revised orted launch. I will send a message out to developers explaining the basic changes. In brief:
1. generalize orte_rml.xcast to become a general broadcast-like messaging system. Messages can now be sent to any tag on the daemons or processes. Note that any message sent via xcast will be delivered to ALL processes in the specified job - you don't get to pick and choose. At a later date, we will introduce an augmented capability that will use the daemons as relays, but will allow you to send to a specified array of process names.
2. extended orte_rml.xcast so it supports more scalable message routing methodologies. At the moment, we support three: (a) direct, which sends the message directly to all recipients; (b) linear, which sends the message to the local daemon on each node, which then relays it to its own local procs; and (b) binomial, which sends the message via a binomial algo across all the daemons, each of which then relays to its own local procs. The crossover points between the algos are adjustable via MCA param, or you can simply demand that a specific algo be used.
3. orteds no longer exhibit two types of behavior: bootproxy or VM. Orteds now always behave like they are part of a virtual machine - they simply launch a job if mpirun tells them to do so. This is another step towards creating an "orteboot" functionality, but also provided a clean system for supporting message relaying.
Note one major impact of this commit: multiple daemons on a node cannot be supported any longer! Only a single daemon/node is now allowed.
This commit is known to break support for the following environments: POE, Xgrid, Xcpu, Windows. It has been tested on rsh, SLURM, and Bproc. Modifications for TM support have been made but could not be verified due to machine problems at LANL. Modifications for SGE have been made but could not be verified. The developers for the non-verified environments will be separately notified along with suggestions on how to fix the problems.
This commit was SVN r15007.
2007-06-12 17:28:54 +04:00
|
|
|
char *job=NULL, *job_session_dir=NULL;
|
2006-02-16 03:16:22 +03:00
|
|
|
|
|
|
|
/* need to setup the top_session_dir with the prefix */
|
|
|
|
tmp = opal_os_path(false,
|
|
|
|
orte_process_info.tmpdir_base,
|
|
|
|
orte_process_info.top_session_dir, NULL);
|
|
|
|
|
Bring in the generalized xcast communication system along with the correspondingly revised orted launch. I will send a message out to developers explaining the basic changes. In brief:
1. generalize orte_rml.xcast to become a general broadcast-like messaging system. Messages can now be sent to any tag on the daemons or processes. Note that any message sent via xcast will be delivered to ALL processes in the specified job - you don't get to pick and choose. At a later date, we will introduce an augmented capability that will use the daemons as relays, but will allow you to send to a specified array of process names.
2. extended orte_rml.xcast so it supports more scalable message routing methodologies. At the moment, we support three: (a) direct, which sends the message directly to all recipients; (b) linear, which sends the message to the local daemon on each node, which then relays it to its own local procs; and (b) binomial, which sends the message via a binomial algo across all the daemons, each of which then relays to its own local procs. The crossover points between the algos are adjustable via MCA param, or you can simply demand that a specific algo be used.
3. orteds no longer exhibit two types of behavior: bootproxy or VM. Orteds now always behave like they are part of a virtual machine - they simply launch a job if mpirun tells them to do so. This is another step towards creating an "orteboot" functionality, but also provided a clean system for supporting message relaying.
Note one major impact of this commit: multiple daemons on a node cannot be supported any longer! Only a single daemon/node is now allowed.
This commit is known to break support for the following environments: POE, Xgrid, Xcpu, Windows. It has been tested on rsh, SLURM, and Bproc. Modifications for TM support have been made but could not be verified due to machine problems at LANL. Modifications for SGE have been made but could not be verified. The developers for the non-verified environments will be separately notified along with suggestions on how to fix the problems.
This commit was SVN r15007.
2007-06-12 17:28:54 +04:00
|
|
|
if (ORTE_JOBID_WILDCARD != jobid) {
|
|
|
|
/* define the proc and job session directories for this process */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.convert_jobid_to_string(&job, jobid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
free(tmp);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
job_session_dir = opal_os_path( false, orte_process_info.universe_session_dir,
|
|
|
|
job, NULL );
|
|
|
|
if( NULL == job_session_dir ) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
free(tmp);
|
|
|
|
free(job);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
opal_os_dirpath_destroy(job_session_dir,
|
|
|
|
true, orte_dir_check_file);
|
|
|
|
/* take out the universe session dir, but only if there
|
|
|
|
* are no remaining job session dirs around
|
|
|
|
*/
|
|
|
|
opal_os_dirpath_destroy(orte_process_info.universe_session_dir,
|
|
|
|
false, orte_dir_check_file);
|
|
|
|
} else {
|
|
|
|
/* if we want the session_dir removed for ALL jobids, then
|
|
|
|
* just recursively blow the whole universe session away
|
|
|
|
*/
|
|
|
|
opal_os_dirpath_destroy(orte_process_info.universe_session_dir,
|
|
|
|
true, orte_dir_check_file);
|
2006-02-16 03:16:22 +03:00
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
opal_os_dirpath_destroy(tmp,
|
|
|
|
false, orte_dir_check_file);
|
|
|
|
|
|
|
|
if (opal_os_dirpath_is_empty(job_session_dir)) {
|
2006-02-16 03:16:22 +03:00
|
|
|
if (orte_debug_flag) {
|
|
|
|
opal_output(0, "sess_dir_finalize: found job session dir empty - deleting");
|
|
|
|
}
|
|
|
|
rmdir(job_session_dir);
|
|
|
|
} else {
|
|
|
|
if (orte_debug_flag) {
|
|
|
|
opal_output(0, "sess_dir_finalize: job session dir not empty - leaving");
|
|
|
|
}
|
|
|
|
goto CLEANUP;
|
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
if (opal_os_dirpath_is_empty(orte_process_info.universe_session_dir)) {
|
2006-02-16 03:16:22 +03:00
|
|
|
if (orte_debug_flag) {
|
|
|
|
opal_output(0, "sess_dir_finalize: found univ session dir empty - deleting");
|
|
|
|
}
|
|
|
|
rmdir(orte_process_info.universe_session_dir);
|
|
|
|
} else {
|
|
|
|
if (orte_debug_flag) {
|
|
|
|
opal_output(0, "sess_dir_finalize: univ session dir not empty - leaving");
|
|
|
|
}
|
|
|
|
goto CLEANUP;
|
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
if (opal_os_dirpath_is_empty(tmp)) {
|
2006-02-16 03:16:22 +03:00
|
|
|
if (orte_debug_flag) {
|
|
|
|
opal_output(0, "sess_dir_finalize: found top session dir empty - deleting");
|
|
|
|
}
|
|
|
|
rmdir(tmp);
|
|
|
|
} else {
|
|
|
|
if (orte_debug_flag) {
|
|
|
|
opal_output(0, "sess_dir_finalize: top session dir not empty - leaving");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
free(tmp);
|
Bring in the generalized xcast communication system along with the correspondingly revised orted launch. I will send a message out to developers explaining the basic changes. In brief:
1. generalize orte_rml.xcast to become a general broadcast-like messaging system. Messages can now be sent to any tag on the daemons or processes. Note that any message sent via xcast will be delivered to ALL processes in the specified job - you don't get to pick and choose. At a later date, we will introduce an augmented capability that will use the daemons as relays, but will allow you to send to a specified array of process names.
2. extended orte_rml.xcast so it supports more scalable message routing methodologies. At the moment, we support three: (a) direct, which sends the message directly to all recipients; (b) linear, which sends the message to the local daemon on each node, which then relays it to its own local procs; and (b) binomial, which sends the message via a binomial algo across all the daemons, each of which then relays to its own local procs. The crossover points between the algos are adjustable via MCA param, or you can simply demand that a specific algo be used.
3. orteds no longer exhibit two types of behavior: bootproxy or VM. Orteds now always behave like they are part of a virtual machine - they simply launch a job if mpirun tells them to do so. This is another step towards creating an "orteboot" functionality, but also provided a clean system for supporting message relaying.
Note one major impact of this commit: multiple daemons on a node cannot be supported any longer! Only a single daemon/node is now allowed.
This commit is known to break support for the following environments: POE, Xgrid, Xcpu, Windows. It has been tested on rsh, SLURM, and Bproc. Modifications for TM support have been made but could not be verified due to machine problems at LANL. Modifications for SGE have been made but could not be verified. The developers for the non-verified environments will be separately notified along with suggestions on how to fix the problems.
This commit was SVN r15007.
2007-06-12 17:28:54 +04:00
|
|
|
if (NULL != job) free(job);
|
|
|
|
if (NULL != job_session_dir) free(job_session_dir);
|
2006-02-16 03:16:22 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2004-10-15 20:31:54 +04:00
|
|
|
|
|
|
|
int
|
2005-04-14 05:04:26 +04:00
|
|
|
orte_session_dir_finalize(orte_process_name_t *proc)
|
2004-10-15 20:31:54 +04:00
|
|
|
{
|
2005-04-14 05:04:26 +04:00
|
|
|
int rc;
|
2005-04-07 23:19:48 +04:00
|
|
|
char *tmp;
|
2005-04-14 05:04:26 +04:00
|
|
|
char *job, *job_session_dir, *vpid, *proc_session_dir;
|
2005-05-13 01:44:23 +04:00
|
|
|
|
2005-04-07 23:19:48 +04:00
|
|
|
/* need to setup the top_session_dir with the prefix */
|
2005-08-30 01:35:01 +04:00
|
|
|
tmp = opal_os_path(false,
|
|
|
|
orte_process_info.tmpdir_base,
|
|
|
|
orte_process_info.top_session_dir, NULL);
|
2005-04-07 23:19:48 +04:00
|
|
|
|
2005-04-14 05:04:26 +04:00
|
|
|
/* define the proc and job session directories for this process */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid_string(&job, proc))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
free(tmp);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.get_vpid_string(&vpid, proc))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
free(tmp);
|
|
|
|
free(job);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-08-23 07:32:36 +04:00
|
|
|
job_session_dir = opal_os_path( false, orte_process_info.universe_session_dir,
|
|
|
|
job, NULL );
|
|
|
|
if( NULL == job_session_dir ) {
|
2005-04-14 05:04:26 +04:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
free(tmp);
|
|
|
|
free(job);
|
|
|
|
free(vpid);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2006-08-23 07:32:36 +04:00
|
|
|
proc_session_dir = opal_os_path( false, job_session_dir, vpid, NULL );
|
|
|
|
if( NULL == proc_session_dir ) {
|
2005-04-14 05:04:26 +04:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
free(tmp);
|
|
|
|
free(job);
|
|
|
|
free(vpid);
|
|
|
|
free(job_session_dir);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
opal_os_dirpath_destroy(proc_session_dir,
|
|
|
|
false, orte_dir_check_file);
|
|
|
|
opal_os_dirpath_destroy(job_session_dir,
|
|
|
|
false, orte_dir_check_file);
|
|
|
|
opal_os_dirpath_destroy(orte_process_info.universe_session_dir,
|
|
|
|
false, orte_dir_check_file);
|
|
|
|
opal_os_dirpath_destroy(tmp,
|
|
|
|
false, orte_dir_check_file);
|
|
|
|
|
|
|
|
if (opal_os_dirpath_is_empty(proc_session_dir)) {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: found proc session dir empty - deleting");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
2005-04-14 05:04:26 +04:00
|
|
|
rmdir(proc_session_dir);
|
2004-10-15 20:31:54 +04:00
|
|
|
} else {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: proc session dir not empty - leaving");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
2005-04-14 05:04:26 +04:00
|
|
|
goto CLEANUP;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
if (opal_os_dirpath_is_empty(job_session_dir)) {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: found job session dir empty - deleting");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
2005-04-14 05:04:26 +04:00
|
|
|
rmdir(job_session_dir);
|
2004-10-15 20:31:54 +04:00
|
|
|
} else {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: job session dir not empty - leaving");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
2005-04-14 05:04:26 +04:00
|
|
|
goto CLEANUP;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
if (opal_os_dirpath_is_empty(orte_process_info.universe_session_dir)) {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: found univ session dir empty - deleting");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
|
|
|
rmdir(orte_process_info.universe_session_dir);
|
2004-10-15 20:31:54 +04:00
|
|
|
} else {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: univ session dir not empty - leaving");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
2005-04-14 05:04:26 +04:00
|
|
|
goto CLEANUP;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
if (opal_os_dirpath_is_empty(tmp)) {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: found top session dir empty - deleting");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
|
|
|
rmdir(tmp);
|
2004-10-15 20:31:54 +04:00
|
|
|
} else {
|
2005-04-07 23:19:48 +04:00
|
|
|
if (orte_debug_flag) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "sess_dir_finalize: top session dir not empty - leaving");
|
2005-04-07 23:19:48 +04:00
|
|
|
}
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2005-04-14 05:04:26 +04:00
|
|
|
CLEANUP:
|
2005-04-07 23:19:48 +04:00
|
|
|
free(tmp);
|
2005-04-14 05:04:26 +04:00
|
|
|
free(job);
|
|
|
|
free(vpid);
|
|
|
|
free(job_session_dir);
|
|
|
|
free(proc_session_dir);
|
2005-08-15 22:25:35 +04:00
|
|
|
return ORTE_SUCCESS;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
static bool
|
|
|
|
orte_dir_check_file(const char *root, const char *path) {
|
2006-02-16 03:16:22 +03:00
|
|
|
|
2006-07-04 02:23:07 +04:00
|
|
|
/*
|
|
|
|
* Keep:
|
|
|
|
* - files starting with "output-"
|
|
|
|
* - universe contact (universe-setup.txt)
|
|
|
|
*/
|
|
|
|
if( (0 == strncmp(path, "output-", strlen("output-"))) ||
|
|
|
|
(0 == strcmp(path, "universe-setup.txt"))) {
|
|
|
|
return false;
|
2004-11-03 00:48:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2004-10-15 20:31:54 +04:00
|
|
|
}
|