自定义数据类型(MPI_Datatype 数据类型)? [英] Custom datatype (MPI_Datatype datatype)?

查看:106
本文介绍了自定义数据类型(MPI_Datatype 数据类型)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MPI 中是否有自定义数据类型之类的东西,或者您是否必须将所有内容展平为文本字符串并作为 MPI_CHAR 传递?如果您需要展平所有内容,是否有我忽略的内置功能?

Is there such a thing as a custom datatype in MPI, or do you have to flatten everything into a text string and pass as MPI_CHAR? If you are required to flatten everything, is there a built-in function I am overlooking?

推荐答案

更好的答案是 MPI_Type_create_struct.它允许你复制你的结构数据类型并传递它,在 DeinoMPI 有一个很好的例子说明它的使用.

A much better answer is MPI_Type_create_struct. It allows you to replicate your struct datatype and pass it around, there is a great example of it's use at DeinoMPI.

这篇关于自定义数据类型(MPI_Datatype 数据类型)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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