-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathex10.yml
41 lines (41 loc) · 1.95 KB
/
ex10.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# the alpha parameter
alpha: 0.125
# global data-size (excluding the number of ghost layers for boundary conditions)
global_size: { height: 60, width: 12 }
# degree of parallelism (number of blocks in each dimension)
parallelism: { height: 2, width: 2 }
# PDI configuration
pdi:
metadata: # small values for which PDI keeps a copy
ii: int
dsize: { type: array, subtype: int, size: 2 }
psize: { type: array, subtype: int, size: 2 }
pcoord: { type: array, subtype: int, size: 2 }
data: # values for which PDI does not keep a copy
main_field: { type: array, subtype: double, size: [ '$dsize[0]', '$dsize[1]' ] }
plugins:
mpi:
decl_hdf5:
file: ex10.h5
communicator: $MPI_COMM_WORLD
datasets: # list the name of the dataset in the file ex10.h5
main_field: { type: array, subtype: double, size: [ 3, '$psize[0]*($dsize[0]-2)', '$psize[1]*($dsize[1]-2)' ] }
write:
#*** the name of the PDI variable to write
#...
dataset: main_field # name of the dataset in the h5 file (defined in the directive datasets) that we want to fill
dataset_selection:
size: [1, '$dsize[0]-2', '$dsize[1]-2']
start: ['$ii-1', '$pcoord[0]*($dsize[0]-2)', '$pcoord[1]*($dsize[1]-2)']
#*** load the pycall plugin and enable this plugin for event loop
#...
#*** specifies the input parameters (variables) to pass to Python as a set of "$-expressions" (expressions must be defined in .yml script)
#...
#*** add exec keyword of pycall plugin and after the colon, add a space and a vertical bar
#...
# uncomment the following python script
# import numpy as np
# if 0 < iter_id < 4: # iter_id: time iteration
# transformed_field = np.sqrt(source_field[1:-1,1:-1])
# pdi.expose('transformed_field', transformed_field, pdi.OUT)
## the last line allows to expose transformed field to PDI (hence, the data is known by PDI in this call)