Skip to content

Commit 3b931e1

Browse files
authored
Merge pull request #17 from jjhursey/big-count-fix-infl
Fix handling of inflation parameter
2 parents 6944d97 + db60948 commit 3b931e1

File tree

11 files changed

+44
-46
lines changed

11 files changed

+44
-46
lines changed

collective-big-count/common.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,10 @@ int init_environment(int argc, char** argv) {
390390
* @param proposed_count the count that the caller wishes to use
391391
* @param mult_root memory multiplier at root (useful in gather-like operations where the root gathers N times the count)
392392
* @param mult_peer memory multiplier at non-roots (useful in allgather-like operations where the buffer is N times count)
393-
* @param alg_inflation Inflation expected due to the algorithm we are expecting to call
394393
* @return proposed count to use in the collective
395394
*/
396395
size_t calc_uniform_count(size_t datatype_size, size_t proposed_count,
397-
size_t mult_root, size_t mult_peer, double alg_inflation)
396+
size_t mult_root, size_t mult_peer)
398397
{
399398
size_t orig_proposed_count = proposed_count;
400399
size_t orig_mult_root = mult_root;

collective-big-count/test_allgather.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ int main(int argc, char** argv) {
3838
// Each rank contribues: TEST_UNIFORM_COUNT elements
3939
// Largest buffer is : TEST_UNIFORM_COUNT x world_size
4040
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
41-
(size_t)world_size, (size_t)world_size, alg_inflation);
41+
(size_t)world_size, (size_t)world_size);
4242
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, true, true);
4343
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
44-
(size_t)world_size, (size_t)world_size, alg_inflation);
44+
(size_t)world_size, (size_t)world_size);
4545
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, true, true);
4646
if (allow_nonblocked) {
4747
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
48-
(size_t)world_size, (size_t)world_size, alg_inflation);
48+
(size_t)world_size, (size_t)world_size);
4949
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, true, false);
5050
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
51-
(size_t)world_size, (size_t)world_size, alg_inflation);
51+
(size_t)world_size, (size_t)world_size);
5252
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, true,
5353
false);
5454
}

collective-big-count/test_allgatherv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main(int argc, char** argv) {
5858
// Note: Displacement is an int, so the recv buffer cannot be too large as to overflow the int
5959
// As such divide by the world_size
6060
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT / (size_t)world_size,
61-
(size_t)world_size, (size_t)world_size, 1.0);
61+
(size_t)world_size, (size_t)world_size);
6262
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, MODE_PACKED, true, true);
6363
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
6464
ret += my_c_test_core(MPI_INT,
@@ -68,7 +68,7 @@ int main(int argc, char** argv) {
6868
// Note: Displacement is an int, so the recv buffer cannot be too large as to overflow the int
6969
// As such divide by the world_size
7070
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT / (size_t)world_size,
71-
(size_t)world_size, (size_t)world_size, 1.0);
71+
(size_t)world_size, (size_t)world_size);
7272
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, MODE_PACKED, true,
7373
true);
7474
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
@@ -77,15 +77,15 @@ int main(int argc, char** argv) {
7777
MODE_SKIP, true, true);
7878
if (allow_nonblocked) {
7979
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT / (size_t)world_size,
80-
(size_t)world_size, (size_t)world_size, 1.0);
80+
(size_t)world_size, (size_t)world_size);
8181
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, MODE_PACKED, true,
8282
false);
8383
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
8484
ret += my_c_test_core(MPI_INT,
8585
(proposed_count - disp_stride*world_size) * (size_t)world_size,
8686
MODE_SKIP, true, false);
8787
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT / (size_t)world_size,
88-
(size_t)world_size, (size_t)world_size, 1.0);
88+
(size_t)world_size, (size_t)world_size);
8989
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, MODE_PACKED,
9090
true, false);
9191
// Adjust these to be V_SIZE_INT - displacement strides so it will pass

collective-big-count/test_allreduce.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ int main(int argc, char** argv) {
4242
// Each rank contribues: TEST_UNIFORM_COUNT elements
4343
// Largest buffer is : TEST_UNIFORM_COUNT elements
4444
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
45-
2, 2, 1.0); // 1 send, 1 recv buffer each
45+
2, 2); // 1 send, 1 recv buffer each
4646
ret += my_c_test_core(MPI_INT, proposed_count, true);
4747

4848
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
49-
2, 2, 1.0); // 1 send, 1 recv buffer each
49+
2, 2); // 1 send, 1 recv buffer each
5050
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count, true);
5151
if (allow_nonblocked) {
5252
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
53-
2, 2, 1.0); // 1 send, 1 recv buffer each
53+
2, 2); // 1 send, 1 recv buffer each
5454
ret += my_c_test_core(MPI_INT, proposed_count, false);
5555
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
56-
2, 2, 1.0); // 1 send, 1 recv buffer each
56+
2, 2); // 1 send, 1 recv buffer each
5757
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count, false);
5858
}
5959
#endif

collective-big-count/test_alltoall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ int main(int argc, char** argv) {
4141
// Each rank contribues: TEST_UNIFORM_COUNT elements
4242
// Largest buffer is : TEST_UNIFORM_COUNT x world_size
4343
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
44-
(size_t)world_size, (size_t)world_size, alg_inflation);
44+
(size_t)world_size, (size_t)world_size);
4545
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, true);
4646

4747
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
48-
(size_t)world_size, (size_t)world_size, alg_inflation);
48+
(size_t)world_size, (size_t)world_size);
4949
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, true);
5050
if (allow_nonblocked) {
5151
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
52-
(size_t)world_size, (size_t)world_size, alg_inflation);
52+
(size_t)world_size, (size_t)world_size);
5353
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, false);
5454
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
55-
(size_t)world_size, (size_t)world_size, alg_inflation);
55+
(size_t)world_size, (size_t)world_size);
5656
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, false);
5757
}
5858
#endif

collective-big-count/test_bcast.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ int main(int argc, char** argv) {
3636
// Each rank contribues: TEST_UNIFORM_COUNT elements
3737
// Largest buffer is : TEST_UNIFORM_COUNT elements
3838
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
39-
2, 2, 1.0); // 1 send, 1 recv buffer each
39+
2, 2); // 1 send, 1 recv buffer each
4040
ret += my_c_test_core(MPI_INT, proposed_count, true);
4141
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
42-
2, 2, 1.0); // 1 send, 1 recv buffer each
42+
2, 2); // 1 send, 1 recv buffer each
4343
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count, true);
4444
if (allow_nonblocked) {
4545
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
46-
2, 2, 1.0); // 1 send, 1 recv buffer each
46+
2, 2); // 1 send, 1 recv buffer each
4747
ret += my_c_test_core(MPI_INT, proposed_count, false);
4848
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
49-
2, 2, 1.0); // 1 send, 1 recv buffer each
49+
2, 2); // 1 send, 1 recv buffer each
5050
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count, false);
5151
}
5252
#endif

collective-big-count/test_gather.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ int main(int argc, char** argv) {
3636
// Each rank contribues: TEST_UNIFORM_COUNT elements
3737
// Largest buffer is : TEST_UNIFORM_COUNT x world_size
3838
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
39-
(size_t)world_size, 1, 1.0);
39+
(size_t)world_size, 1);
4040
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, true);
4141

4242
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
43-
(size_t)world_size, 1, 1.0);
43+
(size_t)world_size, 1);
4444
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, true);
4545
if (allow_nonblocked) {
4646
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
47-
(size_t)world_size, 1, 1.0);
47+
(size_t)world_size, 1);
4848
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, false);
4949
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
50-
(size_t)world_size, 1, 1.0);
50+
(size_t)world_size, 1);
5151
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, false);
5252
}
5353
#endif

collective-big-count/test_gatherv.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int main(int argc, char** argv) {
5757
// Note: Displacement is an int, so the recv buffer cannot be too large as to overflow the int
5858
// As such divide by the world_size
5959
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT / (size_t)world_size,
60-
(size_t)world_size, 1, 1.0);
60+
(size_t)world_size, 1);
6161
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, MODE_PACKED, true);
6262
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
6363
ret += my_c_test_core(MPI_INT,
@@ -67,25 +67,24 @@ int main(int argc, char** argv) {
6767
// Note: Displacement is an int, so the recv buffer cannot be too large as to overflow the int
6868
// As such divide by the world_size
6969
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT / (size_t)world_size,
70-
(size_t)world_size, 1, 1.0);
70+
(size_t)world_size, 1);
7171
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, MODE_PACKED, true);
7272
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
7373
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX,
7474
(proposed_count - disp_stride*world_size) * (size_t)world_size,
7575
MODE_SKIP, true);
7676
if (allow_nonblocked) {
7777
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT / (size_t)world_size,
78-
(size_t)world_size, 1, 1.0);
78+
(size_t)world_size, 1);
7979
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, MODE_PACKED, false);
8080
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
8181
ret += my_c_test_core(MPI_INT,
8282
(proposed_count - disp_stride*world_size) * (size_t)world_size,
8383
MODE_SKIP, false);
84-
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX,
85-
(proposed_count - disp_stride*world_size) * (size_t)world_size,
86-
MODE_SKIP, false);
87-
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, MODE_PACKED,
88-
false);
84+
85+
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT / (size_t)world_size,
86+
(size_t)world_size, 1);
87+
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size, MODE_PACKED, false);
8988
// Adjust these to be V_SIZE_INT - displacement strides so it will pass
9089
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX,
9190
(proposed_count - disp_stride*world_size) * (size_t)world_size,

collective-big-count/test_reduce.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ int main(int argc, char** argv) {
3636
// Each rank contribues: TEST_UNIFORM_COUNT elements
3737
// Largest buffer is : TEST_UNIFORM_COUNT elements
3838
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
39-
2, 2, 1.0); // 1 send, 1 recv buffer each
39+
2, 2); // 1 send, 1 recv buffer each
4040
ret += my_c_test_core(MPI_INT, proposed_count, true);
4141

4242
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
43-
2, 2, 1.0); // 1 send, 1 recv buffer each
43+
2, 2); // 1 send, 1 recv buffer each
4444
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count, true);
4545
if (allow_nonblocked) {
4646
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
47-
2, 2, 1.0); // 1 send, 1 recv buffer each
47+
2, 2); // 1 send, 1 recv buffer each
4848
ret += my_c_test_core(MPI_INT, proposed_count, false);
4949
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
50-
2, 2, 1.0); // 1 send, 1 recv buffer each
50+
2, 2); // 1 send, 1 recv buffer each
5151
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count, false);
5252
}
5353
#endif

collective-big-count/test_scatter.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ int main(int argc, char** argv) {
3737
// Each rank contribues: TEST_UNIFORM_COUNT elements
3838
// Largest buffer is : TEST_UNIFORM_COUNT x world_size
3939
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
40-
(size_t)world_size, 1, 1.0);
40+
(size_t)world_size, 1);
4141
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, true);
4242

4343
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
44-
(size_t)world_size, 1, 1.0);
44+
(size_t)world_size, 1);
4545
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size,
4646
true);
4747
if (allow_nonblocked) {
4848
proposed_count = calc_uniform_count(sizeof(int), TEST_UNIFORM_COUNT,
49-
(size_t)world_size, 1, 1.0);
49+
(size_t)world_size, 1);
5050
ret += my_c_test_core(MPI_INT, proposed_count * (size_t)world_size, false);
5151
proposed_count = calc_uniform_count(sizeof(double _Complex), TEST_UNIFORM_COUNT,
52-
(size_t)world_size, 1, 1.0);
52+
(size_t)world_size, 1);
5353
ret += my_c_test_core(MPI_C_DOUBLE_COMPLEX, proposed_count * (size_t)world_size,
5454
false);
5555
}

0 commit comments

Comments
 (0)