Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add io test in mpich testsuite.
[simgrid.git] / teshsuite / smpi / mpich3-test / io / getextent.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *
4  *  (C) 2003 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7 #include "mpi.h"
8 #include <stdio.h>
9 #include "mpitest.h"
10
11 /*
12 static char MTEST_Descrip[] = "Test file_get_extent";
13 */
14
15 int main(int argc, char *argv[])
16 {
17     int errs = 0;
18     MPI_File fh;
19     MPI_Comm comm;
20     MPI_Aint extent, nextent;
21
22     MTest_Init(&argc, &argv);
23
24     comm = MPI_COMM_WORLD;
25     MPI_File_open(comm, (char *) "test.ord",
26                   MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh);
27
28     MPI_File_get_type_extent(fh, MPI_INT, &extent);
29     MPI_Type_extent(MPI_INT, &nextent);
30
31     if (nextent != extent) {
32         errs++;
33         fprintf(stderr, "Native extent not the same as the file extent\n");
34     }
35     MPI_File_close(&fh);
36
37     MTest_Finalize(errs);
38     MPI_Finalize();
39     return 0;
40 }