-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move compile-time conditional import of parallel modules to code-gen
To avoid the last deprecated compile-time `IF`, we instead separate the two branches of the conditional into different files and choose which one to include at build time.
- Loading branch information
Showing
5 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Stubs for when parallel support is not enabled | ||
|
||
ctypedef int Comm | ||
ctypedef int Info | ||
cdef Comm MPI_COMM_WORLD | ||
cdef Info MPI_INFO_NULL | ||
MPI_COMM_WORLD = 0 | ||
MPI_INFO_NULL = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Imports and typedefs required at compile time for enabling parallel support | ||
|
||
cimport mpi4py.MPI as MPI | ||
from mpi4py.libmpi cimport ( | ||
MPI_Comm, | ||
MPI_Info, | ||
MPI_Comm_dup, | ||
MPI_Info_dup, | ||
MPI_Comm_free, | ||
MPI_Info_free, | ||
MPI_INFO_NULL, | ||
MPI_COMM_WORLD, | ||
) | ||
|
||
ctypedef MPI.Comm Comm | ||
ctypedef MPI.Info Info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters