Statistics
| Branch: | Revision:

root / synthbench / euroben-dm / mod2i / csetup.f @ 0:839f52ef7657

History | View | Annotate | Download (1.6 kB)

1
      Subroutine csetup
2
! ----------------------------------------------------------------------
3
! --- 'csetup' initializes the communication for MPI programs.
4
!
5
! --- Output parameters (in dist_module):
6
!     Integer: me    --- Local node number (0 <= me <= nodes-1).
7
!     Integer: nodes --- Number of nodes as found in the MPI system.
8
! ----------------------------------------------------------------------
9
      Use        dist_module
10
      Include       'mpif.h'
11

    
12
      Integer :: info
13
! ----------------------------------------------------------------------
14
! --- Initialize MPI also, initialize this processor and the set of 
15
!     processors for this job. (In case of problems, report and stop).
16
! ----------------------------------------------------------------------
17

    
18
      Call Mpi_Init( info )
19
      If ( info /= Mpi_Success ) Then
20
         Print *, 'Could not initialize MPI, ierr = ', info
21
         Stop 'Csetup stage 1'
22
      End If
23
      Call Mpi_Comm_Rank( Mpi_Comm_World, me, info )
24
      If ( info /= Mpi_Success ) Then
25
         Print *, 'Could not find my process id, ierr = ', info
26
         Stop 'Csetup stage 2'
27
      End If
28
      Call Mpi_Comm_Size( Mpi_Comm_World, nodes, info )
29
      If ( info /= Mpi_Success ) Then
30
         Print *, 'Could not determine no. of nodes, ierr = ', info
31
         Stop 'Csetup stage 3'
32
      End If
33
! ----------------------------------------------------------------------
34
! --- Be sure that all processors start together.
35

    
36
      Call Mpi_Barrier( Mpi_Comm_World, info )
37
! ----------------------------------------------------------------------
38
      End Subroutine csetup