def default_mpi_compilers(): """Get the default installed MPI compilers for the host. This is most likely the installation of the host's preferred MPI compilers, (see :any:`preferred_mpi_compilers`) but if those compilers are not installed then it will be an installation of any known compiler family. May probe environment variables and file systems in cases where the arch isn't immediately known to Python. These tests may be expensive so the detected value is cached to improve performance. Raises: ConfigurationError: No recognized compilers are installed. Returns: InstalledCompilerFamily: The default compilers. """ try: inst = default_mpi_compilers.inst except AttributeError: from tau.cf.compiler.mpi import MpiCompilerFamily LOGGER.debug("Detecting default MPI compilers") for family in MpiCompilerFamily.all(): try: inst = InstalledCompilerFamily(family) except ConfigurationError as err: LOGGER.debug(err) else: LOGGER.debug("Found a %s MPI compiler installation", family.name) default_mpi_compilers.inst = inst break else: raise ConfigurationError("No recognized compilers installed.") return inst
def construct_parser(self): parser = super(TargetCreateCommand, self).construct_parser() group = parser.add_argument_group('host arguments') group.add_argument('--host-compilers', help="select all host compilers automatically from the given family", metavar='<family>', dest='host_family', default=host.preferred_compilers().name, choices=CompilerFamily.family_names()) group = parser.add_argument_group('Message Passing Interface (MPI) arguments') group.add_argument('--mpi-compilers', help="select all MPI compilers automatically from the given family", metavar='<family>', dest='mpi_family', default=host.preferred_mpi_compilers().name, choices=MpiCompilerFamily.family_names()) return parser