buildtest.cli.compilers

Module Contents

Classes

BuildtestCompilers

param settings_file:

Specify an alternate settings file to use when finding compilers

Functions

compiler_cmd(args, configuration)

remove_compilers(configuration, names)

This method will remove compilers from buildtest configuration file and update the configuration file. A list

list_compilers(configuration[, print_yaml, print_json])

This method will print available compilers found in configuration file which

compiler_test(configuration[, compiler_names])

This method implements buildtest config compilers test which tests

compiler_find(configuration[, modulepath, detailed, ...])

This method implements buildtest config compilers find which detects

buildtest.cli.compilers.compiler_cmd(args, configuration)[source]
buildtest.cli.compilers.remove_compilers(configuration, names)[source]

This method will remove compilers from buildtest configuration file and update the configuration file. A list of compiler names are specified, if compiler is found it will be removed.

Parameters:
buildtest.cli.compilers.list_compilers(configuration, print_yaml=None, print_json=None)[source]
This method will print available compilers found in configuration file which

can be retrieved by running buildtest config compilers list

Parameters:
  • configuration (buildtest.config.SiteConfiguration) – An instance of SiteConfiguration class

  • print_yaml (bool, optional) – Print output in YAML format

  • print_json (bool, optional) – Print output in JSON format

buildtest.cli.compilers.compiler_test(configuration, compiler_names=None)[source]

This method implements buildtest config compilers test which tests the compilers with the corresponding modules if set. This command iterates over all compilers and perform the module load test and show an output of each compiler.

Parameters:
buildtest.cli.compilers.compiler_find(configuration, modulepath=None, detailed=None, update=None, filepath=None)[source]

This method implements buildtest config compilers find which detects new compilers based on module names defined in configuration. If system has Lmod we use Lmodule API to detect the compilers. For environment-modules we search for all modules in current $MODULEPATH.

Parameters:
  • configuration (buildtest.config.SiteConfiguration) – An instance of SiteConfiguration class

  • modulepath (List, optional) – A list of directories to search for modules via MODULEPATH to detect compilers

  • detailed (bool, optional) – Flag for printing a detailed report.

  • update (bool, optional) – Flag for updating configuration file with new compilers

  • filepath (str, optional) – An option to specify an alternative filepath where configuration file will be written

class buildtest.cli.compilers.BuildtestCompilers(configuration, settings_file=None, detailed=False, modulepath=None)[source]
Parameters:
  • settings_file – Specify an alternate settings file to use when finding compilers

  • settings_file – str, optional

  • compilers (dict) – compiler section from buildtest configuration.

compiler_table
find_compilers()[source]

This method returns compiler modules discovered depending on your module system. If you have Lmod system we use spider utility to detect modules, this is leveraging Lmodule API. If you have environment-modules we parse output of module av -t.

Returns:

return a list of compiler modules detected based on module key name.

Return type:

dict

_validate_modules(module_dict)[source]

This method will validate modules by running module load test for all discovered modules specified in parameter discovered_modules. This method returns a list of modules that were valid, if all tests pass we return the same list. A module test pass if we get a returncode 0.

_update_compiler_section()[source]

This method will update the compiler section by adding new compilers if found

Returns:

Updated compiler section for buildtest configuration

Return type:

dict

print_json()[source]

Prints compiler section in JSON, this implements buildtest config compilers --json

print_yaml()[source]

Prints compiler section in YAML, this implements buildtest config compilers --yaml

names()[source]

Return a list of compiler names defined in buildtest configuration

print_compilers()[source]

This method implements buildtest config compilers which prints all compilers from buildtest configuration