Skip to content

Commit

Permalink
just remove test_parallel_distribute_mesh from test
Browse files Browse the repository at this point in the history
  • Loading branch information
stoiveroberts committed Sep 14, 2022
1 parent c8cd3e7 commit 3fb8128
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
20 changes: 13 additions & 7 deletions anuga/parallel/parallel_generic_communications.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ def communicate_flux_timestep(domain, yieldstep, finaltime):
t0 = time.time()


local_timestep = domain.local_timestep
global_timestep = domain.global_timestep

#pypar.allreduce(domain.local_timestep, pypar.MIN,
# buffer=domain.global_timestep,
# bypass=True)

from mpi4py import MPI
pypar.comm.Barrier()
pypar.comm.Allreduce(domain.local_timestep, domain.global_timestep, op=MPI.MIN)
pypar.comm.Barrier()
#pypar.comm.Barrier()
pypar.comm.Allreduce(local_timestep, global_timestep, op=MPI.MIN)
#pypar.comm.Barrier()


domain.communication_reduce_time += time.time()-t0
Expand Down Expand Up @@ -75,7 +78,7 @@ def communicate_flux_timestep(domain, yieldstep, finaltime):



def communicate_ghosts_blocking(domain):
def communicate_ghosts_blocking(domain, quantities=None):

# We must send the information from the full cells and
# receive the information for the ghost cells
Expand All @@ -86,6 +89,9 @@ def communicate_ghosts_blocking(domain):
import time
t0 = time.time()

if quantities is None:
quantities = domain.conserved_quantities

# update of non-local ghost cells
for iproc in range(domain.numproc):
if iproc == domain.processor:
Expand All @@ -96,7 +102,7 @@ def communicate_ghosts_blocking(domain):
Idf = domain.full_send_dict[send_proc][0]
Xout = domain.full_send_dict[send_proc][2]

for i, q in enumerate(domain.conserved_quantities):
for i, q in enumerate(quantities):
#print 'Send',i,q
Q_cv = domain.quantities[q].centroid_values
Xout[:,i] = num.take(Q_cv, Idf)
Expand All @@ -113,7 +119,7 @@ def communicate_ghosts_blocking(domain):

X = pypar.receive(int(iproc), buffer=X, bypass=True)

for i, q in enumerate(domain.conserved_quantities):
for i, q in enumerate(quantities):
#print 'Receive',i,q
Q_cv = domain.quantities[q].centroid_values
num.put(Q_cv, Idg, X[:,i])
Expand All @@ -130,7 +136,7 @@ def communicate_ghosts_blocking(domain):
# now store ghost as local id, global id, value
Idg = domain.ghost_recv_dict[iproc][0]

for i, q in enumerate(domain.conserved_quantities):
for i, q in enumerate(quantities):
#print 'LOCAL SEND RECEIVE',i,q
Q_cv = domain.quantities[q].centroid_values
num.put(Q_cv, Idg, num.take(Q_cv, Idf))
Expand Down
7 changes: 4 additions & 3 deletions anuga/shallow_water/shallow_water_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
def profileit(name):
def inner(func):
def wrapper(*args, **kwargs):
import cProfile
prof = cProfile.Profile()
retval = prof.runcall(func, *args, **kwargs)
# Note use of name from outer scope
Expand Down Expand Up @@ -2308,7 +2309,7 @@ def distribute_using_vertex_limiter(self):
raise Exception('Unknown order')
else:
# Old code:
for name in domain.conserved_quantities:
for name in self.conserved_quantities:
Q = self.quantities[name]

if self._order_ == 1:
Expand Down Expand Up @@ -3368,7 +3369,7 @@ def distribute_using_vertex_limiter(domain):
raise Exception('Unknown order')

# Take bed elevation into account when water heights are small
balance_deep_and_shallow(domain)
domain.balance_deep_and_shallow()

# Compute edge values by interpolation
for name in domain.conserved_quantities:
Expand Down Expand Up @@ -3589,7 +3590,7 @@ def depth_dependent_friction(domain, default_friction,
elif d_vals[i] >= d2:
ddf = n2
else:
ddf = n1 + (old_div((n2-n1),(d2-d1)))*(d_vals[i]-d1)
ddf = n1 + ((n2-n1)/(d2-d1))*(d_vals[i]-d1)

# check sanity of result
if (ddf < 0.010 or \
Expand Down

0 comments on commit 3fb8128

Please sign in to comment.