如何以“串行"方式编译MPI应用程序.模式(不使用MPI编译器)? [英] Howto compile MPI application in "serial" mode (without using MPI compiler)?

查看:378
本文介绍了如何以“串行"方式编译MPI应用程序.模式(不使用MPI编译器)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题听起来有点奇怪...

This question might sound a bit weird...

想象一下我有一个MPI应用程序,但是我没有安装MPI的系统. 所以我想在不修改MPI支持(1进程1线程)的情况下编译应用程序,而无需修改源代码. 有可能吗?

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?

我在某个地方找到了一个"mimic_mpi.h"包装器,该包装器应该可以完全满足我的要求.但是那里缺少一些MPI函数(例如MPI_Cart_create,MPI_Cart_get等),所以我没有成功.

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.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

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

您知道我可以使用其他任何方法来编译不支持MPI的MPI应用程序吗?

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

提前谢谢!

推荐答案

您可以通过一个进程轻松运行真实的" MPI应用程序.实际上,这甚至在不使用mpiexec/mpirun的情况下也可以使用,尽管我不确定这是否得到正式支持.那就是说,一个完整的且经过确认的1进程MPI串行"实现及其自己的库可能会变得相当复杂-因此,在这种情况下,为什么不仅仅使用一个真正的完整MPI实现?

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?

希望您能看到我要绘制的圆圈: 如果您想要完整的MPI行为,则只需使用MPI实现-不管它是否仅限于单个进程.

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.

在实践中,希望能够在有或没有MPI的情况下运行的应用程序似乎经常使用特定于域的通信包装程序,#ifdef HAVE_MPI或更复杂的宏来使用自己的MPI抽象.

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.

这篇关于如何以“串行"方式编译MPI应用程序.模式(不使用MPI编译器)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆