MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / set_other_mpi_vars

Function set_other_mpi_vars

configure.py:1177–1215  ·  view source on GitHub ↗

Set other MPI related variables.

(environ_cp)

Source from the content-addressed store, hash-verified

1175
1176
1177def set_other_mpi_vars(environ_cp):
1178 """Set other MPI related variables."""
1179 # Link the MPI header files
1180 mpi_home = environ_cp.get('MPI_HOME')
1181 symlink_force('%s/include/mpi.h' % mpi_home, 'third_party/mpi/mpi.h')
1182
1183 # Determine if we use OpenMPI or MVAPICH, these require different header files
1184 # to be included here to make bazel dependency checker happy
1185 if os.path.exists(os.path.join(mpi_home, 'include/mpi_portable_platform.h')):
1186 symlink_force(
1187 os.path.join(mpi_home, 'include/mpi_portable_platform.h'),
1188 'third_party/mpi/mpi_portable_platform.h')
1189 # TODO(gunan): avoid editing files in configure
1190 sed_in_place('third_party/mpi/mpi.bzl', 'MPI_LIB_IS_OPENMPI = False',
1191 'MPI_LIB_IS_OPENMPI = True')
1192 else:
1193 # MVAPICH / MPICH
1194 symlink_force(
1195 os.path.join(mpi_home, 'include/mpio.h'), 'third_party/mpi/mpio.h')
1196 symlink_force(
1197 os.path.join(mpi_home, 'include/mpicxx.h'), 'third_party/mpi/mpicxx.h')
1198 # TODO(gunan): avoid editing files in configure
1199 sed_in_place('third_party/mpi/mpi.bzl', 'MPI_LIB_IS_OPENMPI = True',
1200 'MPI_LIB_IS_OPENMPI = False')
1201
1202 if os.path.exists(os.path.join(mpi_home, 'lib/libmpi.so')):
1203 symlink_force(
1204 os.path.join(mpi_home, 'lib/libmpi.so'), 'third_party/mpi/libmpi.so')
1205 elif os.path.exists(os.path.join(mpi_home, 'lib64/libmpi.so')):
1206 symlink_force(
1207 os.path.join(mpi_home, 'lib64/libmpi.so'), 'third_party/mpi/libmpi.so')
1208 elif os.path.exists(os.path.join(mpi_home, 'lib32/libmpi.so')):
1209 symlink_force(
1210 os.path.join(mpi_home, 'lib32/libmpi.so'), 'third_party/mpi/libmpi.so')
1211
1212 else:
1213 raise ValueError(
1214 'Cannot find the MPI library file in %s/lib or %s/lib64 or %s/lib32' %
1215 (mpi_home, mpi_home, mpi_home))
1216
1217
1218def system_specific_test_config(env):

Callers 1

mainFunction · 0.85

Calls 4

symlink_forceFunction · 0.85
sed_in_placeFunction · 0.85
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected