This repository was archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_domain_comm.c
More file actions
51 lines (40 loc) · 2.19 KB
/
test_domain_comm.c
File metadata and controls
51 lines (40 loc) · 2.19 KB
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
42
43
44
45
46
47
#include "domain_comm.h"
int main(void) {
domain_info *d = malloc(sizeof *d);
int world_size = 9;
size_t number_slices_x = 4;
size_t number_slices_z = 3;
size_t stencil_size_x = 4;
size_t stencil_size_z = 4;
size_t nx = 1200;
size_t nz = 900;
size_t sx = 110;
size_t sz = 315;
// fprintf(stderr,"#Slices X: %5zu Z: %5zu\n", d->number_slices_x, d->number_slices_z);
// fprintf(stderr,"Stencil X: %5zu Z: %5zu\n", d->stencil_size_x, d->stencil_size_z);
// fprintf(stderr,"# grid X: %5zu Z: %5zu\n", d->nx, d->nz);
for(int world_rank=0; world_rank< world_size; world_rank++) {
decompose_domain(world_size, world_rank,
number_slices_x, number_slices_z,
stencil_size_x, stencil_size_z,
nx, nz,
sx, sz,
d);
fprintf(stderr,"Environment info\n");
fprintf(stderr,"=============================================\n");
fprintf(stderr,"MPI size: %5d rank: %5d\n", d->world_size, d->world_rank);
fprintf(stderr,"\nSubdomain info\n");
fprintf(stderr,"=============================================\n");
fprintf(stderr,"RelPos X: %5zu Z: %5zu\n", d->relative_pos_x, d->relative_pos_z);
fprintf(stderr,"Slice_0 X: %5zu Z: %5zu\n", d->slice_x0, d->slice_z0);
fprintf(stderr,"Slice_N X: %5zu Z: %5zu\n", d->slice_nx, d->slice_nz);
fprintf(stderr,"Positin X: %5d Z: %5d\n", d->horizontal_position, d->vertical_position);
fprintf(stderr,"nx a: %5zu b: %5zu\n", d->nxa, d->nxb);
fprintf(stderr,"nz a: %5zu b: %5zu\n", d->nza, d->nzb);
fprintf(stderr,"Ranks U: %5d B: %5d\n", d->upper_rank, d->lower_rank);
fprintf(stderr,"Ranks L: %5d R: %5d\n", d->left_rank, d->right_rank);
fprintf(stderr,"source %d SX: %5zu SZ: %5zu\n", d->has_source, d->sx, d->sz);
fprintf(stderr,"lsource LSX: %5zu LSZ: %5zu\n", d->lsx, d->lsz);
fprintf(stderr,"\n");
}
}