root / synthbench / euroben-dm / mod1k / .svn / text-base / csetup.f.svn-base @ 0:839f52ef7657
History | View | Annotate | Download (1.6 kB)
1 |
Subroutine csetup |
---|---|
2 |
c ---------------------------------------------------------------------- |
3 |
c --- 'csetup' initializes the communication for MPI programs. |
4 |
c |
5 |
c --- Output parameters (in Common /dist/): |
6 |
c Integer: me --- Local node number (0 <= me <= nodes-1). |
7 |
c Integer: nodes --- Number of nodes as found in the MPI system. |
8 |
c ---------------------------------------------------------------------- |
9 |
Use dist_module |
10 |
Include 'mpif.h' |
11 |
|
12 |
Integer info |
13 |
c ---------------------------------------------------------------------- |
14 |
c --- Initialize MPI also, initialize this processor and the set of |
15 |
c processors for this job. (In case of problems, report and stop). |
16 |
c ---------------------------------------------------------------------- |
17 |
|
18 |
Call Mpi_Init( info ) |
19 |
If ( info .NE. 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 .NE. 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 .NE. Mpi_Success ) Then |
30 |
Print *, 'Could not determine no. of nodes, ierr = ', info |
31 |
Stop 'Csetup stage 3' |
32 |
End If |
33 |
c ---------------------------------------------------------------------- |
34 |
c --- Be sure that all processors start together. |
35 |
|
36 |
Call Mpi_Barrier( Mpi_Comm_World, info ) |
37 |
c ---------------------------------------------------------------------- |
38 |
End |