dgamore.config_parser#

YAML configuration parsing. ConfigParser reads the run’s YAML config (rank 0), broadcasts it to all MPI ranks, and populates the global dgamore.config singletons section by section, falling back to the *Config defaults for any missing key/section. The config file location is taken from the -p/-c command-line arguments.

class dgamore.config_parser.ConfigParser[source]#

Bases: object

Parses the config file and builds the global dgamore.config singletons (box, lattice, dmft, …). The configuration is then broadcast to all processes. The config file location can be specified with the path and/or name arguments when executing the main Python file.

parse_config(comm: mpi4py.MPI.Comm = None, path: str = './', name: str = 'dga_config.yaml')[source]#

Parses the config file on rank 0, broadcasts it to all ranks, and populates the global config singletons. The -c/-p command-line arguments override the name/path defaults.

Parameters:
  • comm (mpi4py.MPI.Comm) – The MPI communicator (rank 0 reads the file and broadcasts it).

  • path (str) – Default directory of the config file.

  • name (str) – Default config file name.

Returns:

self (for chaining).

save_config_file(path: str = './', name: str = 'dga_config.yaml') None[source]#

Dumps the loaded config back to a YAML file (typically into the output folder to record the used parameters).

Parameters:
  • path (str) – Directory to write the config file to.

  • name (str) – File name to write.

Returns:

None.

Return type:

None