Search code examples
c++mpiqt-creatormpiexec

Set number of processes mpi in cmake project at qtcreator


How can I set number of processes in qtcreator in a c++ MPI program?

I add -n 4 into run arguments but the program was not run on 4 processes!!

Should I change CMakeLists?


Solution

  • In qtcreator menu :

    projects -> build & run -> run -> add custom executable:

    Executable : mpiexec

    Arguments : -n 4 main

    Note: 4 is number of processes and main is your target name.