I'm using CLion. My CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 3.2)
project(MPI)
add_executable(MPI main.cpp)
# Require MPI for this project:
find_package(MPI REQUIRED)
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
include_directories(MPI_INCLUDE_PATH)
target_link_libraries(MPI ${MPI_LIBRARIES})
The MPI - Hello World runs well. But how do I change the number of the processors in the cmakelists?
I already tried to add -np 4 and -n 4 to the program arguments in CLion. But still I just get
Hello World process 0 of 1