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

📄 view.c

📁 The example for Boor USING MPI2
💻 C
字号:
#include "mpi.h"int main( int argc, char *argv[] ){    MPI_Aint     lb, extent;    MPI_Datatype etype, filetype, contig;    MPI_Offset   disp;    MPI_File     fh;    int buf[1000];    MPI_Init( &argc, &argv );    /* ... other application code ... */    MPI_File_open(MPI_COMM_WORLD, "/pfs/datafile", 		  MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);    MPI_Type_contiguous(2, MPI_INT, &contig);    lb     = 0;    extent = 6 * sizeof(int);    MPI_Type_create_resized(contig, lb, extent, &filetype);    MPI_Type_commit(&filetype);    disp  = 5 * sizeof(int);    /* assume displacement in this file view 				   is of size equal to 5 integers */     etype = MPI_INT;        MPI_File_set_view(fh, disp, etype, filetype, "native", 		      MPI_INFO_NULL);    MPI_File_write(fh, buf, 1000, MPI_INT, MPI_STATUS_IGNORE);    /* ... */    MPI_Finalize();    return 0;}

⌨️ 快捷键说明

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