⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtype.c

📁 The example for Boor USING MPI2
💻 C
字号:
#include "mpi.h"#include <stdio.h>#include <stdlib.h>void is_type_hvector(MPI_Datatype datatype){    int nints, nadds, ntypes, combiner, *ints;    MPI_Aint *adds;    MPI_Datatype *types;    MPI_Type_get_envelope(datatype, &nints, &nadds, &ntypes,			  &combiner);        if (combiner != MPI_COMBINER_HVECTOR)	printf("not type_hvector\n");    else {	printf("is type_hvector\n");	ints = (int *) malloc(nints*sizeof(int));	adds = (MPI_Aint *) malloc(nadds*sizeof(MPI_Aint));	types = (MPI_Datatype *) malloc(ntypes*sizeof(MPI_Datatype));		MPI_Type_get_contents(datatype, nints, nadds, ntypes, 			      ints, adds, types);	printf("count = %d, blocklength = %d, stride = %ld\n", 	       ints[0], ints[1], adds[0]);	free(ints);	free(adds);	free(types);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -