Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added our tweaked version of NAS benchmarks.
[simgrid.git] / examples / smpi / NAS / LU / init_comm.f
1
2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
4
5       subroutine init_comm 
6
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
9
10 c---------------------------------------------------------------------
11 c
12 c   initialize MPI and establish rank and size
13 c
14 c This is a module in the MPI implementation of LUSSOR
15 c pseudo application from the NAS Parallel Benchmarks. 
16 c
17 c---------------------------------------------------------------------
18
19       implicit none
20
21       include 'mpinpb.h'
22       include 'applu.incl'
23
24       integer nodedim
25       integer IERROR
26
27
28 c---------------------------------------------------------------------
29 c    initialize MPI communication
30 c---------------------------------------------------------------------
31       call MPI_INIT( IERROR )
32
33 c---------------------------------------------------------------------
34 c   establish the global rank of this process
35 c---------------------------------------------------------------------
36       call MPI_COMM_RANK( MPI_COMM_WORLD,
37      >                     id,
38      >                     IERROR )
39
40 c---------------------------------------------------------------------
41 c   establish the size of the global group
42 c---------------------------------------------------------------------
43       call MPI_COMM_SIZE( MPI_COMM_WORLD,
44      >                     num,
45      >                     IERROR )
46
47       ndim   = nodedim(num)
48
49       if (.not. convertdouble) then
50          dp_type = MPI_DOUBLE_PRECISION
51       else
52          dp_type = MPI_REAL
53       endif
54
55
56       return
57       end