ctypesinf90.f90 1.61 KB
Newer Older
Junchao Zhang's avatar
Junchao Zhang committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
! -*- Mode: Fortran; -*-
!
!  (C) 2014 by Argonne National Laboratory.
!      See COPYRIGHT in top-level directory.
!
      program main
      use mpi_f08
      integer ierr
      integer errs, wrank
      integer f2ctype
!
      call mtest_init( ierr )
      call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
!
      errs = 0
!
      errs = errs + f2ctype( MPI_CHAR, 0 )
      errs = errs + f2ctype( MPI_SIGNED_CHAR, 1 )
      errs = errs + f2ctype( MPI_UNSIGNED_CHAR, 2 )
      errs = errs + f2ctype( MPI_WCHAR, 3 )
      errs = errs + f2ctype( MPI_SHORT, 4 )
      errs = errs + f2ctype( MPI_UNSIGNED_SHORT, 5 )
      errs = errs + f2ctype( MPI_INT, 6 )
      errs = errs + f2ctype( MPI_UNSIGNED, 7 )
      errs = errs + f2ctype( MPI_LONG, 8 )
      errs = errs + f2ctype( MPI_UNSIGNED_LONG, 9 )
      errs = errs + f2ctype( MPI_FLOAT, 10 )
      errs = errs + f2ctype( MPI_DOUBLE, 11 )
      errs = errs + f2ctype( MPI_FLOAT_INT, 12 )
      errs = errs + f2ctype( MPI_DOUBLE_INT, 13 )
      errs = errs + f2ctype( MPI_LONG_INT, 14 )
      errs = errs + f2ctype( MPI_SHORT_INT, 15 )
      errs = errs + f2ctype( MPI_2INT, 16 )
Junchao Zhang's avatar
Junchao Zhang committed
34
      if (MPI_LONG_DOUBLE .ne. MPI_DATATYPE_NULL) then
Junchao Zhang's avatar
Junchao Zhang committed
35
36
37
          errs = errs + f2ctype( MPI_LONG_DOUBLE, 17 )
          errs = errs + f2ctype( MPI_LONG_DOUBLE_INT, 21 )
      endif
Junchao Zhang's avatar
Junchao Zhang committed
38
      if (MPI_LONG_LONG .ne. MPI_DATATYPE_NULL) then
Junchao Zhang's avatar
Junchao Zhang committed
39
40
41
42
43
44
45
46
47
48
49
          errs = errs + f2ctype( MPI_LONG_LONG_INT, 18 )
          errs = errs + f2ctype( MPI_LONG_LONG, 19 )
          errs = errs + f2ctype( MPI_UNSIGNED_LONG_LONG, 20 )
      endif
!
! Summarize the errors
!
      call mtest_finalize( errs )
      call mpi_finalize( ierr )

      end