Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a custom MPI library #534

Closed
ibaned opened this issue Oct 21, 2022 · 6 comments
Closed

Using a custom MPI library #534

ibaned opened this issue Oct 21, 2022 · 6 comments

Comments

@ibaned
Copy link
Contributor

ibaned commented Oct 21, 2022

I've found a solution for this issue that I will outline below, but I thought it was appropriate to describe here as its own GitHub issue. I use my own implementation of MPI for one rank with TriBITS-based projects: https://github.com/sandialabs/fbmpi.

When using TriBITS' MPI TPL, I couldn't specify my own TPL_MPI_INCLUDE_DIRS unless the call to tribits_tpl_find_include_dirs_and_libraries had a REQUIRED_HEADERS argument. We can provide this with mpi.h, because that is what all MPI codes include. Once that modification is made, I was able to specify the following at configuration time:

-DTPL_ENABLE_MPI=ON
-DTPL_MPI_INCLUDE_DIRS=$MY_INCLUDE_PATH
-DTPL_MPI_LIBRARIES=$MY_LIBRARY
-DMPI_LIBRARY_NAMES=fbmpi

This issue can form a useful anchor for related branches and pull requests with this change

@ibaned
Copy link
Contributor Author

ibaned commented Oct 21, 2022

@bartlettroscoe I might need your help with this too... as you point out it breaks normal Trilinos builds:

trilinos/Trilinos#11175 (comment)

Is there a way that the TriBITS MPI TPL can be set up to work both with the usual MPI compiler wrappers and with a specified include dir and library? Right now I'm running into this line which erases my TPL_MPI_INCLUDE_DIRS setting:

global_null_set(TPL_${TPL_NAME}_INCLUDE_DIRS)

@ibaned
Copy link
Contributor Author

ibaned commented Oct 21, 2022

actually... maybe that file is different in my copy of SEACAS and latest TriBITS...

@ibaned
Copy link
Contributor Author

ibaned commented Oct 21, 2022

Nope, even with the latest snapshot of TriBITS this doesn't work

@bartlettroscoe
Copy link
Member

global_null_set(TPL_${TPL_NAME}_INCLUDE_DIRS)

The simple fix would be to change that line to:

      # Library has no header files, no user override, so just set them to null by default
      if ("${TPL_${TPL_NAME}_INCLUDE_DIRS}" STREQUAL "")
        global_null_set(TPL_${TPL_NAME}_INCLUDE_DIRS "")
      endif()

Can you try that and see if it fixes your use case?

It should be the case that if TPL_${TPL_NAME}_INCLUDE_DIRS is set by the user, then it should be used no questions asked.

bartlettroscoe added a commit to ibaned/Trilinos that referenced this issue Oct 24, 2022
@ibaned
Copy link
Contributor Author

ibaned commented Oct 24, 2022

Thanks @bartlettroscoe ! I'm trying this now

@ibaned
Copy link
Contributor Author

ibaned commented Oct 24, 2022

Yes! This is working for my use case! Thank you!

bartlettroscoe added a commit to bartlettroscoe/TriBITS that referenced this issue Oct 26, 2022
This reverts commit e49070d29fdd8c1d525bb22c52d7b2745271d7e2.

This causes configure failures.
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Oct 27, 2022
…s:develop' (9dd9187).

* trilinos-develop:
  MueLu: reenable libmuelu-adapters.a
  small improvements (TriBITSPub/TriBITS#533)
  Ctest: lightsaber update
  Sacado:  Fix memory leaks in Rad when using DFad nested scalar type.
  Netcdf modern is only used if HDF5 is modern
  Tacho : use same max vector length for factor & update
  Tacho : query max vector / team sizes for factor
  Tacho : cleaner way to avoid "out-of-bound access"
  fix modern Netcdf import (TriBITSPub/TriBITS#533)
  fix modern HDF5 import (TriBITSPub/TriBITS#533)
  Tacho : to avoid "requested too large team size."
  Make Netcdf depend on HDF5, fix TriBITS find modules (TriBITSPub/TriBITS#533)
  Revert "add REQUIRED_HEADERS for TriBITS MPI TPL" (TriBITSPub/TriBITS#534)
  Don't wipe out TPL_<tplName>_INCLUDE_DIRS if set by user (TriBITSPub/TriBITS#534)
  Tacho : fix issue with LDLt
  Add include guards for *_def.hpp file (trilinos#10507)
  STK: Snapshot 10-21-22 11:03
  Netcdf_ENABLE_MODERN mode for TriBITS Netcdf TPL
  add REQUIRED_HEADERS for TriBITS MPI TPL
  Avoid double instantiation of CrsMatrix< SCALAR , LO , GO , NODE >::convert< SCALAR >
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Oct 28, 2022
…s:develop' (9dd9187).

* trilinos-develop: (26 commits)
  updating bug_report.md template instructions
  Stokhos:  Fixes for compiling on HIP
  MueLu: reenable libmuelu-adapters.a
  FastILU : use mirror view instead of host view
  small improvements (TriBITSPub/TriBITS#533)
  MueLu: Add AT PR script
  Ctest: lightsaber update
  Sacado:  Fix memory leaks in Rad when using DFad nested scalar type.
  Netcdf modern is only used if HDF5 is modern
  Tacho : use same max vector length for factor & update
  Tacho : query max vector / team sizes for factor
  Tacho : cleaner way to avoid "out-of-bound access"
  fix modern Netcdf import (TriBITSPub/TriBITS#533)
  fix modern HDF5 import (TriBITSPub/TriBITS#533)
  Tacho : to avoid "requested too large team size."
  Make Netcdf depend on HDF5, fix TriBITS find modules (TriBITSPub/TriBITS#533)
  FROSch : remove compiler warnings "unreachable code"
  FROSch : add an option to call Metis before ILU
  Revert "add REQUIRED_HEADERS for TriBITS MPI TPL" (TriBITSPub/TriBITS#534)
  Don't wipe out TPL_<tplName>_INCLUDE_DIRS if set by user (TriBITSPub/TriBITS#534)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants