Skip to content

Commit

Permalink
[CMake/Make/bin] Remove vestigial MPI support (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
SFrijters authored and kris-rowe committed Aug 12, 2022
1 parent 06938b2 commit ea25a89
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 38 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ MAKE_COMPILED_DEFINES := $(shell cat "$(OCCA_DIR)/scripts/build/compiledDefinesT
sed "s,@@OCCA_OS@@,$(OCCA_OS),g;\
s,@@OCCA_USING_VS@@,$(OCCA_USING_VS),g;\
s,@@OCCA_UNSAFE@@,$(OCCA_UNSAFE),g;\
s,@@OCCA_MPI_ENABLED@@,$(OCCA_MPI_ENABLED),g; \
s,@@OCCA_OPENMP_ENABLED@@,$(OCCA_OPENMP_ENABLED),g;\
s,@@OCCA_CUDA_ENABLED@@,$(OCCA_CUDA_ENABLED),g;\
s,@@OCCA_HIP_ENABLED@@,$(OCCA_HIP_ENABLED),g;\
Expand Down
1 change: 0 additions & 1 deletion docs/guide/user-guide/command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Environment variables override compiled-time defines.
- OCCA_HIP_ENABLED : 0
- OCCA_OPENCL_ENABLED : 1
- OCCA_METAL_ENABLED : 0
- OCCA_MPI_ENABLED : 0
Run-Time Options:
- OCCA_CXX : g++-8
- OCCA_CXXFLAGS : -g
Expand Down
42 changes: 10 additions & 32 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
macro(add_test_with_mode_and_nranks exe mode device nranks)
if (${nranks} GREATER 1)
add_test(NAME ${exe}-${mode} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${nranks} ${MPIEXEC_PREFLAGS} ./${exe} ${MPIEXEC_POSTFLAGS} --verbose --device "${device}")
else()
add_test(NAME ${exe}-${mode} COMMAND ./${exe} --verbose --device "${device}")
endif()
macro(add_test_with_mode exe mode device)
add_test(NAME ${exe}-${mode} COMMAND ./${exe} --verbose --device "${device}")
set_property(TEST ${exe}-${mode} APPEND PROPERTY ENVIRONMENT OCCA_CACHE_DIR=${OCCA_BUILD_DIR}/occa)
endmacro()

macro(add_test_with_modes_and_nranks exe nranks)
add_test_with_mode_and_nranks(${exe} serial "{\"mode\": \"Serial\"}" ${nranks})
macro(add_test_with_modes exe)
add_test_with_mode(${exe} serial "{\"mode\": \"Serial\"}")
if (OCCA_CUDA_ENABLED)
add_test_with_mode_and_nranks(${exe} cuda "{\"mode\": \"CUDA\", \"device_id\": 0}" ${nranks})
add_test_with_mode(${exe} cuda "{\"mode\": \"CUDA\", \"device_id\": 0}")
endif()
if (OCCA_HIP_ENABLED)
add_test_with_mode_and_nranks(${exe} hip "{\"mode\": \"HIP\", \"device_id\": 0}" ${nranks})
add_test_with_mode(${exe} hip "{\"mode\": \"HIP\", \"device_id\": 0}")
endif()
if (OCCA_METAL_ENABLED)
add_test_with_mode_and_nranks(${exe} metal "{\"mode\": \"Metal\", \"device_id\": 0}" ${nranks})
add_test_with_mode(${exe} metal "{\"mode\": \"Metal\", \"device_id\": 0}")
endif()
if (OCCA_OPENCL_ENABLED)
add_test_with_mode_and_nranks(${exe} opencl "{\"mode\": \"OpenCL\", \"platform_id\": 0, \"device_id\": 0}" ${nranks})
add_test_with_mode(${exe} opencl "{\"mode\": \"OpenCL\", \"platform_id\": 0, \"device_id\": 0}")
endif()
if (OCCA_DPCPP_ENABLED)
add_test_with_mode_and_nranks(${exe} dpcpp "{\"mode\": \"dpcpp\", \"platform_id\": 0, \"device_id\": 0}" ${nranks})
add_test_with_mode(${exe} dpcpp "{\"mode\": \"dpcpp\", \"platform_id\": 0, \"device_id\": 0}")
endif()
if (OCCA_OPENMP_ENABLED)
add_test_with_mode_and_nranks(${exe} openmp "{\"mode\": \"OpenMP\"}" ${nranks})
add_test_with_mode(${exe} openmp "{\"mode\": \"OpenMP\"}")
endif()
endmacro()

macro(add_mpi_test_with_modes exe)
add_test_with_modes_and_nranks(${exe} 2)
endmacro()

macro(add_test_with_modes exe)
add_test_with_modes_and_nranks(${exe} 1)
endmacro()

macro(add_test_without_mode exe)
add_test(NAME ${exe} COMMAND ${exe} --verbose)
set_property(TEST ${exe} APPEND PROPERTY ENVIRONMENT OCCA_CACHE_DIR=${OCCA_BUILD_DIR}/occa)
Expand Down Expand Up @@ -72,16 +60,6 @@ macro(compile_cpp_example_with_modes target file)
endif()
endmacro()

macro(compile_cpp_mpi_example_with_modes target file)
add_executable(examples_cpp_${target} ${file})
target_link_libraries(examples_cpp_${target} libocca)
target_include_directories(examples_cpp_${target} PRIVATE
$<BUILD_INTERFACE:${OCCA_SOURCE_DIR}/src>)
if (ENABLE_TESTS)
add_mpi_test_with_modes(examples_cpp_${target})
endif()
endmacro()

add_subdirectory(c)
add_subdirectory(cpp)

Expand Down
1 change: 0 additions & 1 deletion scripts/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ else
endif

OCCA_FORTRAN_ENABLED := $(fortranEnabled)
OCCA_MPI_ENABLED := $(mpiEnabled)
OCCA_OPENMP_ENABLED := $(openmpEnabled)
OCCA_CUDA_ENABLED := $(cudaEnabled)
OCCA_HIP_ENABLED := $(hipEnabled)
Expand Down
1 change: 0 additions & 1 deletion scripts/build/compiledDefinesTemplate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define OCCA_USING_VS @@OCCA_USING_VS@@
#define OCCA_UNSAFE @@OCCA_UNSAFE@@

#define OCCA_MPI_ENABLED @@OCCA_MPI_ENABLED@@
#define OCCA_OPENMP_ENABLED @@OCCA_OPENMP_ENABLED@@
#define OCCA_CUDA_ENABLED @@OCCA_CUDA_ENABLED@@
#define OCCA_HIP_ENABLED @@OCCA_HIP_ENABLED@@
Expand Down
1 change: 0 additions & 1 deletion scripts/build/compiledDefinesTemplate.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#cmakedefine01 OCCA_USING_VS
#cmakedefine01 OCCA_UNSAFE

#cmakedefine01 OCCA_MPI_ENABLED
#cmakedefine01 OCCA_OPENMP_ENABLED
#cmakedefine01 OCCA_OPENCL_ENABLED
#cmakedefine01 OCCA_CUDA_ENABLED
Expand Down
1 change: 0 additions & 1 deletion src/occa/internal/bin/occa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ namespace occa {
<< " - OCCA_OPENCL_ENABLED : " << envEcho("OCCA_OPENCL_ENABLED", OCCA_OPENCL_ENABLED) << "\n"
<< " - OCCA_DPCPP_ENABLED : " << envEcho("OCCA_DPCPP_ENABLED", OCCA_DPCPP_ENABLED) << "\n"
<< " - OCCA_METAL_ENABLED : " << envEcho("OCCA_METAL_ENABLED", OCCA_METAL_ENABLED) << "\n"
<< " - OCCA_MPI_ENABLED : " << envEcho("OCCA_MPI_ENABLED", OCCA_MPI_ENABLED) << "\n"

<< " Run-Time Options:\n"
<< " - OCCA_CXX : " << envEcho("OCCA_CXX") << "\n"
Expand Down

0 comments on commit ea25a89

Please sign in to comment.