Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[examples,smpi] remove warnings and resolve a bug (I hope I amn't sure)
[simgrid.git] / examples / smpi / NAS / LU / proc_grid.f
1
2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
4
5       subroutine proc_grid
6
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
9
10       implicit none
11
12       include 'applu.incl'
13
14 c---------------------------------------------------------------------
15 c  local variables
16 c---------------------------------------------------------------------
17
18 c---------------------------------------------------------------------
19 c
20 c   set up a two-d grid for processors: column-major ordering of unknowns
21 c   NOTE: assumes a power-of-two number of processors
22 c
23 c---------------------------------------------------------------------
24
25       xdim   = 2**(ndim/2)
26       if (mod(ndim,2).eq.1) xdim = xdim + xdim
27       ydim   = num/xdim
28
29       row    = mod(id,xdim) + 1
30       col    = id/xdim + 1
31
32
33       return
34       end
35
36