File: infocrenvf90.f90

package info (click to toggle)
mpich 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 423,384 kB
  • sloc: ansic: 1,088,434; cpp: 71,364; javascript: 40,763; f90: 22,829; sh: 17,463; perl: 14,773; xml: 14,418; python: 10,265; makefile: 9,246; fortran: 8,008; java: 4,355; asm: 324; ruby: 176; lisp: 19; php: 8; sed: 4
file content (88 lines) | stat: -rw-r--r-- 2,268 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
!
! Copyright (C) by Argonne National Laboratory
!     See COPYRIGHT in top-level directory
!

!
! Testing MPI_Info_create_env.
!
       subroutine test_info ( i1, i2, errs )
       implicit none
       include 'mpif.h'
       integer ierr, i, i1, i2, vl, errs
       character*(MPI_MAX_INFO_KEY) value1, value2
       character*(MPI_MAX_INFO_KEY) keys(9)
       logical f1, f2
!
       keys(1) = "command"
       keys(2) = "argv"
       keys(3) = "maxprocs"
       keys(4) = "soft"
       keys(5) = "host"
       keys(6) = "arch"
       keys(7) = "wdir"
       keys(8) = "file"
       keys(9) = "thread_level"
!
       do i = 1, 9
          vl = MPI_MAX_INFO_KEY
          call mpi_info_get_string( i1, keys(i), vl, value1, f1, ierr )
          vl = MPI_MAX_INFO_KEY
          call mpi_info_get_string( i2, keys(i), vl, value2, f2, ierr )
!
!         if ( f1 ) then
!            print *, "keys: ", trim(keys(i)), "value1: ", trim(value1)
!         endif
!         if ( f2 ) then
!            print *, "keys: ", trim(keys(i)), "value2: ", trim(value1)
!         endif
!
!         i1 and i2 should return the same values.
!
          if ( f1 .eqv. f2 ) then
             if ( (f1 .eqv. .TRUE.) .and. value1 .ne. value2) then
                errs = errs + 1
             endif
          else
             errs = errs + 1
          endif
       enddo
       end

       program main
       implicit none
       include 'mpif.h'
       integer i1, i2
       integer ierr, errs
!
       errs = 0

       call mpi_info_create_env( i1, ierr )
       call mpi_info_create_env( i2, ierr )

       call test_info( i1, i2, errs )
       call mpi_info_free( i1, ierr )
       call mpi_info_create_env( i1, ierr )

       call mpi_init( ierr )

       call test_info( i1, i2, errs )
       call mpi_info_free( i1, ierr )
       call mpi_info_create_env( i1, ierr )

       call mpi_finalize( ierr )

       call test_info( i1, i2, errs )
       call mpi_info_free( i1, ierr )
       call mpi_info_create_env( i1, ierr )

       call test_info( i1, i2, errs )
       call mpi_info_free( i1, ierr )
       call mpi_info_free( i2, ierr )

       if ( errs .eq. 0 ) then
          print *, " No Errors"
       else
          print *, " Found ", errs, " errors"
       endif
       end