c++ - 在 C++ 中发送类而不是 MPI_Type_create_struct 是否有不同的 MPI 命令?
问题描述
我正在尝试使用 MPI 创建一个并行程序,它的串行版本包含这样的类。
class car {
public:
//constructor
car(int x, int y, int value){
xPosition = x;
yPosition = y;
}
//deconstructor
~car() {
cout << "Car deconstructor!" << endl;
}
private:
int xPosition;
int yPosition;
int ageInSteps;
int last50Stepsx[stepHistory];
int last50Stepsy[stepHistory];
};
我想将这个类从一个进程发送到另一个进程,所以我认为这样做的方法是创建一个包含这个结构的数据类型。
我看到人们通常使用MPI_Type_create_struct然后MPI_Type_create_resized来使用 C 语言发送结构。
这与在 C++ 中发送类的方式相同吗?
解决方案
推荐阅读
- sql - 在 cakephp 3 查询中将 where 子句添加到计算字段
- bash - 默认情况下如何在git中设置全局可执行的bash文件?
- c# - 如何“覆盖”AccountController 的 Index()?
- android - 删除 .cahcedIn(viewModelScope) 的 Android 分页 3 库将引发异常
- vue.js - dotnet api 和 vue 客户端检测关闭浏览器/选项卡
- php - 获取 woocommerce 购物车数量总和
- java - 根据条件将值放入不同的哈希图中
- c# - 在 C# 中使用“队列”发送短信
- php - Magento2 不为客户保存自定义属性
- reactjs - React Hooks:函数应该定义在函数内还是函数外?