1
1

Shorten the session directory name as some OS's are now providing unusually long temp directory names, causing us to overflow the sockaddr field

Этот коммит содержится в:
Ralph Castain 2016-07-05 14:58:49 -07:00
родитель b7122963e1
Коммит ee56d9dc1a
22 изменённых файлов: 36 добавлений и 55 удалений

0
ompi/mca/mtl/psm2/mtl_psm2_types.h Исполняемый файл → Обычный файл
Просмотреть файл

0
ompi/mpi/fortran/use-mpi-f08-desc/ISO_Fortran_binding.h Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/ext20/pmix_ext20.c Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/ext20/pmix_ext20_server_north.c Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/pmix2x/pmix/src/server/pmix_server_listener.c Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/pmix2x/pmix/src/tool/pmix_tool.c Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/pmix2x/pmix2x.c Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/pmix2x/pmix2x_server_north.c Исполняемый файл → Обычный файл
Просмотреть файл

0
opal/mca/pmix/pmix_server.h Исполняемый файл → Обычный файл
Просмотреть файл

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

@ -138,7 +138,7 @@ int orte_ess_base_app_setup(bool db_restrict_local)
orte_process_info.nodename));
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_process_info.nodename, NULL,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
ORTE_ERROR_LOG(ret);
error = "orte_session_dir";

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

@ -239,23 +239,12 @@ int orte_ess_base_orted_setup(char **hosts)
*/
if (ORTE_SUCCESS != (ret = orte_session_dir(false,
orte_process_info.tmpdir_base,
orte_process_info.nodename, NULL,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
ORTE_ERROR_LOG(ret);
error = "orte_session_dir define";
goto error;
}
/* if we have multiple daemons/node, then add our pid to the name */
if (NULL != (param = getenv("OMPI_MCA_ras_base_multiplier")) &&
1 < strtol(param, NULL, 10)) {
if (0 > asprintf(&param, "%s.%lu", orte_process_info.top_session_dir, (unsigned long)orte_process_info.pid)) {
ret = ORTE_ERR_OUT_OF_RESOURCE;
error = "create top session dir";
goto error;
}
free(orte_process_info.top_session_dir);
orte_process_info.top_session_dir = param;
}
/* clear the session directory just in case there are
* stale directories laying around
*/
@ -263,7 +252,7 @@ int orte_ess_base_orted_setup(char **hosts)
/* now actually create the directory tree */
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_process_info.nodename, NULL,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
ORTE_ERROR_LOG(ret);
error = "orte_session_dir";

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

@ -148,7 +148,7 @@ int orte_ess_base_tool_setup(void)
if (ORTE_SUCCESS != (ret = orte_session_dir_get_name(NULL,
&orte_process_info.tmpdir_base,
&orte_process_info.top_session_dir,
orte_process_info.nodename, NULL, NULL))) {
orte_process_info.nodename, NULL))) {
ORTE_ERROR_LOG(ret);
error = "define session dir names";
goto error;

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

@ -296,7 +296,7 @@ static int rte_init(void)
*/
if (ORTE_SUCCESS != (ret = orte_session_dir(false,
orte_process_info.tmpdir_base,
orte_process_info.nodename, NULL,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
error = "orte_session_dir define";
goto error;
@ -309,7 +309,7 @@ static int rte_init(void)
/* now actually create the directory tree */
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_process_info.nodename, NULL,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
error = "orte_session_dir";
goto error;

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

@ -739,7 +739,7 @@ static int raw_link_local_files(orte_job_t *jdata,
path = NULL;
rc = orte_session_dir_get_name(&path, &prefix, NULL,
orte_process_info.nodename,
NULL, &proc->name);
&proc->name);
/* create it, if it doesn't already exist */
if (OPAL_SUCCESS != (rc = opal_os_dirpath_create(path, S_IRWXU))) {
ORTE_ERROR_LOG(rc);

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

@ -1106,7 +1106,7 @@ static int setup_child(orte_job_t *jdata,
param = NULL;
if (ORTE_SUCCESS != (rc = orte_session_dir_get_name(&param, &value, NULL,
orte_process_info.nodename,
NULL, &child->name))) {
&child->name))) {
ORTE_ERROR_LOG(rc);
if (NULL != value) {
free(value);

0
orte/orted/orted_submit.c Исполняемый файл → Обычный файл
Просмотреть файл

0
orte/orted/pmix/pmix_server.c Исполняемый файл → Обычный файл
Просмотреть файл

0
orte/orted/pmix/pmix_server_gen.c Исполняемый файл → Обычный файл
Просмотреть файл

0
orte/orted/pmix/pmix_server_internal.h Исполняемый файл → Обычный файл
Просмотреть файл

0
orte/test/system/pmixtool.c Исполняемый файл → Обычный файл
Просмотреть файл

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

@ -113,19 +113,18 @@ static int orte_create_dir(char *directory)
}
/*
* Construct the fullpath to the session directory
* Construct the fullpath to the session directory - it
* will consist of "ompi.<hostname>.<pid>"
*/
int
orte_session_dir_get_name(char **fulldirpath,
char **return_prefix, /* This will come back as the valid tmp dir */
char **return_frontend,
char *hostid,
char *batchid,
orte_process_name_t *proc) {
char *hostname = NULL,
*batchname = NULL,
*sessions = NULL,
*user = NULL,
*prefix = NULL,
*frontend = NULL,
*jobfam = NULL,
@ -134,15 +133,10 @@ orte_session_dir_get_name(char **fulldirpath,
bool prefix_provided = false;
int exit_status = ORTE_SUCCESS;
size_t len;
int uid;
/* Ensure that system info is set */
orte_proc_info();
/* get the name of the user */
uid = getuid();
asprintf(&user, "%d", uid);
/*
* set the 'hostname'
*/
@ -160,24 +154,12 @@ orte_session_dir_get_name(char **fulldirpath,
}
}
/*
* set the 'batchid'
*/
if (NULL != batchid)
batchname = strdup(batchid);
else
batchname = strdup("0");
/*
* get the front part of the session directory
* Will look something like:
* openmpi-sessions-USERNAME@HOSTNAME_BATCHID
*/
/* construct the frontend of the session directory*/
if (NULL != orte_process_info.top_session_dir) {
frontend = strdup(orte_process_info.top_session_dir);
}
else { /* If not set then construct it */
if (0 > asprintf(&frontend, "openmpi-sessions-%s@%s_%s", user, hostname, batchname)) {
if (0 > asprintf(&frontend, "ompi.%s.%lu", hostname, (unsigned long)orte_process_info.pid)) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
exit_status = ORTE_ERR_OUT_OF_RESOURCE;
goto cleanup;
@ -325,19 +307,30 @@ orte_session_dir_get_name(char **fulldirpath,
}
cleanup:
if(NULL != hostname)
if(NULL != hostname) {
free(hostname);
if(NULL != batchname)
}
if(NULL != batchname) {
free(batchname);
if(NULL != sessions)
}
if(NULL != sessions) {
free(sessions);
if(NULL != user)
free(user);
if (NULL != prefix) free(prefix);
if (NULL != frontend) free(frontend);
if (NULL != jobfam) free(jobfam);
if (NULL != job) free(job);
if (NULL != vpidstr) free(vpidstr);
}
if (NULL != prefix) {
free(prefix);
}
if (NULL != frontend) {
free(frontend);
}
if (NULL != jobfam) {
free(jobfam);
}
if (NULL != job) {
free(job);
}
if (NULL != vpidstr) {
free(vpidstr);
}
return exit_status;
}
@ -347,7 +340,7 @@ orte_session_dir_get_name(char **fulldirpath,
*/
int orte_session_dir(bool create,
char *prefix, char *hostid,
char *batchid, orte_process_name_t *proc)
orte_process_name_t *proc)
{
char *fulldirpath = NULL,
*frontend = NULL,
@ -367,7 +360,7 @@ int orte_session_dir(bool create,
&local_prefix,
&frontend,
hostid,
batchid, proc))) {
proc))) {
if (ORTE_ERR_FATAL == rc) {
/* this indicates we should abort quietly */
rc = ORTE_ERR_SILENT;

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

@ -121,7 +121,7 @@ BEGIN_C_DECLS
* "false") or created (if create is "true").
*/
ORTE_DECLSPEC int orte_session_dir(bool create, char *prefix, char *hostid,
char *batchid, orte_process_name_t *proc);
orte_process_name_t *proc);
/*
* Construct the session directory name from the input parameters.
@ -131,7 +131,6 @@ ORTE_DECLSPEC int orte_session_dir_get_name(char **fulldirpath,
char **prfx,
char **frontend,
char *hostid,
char *batchid,
orte_process_name_t *proc);
/** The orte_session_dir_finalize() function performs a cleanup of the