Statistics
| Branch: | Revision:

root / synthbench / euroben-dm / mod2b / .svn / text-base / csetup.f.svn-base @ 0:839f52ef7657

History | View | Annotate | Download (1.5 kB)

1
      Subroutine csetup
2
! ----------------------------------------------------------------------
3
! --- Routine Csetup initializes the communication for MPI programs.
4
!
5
! --- Output parameters:
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
      Call Mpi_Init( info )
18
      If ( info .NE. Mpi_Success ) Then
19
         Print *, 'Could not initialize MPI, ierr = ', info
20
         Stop 'Csetup stage 1'
21
      End If
22
      Call Mpi_Comm_Rank( Mpi_Comm_World, me, info )
23
      If ( info .NE. Mpi_Success ) Then
24
         Print *, 'Could not find my process id, ierr = ', info
25
         Stop 'Csetup stage 2'
26
      End If
27
      Call Mpi_Comm_Size( Mpi_Comm_World, nodes, info )
28
      If ( info .NE. Mpi_Success ) Then
29
         Print *, 'Could not determine no. of nodes, ierr = ', info
30
         Stop 'Csetup stage 3'
31
      End If
32
! ----------------------------------------------------------------------
33
! --- Be sure that all processors start together.
34

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