Skip to content

Commit 375bd23

Browse files
committed
examples: Show strided sub-block gather in MPI data notebook
Now that data_gather handles a strided slice whose start falls inside a subdomain, demonstrate it in the reading example (f.data_gather(start=2, stop=8, step=2)).
1 parent cf38077 commit 375bd23

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

examples/mpi/data_initialization.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@
310310
"myrank = grid.distributor.myrank\n",
311311
"\n",
312312
"# `data_gather` collects (a slice of) the global array onto one rank.\n",
313-
"whole = f.data_gather(rank=0) # full global array\n",
314-
"window = f.data_gather(start=2, stop=8, rank=0) # contiguous sub-block\n",
315-
"reverse = f.data_gather(step=-1, rank=0) # reversed on every axis\n",
313+
"whole = f.data_gather(rank=0) # full global array\n",
314+
"window = f.data_gather(start=2, stop=8, step=2, rank=0) # strided sub-block\n",
315+
"reverse = f.data_gather(step=-1, rank=0) # reversed on every axis\n",
316316
"if myrank == 0:\n",
317317
" assert np.all(whole == glb_a)\n",
318-
" assert np.all(window == glb_a[2:8, 2:8])\n",
318+
" assert np.all(window == glb_a[2:8:2, 2:8:2])\n",
319319
" assert np.all(reverse == glb_a[::-1, ::-1])"
320320
]
321321
},

0 commit comments

Comments
 (0)