Skip to content

Commit ca0d9c5

Browse files
Merge pull request #24 from IntelPython/conditional-mpich2
Conditional mpich2
2 parents fce93dd + 881717c commit ca0d9c5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

mkl/_mkl_service.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ cdef extern from "mkl.h":
9191
int MKL_BLACS_MSMPI
9292
int MKL_BLACS_INTELMPI
9393
int MKL_BLACS_MPICH2
94+
int MKL_BLACS_LASTMPI
9495

9596
# VML Constants
9697
int VML_HA

mkl/_mkl_service.pyx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ import warnings
3131
cimport mkl._mkl_service as mkl
3232

3333

34+
cdef extern from *:
35+
"""
36+
/* defind MKL_BLACS_MPICH2 if undefined */
37+
#ifndef MKL_BLACS_MPICH2
38+
#define MKL_BLACS_MPICH2 -1
39+
#endif
40+
"""
41+
3442
ctypedef struct MemStatData:
3543
# DataAllocatedBytes, AllocatedBuffers
3644
mkl.MKL_INT64 allocated_bytes
@@ -874,7 +882,6 @@ cdef __set_mpi(vendor, custom_library_name=None):
874882
'custom': mkl.MKL_BLACS_CUSTOM,
875883
'msmpi': mkl.MKL_BLACS_MSMPI,
876884
'intelmpi': mkl.MKL_BLACS_INTELMPI,
877-
'mpich2': mkl.MKL_BLACS_MPICH2,
878885
},
879886
'output': {
880887
0: 'success',
@@ -883,6 +890,8 @@ cdef __set_mpi(vendor, custom_library_name=None):
883890
-3: 'MPI library cannot be set at this point',
884891
},
885892
}
893+
if mkl.MKL_BLACS_LASTMPI > mkl.MKL_BLACS_INTELMPI + 1:
894+
__variables['input']['mpich2'] = mkl.MKL_BLACS_MPICH2
886895
if ((vendor is 'custom' or custom_library_name is not None) and
887896
(vendor is not 'custom' or custom_library_name is None)):
888897
raise ValueError("Selecting custom MPI for BLACS requires specifying "

0 commit comments

Comments
 (0)