Howto compile MPI application in “serial” mode (without using MPI compiler)?

岁酱吖の 提交于 2019-12-24 14:59:29

问题


This question might sound a bit weird...

Imagine I have an MPI application, but I don't have a system with MPI installed. So I want to compile the application with no MPI support (1-process, 1-thread) without modifying source code. Is that possible?

I found somewhere a "mimic_mpi.h" wrapper which is supposed to do exactly what I want. But there were some MPI functions missing in there (e.g., MPI_Cart_create, MPI_Cart_get, etc.), so I didn't succeed.

mimic_mpi.h http://openmx.sourcearchive.com/documentation/3.2.4.dfsg-3/mimic__mpi_8h-source.html

mimic_mpi.c http://openmx.sourcearchive.com/documentation/3.2.4.dfsg-3/mimic__mpi_8c-source.html

Do you know any other approach I could use to compile MPI apps with no MPI support?

Thanks in advance!


回答1:


You can run a "real" MPI application easily with a single process. In practice this even works without using mpiexec/mpirun although I'm not sure if that's officially supported. That said a full and confirming 1-process MPI "serial" implementation would probably become rather complex and its own library - so in that case, why not just use a real full MPI implementation?

I hope you see the circle I'm trying to draw: If you want full MPI behavior, just use an MPI implementation - regardless if it's just limited to a single process.

In practice, applications that want to be able to function with or without MPI often seem to use their own MPI abstractions using domain specific communication wrappers, #ifdef HAVE_MPI or more complex macros.



来源:https://stackoverflow.com/questions/9308205/howto-compile-mpi-application-in-serial-mode-without-using-mpi-compiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!