Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
FnameTemplate Class Reference

#include <FnameTemplate.h>

Public Member Functions

 FnameTemplate (bool separate_cycle_dirs, std::string outdir)
 
bool separate_cycle_dirs () const noexcept
 
std::string nominal_output_dir_path () const noexcept
 
std::string effective_output_dir_path (int nfile) const noexcept
 
std::string format_fname (int nfile, std::string_view pre_extension_suffix, std::optional< std::string_view > post_extension_suffix=std::nullopt) const noexcept
 
std::string format_fname (int nfile, int file_proc_id, std::string_view pre_extension_suffix, std::optional< std::string_view > post_extension_suffix=std::nullopt) const noexcept
 

Static Public Member Functions

static FnameTemplate from_pmap (ParameterMap &pmap)
 

Detailed Description

Lightweight object designed to centralize the file-naming logic (& any associated configuration).

Cholla pathnames traditionally followed the following template: "{outdir}{nfile}{pre_extension_suffix}{extension}.{proc_id}" where each curly-braced token represents a different variable. In detail:

Instances can be configured to support the following newer file-naming template "{outdir}/{nfile}/{nfile}{pre_extension_suffix}{extension}.{proc_id}" where the the significance of each curly-braced token is largely unchanged. There are 2 things worth noting:

Note
This could probably pull double-duty and get reused with infile.

Member Function Documentation

◆ effective_output_dir_path()

std::string FnameTemplate::effective_output_dir_path ( int  nfile) const
noexcept

Returns the effective output-directory used for outputs at a given simulation-cycle

◆ format_fname()

std::string FnameTemplate::format_fname ( int  nfile,
std::string_view  pre_extension_suffix,
std::optional< std::string_view >  post_extension_suffix = std::nullopt 
) const
noexcept

format the file path

◆ nominal_output_dir_path()

std::string FnameTemplate::nominal_output_dir_path ( ) const
inlinenoexcept

Returns the nominal output-directory (this value is unaffected by separate_cycle_dirs())

◆ separate_cycle_dirs()

bool FnameTemplate::separate_cycle_dirs ( ) const
inlinenoexcept

Specifies whether separate cycles are written to separate directories


The documentation for this class was generated from the following files: