LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::file Namespace Reference

Functions

template<typename... PathNameType>
std::string join_path (PathNameType &&... paths)
 Concatenate all paths, injecting path separators between each argument. More...
 
std::string extract_parent_directory (const std::string &path)
 Wrapper around dirname. More...
 
std::string extract_base_name (const std::string &path)
 Wrapper around basename. More...
 
bool file_exists (const std::string &path)
 Check if file exists. More...
 
bool directory_exists (const std::string &path)
 Check if directory exists. More...
 
void make_directory (const std::string &path)
 Create directory if needed. More...
 
void remove_multiple_slashes (std::string &str)
 
void trainer_master_make_directory (const std::string &path, lbann_comm *comm)
 Trainer master creates directory if needed. More...
 

Function Documentation

◆ directory_exists()

bool lbann::file::directory_exists ( const std::string &  path)

Check if directory exists.

Here is the caller graph for this function:

◆ extract_base_name()

std::string lbann::file::extract_base_name ( const std::string &  path)

Wrapper around basename.

Deletes any prefix up to the last '/' (ignoring trailing slashes).

Here is the caller graph for this function:

◆ extract_parent_directory()

std::string lbann::file::extract_parent_directory ( const std::string &  path)

Wrapper around dirname.

Deletes any suffix beginning with the last '/' (ignoring trailing slashes).

Here is the caller graph for this function:

◆ file_exists()

bool lbann::file::file_exists ( const std::string &  path)

Check if file exists.

Here is the caller graph for this function:

◆ join_path()

template<typename... PathNameType>
std::string lbann::file::join_path ( PathNameType &&...  paths)

Concatenate all paths, injecting path separators between each argument.

Todo:
Assert every

Definition at line 147 of file file_utils.hpp.

Here is the call graph for this function:

◆ make_directory()

void lbann::file::make_directory ( const std::string &  path)

Create directory if needed.

Does nothing if directory already exists. Parent directories are created recursively if needed. This is thread-safe (provided mkdir is thread-safe).

Here is the caller graph for this function:

◆ remove_multiple_slashes()

void lbann::file::remove_multiple_slashes ( std::string &  str)
Here is the caller graph for this function:

◆ trainer_master_make_directory()

void lbann::file::trainer_master_make_directory ( const std::string &  path,
lbann_comm comm 
)

Trainer master creates directory if needed.

Coordinate efforts to allow the trainer master to make a directory if needed and synchronizes all other trainer ranks to ensure they see a consistent state of the file system.