MPI Hello World
2017-03-02 17:44
183 查看
#include <mpi.h> #include <stdio.h> int main(int argc, char** argv) { // Initialize the MPI environment MPI_Init(NULL, NULL); // Get the number of processes int world_size; MPI_Comm_size(MPI_COMM_WORLD, &world_size); // Get the rank of the process int world_rank; MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); // Get the name of the processor char processor_name[MPI_MAX_PROCESSOR_NAME]; int name_len; MPI_Get_processor_name(processor_name, &name_len); // Print off a hello world message printf("Hello world from processor %s, rank %d" " out of %d processors\n", processor_name, world_rank, world_size); // Finalize the MPI environment. MPI_Finalize(); }
相关文章推荐
- "hello world" of MPI version
- MPI—HelloWorld
- Building an MPI program with Managed Build(Eclipse 下怎么创建简单的MPI hello world 程序)
- php的扩展和嵌入--c扩展开发demo! print "helloworld"
- Python学习之helloworld
- hello, world!
- Nodejs hello world
- 茶余饭后来回顾我们熟悉的“Hello world program”
- RabbitMQ消息队列(二):”Hello, World“
- RabbitMQ hello world带有确认功能的生产者
- HelloWorld CMake CMake中构建静态库与动态库及其使用
- 利用开发人员命令提示输出"Hello world"
- Go! new Hello World, 我的第一个Go程序
- web service 应用二[HelloWorldJacky]
- PHP之输出"hello World"
- mahout+eclipse推荐系统开发学习之helloworld
- 正说“Hello,World”
- qt-designer使用教程1--HelloWorld.txt
- as编写hello,world
- go hello world