Запуск MPI программы без mpiexec/mpirun

47
16 января 2022, 20:50

Какое поведение следует ожидать при запуске MPI программы без mpiexec/mpirun, но скомпилированной с помощью MPI компилятора? Специфицировано ли оно в стандарте?

Answer 1

Об этом говорится в разделе 10.5.2 стандарта:

A high-quality implementation will allow any process (including those not started with a “parallel application” mechanism) to become an MPI process by calling MPI_INIT. Such a process can then connect to other MPI processes using the MPI_COMM_ACCEPT and MPI_COMM_CONNECT routines, or spawn other MPI processes. MPI does not mandate this behavior, but strongly encourages it where technically feasible.

Advice to implementors. To start MPI processes belonging to the same MPI_COMM_WORLD requires some special coordination. The processes must be started at the “same” time, they must have a mechanism to establish communication, etc. Either the user or the operating system must take special steps beyond simply starting processes.

When an application enters MPI_INIT, clearly it must be able to determine if these special steps were taken. If a process enters MPI_INIT and determines that no special steps were taken (i.e., it has not been given the information to form an MPI_COMM_WORLD with other processes) it succeeds and forms a singleton MPI program, that is, one in which MPI_COMM_WORLD has size 1.

In some implementations, MPI may not be able to function without an “MPI environ- ment.” For example, MPI may require that daemons be running or MPI may not be able to work at all on the front-end of an MPP. In this case, an MPI implementation may either

  1. Create the environment (e.g., start a daemon) or
  2. Raise an error if it cannot create the environment and the environment has not been started independently.

A high-quality implementation will try to create a singleton MPI process and not raise an error.

(End of advice to implementors.)

То есть поведение не специфицировано, но рекомендовано в таком случае создавать коммуникатор размера 1 с нулевыми рангами процессов.

READ ALSO
Как удалить элемент в линейном списке?

Как удалить элемент в линейном списке?

Создал линейный список и заполнил числами от 0 до 10Как удалить элемент списка, значение которого равно 5? Пожалуйста, подскажите

79
c# - повторное использование подключенных методов

c# - повторное использование подключенных методов

Нужен способ вытаскивать инфу из msi пакетаНашел решение в инете, на его основе сделал класс

155
Task.FromException c#

Task.FromException c#

Создаю асинхронную задачу Task

126
Ошибка в unity CS1061

Ошибка в unity CS1061

Все работало буквально 10 минут назадСоздал новую сцену, все так же работало, но потом что-то пошло не так

161