MPI_TYPE 相关方法

本文介绍了MPI中几种类型构造函数的用法,包括MPI_Type_extent获取数据类型的大小,MPI_Type_size计算元素总大小,MPI_Type_contiguous创建连续复制的数据类型,MPI_Type_vector创建等间距块的数据类型,MPI_Type_hvector以字节为单位的步长创建数据类型,MPI_Type_indexed构建不同长度和偏移量的块,以及MPI_Type_struct允许不同数据类型组成的结构体数据类型。
摘要由CSDN通过智能技术生成

MPI_Type_extent(MPI_Datatype datatype,MPI_Aint extent)
return the extent of a datatype.
MPI_Type_size(MPI_Datatype datatype,int *size)
return the total size,in bytes,of the entries in the type signature associated with datatype.
eg:type={(double,0),(char 8)}(a double at displacement zero,followed by a char at displacement eight)
a call to MPI_Type_extent(type,i) will return i=16,a call to MPI_Type_size(type,i) will return i=9.

MPI_Type_contiguous(int count,MPI_Datatype oldType,MPI_Datatype *newType)
return a newType consisting of the replication of a datatype into contiguous location.
eg:type={(double,0),(char 8)},let count=3,call MPI_Type_contiguous(3,type,newtype),so the newtype={(double,0),(char 8),(double,16),(char 24),(double,32),(char 40)}

MPI_Type_vector(int count,int blocklen,int stride,MPI_Datatype oldtype,MPI_datatype *newtype)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值