1
1

* rename orte_os_create_dirpath to opal_os_create_dirpath

* rename orte_os_path to opal_os_path
* rename ompi_path_find to opal_path_find
* rename ompi_pow2 to opal_pow2

This commit was SVN r6334.
Этот коммит содержится в:
Brian Barrett 2005-07-04 01:59:52 +00:00
родитель 4d4908f011
Коммит 46245aaac1
32 изменённых файлов: 141 добавлений и 137 удалений

Просмотреть файл

@ -21,7 +21,7 @@
#include "include/sys/cache.h"
#include "include/sys/atomic.h"
#include "mca/mpool/mpool.h"
#include "util/pow2.h"
#include "opal/util/pow2.h"
/** @file
@ -135,7 +135,7 @@ static inline int ompi_cb_fifo_init(int size_of_fifo, int lazy_free_freq,
}
/* set fifo size */
fifo->size = ompi_round_up_to_nearest_pow2(size_of_fifo);
fifo->size = opal_round_up_to_nearest_pow2(size_of_fifo);
/* set lazy free frequence */
if( ( 0 >= lazy_free_freq ) ||
@ -468,7 +468,7 @@ static inline int ompi_cb_fifo_init_same_base_addr(int size_of_fifo,
}
/* set fifo size */
fifo->size = ompi_round_up_to_nearest_pow2(size_of_fifo);
fifo->size = opal_round_up_to_nearest_pow2(size_of_fifo);
/* set lazy free frequence */
if( ( 0 >= lazy_free_freq ) ||

Просмотреть файл

@ -28,10 +28,10 @@
#include <unistd.h>
#include <errno.h>
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/util/argv.h"
#include "opal/util/few.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "util/show_help.h"
#include "tools/wrappers/ompi_wrap.h"
@ -429,7 +429,7 @@ ompi_wrap_exec_sv(const ompi_sv_t & sv)
// the called app returned non-zero or if there was a failure in the
// exec (like the file not being found). So we look for the
// compiler first, just to try to eliminate that case.
tmp = ompi_path_findv(av[0], 0, environ, NULL);
tmp = opal_path_findv(av[0], 0, environ, NULL);
if (NULL == tmp) {
ompi_show_help("help-wrapper.txt", "no-compiler-found", true,
av[0], NULL);

Просмотреть файл

@ -15,7 +15,7 @@
*/
#include "orte_config.h"
#include "ompi_config.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
@ -27,11 +27,11 @@
#include <stdlib.h>
#include "include/constants.h"
#include "util/os_create_dirpath.h"
#include "opal/util/os_create_dirpath.h"
#include "util/sys_info.h"
#include "opal/util/argv.h"
int orte_os_create_dirpath(const char *path, const mode_t mode)
int opal_os_create_dirpath(const char *path, const mode_t mode)
{
struct stat buf;
char **parts, *tmp;

Просмотреть файл

@ -17,28 +17,28 @@
/** @file:
* Creates a directory tree set to the specified permissions.
*
* The orte_os_create_dirpath() function creates a directory
* The opal_os_create_dirpath() function creates a directory
* tree, with each directory that is created in the tree having the specified
* access permissions. Existing directories within the tree are left
* untouched - however, if they do not permit the user to create a directory
* within them, the function will return an error condition.
*
* If the specified full path name already exists, the
* orte_os_create_dirpath() function will check to ensure that
* opal_os_create_dirpath() function will check to ensure that
* the final directory in the tree has at least the specified access permission. In other
* words, if the directory has read-write-execute for all, and the user
* has requested read-write access for just the user, then the function
* will consider the directory acceptable. If the minimal permissions are
* not currently provided, the function will attempt to change the
* access permissions of the directory to add the specified
* permissions. The function will return ORTE_ERROR if this cannot
* permissions. The function will return OMPI_ERROR if this cannot
* be done.
**/
#ifndef ORTE_OS_CREATE_DIRPATH_H
#define ORTE_SHOW_HELP_H
#ifndef OPAL_OS_CREATE_DIRPATH_H
#define OPAL_OS_CREATE_DIRPATH_H
#include "orte_config.h"
#include "ompi_config.h"
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@ -51,12 +51,12 @@
* @param path A pointer to a string that contains the path name to be built.
* @param mode A mode_t bit mask that specifies the access permissions for the
* directories being constructed.
* @retval ORTE_SUCCESS If the directory tree has been successfully created with
* @retval OMPI_SUCCESS If the directory tree has been successfully created with
* the specified access permissions.
* @retval ORTE_ERROR If the directory tree could not be created with the
* @retval OMPI_ERROR If the directory tree could not be created with the
* specified access permissions.
*/
ORTE_DECLSPEC int orte_os_create_dirpath(const char *path, const mode_t mode);
OMPI_DECLSPEC int opal_os_create_dirpath(const char *path, const mode_t mode);
#endif

Просмотреть файл

@ -14,7 +14,7 @@
* $HEADER$
*/
#include "orte_config.h"
#include "ompi_config.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
@ -29,12 +29,12 @@
#include <stdlib.h>
#include <stdarg.h>
#include "include/orte_constants.h"
#include "include/constants.h"
#include "util/sys_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "util/sys_info.h"
char *orte_os_path(bool relative, ...)
char *opal_os_path(bool relative, ...)
{
va_list ap, ap1;
char *element, *path;

Просмотреть файл

@ -17,7 +17,7 @@
/** @file:
* Creates an operating system-acceptable path name.
*
* The orte_os_path() function takes a variable number of string arguments and
* The opal_os_path() function takes a variable number of string arguments and
* concatenates them into a path name using the path separator character appropriate
* to the local operating system. NOTE: the string returned by this function has been
* malloc'd - thus, the user is responsible for free'ing the memory used by
@ -36,10 +36,14 @@
*
*/
#include "orte_config.h"
#include "ompi_config.h"
#include <stdio.h>
#include <stdarg.h>
#ifndef OPAL_OS_PATH_H
#define OPAL_OS_PATH_H
/**
* @param relative A boolean that specifies if the path name is to be constructed
* relative to the current directory or as an absolute path. If no path
@ -55,4 +59,6 @@
* appropriate to the local operating system. The path_name string has been malloc'd
* and therefore the user is responsible for free'ing the field.
*/
ORTE_DECLSPEC char *orte_os_path(bool relative, ...);
OMPI_DECLSPEC char *opal_os_path(bool relative, ...);
#endif /* OPAL_OS_PATH_H */

Просмотреть файл

@ -21,7 +21,7 @@
#include <unistd.h>
#endif
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/util/argv.h"
/*
@ -41,7 +41,7 @@ static char *list_env_get(char *var, char **list);
/**
* Locates a file with certain permissions
*/
char *ompi_path_find(char *fname, char **pathv, int mode, char **envv)
char *opal_path_find(char *fname, char **pathv, int mode, char **envv)
{
char *fullpath;
char *delimit;
@ -102,7 +102,7 @@ char *ompi_path_find(char *fname, char **pathv, int mode, char **envv)
/*
* Locates a file with certain permissions from a list of search paths
*/
char *ompi_path_findv(char *fname, int mode, char **envv, char *wrkdir)
char *opal_path_findv(char *fname, int mode, char **envv, char *wrkdir)
{
char **dirv;
char *fullpath;
@ -144,7 +144,7 @@ char *ompi_path_findv(char *fname, int mode, char **envv, char *wrkdir)
if(NULL == dirv)
return NULL;
fullpath = ompi_path_find(fname, dirv, mode, envv);
fullpath = opal_path_find(fname, dirv, mode, envv);
opal_argv_free(dirv);
return fullpath;
}

Просмотреть файл

@ -16,8 +16,8 @@
* @file
*/
#ifndef OMPI_PATH_H
#define OMPI_PATH_H
#ifndef OPAL_PATH_H
#define OPAL_PATH_H
#include "ompi_config.h"
@ -42,7 +42,7 @@ extern "C" {
* Environment variables must be followed by a path delimiter or
* end-of-string.
*/
OMPI_DECLSPEC char *ompi_path_find(char *fname, char **pathv, int mode,
OMPI_DECLSPEC char *opal_path_find(char *fname, char **pathv, int mode,
char **envv);
/**
@ -61,10 +61,10 @@ extern "C" {
* given by the $PATH environment variable. Replaces "." in the
* path with the working dir.
*/
OMPI_DECLSPEC char *ompi_path_findv(char *fname, int mode,
OMPI_DECLSPEC char *opal_path_findv(char *fname, int mode,
char **envv, char *wrkdir);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OMPI_PATH_H */
#endif /* OPAL_PATH_H */

Просмотреть файл

@ -16,7 +16,7 @@
#include "ompi_config.h"
#include "util/pow2.h"
#include "opal/util/pow2.h"
/**
@ -28,7 +28,7 @@
* @returnvalue power of 2 integer same or greater than the input
* parameter.
*/
int ompi_round_up_to_nearest_pow2(int input_integer)
int opal_round_up_to_nearest_pow2(int input_integer)
{
int pop_count, highest_used_bit, tmp_input_integer, return_value;

Просмотреть файл

@ -14,10 +14,8 @@
* $HEADER$
*/
#ifndef OMPI_POW2_H
#define OMPI_POW2_H
#include "ompi_config.h"
#ifndef OPAL_POW2_H
#define OPAL_POW2_H
/**
* This routine takes in an interger, and returns the nearest
@ -28,6 +26,6 @@
* @returnvalue power of 2 integer same or greater than the input
* parameter.
*/
OMPI_DECLSPEC int ompi_round_up_to_nearest_pow2(int input_integer);
OMPI_DECLSPEC int opal_round_up_to_nearest_pow2(int input_integer);
#endif /* OMPI_POW2_H */
#endif /* OPAL_POW2_H */

Просмотреть файл

@ -37,9 +37,9 @@
#include "mca/rmaps/base/rmaps_base_map.h"
#include "pls_bproc_orted.h"
#include "mca/ns/base/base.h"
#include "util/os_create_dirpath.h"
#include "opal/util/os_create_dirpath.h"
#include "mca/oob/base/base.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "opal/runtime/opal_progress.h"
#include "pls_bproc_orted.h"
@ -74,7 +74,7 @@ static int pls_bproc_orted_make_dir(char *directory)
pls_bproc_orted_delete_dir_tree(directory);
}
/* try to create it with proper mode */
return(orte_os_create_dirpath(directory, my_mode));
return(opal_os_create_dirpath(directory, my_mode));
}
/**
@ -289,7 +289,7 @@ static void pls_bproc_orted_delete_dir_tree(char * path) {
while (NULL != (ep = readdir(dp)) ) {
/* skip: . and .. */
if ((0 != strcmp(ep->d_name, ".")) && (0 != strcmp(ep->d_name, ".."))) {
filenm = orte_os_path(false, path, ep->d_name, NULL);
filenm = opal_os_path(false, path, ep->d_name, NULL);
ret = stat(filenm, &buf);
if (ret < 0 || S_ISDIR(buf.st_mode)) {
pls_bproc_orted_delete_dir_tree(filenm);

Просмотреть файл

@ -28,7 +28,7 @@
#include "include/orte_constants.h"
#include "opal/util/argv.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "mca/pls/pls.h"
#include "mca/pls/fork/pls_fork.h"
#include "mca/pls/fork/pls-fork-version.h"

Просмотреть файл

@ -25,7 +25,7 @@
#include "include/orte_constants.h"
#include "mca/pls/pls.h"
#include "pls_poe.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/util/argv.h"
#include "mca/pls/poe/pls-poe-version.h"
#include "mca/base/mca_base_param.h"
@ -157,11 +157,11 @@ orte_pls_poe_component_init - initialize component, check if we can run on this
orte_pls_base_module_t *orte_pls_poe_component_init(int *priority)
{
extern char **environ;
mca_pls_poe_component.path = ompi_path_findv(mca_pls_poe_component.argv[0], 0, environ, NULL);
mca_pls_poe_component.path = opal_path_findv(mca_pls_poe_component.argv[0], 0, environ, NULL);
if (NULL == mca_pls_poe_component.path) {
return NULL;
}
mca_pls_poe_component.env = ompi_path_findv(mca_pls_poe_component.env, 0, environ, NULL);
mca_pls_poe_component.env = opal_path_findv(mca_pls_poe_component.env, 0, environ, NULL);
if (NULL == mca_pls_poe_component.env) {
return NULL;
}

Просмотреть файл

@ -28,7 +28,7 @@
#include "include/orte_constants.h"
#include "opal/util/argv.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/util/basename.h"
#include "mca/pls/pls.h"
#include "mca/pls/rsh/pls_rsh.h"
@ -182,7 +182,7 @@ orte_pls_base_module_t *orte_pls_rsh_component_init(int *priority)
if (NULL == mca_pls_rsh_component.argv || NULL == mca_pls_rsh_component.argv[0]) {
return NULL;
}
mca_pls_rsh_component.path = ompi_path_findv(mca_pls_rsh_component.argv[0], 0, environ, NULL);
mca_pls_rsh_component.path = opal_path_findv(mca_pls_rsh_component.argv[0], 0, environ, NULL);
if (NULL == mca_pls_rsh_component.path) {
return NULL;
}

Просмотреть файл

@ -42,7 +42,7 @@
#include "util/univ_info.h"
#include "util/session_dir.h"
#include "opal/util/if.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/event/event.h"
#include "runtime/orte_wait.h"
@ -460,7 +460,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
if (0 == strcmp(node->node_name, orte_system_info.nodename) ||
opal_ifislocal(node->node_name)) {
exec_argv = &argv[local_exec_index];
exec_path = ompi_path_findv(exec_argv[0], 0, environ, NULL);
exec_path = opal_path_findv(exec_argv[0], 0, environ, NULL);
} else {
exec_argv = argv;
exec_path = strdup(mca_pls_rsh_component.path);

Просмотреть файл

@ -32,7 +32,7 @@
#import "mca/ras/base/ras_base_node.h"
#import "mca/gpr/gpr.h"
#import "mca/rml/rml.h"
#import "util/path.h"
#import "opal/util/path.h"
#import "pls_xgrid_client.h"
@ -247,7 +247,7 @@ mca_pls_xgrid_set_node_name(orte_ras_base_node_t* node,
char *orted_path;
/* find orted */
orted_path = ompi_path_findv((char*) [orted cString], 0, environ, NULL);
orted_path = opal_path_findv((char*) [orted cString], 0, environ, NULL);
/* query the list of nodes allocated to the job */
OBJ_CONSTRUCT(&nodes, opal_list_t);

Просмотреть файл

@ -27,7 +27,7 @@
#import "include/orte_constants.h"
#import "opal/util/argv.h"
#import "util/path.h"
#import "opal/util/path.h"
#import "opal/util/basename.h"
#import "mca/pls/pls.h"
#import "mca/pls/base/base.h"

Просмотреть файл

@ -20,7 +20,7 @@
#include "mca/base/mca_base_param.h"
#include "util/proc_info.h"
#include "opal/util/output.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "mca/rds/hostfile/rds_hostfile.h"
/*
@ -97,7 +97,7 @@ static int orte_rds_hostfile_open(void)
printf("Unimplemented feature for windows\n");
return ORTE_ERROR;
#else
char *path = orte_os_path(false, ORTE_SYSCONFDIR, "openmpi-default-hostfile", NULL);
char *path = opal_os_path(false, ORTE_SYSCONFDIR, "openmpi-default-hostfile", NULL);
OBJ_CONSTRUCT(&mca_rds_hostfile_component.lock, opal_mutex_t);
mca_rds_hostfile_component.debug = orte_rds_hostfile_param_register_int("debug",1);
mca_rds_hostfile_component.path = orte_rds_hostfile_param_register_string("path", path);

Просмотреть файл

@ -47,7 +47,7 @@
#include "util/sys_info.h"
#include "opal/util/cmd_line.h"
#include "util/universe_setup_file_io.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "runtime/runtime.h"
#include "runtime/runtime_internal.h"
@ -329,7 +329,7 @@ int orte_init_stage1(void)
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return ORTE_ERR_NOT_FOUND;
}
contact_path = orte_os_path(false, orte_process_info.universe_session_dir,
contact_path = opal_os_path(false, orte_process_info.universe_session_dir,
"universe-setup.txt", NULL);
if (orte_debug_flag) {
opal_output(0, "[%lu,%lu,%lu] contact_file %s",

Просмотреть файл

@ -46,11 +46,11 @@
#include "opal/util/argv.h"
#include "opal/util/opal_environ.h"
#include "opal/util/output.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "util/univ_info.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "util/session_dir.h"
#include "util/universe_setup_file_io.h"
@ -356,7 +356,7 @@ MOVEON:
free(param);
/* setup the path */
path = ompi_path_findv(argv[0], 0, environ, NULL);
path = opal_path_findv(argv[0], 0, environ, NULL);
/* add the username and nodename */
opal_argv_append(&argc, &argv, "-l");

Просмотреть файл

@ -33,7 +33,7 @@
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "util/univ_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
/**
* Leave ORTE.
@ -49,7 +49,7 @@ int orte_system_finalize(void)
/* if I'm the seed, remove the universe contact info file */
if (orte_process_info.seed) {
contact_path = orte_os_path(false, orte_process_info.universe_session_dir,
contact_path = opal_os_path(false, orte_process_info.universe_session_dir,
"universe-setup.txt", NULL);
unlink(contact_path);
free(contact_path);

Просмотреть файл

@ -33,7 +33,7 @@
#include "util/univ_info.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "util/session_dir.h"
#include "util/universe_setup_file_io.h"
@ -66,7 +66,7 @@ int orte_universe_exists(orte_universe_t *univ)
}
/* check for "contact-info" file. if present, read it in. */
if (NULL == (contact_file = orte_os_path(false, orte_process_info.universe_session_dir,
if (NULL == (contact_file = opal_os_path(false, orte_process_info.universe_session_dir,
"universe-setup.txt", NULL))) {
/* NOTE: NOT FINDING THE FILE IS NOT AN ERROR - DON'T ERROR_LOG IT */
return ORTE_ERR_NOT_FOUND;

Просмотреть файл

@ -31,7 +31,7 @@
#include "util/proc_info.h"
#include "util/session_dir.h"
#include "opal/util/output.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "util/show_help.h"
#include "util/universe_setup_file_io.h"
#include "runtime/runtime.h"

Просмотреть файл

@ -42,7 +42,7 @@
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "util/sys_info.h"
#include "util/univ_info.h"
#include "opal/util/cmd_line.h"

Просмотреть файл

@ -40,7 +40,7 @@
#include "opal/util/output.h"
#include "util/show_help.h"
#include "util/sys_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "opal/util/cmd_line.h"
#include "util/proc_info.h"
#include "util/univ_info.h"
@ -281,7 +281,7 @@ int main(int argc, char *argv[])
/* define a log file name in the session directory */
sprintf(log_file, "output-orted-%s-%s.log",
jobidstring, orte_system_info.nodename);
log_path = orte_os_path(false,
log_path = opal_os_path(false,
orte_process_info.tmpdir_base,
orte_process_info.top_session_dir,
log_file,

Просмотреть файл

@ -38,11 +38,11 @@
#include "dps/dps.h"
#include "opal/event/event.h"
#include "opal/util/argv.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/util/output.h"
#include "util/show_help.h"
#include "util/sys_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "opal/util/cmd_line.h"
#include "util/proc_info.h"
#include "util/univ_info.h"
@ -370,7 +370,7 @@ fprintf(stderr, "using %s for orted command\n", orted);
}
/* setup the path */
path = ompi_path_findv(ortedargv[0], 0, environ, NULL);
path = opal_path_findv(ortedargv[0], 0, environ, NULL);
fprintf(stderr, "path setup as %s\n", path);

Просмотреть файл

@ -37,7 +37,7 @@
#include "util/proc_info.h"
#include "opal/util/argv.h"
#include "opal/util/opal_environ.h"
#include "util/path.h"
#include "opal/util/path.h"
#include "opal/util/cmd_line.h"
#include "util/sys_info.h"
#include "opal/util/output.h"
@ -986,7 +986,7 @@ static int create_app(int argc, char* argv[], orte_app_context_t **app_ptr,
value = opal_basename(app->argv[0]);
if (strlen(value) == strlen(app->argv[0])) {
app->app = ompi_path_findv(app->argv[0], 0, environ, app->cwd);
app->app = opal_path_findv(app->argv[0], 0, environ, app->cwd);
} else {
app->app = strdup(app->argv[0]);
}

Просмотреть файл

@ -48,8 +48,8 @@
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "opal/util/output.h"
#include "util/os_path.h"
#include "util/os_create_dirpath.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"
#include "mca/errmgr/errmgr.h"
#include "runtime/runtime.h"
@ -90,7 +90,7 @@ static int orte_check_dir(bool create, char *directory)
}
}
if (create) {
return(orte_os_create_dirpath(directory, my_mode)); /* try to create it with proper mode */
return(opal_os_create_dirpath(directory, my_mode)); /* try to create it with proper mode */
}
return(OMPI_ERROR); /* couldn't find it, or don't have access rights, and not asked to create it */
}
@ -182,7 +182,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid,
if (NULL != prefix) { /* if a prefix is specified, start looking here */
tmp = strdup(prefix);
fulldirpath = strdup(orte_os_path(false, tmp, sessions, NULL)); /* make sure it's an absolute pathname */
fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); /* make sure it's an absolute pathname */
if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */
return_code = OMPI_SUCCESS;
goto COMPLETE;
@ -200,7 +200,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid,
/* no prefix was specified, so check other options in order */
if (NULL != orte_process_info.tmpdir_base) { /* stored value previously */
tmp = strdup(orte_process_info.tmpdir_base);
fulldirpath = strdup(orte_os_path(false, tmp, sessions, NULL));
fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL));
if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */
return_code = OMPI_SUCCESS;
goto COMPLETE;
@ -209,7 +209,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid,
free(fulldirpath); fulldirpath = NULL;
} else if (NULL != getenv("OMPI_PREFIX_ENV")) { /* we have prefix enviro var - try that next */
tmp = strdup(getenv("OMPI_PREFIX_ENV"));
fulldirpath = strdup(orte_os_path(false, tmp, sessions, NULL));
fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL));
if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */
return_code = OMPI_SUCCESS;
goto COMPLETE;
@ -218,7 +218,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid,
free(fulldirpath); fulldirpath = NULL;
} else if (NULL != getenv("TMPDIR")) {
tmp = strdup(getenv("TMPDIR"));
fulldirpath = strdup(orte_os_path(false, tmp, sessions, NULL));
fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL));
if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */
return_code = OMPI_SUCCESS;
goto COMPLETE;
@ -227,7 +227,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid,
free(fulldirpath); fulldirpath = NULL;
} else if (NULL != getenv("TMP")) {
tmp = strdup(getenv("TMP"));
fulldirpath = strdup(orte_os_path(false, tmp, sessions, NULL));
fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL));
if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */
return_code = OMPI_SUCCESS;
goto COMPLETE;
@ -236,7 +236,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid,
free(fulldirpath); fulldirpath = NULL;
} else {
tmp = strdup(OMPI_DEFAULT_TMPDIR);
fulldirpath = strdup(orte_os_path(false, tmp, sessions, NULL));
fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL));
if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */
return_code = OMPI_SUCCESS;
goto COMPLETE;
@ -364,7 +364,7 @@ orte_session_dir_finalize(orte_process_name_t *proc)
char *job, *job_session_dir, *vpid, *proc_session_dir;
/* need to setup the top_session_dir with the prefix */
tmp = strdup(orte_os_path(false,
tmp = strdup(opal_os_path(false,
orte_process_info.tmpdir_base,
orte_process_info.top_session_dir, NULL));
@ -495,7 +495,7 @@ orte_dir_empty(char *pathname)
(0 != strncmp(ep->d_name, "output-", strlen("output-"))) &&
(0 != strcmp(ep->d_name, "universe-setup.txt"))) {
filenm = orte_os_path(false, pathname, ep->d_name, NULL);
filenm = opal_os_path(false, pathname, ep->d_name, NULL);
/* make sure it's not a directory */
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
@ -536,7 +536,7 @@ orte_dir_empty(char *pathname)
(0 != strncmp(file_data.cFileName,"output-", strlen("output-"))) &&
(0 != strcmp(file_data.cFileName,"universe-setup.txt-"))) {
file_name = orte_os_path(false, pathname, file_data.cFileName, NULL);
file_name = opal_os_path(false, pathname, file_data.cFileName, NULL);
DeleteFile(file_name);
}

Просмотреть файл

@ -20,9 +20,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/test/support
check_PROGRAMS = \
ompi_numtostr \
opal_if \
orte_os_path \
opal_os_path \
orte_sys_info \
orte_os_create_dirpath \
opal_os_create_dirpath \
orte_session_dir \
opal_argv \
opal_basename \
@ -55,11 +55,11 @@ opal_basename_LDADD = \
$(top_builddir)/test/support/libsupport.a
opal_basename_DEPENDENCIES = $(opal_basename_LDADD)
orte_os_path_SOURCES = orte_os_path.c
orte_os_path_LDADD = \
opal_os_path_SOURCES = opal_os_path.c
opal_os_path_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.a
orte_os_path_DEPENDENCIES = $(orte_os_path_LDADD)
opal_os_path_DEPENDENCIES = $(opal_os_path_LDADD)
orte_sys_info_SOURCES = orte_sys_info.c
@ -68,11 +68,11 @@ orte_sys_info_LDADD = \
$(top_builddir)/test/support/libsupport.a
orte_sys_info_DEPENDENCIES = $(orte_sys_info_LDADD)
orte_os_create_dirpath_SOURCES = orte_os_create_dirpath.c
orte_os_create_dirpath_LDADD = \
opal_os_create_dirpath_SOURCES = opal_os_create_dirpath.c
opal_os_create_dirpath_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.a
orte_os_create_dirpath_DEPENDENCIES = $(orte_os_create_dirpath_LDADD)
opal_os_create_dirpath_DEPENDENCIES = $(opal_os_create_dirpath_LDADD)
orte_session_dir_SOURCES = orte_session_dir.c
orte_session_dir_LDADD = \

Просмотреть файл

@ -28,8 +28,8 @@
#include "include/constants.h"
#include "util/sys_info.h"
#include "util/os_path.h"
#include "util/os_create_dirpath.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"
#include "support.h"
static bool test1(void); /* trivial test */
@ -39,7 +39,7 @@ static bool test3(void); /* test making a directory tree */
int main(int argc, char* argv[])
{
test_init("orte_os_create_dirpath_t");
test_init("opal_os_create_dirpath_t");
orte_sys_info(); /* initialize system info */
@ -49,21 +49,21 @@ int main(int argc, char* argv[])
test_success();
}
else {
test_failure("orte_os_create_dirpath test1 failed");
test_failure("opal_os_create_dirpath test1 failed");
}
if (test2()) {
test_success();
}
else {
test_failure("orte_os_create_dirpath test2 failed");
test_failure("opal_os_create_dirpath test2 failed");
}
if (test3()) {
test_success();
}
else {
test_failure("orte_os_create_dirpath test3 failed");
test_failure("opal_os_create_dirpath test3 failed");
}
test_finalize();
@ -77,7 +77,7 @@ static bool test1(void)
/* Test trivial functionality. Program should return OMPI_ERROR when called with NULL path. */
if (OMPI_ERROR != orte_os_create_dirpath(NULL, S_IRWXU))
if (OMPI_ERROR != opal_os_create_dirpath(NULL, S_IRWXU))
return(false);
return true;
@ -93,20 +93,20 @@ static bool test2(void)
printf("test2 cannot be run\n");
return(false);
}
tmp = orte_os_path(true, "tmp", NULL);
tmp = opal_os_path(true, "tmp", NULL);
if (0 != mkdir(tmp, S_IRWXU)) {
printf("test2 could not be run - directory could not be made\n");
return(false);
}
if (OMPI_ERROR == orte_os_create_dirpath(tmp, S_IRWXU)) {
if (OMPI_ERROR == opal_os_create_dirpath(tmp, S_IRWXU)) {
rmdir(tmp);
return(false);
}
chmod(tmp, S_IRUSR);
if (OMPI_ERROR == orte_os_create_dirpath(tmp, S_IRWXU)) {
if (OMPI_ERROR == opal_os_create_dirpath(tmp, S_IRWXU)) {
rmdir(tmp);
return(false);
}
@ -133,15 +133,15 @@ static bool test3(void)
return(false);
}
out = orte_os_path(true, a[0], a[1], a[2], NULL);
if (OMPI_ERROR == orte_os_create_dirpath(out, S_IRWXU)) {
out = orte_os_path(true, a[0], a[1], a[2], NULL);
out = opal_os_path(true, a[0], a[1], a[2], NULL);
if (OMPI_ERROR == opal_os_create_dirpath(out, S_IRWXU)) {
out = opal_os_path(true, a[0], a[1], a[2], NULL);
if (0 == stat(out, &buf))
rmdir(out);
out = orte_os_path(true, a[0], a[1], NULL);
out = opal_os_path(true, a[0], a[1], NULL);
if (0 == stat(out, &buf))
rmdir(out);
out = orte_os_path(true, a[0], NULL);
out = opal_os_path(true, a[0], NULL);
if (0 == stat(out, &buf))
rmdir(out);
return(false);

Просмотреть файл

@ -23,7 +23,7 @@
#endif
#include "util/sys_info.h"
#include "util/os_path.h"
#include "opal/util/os_path.h"
#include "support.h"
static bool test1(void); /* trivial answer test */
@ -36,7 +36,7 @@ static bool test5(void); /* very long path name test */
int main(int argc, char* argv[])
{
test_init("orte_os_path_t");
test_init("opal_os_path_t");
/* setup the system info structure */
orte_sys_info();
@ -44,35 +44,35 @@ int main(int argc, char* argv[])
test_success();
}
else {
test_failure("orte_os_path_t test1 failed");
test_failure("opal_os_path_t test1 failed");
}
if (test2()) {
test_success();
}
else {
test_failure("orte_os_path_t test2 failed");
test_failure("opal_os_path_t test2 failed");
}
if (test3()) {
test_success();
}
else {
test_failure("orte_os_path_t test3 failed");
test_failure("opal_os_path_t test3 failed");
}
if (test4()) {
test_success();
}
else {
test_failure("orte_os_path_t test4 failed");
test_failure("opal_os_path_t test4 failed");
}
if (test5()) {
test_success();
}
else {
test_failure("orte_os_path_t test5 failed");
test_failure("opal_os_path_t test5 failed");
}
test_finalize();
@ -86,13 +86,13 @@ static bool test1(void)
/* Test trivial functionality. Program should return ".[separator]" when called in relative
* mode, and the separator character when called in absolute mode. */
if (NULL != (out = orte_os_path(true,NULL))) {
if (NULL != (out = opal_os_path(true,NULL))) {
answer = strdup(".");
strcat(answer, orte_system_info.path_sep);
if (0 != strcmp(answer, out))
return(false);
}
if (NULL != (out = orte_os_path(false,NULL))) {
if (NULL != (out = opal_os_path(false,NULL))) {
if (0 != strcmp(orte_system_info.path_sep, out))
return(false);
}
@ -115,17 +115,17 @@ static bool test2(void)
out = strdup(".");
out = strcat(out, orte_system_info.path_sep);
out = strcat(out, a[0]);
if (0 != strcmp(out, orte_os_path(true, a[0], NULL)))
if (0 != strcmp(out, opal_os_path(true, a[0], NULL)))
return(false);
out = strcat(out, orte_system_info.path_sep);
out = strcat(out, a[1]);
if (0 != strcmp(out, orte_os_path(true, a[0], a[1], NULL)))
if (0 != strcmp(out, opal_os_path(true, a[0], a[1], NULL)))
return(false);
out = strcat(out, orte_system_info.path_sep);
out = strcat(out, a[2]);
if (0 != strcmp(out, orte_os_path(true, a[0], a[1], a[2], NULL)))
if (0 != strcmp(out, opal_os_path(true, a[0], a[1], a[2], NULL)))
return(false);
return true;
@ -145,17 +145,17 @@ static bool test3(void)
/* Same as prior test, only with absolute path name */
out = strdup(orte_system_info.path_sep);
out = strcat(out, a[0]);
if (0 != strcmp(out, orte_os_path(false, a[0], NULL)))
if (0 != strcmp(out, opal_os_path(false, a[0], NULL)))
return(false);
out = strcat(out, orte_system_info.path_sep);
out = strcat(out, a[1]);
if (0 != strcmp(out, orte_os_path(false, a[0], a[1], NULL)))
if (0 != strcmp(out, opal_os_path(false, a[0], a[1], NULL)))
return(false);
out = strcat(out, orte_system_info.path_sep);
out = strcat(out, a[2]);
if (0 != strcmp(out, orte_os_path(false, a[0], a[1], a[2], NULL)))
if (0 != strcmp(out, opal_os_path(false, a[0], a[1], a[2], NULL)))
return(false);
return true;
@ -174,7 +174,7 @@ static bool test4(void)
for (i=0; i< MAXPATHLEN+5; i++) {
a[i] = 'a';
}
if (NULL != orte_os_path(false, a, NULL)) {
if (NULL != opal_os_path(false, a, NULL)) {
return(false);
}
return (true);

Просмотреть файл

@ -33,8 +33,8 @@
#include "mca/ns/ns_types.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "util/os_path.h"
#include "util/os_create_dirpath.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"
#include "util/session_dir.h"
#include "util/proc_info.h"
#include "runtime/runtime.h"
@ -159,7 +159,7 @@ static bool test1(void)
clear_proc_info();
prefix = orte_os_path(false, "tmp", NULL);
prefix = opal_os_path(false, "tmp", NULL);
if (OMPI_ERROR == orte_session_dir(true, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
fprintf(test_out, "test1 - couldn't create specified path\n");
free(prefix);
@ -303,17 +303,17 @@ static bool test7(void)
/* create some files */
filenm[0] = orte_os_path(false, orte_process_info.proc_session_dir, "dum1", NULL);
filenm[0] = opal_os_path(false, orte_process_info.proc_session_dir, "dum1", NULL);
fp = fopen(filenm[0], "w");
fprintf(fp, "ss");
fclose(fp);
filenm[1] = orte_os_path(false, orte_process_info.job_session_dir, "dum2", NULL);
filenm[1] = opal_os_path(false, orte_process_info.job_session_dir, "dum2", NULL);
fp = fopen(filenm[1], "w");
fprintf(fp, "ss");
fclose(fp);
filenm[2] = orte_os_path(false, orte_process_info.universe_session_dir, "dum3", NULL);
filenm[2] = opal_os_path(false, orte_process_info.universe_session_dir, "dum3", NULL);
fp = fopen(filenm[2], "w");
fprintf(fp, "ss");
fclose(fp);
@ -348,17 +348,17 @@ static bool test8(void)
/* create some files */
filenm[0] = orte_os_path(false, orte_process_info.proc_session_dir, "dum1", NULL);
filenm[0] = opal_os_path(false, orte_process_info.proc_session_dir, "dum1", NULL);
fp = fopen(filenm[0], "w");
fprintf(fp, "ss");
fclose(fp);
filenm[1] = orte_os_path(false, orte_process_info.job_session_dir, "dum2", NULL);
filenm[1] = opal_os_path(false, orte_process_info.job_session_dir, "dum2", NULL);
fp = fopen(filenm[1], "w");
fprintf(fp, "ss");
fclose(fp);
filenm[2] = orte_os_path(false, orte_process_info.universe_session_dir, "dum3", NULL);
filenm[2] = opal_os_path(false, orte_process_info.universe_session_dir, "dum3", NULL);
fp = fopen(filenm[2], "w");
fprintf(fp, "ss");
fclose(fp);