应用介绍
使用openmpi编程实现一个hello world程序 ,里面有很多常用的opempi程序例子, 对学习openmpi编程有帮助
#include <stdio.h>
#include "mpi.h"
int main(int argc, char* argv[])
{
int rank, size, len;
char version[MPI_MAX_LIBRARY_VERSION_STRING];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Get_library_version(version, &len);
printf("Hello, world, I am %d of %d, (%s, %d)\n",
rank, size, version, len);
MPI_Finalize();
return 0;
}
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: www_apollocode_net@163.com 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » openmpi hello world!
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
connectivity_c.c | 0.77 KB | 2020-03-04 |
Hello.java | 0.66 KB | 2020-03-04 |
hello_c.c | 0.43 KB | 2020-03-04 |
hello_cxx.cc | 0.61 KB | 2020-03-04 |
hello_mpifh.f | 0.44 KB | 2020-03-04 |
hello_oshmemfh.f90 | 0.41 KB | 2020-03-04 |
hello_oshmem_c.c | 0.47 KB | 2020-03-04 |
hello_oshmem_cxx.cc | 0.53 KB | 2020-03-04 |
hello_usempi.f90 | 0.47 KB | 2020-03-04 |
hello_usempif08.f90 | 0.50 KB | 2020-03-04 |
Makefile | 1.48 KB | 2020-03-04 |
Makefile.include | 0.82 KB | 2020-03-04 |
oshmem_circular_shift.c | 0.37 KB | 2020-03-04 |
oshmem_max_reduction.c | 0.51 KB | 2020-03-04 |
oshmem_shmalloc.c | 0.33 KB | 2020-03-04 |
oshmem_strided_puts.c | 0.66 KB | 2020-03-04 |
oshmem_symmetric_data.c | 0.54 KB | 2020-03-04 |
README | 1.11 KB | 2020-03-04 |
Ring.java | 0.90 KB | 2020-03-04 |
ring_c.c | 0.96 KB | 2020-03-04 |
ring_cxx.cc | 1.13 KB | 2020-03-04 |
ring_mpifh.f | 1.00 KB | 2020-03-04 |
ring_oshmemfh.f90 | 0.78 KB | 2020-03-04 |
ring_oshmem_c.c | 0.82 KB | 2020-03-04 |
ring_usempi.f90 | 0.98 KB | 2020-03-04 |
ring_usempif08.f90 | 1.02 KB | 2020-03-04 |
spc_example.c | 1.45 KB | 2020-03-04 |
examples | 0.00 KB | 2020-10-03 |
发表评论 取消回复