<p><b>mmwolf@sandia.gov</b> 2010-01-05 14:32:08 -0700 (Tue, 05 Jan 2010)</p><p>More changes to integrate Zoltan Ordering, should not affect people not using Zoltan<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/swmodel/Makefile
===================================================================
--- trunk/swmodel/Makefile        2009-12-23 20:45:27 UTC (rev 100)
+++ trunk/swmodel/Makefile        2010-01-05 21:32:08 UTC (rev 101)
@@ -67,7 +67,7 @@
 RANLIB = ranlib
 
 #########################
-# Section for Zoltan TPL                                                                                                                                                                                      
+# Section for Zoltan TPL
 #########################
 ifdef ZOLTAN_HOME
    FFLAGS += -DHAVE_ZOLTAN

Modified: trunk/swmodel/namelist.input
===================================================================
--- trunk/swmodel/namelist.input        2009-12-23 20:45:27 UTC (rev 100)
+++ trunk/swmodel/namelist.input        2010-01-05 21:32:08 UTC (rev 101)
@@ -2,7 +2,7 @@
    config_test_case = 5
    config_time_integration = 'RK4'
    config_dt = 172.8
-   config_ntimesteps = 7500
+   config_ntimesteps = 2500
    config_output_interval = 500
    config_visc  = 0.0
 /

Modified: trunk/swmodel/src/Makefile
===================================================================
--- trunk/swmodel/src/Makefile        2009-12-23 20:45:27 UTC (rev 100)
+++ trunk/swmodel/src/Makefile        2010-01-05 21:32:08 UTC (rev 101)
@@ -24,7 +24,7 @@
 
 all: swmodel
 
-swmodel.o: module_configure.o module_dmpar.o module_grid_types.o module_test_cases.o module_io_input.o module_sw_solver.o module_timer.o
+swmodel.o: module_configure.o module_dmpar.o module_grid_types.o module_test_cases.o module_io_input.o module_sw_solver.o module_timer.o $(ZOLTANOBJ)
 
 module_configure.o: module_dmpar.o
 
@@ -34,7 +34,7 @@
 
 module_block_decomp.o: module_grid_types.o module_hash.o
 
-module_io_input.o: module_grid_types.o module_dmpar.o module_block_decomp.o module_sort.o module_configure.o
+module_io_input.o: module_grid_types.o module_dmpar.o module_block_decomp.o module_sort.o module_configure.o $(ZOLTANOBJ)
 
 module_io_output.o: module_grid_types.o module_dmpar.o module_sort.o module_configure.o
 

Modified: trunk/swmodel/src/module_io_input.F
===================================================================
--- trunk/swmodel/src/module_io_input.F        2009-12-23 20:45:27 UTC (rev 100)
+++ trunk/swmodel/src/module_io_input.F        2010-01-05 21:32:08 UTC (rev 101)
@@ -6,6 +6,10 @@
    use sort
    use configure
 
+#ifdef HAVE_ZOLTAN
+   use zoltan_interface
+#endif
+
    type io_input_object
       character (len=1024) :: filename
       integer :: rd_ncid
@@ -331,7 +335,17 @@
       block_graph_2Halo % nVertices = block_graph_0Halo % nVertices
       block_graph_2Halo % ghostStart = block_graph_2Halo % nVertices + 1
 
-   
+#ifdef HAVE_ZOLTAN
+#ifdef _MPI 
+      !! For now, only use Zoltan with MPI
+      !! Zoltan initialization
+      call zoltanStart()
+
+      !! Zoltan hook for cells
+      call zoltanOrderLocHSFC_Cells(block_graph_2Halo%nVertices,block_graph_2Halo%VertexID)
+#endif
+#endif
+
       call dmpar_get_owner_list(domain % dminfo, &amp;
                                 block_graph_0Halo % nVertices, block_graph_2Halo % nVerticesTotal, &amp;
                                 block_graph_0Halo % vertexID,  block_graph_2Halo % vertexID, &amp;

Modified: trunk/swmodel/src/module_zoltan_interface.F
===================================================================
--- trunk/swmodel/src/module_zoltan_interface.F        2009-12-23 20:45:27 UTC (rev 100)
+++ trunk/swmodel/src/module_zoltan_interface.F        2010-01-05 21:32:08 UTC (rev 101)
@@ -4,6 +4,9 @@
 
    implicit none
 
+   integer :: numCells
+   integer, dimension(:), pointer :: cellIDs
+
    contains
 
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -14,6 +17,7 @@
       integer(Zoltan_INT) :: error
       real(Zoltan_FLOAT) :: version
 
+
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       !! Body of subroutine
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -25,9 +29,13 @@
 
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   subroutine zoltanOrderLocHSFC_Cells()
+   subroutine zoltanOrderLocHSFC_Cells(in_numcells,in_cellIDs)
 
       implicit none
+
+      integer :: in_numcells
+      integer, dimension(:), pointer :: in_cellIDs
+
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       !! local variables
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -38,11 +46,15 @@
       integer :: numGidEntries, myrank, locNumObj, i
       integer(ZOLTAN_INT), allocatable :: global_ids(:)
       integer(ZOLTAN_INT), allocatable :: permGIDs(:)
+      integer(ZOLTAN_INT), allocatable :: permIndices(:)
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       !! Body of subroutine
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      numCells = in_numcells
+      cellIDs =&gt; in_cellIDs
+
       nullify(zz_obj)
       zz_obj =&gt; Zoltan_Create(MPI_COMM_SELF)
 
@@ -64,6 +76,7 @@
 
       allocate(global_ids(locNumObj))
       allocate(permGIDs(locNumObj))
+      allocate(permIndices(locNumObj))
 
       call MPI_Comm_rank(MPI_COMM_WORLD, myrank, ierr)
 
@@ -71,15 +84,22 @@
         global_ids(i) = i
       end do
 
-      ierr = Zoltan_Order(zz_obj, numGidEntries, locNumObj, global_ids, permGIDs);
+      ierr = Zoltan_Order(zz_obj, numGidEntries, locNumObj, global_ids, permIndices);
 
-
+      !!!!!!!!!!!!!!!!!!!!!!!!!!
+      !! This is necessary for now until we fix a small bug in Zoltan_Order
+      !!!!!!!!!!!!!!!!!!!!!!!!!!
       do i=1,locNumObj
-         write(*,*) global_ids(i), permGIDs(i)
+        permGIDs(i) = global_ids(permIndices(i)+1)
       end do
 
+!!      do i=1,locNumObj
+!!         write(*,*) global_ids(i), permGIDs(i)
+!!      end do
+
       deallocate(global_ids)
       deallocate(permGIDs)
+      deallocate(permIndices)
 
       call Zoltan_Destroy(zz_obj)
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                                                                                                                                 
@@ -98,6 +118,7 @@
       integer(ZOLTAN_INT), intent(out) :: ierr
 
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !! MMW: Should be set to numCells
       zqfNumCells = 16
       ierr = ZOLTAN_OK
       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -126,6 +147,8 @@
 
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+     !! MMW: cellIDs should have global cell IDs
+
      do i= 1, 16
        global_ids(i) = i
        local_ids(i) = i

</font>
</pre>