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

Fix missing MPI in custom-matrix-format example #1370

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmake/autodetect_executors.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ if (NOT DEFINED GINKGO_BUILD_OMP)
endif()
endif()

if (NOT DEFINED GINKGO_BUILD_MPI)
if(NOT DEFINED GINKGO_BUILD_MPI)
set(GINKGO_MPI_ASSUME_NO_BUILTIN_MPI ON CACHE BOOL "Disables using MPI wrapper compiler directly.")
mark_as_advanced(GIKNGO_MPI_ASSUME_NO_BUILTIN_MPI)
Comment on lines +18 to +19
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to make this controllable at all? It seems to be relevant only in very limited circumstances, where either mpiexec is missing from the environment, or the user has a MPI compiler wrapper loaded that is not the one specified by CXX_COMPILER

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH, I'm not 100% sure how cmake finds MPI with this option on. Perhaps there are some weird cases, where it doesn't use the same MPI as the MPI wrapper would have. So I added the option to turn it off. I also marked it as advanced to indicate that users generally need not to worry about it.

set(MPI_ASSUME_NO_BUILTIN_MPI ${GINKGO_MPI_ASSUME_NO_BUILTIN_MPI})
find_package(MPI 3.1 COMPONENTS CXX)
if(MPI_FOUND)
message(STATUS "Enabling MPI support")
Expand Down
2 changes: 0 additions & 2 deletions examples/custom-matrix-format/stencil_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <cstdlib>

#include <ginkgo/ginkgo.hpp>


#define INSTANTIATE_FOR_EACH_VALUE_TYPE(_macro) \
template _macro(float); \
Expand Down
Loading