<p><b>duda</b> 2012-01-05 16:00:49 -0700 (Thu, 05 Jan 2012)</p><p>BRANCH COMMIT<br>
<br>
Add a global blockID to the block type, and when allocating blocks, set the blockID <br>
to the MPI task ID, since we currently only handle a single block per task.<br>
<br>
Also, add a blockID in the exchange_list type.<br>
<br>
<br>
M src/framework/mpas_io_input.F<br>
M src/framework/mpas_dmpar.F<br>
M src/framework/mpas_grid_types.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/omp_blocks/ddt_reorg/src/framework/mpas_dmpar.F
===================================================================
--- branches/omp_blocks/ddt_reorg/src/framework/mpas_dmpar.F        2012-01-05 22:33:51 UTC (rev 1302)
+++ branches/omp_blocks/ddt_reorg/src/framework/mpas_dmpar.F        2012-01-05 23:00:49 UTC (rev 1303)
@@ -26,6 +26,7 @@
type exchange_list
integer :: procID
+ integer :: blockID
integer :: nlist
integer, dimension(:), pointer :: list
type (exchange_list), pointer :: next
@@ -635,6 +636,7 @@
allocate(sendListPtr % next)
sendListPtr => sendListPtr % next
sendListPtr % procID = currentProc
+ sendListPtr % blockID = currentProc ! Currently, we have just one block per task, so blockID = procID
sendListPtr % nlist = numToSend
allocate(sendListPtr % list(numToSend))
nullify(sendListPtr % next)
@@ -668,6 +670,7 @@
allocate(recvListPtr % next)
recvListPtr => recvListPtr % next
recvListPtr % procID = i
+ recvListPtr % blockID = i ! Currently, we have just one block per task, so blockID = procID
recvListPtr % nlist = numToRecv
allocate(recvListPtr % list(numToRecv))
nullify(recvListPtr % next)
@@ -696,6 +699,7 @@
#else
allocate(recvList)
recvList % procID = dminfo % my_proc_id
+ recvList % blockID = dminfo % my_proc_id ! Currently, we have just one block per task, so blockID = procID
recvList % nlist = nNeededList
allocate(recvList % list(nNeededList))
nullify(recvList % next)
@@ -705,6 +709,7 @@
allocate(sendList)
sendList % procID = dminfo % my_proc_id
+ sendList % blockID = dminfo % my_proc_id ! Currently, we have just one block per task, so blockID = procID
sendList % nlist = nOwnedList
allocate(sendList % list(nOwnedList))
nullify(sendList % next)
Modified: branches/omp_blocks/ddt_reorg/src/framework/mpas_grid_types.F
===================================================================
--- branches/omp_blocks/ddt_reorg/src/framework/mpas_grid_types.F        2012-01-05 22:33:51 UTC (rev 1302)
+++ branches/omp_blocks/ddt_reorg/src/framework/mpas_grid_types.F        2012-01-05 23:00:49 UTC (rev 1303)
@@ -113,6 +113,8 @@
#include "block_group_members.inc"
+ integer :: blockID ! Unique global ID number for this block
+
type (domain_type), pointer :: domain
type (parallel_info), pointer :: parinfo
@@ -147,7 +149,7 @@
end subroutine mpas_allocate_domain
- subroutine mpas_allocate_block(b, dom, &
+ subroutine mpas_allocate_block(b, dom, blockID, &
#include "dim_dummy_args.inc"
)
@@ -155,10 +157,13 @@
type (block_type), pointer :: b
type (domain_type), pointer :: dom
+ integer, intent(in) :: blockID
#include "dim_dummy_decls.inc"
integer :: i
+ b % blockID = blockID
+
nullify(b % prev)
nullify(b % next)
Modified: branches/omp_blocks/ddt_reorg/src/framework/mpas_io_input.F
===================================================================
--- branches/omp_blocks/ddt_reorg/src/framework/mpas_io_input.F        2012-01-05 22:33:51 UTC (rev 1302)
+++ branches/omp_blocks/ddt_reorg/src/framework/mpas_io_input.F        2012-01-05 23:00:49 UTC (rev 1303)
@@ -730,7 +730,7 @@
nEdges = nlocal_edges
nVertices = nlocal_vertices
- call mpas_allocate_block(domain % blocklist, domain, &
+ call mpas_allocate_block(domain % blocklist, domain, domain%dminfo%my_proc_id, &
#include "dim_dummy_args.inc"
)
</font>
</pre>