Skip to content

Commit

Permalink
Specialize topology in benchmark scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Oct 11, 2023
1 parent 56dbb65 commit e2bc198
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion fast/diffusion_3D_wBCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@

print("dx %s, dy %s, dz %s" % (dx, dy, dz))

grid = Grid(shape=(nx, ny, nz), extent=(2., 2., 2.))
topology = None
#xDSL only handles 2D domain decomposition right now
if args.xdsl:
topology = ('*', '*', 1)

grid = Grid(shape=(nx, ny, nz), extent=(2., 2., 2.), topology=topology)
u = TimeFunction(name='u', grid=grid, space_order=so)

a = Constant(name='a')
Expand Down
3 changes: 2 additions & 1 deletion fast/mpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ do

# To uncomment to check what's going on without capturing the output.
# echo OMP_NUM_THREADS=$threads
mpirun -np $MPI_NUM_RANKS --bind-to=core python $bench -so $so --devito 1
# mpirun -np $MPI_NUM_RANKS --bind-to=core python $bench -so $so --devito 1
# mpirun -np $MPI_NUM_RANKS --bind-to=core python $bench -so $so --xdsl 1

# Get the runtimes
devito_time=$(get_runtime mpirun -np $MPI_NUM_RANKS --bind-to=core python $bench -so $so --devito 1)
Expand Down
8 changes: 7 additions & 1 deletion fast/wave3d_b.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@
origin = as_tuple(0.0 for _ in range(len(shape))) # What is the location of the top left corner.
domain_size = tuple((d-1) * s for d, s in zip(shape, spacing))
extent = np.load("so%s_grid_extent%s.npz" % (so, shape_str))['arr_0']
grid = Grid(shape=shape, extent=as_tuple(extent))

topology = None
#xDSL only handles 2D domain decomposition right now
if args.xdsl:
topology = ('*', '*', 1)

grid = Grid(shape=(nx, ny, nz), extent=(2., 2., 2.), topology=topology)

# With the velocity and model size defined, we can create the seismic model that
# encapsulates this properties. We also define the size of the absorbing layer as
Expand Down

0 comments on commit e2bc198

Please sign in to comment.