@@ -174,30 +174,30 @@ static void compute_psign() {
174
174
}
175
175
176
176
#ifndef WITH_MPI_CART
177
- #define MPI_coord_to_id (x0 , x1 , x2 , x3 , ib0 , ib1 , ib2 , ib3 ) \
178
- (x1 + (NP_X / MPI_NBLK_X ) * (x2 + (NP_Y / MPI_NBLK_Y ) * (x3 + (NP_Z / MPI_NBLK_Z ) * x0 ))) + \
179
- (NP_X / MPI_NBLK_X ) * (NP_Y / MPI_NBLK_Y ) * (NP_Z / MPI_NBLK_Z) * (NP_T / MPI_NBLK_T) * \
180
- (ib1 + (MPI_NBLK_X ) * (ib2 + (MPI_NBLK_Y ) * (ib3 + (MPI_NBLK_Z ) * ib0)))
177
+ #define MPI_coord_to_id (x0 , x1 , x2 , x3 , ib0 , ib1 , ib2 , ib3 ) \
178
+ ((x1) + (MPI_BLK_X ) * ((x2) + (MPI_BLK_Y ) * ((x3) + (MPI_BLK_Z ) * (x0) ))) + \
179
+ (MPI_BLK_X) * (MPI_BLK_Y ) * (MPI_BLK_Z) * (MPI_BLK_T ) * \
180
+ (( ib1) + (NP_X/MPI_BLK_X ) * (( ib2) + (NP_Y/MPI_BLK_Y ) * (( ib3) + (NP_Z/MPI_BLK_Z ) * ( ib0) )))
181
181
182
- void MPI_id_to_coord (int MPI_coord_id , int * ixc , int * ibc , int * ix ) {
182
+ void MPI_id_to_coord (int MPI_coord_id , int * ixc , int * ibc , int * ix ) {
183
183
int nib , nix ;
184
- nib = MPI_coord_id / ((NP_X / MPI_NBLK_X ) * (NP_Y / MPI_NBLK_Y ) * (NP_Z / MPI_NBLK_Z ) * (NP_T / MPI_NBLK_T ));
185
- nix = MPI_coord_id % ((NP_X / MPI_NBLK_X ) * (NP_Y / MPI_NBLK_Y ) * (NP_Z / MPI_NBLK_Z ) * (NP_T / MPI_NBLK_T ));
186
-
187
- ixc [1 ] = nix % (NP_X / MPI_NBLK_X );
188
- ixc [2 ] = (nix / (NP_X / MPI_NBLK_X )) % (NP_Y / MPI_NBLK_Y );
189
- ixc [3 ] = ((nix / (NP_X / MPI_NBLK_X )) / (NP_Y / MPI_NBLK_Y )) % (NP_Z / MPI_NBLK_Z );
190
- ixc [0 ] = (((nix / (NP_X / MPI_NBLK_X )) / (NP_Y / MPI_NBLK_Y )) / (NP_Z / MPI_NBLK_Z ));
191
-
192
- ibc [1 ] = nib % (MPI_NBLK_X );
193
- ibc [2 ] = (nib / (MPI_NBLK_X )) % (MPI_NBLK_Y );
194
- ibc [3 ] = ((nib / (MPI_NBLK_X )) / (MPI_NBLK_Y )) % (MPI_NBLK_Z );
195
- ibc [0 ] = (((nib / (MPI_NBLK_X )) / (MPI_NBLK_Y )) / (MPI_NBLK_Z ));
196
-
197
- ix [0 ] = ixc [0 ] + ibc [0 ] * (NP_T / MPI_NBLK_T );
198
- ix [1 ] = ixc [1 ] + ibc [1 ] * (NP_X / MPI_NBLK_X );
199
- ix [2 ] = ixc [2 ] + ibc [2 ] * (NP_Y / MPI_NBLK_Y );
200
- ix [3 ] = ixc [3 ] + ibc [3 ] * (NP_Z / MPI_NBLK_Z );
184
+ nib = MPI_coord_id / ((MPI_BLK_X ) * (MPI_BLK_Y ) * (MPI_BLK_Z ) * (MPI_BLK_T ));
185
+ nix = MPI_coord_id % ((MPI_BLK_X ) * (MPI_BLK_Y ) * (MPI_BLK_Z ) * (MPI_BLK_T ));
186
+
187
+ ixc [1 ] = nix % (MPI_BLK_X );
188
+ ixc [2 ] = (nix / (MPI_BLK_X )) % (MPI_BLK_Y );
189
+ ixc [3 ] = ((nix / (MPI_BLK_X )) / (MPI_BLK_Y )) % (MPI_BLK_Z );
190
+ ixc [0 ] = (((nix / (MPI_BLK_X )) / (MPI_BLK_Y )) / (MPI_BLK_Z ));
191
+
192
+ ibc [1 ] = nib % (NP_X / MPI_BLK_X );
193
+ ibc [2 ] = (nib / (NP_X / MPI_BLK_X )) % (NP_Y / MPI_BLK_Y );
194
+ ibc [3 ] = ((nib / (NP_X / MPI_BLK_X )) / (NP_Y / MPI_BLK_Y )) % (NP_Z / MPI_BLK_Z );
195
+ ibc [0 ] = (((nib / (NP_X / MPI_BLK_X )) / (NP_Y / MPI_BLK_Y )) / (NP_Z / MPI_BLK_Z ));
196
+
197
+ ix [0 ] = ixc [0 ] + ibc [0 ] * (MPI_BLK_T );
198
+ ix [1 ] = ixc [1 ] + ibc [1 ] * (MPI_BLK_X );
199
+ ix [2 ] = ixc [2 ] + ibc [2 ] * (MPI_BLK_Y );
200
+ ix [3 ] = ixc [3 ] + ibc [3 ] * (MPI_BLK_Z );
201
201
}
202
202
203
203
#endif
@@ -332,14 +332,14 @@ int geometry_init() {
332
332
}
333
333
#else
334
334
335
- error (NP_T % MPI_NBLK_T != 0 , 1 , "geometry_init " __FILE__ ,
336
- "MPI_NBLK_T must be an exact divisor of NP_T (NP_T % MPI_NBLK_T == 0)" );
337
- error (NP_X % MPI_NBLK_X != 0 , 1 , "geometry_init " __FILE__ ,
338
- "MPI_NBLK_X must be an exact divisor of NP_X (NP_X % MPI_NBLK_X == 0)" );
339
- error (NP_Y % MPI_NBLK_Y != 0 , 1 , "geometry_init " __FILE__ ,
340
- "MPI_NBLK_Y must be an exact divisor of NP_Y (NP_Y % MPI_NBLK_Y == 0)" );
341
- error (NP_Z % MPI_NBLK_Z != 0 , 1 , "geometry_init " __FILE__ ,
342
- "MPI_NBLK_Z must be an exact divisor of NP_Z (NP_Z % MPI_NBLK_Z == 0)" );
335
+ error (NP_T % MPI_BLK_T != 0 , 1 , "geometry_init " __FILE__ ,
336
+ "MPI_BLK_T must be an exact divisor of NP_T (NP_T % MPI_BLK_T == 0)" );
337
+ error (NP_X % MPI_BLK_X != 0 , 1 , "geometry_init " __FILE__ ,
338
+ "MPI_BLK_X must be an exact divisor of NP_X (NP_X % MPI_BLK_X == 0)" );
339
+ error (NP_Y % MPI_BLK_Y != 0 , 1 , "geometry_init " __FILE__ ,
340
+ "MPI_BLK_Y must be an exact divisor of NP_Y (NP_Y % MPI_BLK_Y == 0)" );
341
+ error (NP_Z % MPI_BLK_Z != 0 , 1 , "geometry_init " __FILE__ ,
342
+ "MPI_BLK_Z must be an exact divisor of NP_Z (NP_Z % MPI_BLK_Z == 0)" );
343
343
344
344
cart_comm = GLB_COMM ;
345
345
MPI_Comm_size (cart_comm , & CART_SIZE );
@@ -387,8 +387,8 @@ int geometry_init() {
387
387
lprintf ("GEOMETRY_INIT" , 0 , "Extended local size is %dx%dx%dx%d\n" , T_EXT , X_EXT , Y_EXT , Z_EXT );
388
388
lprintf ("GEOMETRY_INIT" , 0 , "The lattice borders are (%d,%d,%d,%d)\n" , T_BORDER , X_BORDER , Y_BORDER , Z_BORDER );
389
389
lprintf ("GEOMETRY_INIT" , 0 , "Size of the bulk subblocking (%d,%d,%d,%d)\n" , PB_T , PB_X , PB_Y , PB_Z );
390
- if (MPI_NBLK_T + MPI_NBLK_X + MPI_NBLK_Y + MPI_NBLK_Z < 40 ) {
391
- lprintf ("GEOMETRY_INIT" , 0 , "MPI Blocking arrangment (%d,%d,%d,%d)\n" , MPI_NBLK_T , MPI_NBLK_X , MPI_NBLK_Y , MPI_NBLK_Z );
390
+ if (MPI_BLK_T * MPI_BLK_X * MPI_BLK_Y + MPI_BLK_Z > 1 ) {
391
+ lprintf ("GEOMETRY_INIT" , 0 , "MPI Blocking size (%d,%d,%d,%d)\n" , MPI_BLK_T , MPI_BLK_X , MPI_BLK_Y , MPI_BLK_Z );
392
392
}
393
393
394
394
lprintf ("GEOMETRY_INIT" , 0 , "Process sign is %d\n" , PSIGN );
@@ -423,7 +423,7 @@ int proc_up(int id, int dir) {
423
423
424
424
return outid ;
425
425
#else
426
- int MPIBLS [4 ] = { (NP_T / MPI_NBLK_T ), (NP_X / MPI_NBLK_X ), (NP_Y / MPI_NBLK_Y ), (NP_Z / MPI_NBLK_Z ) };
426
+ int MPIBLS [4 ] = { (MPI_BLK_T ), (MPI_BLK_X ), (MPI_BLK_Y ), (MPI_BLK_Z ) };
427
427
int NPROC [4 ] = { NP_T , NP_X , NP_Y , NP_Z };
428
428
429
429
int ixc [4 ], ibc [4 ], ix [4 ], newpoint ;
@@ -450,7 +450,7 @@ int proc_dn(int id, int dir) {
450
450
451
451
return outid ;
452
452
#else
453
- int MPIBLS [4 ] = { (NP_T / MPI_NBLK_T ), (NP_X / MPI_NBLK_X ), (NP_Y / MPI_NBLK_Y ), (NP_Z / MPI_NBLK_Z ) };
453
+ int MPIBLS [4 ] = { (MPI_BLK_T ), (MPI_BLK_X ), (MPI_BLK_Y ), (MPI_BLK_Z ) };
454
454
int NPROC [4 ] = { NP_T , NP_X , NP_Y , NP_Z };
455
455
int ixc [4 ], ibc [4 ], ix [4 ], newpoint ;
456
456
MPI_id_to_coord (id , ixc , ibc , ix );
@@ -472,9 +472,9 @@ int proc_id(int coords[4]) {
472
472
MPI_Cart_rank (cart_comm , coords , & outid );
473
473
return outid ;
474
474
#else
475
- return MPI_coord_to_id (coords [0 ] % (NP_T / MPI_NBLK_T ), coords [1 ] % (NP_X / MPI_NBLK_X ), coords [2 ] % (NP_Y / MPI_NBLK_Y ),
476
- coords [3 ] % (NP_Z / MPI_NBLK_Z ), coords [0 ] / (NP_T / MPI_NBLK_T ), coords [1 ] / (NP_X / MPI_NBLK_X ),
477
- coords [2 ] / (NP_Y / MPI_NBLK_Y ), coords [3 ] / (NP_Z / MPI_NBLK_Z ));
475
+ return MPI_coord_to_id (coords [0 ] % (MPI_BLK_T ), coords [1 ] % (MPI_BLK_X ), coords [2 ] % (MPI_BLK_Y ),
476
+ coords [3 ] % (MPI_BLK_Z ), coords [0 ] / (MPI_BLK_T ), coords [1 ] / (MPI_BLK_X ),
477
+ coords [2 ] / (MPI_BLK_Y ), coords [3 ] / (MPI_BLK_Z ));
478
478
479
479
#endif
480
480
#else
0 commit comments