Skip to content

Add compilers paths for dependents of intel-parallel-studio#2980

Closed
DaanVanVugt wants to merge 2 commits intospack:developfrom
DaanVanVugt:feature/intel-parallel-studio-mpi
Closed

Add compilers paths for dependents of intel-parallel-studio#2980
DaanVanVugt wants to merge 2 commits intospack:developfrom
DaanVanVugt:feature/intel-parallel-studio-mpi

Conversation

@DaanVanVugt
Copy link
Copy Markdown

@DaanVanVugt DaanVanVugt commented Feb 1, 2017

Fixes #2978

Copy link
Copy Markdown
Member

@davydden davydden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@zzzoom
Copy link
Copy Markdown
Contributor

zzzoom commented Feb 1, 2017

Is this just for Intel MPI or the whole Intel toolchain?
mpi{icc,icpc,ifort} will always run intel compilers, but if you want to use Intel MPI with any other compiler you should set I_MPI_CC and run mpicc.

@davydden
Copy link
Copy Markdown
Member

davydden commented Feb 1, 2017

mpi{icc,icpc,ifort} will always run intel compilers, but if you want to use Intel MPI with any other compiler you should set I_MPI_CC and run mpicc.

that's a valid point. We should also make sure Spack's compiler wrappers are used underneath. For openmpi this is done via

        spack_env.set('OMPI_CC', spack_cc)
        spack_env.set('OMPI_CXX', spack_cxx)
        spack_env.set('OMPI_FC', spack_fc)
        spack_env.set('OMPI_F77', spack_f77)

in setup_dependent_environment.

@zzzoom i never used Intel MPI, so does it always have mpicc in bins?

@zzzoom
Copy link
Copy Markdown
Contributor

zzzoom commented Feb 1, 2017

I can see both mpicc and mpiicc in my IPSXE 2016u4 mpi/bin64 directory, dunno how long it has been like that for.

@davydden
Copy link
Copy Markdown
Member

davydden commented Feb 1, 2017

@lee218llnl if I am not mistaken, you contributed intel packages, do you know about differences between mpicc and mpiicc and how we should add these wrappers in Spack?

@davydden
Copy link
Copy Markdown
Member

davydden commented Feb 1, 2017

@Exteris @zzzoom it looks like we can use mpicc with intel compilers as well:

Note that if you want to use mpif90/mpicc/etc (eg for existing configure scripts/Makefiles, etc) with the Intel compilers, one need only modify environment variables to point to the appropriate compilers: eg,
export I_MPI_CC=icc
export I_MPI_CXX=icpc
export I_MPI_F77=ifort
export I_MPI_F90=ifort

from https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology/topic/288354

So maybe one just need to add

spack_env.set('I_MPI_CC', spack_cc)
spack_env.set('I_MPI_CXX', spack_cxx)
spack_env.set('I_MPI_F77', spack_fc)
spack_env.set('I_MPI_F90', spack_f77)

together with standard wrapper names (i.e. mpicc).

@lee218llnl
Copy link
Copy Markdown
Contributor

@davydden it looks like you answered your own question. By default the mpicc, mpicxx, mpif, etc. scripts will use the GNU compilers unless you set the I_MPI_* variables. Note you should also add:

spack_env.set('I_MPI_FC', spack_fc)

@davydden
Copy link
Copy Markdown
Member

davydden commented Feb 1, 2017

@lee218llnl thanks for confirming.

@Exteris would you mind to update the PR accordingly?

@DaanVanVugt
Copy link
Copy Markdown
Author

Updated.
I need to stress for this PR that I have not tested this with a spack-installed intel-parallel-studio, but only with intel-parallel-studio loaded from a module. Perhaps someone who installs their own IPSXE can try?

# file if Intel MPI is the dominant, or only, MPI on a system.
run_env.set('I_MPI_ROOT', join_path(self.prefix, 'impi'))
# Set mpi environment variables
spack_env.set('I_MPI_CC', spack_cc)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right, I'll alter it.
What is the function signature? In the docs I see both:

    def setup_dependent_environment(self, module, spec, dep_spec):
        """Dependencies of Qt find it using the QTDIR environment variable."""
        os.environ['QTDIR'] = self.prefix

The arguments to this function are:

module: the module of the dependent package, where global properties can be assigned.
spec: the spec of the dependency package (the one the function is called on).
dep_spec: the spec of the dependent package (i.e. dep_spec depends on spec).

and

def setup_dependent_environment(self, spack_env, run_env, extension_spec):

The difference in names confuses me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would take the same one which is used in openmpi:

def setup_dependent_environment(self, spack_env, run_env, dependent_spec):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the inconsistencies in the documentation in #3351. You should use:

setup_dependent_environment(self, spack_env, run_env, dependent_spec):

@davydden
Copy link
Copy Markdown
Member

@Exteris what's the status of this PR? would you mind fixing the minor issue related to setup_dependent_environment?

@tgamblin
Copy link
Copy Markdown
Member

@weijianwen: I think you could update this PR slightly to fix your issue.

@davydden
Copy link
Copy Markdown
Member

@Exteris ping.

elif os.path.isdir(join_path(self.prefix, 'bin64')):
bindir = join_path(self.prefix, 'bin64')
else:
raise "No suitable bindir found"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in another PR, @adamjstewart said that this should probably be raise RuntimeError('No suitable bindir found')

@davydden
Copy link
Copy Markdown
Member

superseded by #3905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants