OpenMPI
0.1.1
|
Find and/or create Open MPI session directory. More...
Go to the source code of this file.
Functions | |
BEGIN_C_DECLS ORTE_DECLSPEC int | orte_session_dir (bool create, char *prefix, char *hostid, char *batchid, orte_process_name_t *proc) |
ORTE_DECLSPEC int | orte_session_dir_get_name (char **fulldirpath, char **prfx, char **frontend, char *hostid, char *batchid, orte_process_name_t *proc) |
ORTE_DECLSPEC int | orte_session_dir_finalize (orte_process_name_t *proc) |
The orte_session_dir_finalize() function performs a cleanup of the session directory tree. More... | |
ORTE_DECLSPEC int | orte_session_dir_cleanup (orte_jobid_t jobid) |
The orte_session_dir_cleanup() function performs a cleanup of the session directory tree when a job is aborted. More... | |
Find and/or create Open MPI session directory.
The orte_session_dir() function searches for a temporary directory that is used by the Open MPI system for storing system-critical information. For a given system and user, the function attempts to find (or create, if not found and create is requested) a directory that will be used to independently house information for multiple universes, as the user creates them. Thus, the function pursues a directory tree of the form:
create
is true
, the directory will be created and theBEGIN_C_DECLS ORTE_DECLSPEC int orte_session_dir | ( | bool | create, |
char * | prefix, | ||
char * | hostid, | ||
char * | batchid, | ||
orte_process_name_t * | proc | ||
) |
create | A boolean variable that indicates whether or not to create the specified directory. If set to "false", the function only checks to see if an existing directory can be found. This is typically used to locate an already existing universe for reconnection purposes. If set to "true", then the function creates the directory, if possible. |
prefix | A string variable indicating where the user stipulated the directory should be found or placed. A value of "NULL" indicates that the user specified no location - hence, the function explores a range of "standard" locations. |
hostid | Name of the host on which the session directory is being built. Used to build the name of the "openmpi-sessions-[user]@[host]:[batch]" branch of the directory tree. NULL indicates that the nodename found in orte_process_info is to be used. |
batchid | Batch job name, used in batch scheduling systems. NULL indicates that the default of "0" is to be used. |
proc | Pointer to a process name for which the session dir name is desired |
ORTE_SUCCESS | The directory was found and/or created with the proper permissions. |
OMPI_ERROR | The directory cannot be found (if create is "false") or created (if create is "true"). |
References orte_proc_info_t::job_session_dir, orte_process_name_t::jobid, opal_dirname(), opal_os_dirpath_access(), opal_output(), orte_process_info, orte_proc_info_t::proc_session_dir, orte_proc_info_t::tmpdir_base, orte_proc_info_t::top_session_dir, and orte_process_name_t::vpid.
Referenced by orte_ess_base_orted_setup().
ORTE_DECLSPEC int orte_session_dir_cleanup | ( | orte_jobid_t | jobid | ) |
The orte_session_dir_cleanup() function performs a cleanup of the session directory tree when a job is aborted.
It cleans up all process directories for a given job and then backs up the tree.
jobid |
OMPI_SUCCESS | If the directory tree is properly cleaned up. |
OMPI_ERROR | If something prevents the tree from being properly cleaned up. |
References opal_os_dirpath_destroy(), opal_os_dirpath_is_empty(), opal_os_path(), opal_output(), ORTE_PROC_MY_NAME, orte_process_info, orte_proc_info_t::tmpdir_base, and orte_proc_info_t::top_session_dir.
ORTE_DECLSPEC int orte_session_dir_finalize | ( | orte_process_name_t * | proc | ) |
The orte_session_dir_finalize() function performs a cleanup of the session directory tree.
It first removes the session directory for the calling process. It then checks to see if the job-level session directory is now empty - if so, it removes that level as well. Finally, it checks to see if the universe-level session directory is now empty - if so, it also removes that level. This three-part "last-one-out" procedure ensures that the directory tree is properly removed if all processes and applications within a universe have completed.
None |
ORTE_SUCCESS | If the directory tree is properly cleaned up. |
OMPI_ERROR | If something prevents the tree from being properly cleaned up. |
References orte_process_name_t::jobid, opal_os_dirpath_destroy(), opal_os_dirpath_is_empty(), opal_os_path(), opal_output(), orte_process_info, orte_proc_info_t::tmpdir_base, orte_proc_info_t::top_session_dir, and orte_process_name_t::vpid.