Index: anuga_core/source/anuga_parallel/parallel_api.py
===================================================================
--- anuga_core/source/anuga_parallel/parallel_api.py	(revision 6719)
+++ anuga_core/source/anuga_parallel/parallel_api.py	(revision 6721)
@@ -117,4 +117,7 @@
     #------------------------------------------------------------------------
 
+    if verbose: print 'myid ',myid, number_of_full_nodes, number_of_full_triangles
+
+    
     domain = Parallel_Domain(points, vertices, boundary,
                              full_send_dict=full_send_dict,
Index: anuga_core/source/anuga_parallel/parallel_meshes.py
===================================================================
--- anuga_core/source/anuga_parallel/parallel_meshes.py	(revision 6719)
+++ anuga_core/source/anuga_parallel/parallel_meshes.py	(revision 6721)
@@ -42,4 +42,7 @@
     numproc   = pypar.size()
 
+    print 'numproc',numproc
+    print 'processor ',processor
+
     m_low, m_high = pypar.balance(m_g, numproc, processor)
     
@@ -47,4 +50,6 @@
     m_low  = m_low-1
     m_high = m_high+1
+
+    print 'm_low, m_high', m_low, m_high
     m = m_high - m_low
 
@@ -161,8 +166,19 @@
         Idfl.extend(Idfr)
         Idgr.extend(Idgl)
+
+        print Idfl
+        print Idgr
+        
         Idfl = array(Idfl,Int)
         Idgr = array(Idgr,Int)
+
+        print Idfl
+        print Idgr
+        
         full_send_dict[processor]  = [Idfl, Idfl]
         ghost_recv_dict[processor] = [Idgr, Idgr]
+
+        print  full_send_dict[processor]
+        print ghost_recv_dict[processor]
     elif numproc == 2:
         Idfl.extend(Idfr)
@@ -186,5 +202,6 @@
 
 
-        
+    print full_send_dict
+    print ghost_recv_dict        
     
     return  points, elements, boundary, full_send_dict, ghost_recv_dict
Index: anuga_core/source/anuga_parallel/pmesh_divide.py
===================================================================
--- anuga_core/source/anuga_parallel/pmesh_divide.py	(revision 6719)
+++ anuga_core/source/anuga_parallel/pmesh_divide.py	(revision 6721)
@@ -119,5 +119,5 @@
     n_tri = len(domain.triangles)
     if n_procs != 1: #Because metis chokes on it...
-        n_vert = domain.number_of_nodes
+        n_vert = domain.get_number_of_nodes()
         t_list = domain.triangles.copy()
         t_list = reshape(t_list, (-1,))
Index: anuga_core/source/anuga_parallel/run_parallel_advection.py
===================================================================
--- anuga_core/source/anuga_parallel/run_parallel_advection.py	(revision 6719)
+++ anuga_core/source/anuga_parallel/run_parallel_advection.py	(revision 6721)
@@ -50,6 +50,6 @@
 processor_name = pypar.Get_processor_name()
 
-N = 100
-M = 100
+N = 5
+M = 2
 
 #######################
@@ -62,4 +62,9 @@
 points, vertices, boundary, full_send_dict, ghost_recv_dict =  \
     parallel_rectangle(N, M, len1_g=1.0)
+
+#print 'ghost ',ghost_recv_dict
+#print 'full  ',full_send_dict
+
+
 
 print "Myid = ", myid, "no points = ", len(points), \
@@ -75,4 +80,8 @@
 domain = Parallel_Domain(points, vertices, boundary,
                          full_send_dict, ghost_recv_dict, velocity=[1.0, 0.0])
+
+#print 'ghost ',ghost_recv_dict
+#print 'full  ',full_send_dict
+
 
 # Boundaries
@@ -116,6 +125,5 @@
     from anuga.visualiser import RealtimeVisualiser
     vis = RealtimeVisualiser(domain)
-    #vis.render_quantity_height("elevation", offset=0.01, dynamic=False)
-    vis.render_quantity_height("stage", dynamic=True)
+    vis.render_quantity_height("stage", zScale = 5.0, dynamic=True)
     vis.colour_height_quantity('stage', (0.2, 0.2, 0.8))
     vis.start()
Index: anuga_core/source/anuga_parallel/test_parallel_sw.py
===================================================================
--- anuga_core/source/anuga_parallel/test_parallel_sw.py	(revision 6719)
+++ anuga_core/source/anuga_parallel/test_parallel_sw.py	(revision 6721)
@@ -170,5 +170,5 @@
 def assert_(condition, msg="Assertion Failed"):
     if condition == False:
-        pypar.finalize()
+        #pypar.finalize()
         raise AssertionError, msg
 
@@ -215,6 +215,5 @@
                         assert_(abs(l2norm_par[x][y] - l2norm_par[x-1][y]) < tol)
                         assert_(abs(linfnorm_par[x][y] - linfnorm_par[x-1][y]) < tol)
-
-        if myid == 0:
+                
             print 'Parallel test OK'
 
Index: anuga_core/source/anuga_parallel/test_parallel_sw_runup.py
===================================================================
--- anuga_core/source/anuga_parallel/test_parallel_sw_runup.py	(revision 6719)
+++ anuga_core/source/anuga_parallel/test_parallel_sw_runup.py	(revision 6721)
@@ -42,4 +42,5 @@
     domain = Domain(points, vertices, boundary) # Create domain
 else:
+    #So full domain is only constructed for the 0th processor (will save on memory)
     domain = None
 
@@ -61,18 +62,25 @@
 # Create the parallel domain
 #--------------------------------------------------------------------------
+domain = distribute(domain, verbose=False)
 
-domain = distribute(domain, verbose=True)
-
+#--------------------------------------------------------------------------
+# Setup domain parameters
+#--------------------------------------------------------------------------
 domain.set_name('runup')                    # Set sww filename
 domain.set_datadir('.')                     # Set output dir
-domain.set_maximum_allowed_speed(100)       # 
+
+domain.set_default_order(1)        
 domain.set_quantities_to_be_stored(None)
+domain.set_maximum_allowed_speed(100) #FIXME (Ole): try to remove this
+
+# FIXME (Ole): Need tests where this is commented out
 domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)
 domain.H0 = 0 # Backwards compatibility (6/2/7)
 domain.use_centroid_velocities = 0 # Backwards compatibility (7/5/8)
 
+
 #------------------------------------------------------------------------------
 # Setup boundary conditions
-# This must currently happen *after* domain has been distributed
+# This must currently happen *AFTER* domain has been distributed
 #------------------------------------------------------------------------------
 
@@ -89,36 +97,30 @@
 #------------------------------------------------------------------------------
 
-interpolation_points = [[0.4,0.5], [0.6,0.5], [0.8,0.5], [0.9,0.5]]
+interpolation_points = [[0.4,0.51], [0.6,0.51], [0.8,0.51], [0.9,0.51]]
 gauge_values = []
-local_interpolation_points = []
+tri_ids = []
 for i, point in enumerate(interpolation_points):
     gauge_values.append([]) # Empty list for timeseries
 
-    if is_inside_polygon(point, domain.get_boundary_polygon()):
+    #if is_inside_polygon(point, domain.get_boundary_polygon()):
+    try:
+        k = domain.get_triangle_containing_point(point)
+        #print 'KKK',myid, k, domain.tri_full_flag[k]
+        if domain.tri_full_flag[k] == 1:
+            tri_ids.append(k)
+        else:
+            tri_ids.append(-1)            
+    except:
+        tri_ids.append(-2)
 
-        # FIXME: One point appears on multiple processes
-        # Need to get true boundary somehow
-        
-        #print 'P%d: point=[%f,%f]' %(myid, point[0], point[1])
-        local_interpolation_points.append(i)
+#print myid, tri_ids
+#print myid, domain.tri_full_flag[tri_ids[0]]
 
-# Hack before we excluded ghosts.
-if numprocs == 2:
-    if myid == 0:
-        del local_interpolation_points[0]                
-        #local_interpolation_points = [1,2,3]
-if numprocs == 3:
-    if myid == 1:
-        del local_interpolation_points[0]
-if numprocs == 4:
-    if myid == 0:
-        del local_interpolation_points[1] #2
-        del local_interpolation_points[1] #3                
-    if myid == 3:
-        del local_interpolation_points[1]
+
+#print myid, domain.tri_full_flag
 
 
 
-print 'P%d has points = %s' %(myid, local_interpolation_points)
+print 'P%d has points = %s' %(myid, tri_ids)
 
 
@@ -126,5 +128,5 @@
 
 for t in domain.evolve(yieldstep = 0.1, finaltime = 5.0):
-    domain.write_time()
+    if myid == 0: domain.write_time()
 
     # Record time series at known points
@@ -132,47 +134,20 @@
     
     stage = domain.get_quantity('stage')
-    w = stage.get_values(interpolation_points=interpolation_points)
 
-    print 'P%d:w(%f) = '%(myid,domain.get_time()),w
-    
-    for i, _ in enumerate(interpolation_points):
-        gauge_values[i].append(w[i])
-
-## if myid == 0:
-##     for i, (x,y) in enumerate(interpolation_points):
-
-##         try:
-##             from pylab import *
-##         except:
-##             pass
-##         else:
-##             ion()
-##             hold(False)
-##             plot(time, gauge_values[i], 'r.-')
-##             #time, predicted_gauge_values[i], 'k-')
-
-##             title('Gauge %d (%f,%f)' %(i,x,y))
-##             xlabel('time(s)')
-##             ylabel('stage (m)')    
-##             #legend(('Observed', 'Modelled'), shadow=True, loc='upper left')
-##             #savefig('Gauge_%d.png' %i, dpi = 300)
-
-##         raw_input('Next')
-        
+    for i in range(4):
+        if tri_ids[i] > -1:
+            gauge_values[i].append(stage.centroid_values[tri_ids[i]])
 
 
-# Reference from sequential version (also available as a
-# unit test in test_shallow_water_domain)
-# Added Friday 13 October 2006 by Ole
 
-        G0 = ensure_numeric([-0.20000000000000001, -0.20000000000000001, -0.19920600846161715, -0.19153647344085376, -0.19127622768281194, -0.1770671909675095, -0.16739412133181927, -0.16196038919122191, -0.15621633053131384, -0.15130021599977705, -0.13930978857215484, -0.19349274358263582, -0.19975307598803765, -0.19999897143103357, -0.1999999995532111, -0.19999999999949952, -0.19999999999949952, -0.19999999999949952, -0.19997270012494556, -0.19925805948554556, -0.19934513778450533, -0.19966484196394893, -0.1997352860102084, -0.19968260481750394, -0.19980280797303882, -0.19998804881822749, -0.19999999778075916, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167, -0.19999999999966167])
 
-        G1 = ensure_numeric([-0.29999999999999993, -0.29999588068034899, -0.29250047332330331, -0.28335081844518584, -0.26142206997410805, -0.22656028856329835, -0.21224087216745585, -0.19934324109114465, -0.1889857939783175, -0.18146311603911383, -0.17401078727434263, -0.15419361061257214, -0.16225060576782063, -0.19010941396999181, -0.20901161407004412, -0.21670683975774699, -0.21771386270738891, -0.21481284465869752, -0.21063120869004387, -0.20669243364582401, -0.20320707386714859, -0.19984087691926442, -0.19725417448019505, -0.19633783049069981, -0.19650494599999785, -0.19708316838336942, -0.19779309449413818, -0.19853070294429562, -0.19917342167307153, -0.19964814677795845, -0.19991627610824922, -0.20013162970144974, -0.20029864969405509, -0.20036259676501131, -0.20030682824965193, -0.20016105135750167, -0.19997664501985918, -0.19980185871568762, -0.19966836175417696, -0.19958856744312226, -0.19955954696194517, -0.19956950051110917, -0.19960377086336181, -0.19964885299433241, -0.19969427478531132, -0.19973301547655564, -0.19976121574277764, -0.19977765285688653, -0.19978315117522441, -0.19977994634841739, -0.19977101394878494])
-        
-        G2 = ensure_numeric([-0.40000000000000002, -0.39077401254732241, -0.33350466136630474, -0.29771023004255281, -0.27605439066140897, -0.25986156218997497, -0.24502185018573647, -0.231792624329521, -0.21981564668803993, -0.20870707082936543, -0.19877739883776599, -0.18980922837977957, -0.17308011674005838, -0.16306400164013773, -0.17798470933304333, -0.1929554075869116, -0.20236705191987037, -0.20695767560655007, -0.20841025876092567, -0.20792102174869989, -0.20655350005579293, -0.20492002526259828, -0.20310627026780645, -0.20105983335287836, -0.19937394565794653, -0.19853917506699659, -0.19836389977624452, -0.19850305023602796, -0.19877764028836831, -0.19910928131034669, -0.19943705712418805, -0.19970344172958865, -0.19991076989870474, -0.20010020127747646, -0.20025937787100062, -0.20035087292905965, -0.20035829921463297, -0.20029606557316171, -0.20019606915365515, -0.20009096093399206, -0.20000371608204368, -0.19994495432920584, -0.19991535665176338, -0.19990981826533513, -0.19992106419898723, -0.19994189853516578, -0.19996624091229293, -0.19998946016985167, -0.20000842303470234, -0.20002144460718174, -0.20002815561337187])
-        
-        G3 = ensure_numeric([-0.45000000000000001, -0.37631169657400332, -0.33000044342859486, -0.30586045469008522, -0.28843572253009941, -0.27215308978603808, -0.25712951540331219, -0.2431608296216613, -0.23032023651386374, -0.2184546873456619, -0.20735123704254332, -0.19740397194806389, -0.1859829564064375, -0.16675980728362105, -0.16951575032846536, -0.1832860872609344, -0.19485758939241243, -0.20231368291811427, -0.20625610376074754, -0.20758116241495619, -0.20721445402086161, -0.20603406830353785, -0.20450262808396991, -0.2026769581185151, -0.2007401212066364, -0.19931160535777592, -0.19863606301128725, -0.19848511940572691, -0.19860091042948352, -0.19885490669377764, -0.19916542732701112, -0.19946678238611959, -0.19971209594104697, -0.19991912886512292, -0.2001058430788881, -0.20024959409472989, -0.20032160254609382, -0.20031583165752354, -0.20025051539293123, -0.2001556115816068, -0.20005952955420872, -0.1999814429561611, -0.19992977821558131, -0.19990457708664208, -0.19990104785490476, -0.19991257153954825, -0.19993258231880562, -0.19995548502882532, -0.19997700760919687, -0.19999429663503748, -0.20000588800248761])
+G0 = [-0.19166666666666665, -0.19166666666666665, -0.1908726751282839, -0.18320314010752042, -0.18294289434947858, -0.17186692881708804, -0.16703039399924297, -0.16196038919122194, -0.15621633053131387, -0.15130021599977714, -0.13930978857215476, -0.18515941024930252, -0.19141974265470424, -0.19166563809769938, -0.19166666621987774, -0.19166666666616614, -0.19166666666616614, -0.19166666666616614, -0.19163936679820112, -0.19092472615522754, -0.19101180444286325, -0.19133150862916881, -0.1914019526842341, -0.19134927149082989, -0.19146947464147604, -0.19165471548476315, -0.19166666444742567, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831, -0.19166666666632831]
+
+G1 = [-0.29166666666666669, -0.29160604748111429, -0.28349212083663766, -0.26637122760395054, -0.25078182919408626, -0.22796566989512818, -0.21386588163016981, -0.20291676395026542, -0.19288397535979634, -0.18529863721918491, -0.17833464440180594, -0.16041289672597714, -0.15844675190030885, -0.18498595153509523, -0.20472977209518117, -0.21430915468432699, -0.21656349614594508, -0.2143710033505706, -0.21047592509949745, -0.20690277124897924, -0.20383621964071927, -0.2009312504622697, -0.19832906347760781, -0.19715218778669685, -0.19713511857310209, -0.19760258124272423, -0.19821523236790017, -0.19886735995941604, -0.19945089045017395, -0.19990124934465239, -0.20016164831872438, -0.20035891530554095, -0.20053280091253389, -0.20062879519403856, -0.20061453716771055, -0.20050516254700712, -0.20034457406881809, -0.2001804893235041, -0.20004787348381434, -0.19996313076460828, -0.19992645686226715, -0.19992808844809359, -0.19995462843450704, -0.19999336711919727, -0.20003430609120498, -0.20007059456815027, -0.20009823569348062, -0.20011560727571823, -0.20012297891084577, -0.20012200982886325, -0.2001151929510443]
 
         
+G2 = [-0.39166666666666666, -0.38244067921398905, -0.33350466136630463, -0.29771023004255276, -0.27605439066140891, -0.25986156218997503, -0.24502185018573649, -0.23179262432952102, -0.21981564668803996, -0.20870707082936543, -0.19877739883776596, -0.18980922837977954, -0.1730801167400583, -0.16306400164063853, -0.17798470933316624, -0.19295540736943456, -0.20236705173335867, -0.20695767548229582, -0.20841025868691554, -0.20792102171307641, -0.20655350005113712, -0.2049200252815718, -0.20310627030300929, -0.20105983339290284, -0.19937394568595421, -0.1985391750807548, -0.19836389978207072, -0.19850305023816406, -0.19877764028800521, -0.19910928130800573, -0.19943705712074122, -0.19970344172627957, -0.19991076989513878, -0.20010020127344161, -0.20025937786728282, -0.20035087292654716, -0.20035829921368681, -0.20029606557358018, -0.2001960691549278, -0.20009096093557327, -0.20000371608352077, -0.19994495433034862, -0.1999153566524963, -0.19990981826568235, -0.19992106419902292, -0.19994189853498176, -0.19996624091198109, -0.19998946016949451, -0.20000842303436642, -0.20002144460691332, -0.20002815561319481]
+        
+G3 = [-0.44166666666666665, -0.37631169657400343, -0.33000044342859486, -0.30586045469008505, -0.28843572253009925, -0.27215308978603797, -0.25712951540331214, -0.2431608296216613, -0.23032023651386366, -0.21845468734566184, -0.20735123704254327, -0.19740397194806383, -0.18598295640643708, -0.16675980728412546, -0.1695157503295662, -0.18328608714846414, -0.19485758921965809, -0.2023136827680253, -0.20625610365424957, -0.20758116234856749, -0.20721445398906116, -0.20603406830101498, -0.20450262810357958, -0.2026769581530177, -0.20074012124164839, -0.19931160538111795, -0.1986360630235105, -0.19848511941161767, -0.1986009104317408, -0.19885490669335967, -0.19916542732465842, -0.19946678238299068, -0.19971209593781808, -0.19991912886144106, -0.20010584307496243, -0.20024959409137078, -0.20032160254398582, -0.2003158316568579, -0.20025051539345248, -0.20015561158283834, -0.20005952955567172, -0.19998144295750273, -0.19992977821660762, -0.19990457708729134, -0.19990104785520091, -0.19991257153955966, -0.19993258231861782, -0.19995548502852453, -0.19997700760886039, -0.19999429663472679, -0.20000588800224417]
 
 
@@ -180,9 +155,15 @@
 G = [G0, G1, G2, G3]
 
-for i in local_interpolation_points:
-    msg = 'P%d, point #%d: Computed time series and reference time series are different: %s'\
-          %(myid, i, gauge_values[i]-G[i])
-    assert allclose(gauge_values[i], G[i]), msg
 
-print 'P%d completed succesfully using points = %s' %(myid, local_interpolation_points)
+success = True
 
+for i in range(4):
+    if tri_ids[i] > -1:
+        #print 'myid = %g, allclose(gauge_values[%g], G%g) = %g' % (myid, i,i, allclose(gauge_values[i], G[i]))
+        success = success and allclose(gauge_values[i], G[i])
+
+
+if success:
+    print 'Successful completion on processor ',myid
+else:
+    print 'Failure on processor ',myid
