Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added our tweaked version of NAS benchmarks.
[simgrid.git] / examples / smpi / NAS / LU / proc_grid.f
diff --git a/examples/smpi/NAS/LU/proc_grid.f b/examples/smpi/NAS/LU/proc_grid.f
new file mode 100644 (file)
index 0000000..40271c1
--- /dev/null
@@ -0,0 +1,36 @@
+
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+
+      subroutine proc_grid
+
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+
+      implicit none
+
+      include 'applu.incl'
+
+c---------------------------------------------------------------------
+c  local variables
+c---------------------------------------------------------------------
+
+c---------------------------------------------------------------------
+c
+c   set up a two-d grid for processors: column-major ordering of unknowns
+c   NOTE: assumes a power-of-two number of processors
+c
+c---------------------------------------------------------------------
+
+      xdim   = 2**(ndim/2)
+      if (mod(ndim,2).eq.1) xdim = xdim + xdim
+      ydim   = num/xdim
+
+      row    = mod(id,xdim) + 1
+      col    = id/xdim + 1
+
+
+      return
+      end
+
+