我工作的MPI對C.我有我想要序列,並使用MPI集體通信發送到其他節點這個自定義結構(收集,分散,廣播)發送一個結構使用MPI集體通信
的結構是如下
typedef struct {
double x[2]; /* Old and new X-axis coordinates */
double y[2]; /* Old and new Y-axis coordinates */
double xf; /* force along X-axis */
double yf; /* force along Y-axis */
double xv; /* velocity along X-axis */
double yv; /* velocity along Y-axis */
double mass; /* Mass of the body */
double radius; /* width (derived from mass) */
} bodyType;
我試圖瞭解關於MPI自定義結構體的序列化,但不能真正理解這個過程。如果有人能幫助我在這裏將是巨大的
謝謝
'MPI_Type_struct'是你的朋友! – simpel01
@ simpel01,'MPI_Type_struct'在MPI-2中被棄用,並且在MPI-3中不再存在。應該使用'MPI_Type_create_struct'來代替。 –
anyhelp如何實際使用它們? –