Skip to content

zoltan: rely on MPI wrappers instead of guessing MPI libraries#8986

Merged
adamjstewart merged 2 commits intospack:developfrom
tz-rrze:bugfix-zoltan-mpilibs
Dec 17, 2018
Merged

zoltan: rely on MPI wrappers instead of guessing MPI libraries#8986
adamjstewart merged 2 commits intospack:developfrom
tz-rrze:bugfix-zoltan-mpilibs

Conversation

@tz-rrze
Copy link
Copy Markdown
Contributor

@tz-rrze tz-rrze commented Aug 15, 2018

fixes #8979

- if MPI-wrappers are used for compilation, we can assume that
  linking works without manually specifying MPI libs
  (guessing may result in wrong libs, cf. spack#8979)
- thus, only guess the NPI libs and add them explicitly if no
  MPI-wrappers are used
- use llnl.util.filesystem.find_libraries instead of a locally
  defined routine to guess the MPI libs if needed
  (cf. spack#8979)
else:
# we do not use MPI-wrappers, thus, it is likely that we need to
# manually add libs for linking; try to find all possible ones
mpi_static_libs = find_libraries('lib*mpi*', spec['mpi'].prefix.lib,
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.

Don’t we have spec[mpi].libs() ? It’s a job of MPI package to know its libs, not the packages that use it.

Copy link
Copy Markdown
Contributor Author

@tz-rrze tz-rrze Aug 15, 2018

Choose a reason for hiding this comment

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

I have only seen mpicxx_shared_libs. And I know that @adamjstewart suggested in #8979 (comment) to extend the MPI packages. But that's not trivial at all. For example the current intel-mpi package even seems to not correctly take into account in its mpi_libs() or mpicxx_shared_libs whether the multi-threaded versions of the library (*_mt.so) are to be used or not.
MPIs typically provide MPI-compiler-wrappers which take all these specialties into account. Thus, in the suggested patch, the 'else' branch will not be used at all for Open MPI, Intel MPI, mpich, mvapich, Spectrum MPI, ... It will only be reached on nowadays exotic systems / configurations (I'm not aware of any as e.g. even Blue Gene uses wrapper these days; maybe Cray with PrgEnv-cray?) which do not have compiler wrappers and require manual linking with -lmpi or whatever.
Moreover, Zoltan seems to need the Fortran (MPI) libraries to be linked with a C compiler which is not a typical use case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just saw that even on Cray 'ftn', 'cc', and 'CC' seem to be MPI-wrappers ...; there is no need to specify anything for MPI linking.
If there are no machines / configurations without MPI wrappers, one probably could go completely without the handcrafted wrapper check ("starts with mpi") and omit the else part; just always doing config_args.append('--with-mpi-libs= ') only.

@tz-rrze tz-rrze changed the title zoltan: only add guessed MPI libs if no MPI wrappers are used zoltan: rely on MPI wrappers instead of guessing MPI libraries Aug 16, 2018
@adamjstewart adamjstewart merged commit a02cf10 into spack:develop Dec 17, 2018
tgamblin added a commit that referenced this pull request Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

building zoltan fails if openmpi has been compiled with pmi/slurm-support (i.e. without --enable-static)

4 participants