<p><b>dwj07@fsu.edu</b> 2012-01-27 14:53:34 -0700 (Fri, 27 Jan 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Updating the design doc.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/omp_blocks/docs/mpas_block_decomp_redesign.pdf
===================================================================
(Binary files differ)

Modified: branches/omp_blocks/docs/mpas_block_decomp_redesign.tex
===================================================================
--- branches/omp_blocks/docs/mpas_block_decomp_redesign.tex        2012-01-27 18:04:19 UTC (rev 1430)
+++ branches/omp_blocks/docs/mpas_block_decomp_redesign.tex        2012-01-27 21:53:34 UTC (rev 1431)
@@ -128,8 +128,14 @@
 added that will allow these two values to differ. \\
 
 The namelist.input files will have the value config\_number\_of\_blocks added
-as an integer field to the io section. This option
-will have a default value of 1. \\
+as an integer field to the io section. This option will have a default value of
+0. A value of 0 in this field means there should be nProcs blocks, or one block
+for ever MPI task, which is the default behavior currently.
+config\_decomp\_file\_prefix will be separated into
+config\_proc\_decomp\_file\_prefix and config\_block\_decomp\_file\_prefix.
+Where config\_block\_decomp\_file\_prefix is read by default and
+config\_proc\_decomp\_file\_prefix is only read for external block assignment,
+as will be described later.\\
 
 Inside mpas\_block\_decomp.F, the mpas\_block\_decomp\_cells\_for\_proc needs
 to be changed.  To not only read in all cells in all blocks, but also their
@@ -148,15 +154,14 @@
 
 \begin{lstlisting}[language=fortran,escapechar=@,frame=single]
 subroutine mpas_block_decomp_cells_for_proc(dminfo,  &amp;
-           partial_global_graph_info, local_cell_list)}@
+           partial_global_graph_info, local_cell_list)
 \end{lstlisting}
 
 to
 
 \begin{lstlisting}[language=fortran,escapechar=@,frame=single]
 subroutine mpas_block_decomp_cells_for_proc(dminfo, &amp;
-           partial_global_graph_info,  @\colorbox{yellow}{cellsOnCell}@, &amp;
-           local_cell_list, @\colorbox{yellow}{local\_block\_list}@)
+           partial_global_graph_info, local_cell_list, @\colorbox{yellow}{local\_block\_list}@)
 \end{lstlisting}
 
 where local\_cell\_list is a list of cells owned by a processor, and
@@ -167,33 +172,67 @@
 number of processors to enable the use of multiple blocks on a single
 processor. \\
 
-\pagebreak
+Within mpas\_block\_decomp.F a new private subroutine will be implemented,
+called mpas\_get\_blocks\_per\_proc. This routine takes as input the domain
+information and a processor number. On output blocks\_per\_proc contains the
+number of blocks a processor owns. \\
 
-To begin, the mapping from global block id to owning processor number and local
-block number is as follows.
+There will be two additions to the public interface of mpas\_block\_decomp.F
+The first adds the routine mpas\_get\_local\_block\_id which takes has three
+arguments. As input it takes the domain information and the global block
+number, and as output it provides the local block number on a processor. This
+allows other parts of MPAS to determine what local block number a global block
+is, even if it's on another processor. \\
 
+The second addition to the public interface is the subroutine
+mpas\_get\_owning\_proc. This subroutine takes as input the domain information
+and the global block number, and as output provides the MPI task number that
+owns the block. This allows other parts of MPAS to determine from a block
+number which MPI task it needs to communicate with to read/write this block. \\
+
+In addition to the ad-hoc method of determining which blocks belong to which
+processors, a file based method will be added. This method will be toggelable
+by a namelist option named config\_block\_decomp\_file, which will be logical.
+If this option is true, a file (config\_proc\_decomp\_file\_prefix) will be
+provided, wher is the number of processors. This file will have number of
+blocks lines, and each line will say what processor should own the block. This
+file can be created using metis externally. \\
+
+%\begin{lstlisting}[language=fortran,escapechar=@,frame=single]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Implementation
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\chapter{Implementation}
+
+Implementation of the mpas\_get\_blocks\_per\_proc subroutine is as follows:
+
 \begin{lstlisting}[language=fortran,escapechar=@,frame=single]
-subroutine mpas_get_blocks_per_proc(dminfo, blocks_per_proc)
+subroutine mpas_get_blocks_per_proc(dminfo, proc_number, blocks_per_proc)
   type(domain_info), intent(in) :: dminfo
-  integer, dimension(:), pointer :: blocks_per_proc
+  integer, intent(in) :: proc_number
+  integer, intent(out) :: blocks_per_proc
   integer :: blocks_per_proc_min, even_blocks, remaining_blocks
 
-  allocate(blocks_per_proc(dminfo % nprocs))
-
   blocks_per_proc_min = config_number_of_blocks / dminfo % nprocs
   remaining_blocks = config_number_of_blocks - &amp;
          (blocks_per_proc_min * dminfo % nprocs)
   even_blocks = config_number_of_blocks - remaining_blocks
 
-  do i = 1, dminfo % nProcs
-    blocks_per_proc(i) = blocks_per_proc_min
-    if(i-1 .le. remaining_blocks) then
-      blocks_per_proc(i) = blocks_per_proc(i) + 1
-    end if
-  end do
+  blocks_per_proc = blocks_per_proc_min
+  if(proc_number .le. remaining_blocks) then
+    blocks_per_proc = blocks_per_proc + 1
+  end if
 end subroutine mpas_get_blocks_per_proc
 \end{lstlisting}
 
+\pagebreak
+
+Implementation of the mpas\_get\_local\_block\_id is as follows:
+
 \begin{lstlisting}[language=fortran,escapechar=@,frame=single]
 subroutine mpas_get_local_block_id(dminfo, &amp;
            global_block_number, local_block_number)
@@ -217,6 +256,8 @@
 
 \pagebreak
 
+Implementation of the mpas\_get\_owning\_proc routine is as follows:
+
 \begin{lstlisting}[language=fortran,escapechar=@,frame=single]
 subroutine mpas_get_owning_proc(dminfo, &amp;
            global_block_number, owning_proc)
@@ -238,26 +279,6 @@
 end subroutine mpas_get_owning_proc
 \end{lstlisting}
 
-In this case, the variable blocks\_per\_proc\_min is a module variables. Module
-variables will be added, as vectors of integers with length nProcs that will
-describe the mapping from global block id to local block id, and owning
-processor number. \\
-
-In addition to this ad-hoc method of determining which blocks belong to which
-processors, a file based method will be added. This method will be toggelable
-by a namelist option named config\_block\_decomp\_file, which will be logical.
-If this option is true, a file (proc.graph.info.part.N) will be provided, where
-N is the number of processors. This file will have number of blocks lines, and
-each line will say what processor should own the block. This file can be
-created using metis externally. \\
-
-%\begin{lstlisting}[language=fortran,escapechar=@,frame=single]
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Implementation
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Testing}
 Only limited testing can be performed on this task. Since this task alone
 doesn't allow the use of multiple blocks the only testing that can really be

</font>
</pre>