Hi Tim,

OK, I didn't take into account that the toolchain support for OpenMPI (implemented in easybuild/toolchains/mpi/openmpi.py, which is where the crash is occuring) may be depending on MPI_MODULE_NAME being non-empty...

Try including this in your toolchain definition as well (indented properly to be part of the PicGompi class):

    def _set_mpi_compiler_variables(self):
        """Define MPI wrapper commands."""

# version-dependent, see http://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0 # assumption here is that OpenMPI version being used is recent enough (>= 1.7) to provide mpifort
        self.MPI_COMPILER_MPIF77 = 'mpifort'
        self.MPI_COMPILER_MPIF90 = 'mpifort'
        self.MPI_COMPILER_MPIFC = 'mpifort'

# this needs to be done first, otherwise e.g., CC is set to MPICC if the usempi toolchain option is enabled
        for var, _ in COMPILER_VARIABLES:
self.variables.nappend('OMPI_%s' % var, str(self.variables[var].get_first()), var_class=CommandFlagList)

        super(PicGompi, self)._set_mpi_compiler_variables()


This will effectively override the implementation of _set_mpi_compiler_variables in openmpi.py, which should hopefully solve your problem... Do note that I'm assuming that the OpenMPI version provided by your external module is sufficiently recent...

The underlying issue is indeed that get_software_version is not taking into account that the module could be an external module. Can you try and reproduce the problem you had with using your external module name in MPI_MODULE_NAME?
I'll open an issue to try and get this fixed then...


regards,

Kenneth


On 08/09/16 02:27, Tim Slauson wrote:
Hi Kenneth,

Thanks for the MPI_MODULE_NAME suggestion. I had earlier tried setting that to my external module name, but ran into different errors and just gave up.

When I set MPI_MODULE_NAME to an empty list, the OpenMPI toolchain module hits an IndexError when trying to retrieve a software version (see traceback below). Since I'm specifying that information in an external module metadata file, shouldn't the software version be taken from there?

Thanks,
Tim


ERROR: Traceback (most recent call last):
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/main.py", line 114, in build_and_install_software (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env) File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/framework/easyblock.py", line 2363, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/framework/easyblock.py", line 2279, in run_all_steps
    self.run_step(step_name, step_methods)
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/framework/easyblock.py", line 2158, in run_step
    step_method(self)()
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/framework/easyblock.py", line 1554, in prepare_step self.toolchain.prepare(self.cf <http://self.cf>g['onlytcmod'], silent=self.silent) File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/tools/toolchain/toolchain.py", line 608, in prepare
    self.set_variables()
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/tools/toolchain/compiler.py", line 154, in set_variables
    super(Compiler, self).set_variables()
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/tools/toolchain/mpi.py", line 94, in set_variables
    self._set_mpi_compiler_variables()
File "/import/usrlocal/easybuild/2.8.2/software/EasyBuild/2.8.2/lib/python2.6/site-packages/easybuild_framework-2.8.2-py2.6.egg/easybuild/toolchains/mpi/openmpi.py", line 62, in _set_mpi_compiler_variables
    ompi_ver = self.get_software_version(self.MPI_MODULE_NAME)[0]
IndexError: list index out of range


On Wed, Sep 7, 2016 at 3:32 AM, Kenneth Hoste <[email protected] <mailto:[email protected]>> wrote:

    Hi Tim,

    Welcome to the wonderful world of EasyBuild!


    On 07/09/16 01:29, Tim Slauson wrote:

        Hello EasyBuilders,

        I'm trying out EasyBuild for the first time (version 2.8.2),
        and am having trouble hooking in the vendor-provided MPI
        modules on one of our clusters. The modules all follow the
        same naming convention of name/compiler/ver (e.g.
        openmpi/gnu/1.10.2, mvapich2-psm/intel/2.1, ...).  After
        reading about EXTERNAL_MODULE, I adapted the gompi-2016.06.eb
        toolchain easyconfig:

        3c3
        < name = 'gompi'
        ---
        > name = 'pic-gompi'
        17c17
        <     ('OpenMPI', '1.10.3', '', ('GCC', gccver)),
        ---
        >     ('openmpi/gnu/1.10.2', EXTERNAL_MODULE),


        And wrote external module metadata:

        [openmpi/gnu/1.10.2]
        name = OpenMPI
        version = 1.10.2
        prefix = MPI_HOME


        And defined a new toolchain:

        from easybuild.toolchains.gompi import Gompi

        class PicGompi(Gompi):
            """PIC compiler toolchain with GNU compilers and OpenMPI"""
            NAME = 'pic-gompi'


        This allows me to build a toolchain.  But when I run this:

        eb FFTW-3.3.4-gompi-2016.06.eb --try-toolchain=pic-gompi,2016.06

        I get this error:

        ERROR: Build of
        /tmp/eb-HkZNza/tweaked_easyconfigs/FFTW-3.3.4-pic-gompi-2016.06.eb
        failed (err: "build failed (first 300 chars): List of
        toolchain dependency modules and toolchain definition do not
        match (found ['GCC/5.4.0-2.26', 'openmpi/gnu/1.10.2'] vs
        expected set(['GCC', 'OpenMPI']))")

        I get similar errors when repeating this process for the other
        vendor-provided libraries.  Can somebody please point me in
        the right direction?


    You're hitting this because EasyBuild verifies the module for the
    toolchain with the definition of the toolchain.
    This is done using module names, see for example
    
https://github.com/hpcugent/easybuild-framework/blob/master/easybuild/toolchains/mpi/openmpi.py#L44
    
<https://github.com/hpcugent/easybuild-framework/blob/master/easybuild/toolchains/mpi/openmpi.py#L44>
    .

    You should be able to fix your problem by including this in your
    pic-gompi toolchain definition (i.e. reset it to the default):

        MPI_MODULE_NAME = []

    This should only affect the toolchain definition verification
    mechanism, nothing else.


    regards,

    Kenneth




--
Tim Slauson
GI/RCS
University of Alaska Fairbanks

Reply via email to