-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from gvallee/issue96
Issue96
- Loading branch information
Showing
23 changed files
with
253 additions
and
30 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/************************************************************************* | ||
* Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. | ||
* | ||
* See LICENSE.txt for license information | ||
************************************************************************/ | ||
|
||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <assert.h> | ||
#include "mpi.h" | ||
|
||
#define MPICHECK(c) \ | ||
do \ | ||
{ \ | ||
if (c != MPI_SUCCESS) \ | ||
{ \ | ||
fprintf(stderr, "MPI command failed\n"); \ | ||
return 1; \ | ||
} \ | ||
} while (0); | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
int i; | ||
int world_size; | ||
int world_rank; | ||
int *send_buffer_int; | ||
int *recv_buffer_int; | ||
double *send_buffer_double; | ||
double *recv_buffer_double; | ||
int *send_count; | ||
int *recv_count; | ||
int *recv_displ; | ||
int *send_displ; | ||
|
||
MPICHECK(MPI_Init(&argc, &argv)); | ||
MPICHECK(MPI_Comm_size(MPI_COMM_WORLD, &world_size)); | ||
MPICHECK(MPI_Comm_rank(MPI_COMM_WORLD, &world_rank)); | ||
|
||
send_buffer_int = (int *)calloc(world_size * world_size, sizeof(int)); | ||
assert(send_buffer_int); | ||
recv_buffer_int = (int *)calloc(world_size * world_size, sizeof(int)); | ||
assert(recv_buffer_int); | ||
send_buffer_double = (double *)calloc(world_size * world_size, sizeof(double)); | ||
assert(send_buffer_double); | ||
recv_buffer_double = (double *)calloc(world_size * world_size, sizeof(double)); | ||
assert(recv_buffer_double); | ||
send_count = calloc(world_size, sizeof(int)); | ||
assert(send_count); | ||
recv_count = calloc(world_size, sizeof(int)); | ||
assert(recv_count); | ||
send_displ = calloc(world_size, sizeof(int)); | ||
assert(send_displ); | ||
recv_displ = calloc(world_size, sizeof(int)); | ||
assert(recv_displ); | ||
|
||
for (i = 0; i < world_size * world_size; i++) | ||
{ | ||
send_buffer_int[i] = i + 10 * world_rank; | ||
} | ||
|
||
for (i = 0; i < world_size * world_size; i++) | ||
{ | ||
send_buffer_double[i] = i + 10 * world_rank; | ||
} | ||
|
||
for (i = 0; i < world_size; i++) | ||
{ | ||
send_count[i] = 1; | ||
recv_count[i] = 1; | ||
recv_displ[i] = 0; | ||
send_displ[i] = 0; | ||
} | ||
|
||
if (world_rank == 0) | ||
{ | ||
int s; | ||
MPI_Type_size(MPI_INT, &s); | ||
fprintf(stdout, "Size of MPI_INT: %d\n", s); | ||
MPI_Type_size(MPI_DOUBLE, &s); | ||
fprintf(stdout, "Size of MPI_DOUBLE: %d\n", s); | ||
} | ||
|
||
MPICHECK(MPI_Alltoallv(send_buffer_int, send_count, send_displ, MPI_INT, | ||
recv_buffer_int, recv_count, recv_displ, MPI_INT, | ||
MPI_COMM_WORLD)); | ||
|
||
MPICHECK(MPI_Alltoallv(send_buffer_double, send_count, send_displ, MPI_DOUBLE, | ||
recv_buffer_double, recv_count, recv_displ, MPI_DOUBLE, | ||
MPI_COMM_WORLD)); | ||
|
||
free(send_buffer_int); | ||
free(recv_buffer_int); | ||
free(send_buffer_double); | ||
free(recv_buffer_double); | ||
free(send_count); | ||
free(recv_count); | ||
free(send_displ); | ||
free(recv_displ); | ||
MPI_Finalize(); | ||
return EXIT_SUCCESS; | ||
|
||
exit_on_failure: | ||
MPI_Finalize(); | ||
return EXIT_FAILURE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Raw counters | ||
|
||
Number of ranks: 4 | ||
Datatype size: 8 | ||
Datatype size: 4 | ||
Alltoallv calls 0-0 | ||
Count: 1 calls - 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Raw counters | ||
|
||
Number of ranks: 4 | ||
Datatype size: 8 | ||
Datatype size: 4 | ||
Alltoallv calls 0-0 | ||
Count: 1 calls - 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/alltoallv_dt_c/expectedOutput/patterns-job0-rank0.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Patterns | ||
## Pattern #0 (2/2 alltoallv calls) | ||
|
||
Alltoallv calls: 0-1 | ||
|
||
4 ranks sent to 4 other ranks | ||
|
||
4 ranks recv'd from 4 other ranks | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
tests/alltoallv_dt_c/expectedOutput/patterns-summary-job0-rank0.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# N to n patterns | ||
|
||
## Pattern #0 (2/2 alltoallv calls) | ||
|
||
Alltoallv calls: 0-1 | ||
|
||
4 ranks sent to 4 other ranks | ||
|
||
4 ranks recv'd from 4 other ranks | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
tests/alltoallv_dt_c/expectedOutput/profile_alltoallv_job0.rank0.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Summary | ||
COMM_WORLD size: 4 | ||
Total number of Alltoallv calls = 2 (limit is 0; -1 means no limit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Total number of alltoallv calls: 2 | ||
|
||
# Datatypes | ||
|
||
1/2 calls use a datatype of size 4 while sending data | ||
1/2 calls use a datatype of size 8 while sending data | ||
1/2 calls use a datatype of size 4 while receiving data | ||
1/2 calls use a datatype of size 8 while receiving data | ||
|
||
# Communicator size(s) | ||
|
||
2/2 calls use a communicator size of 4 | ||
|
||
# Message sizes | ||
|
||
0/32 of all messages are large (threshold = 200) | ||
32/32 of all messages are small (threshold = 200) | ||
32/32 of all messages are small, but not 0-size (threshold = 200) | ||
|
||
# Sparsity | ||
|
||
2/2 of all calls have 0 send counts equals to zero | ||
2/2 of all calls have 0 recv counts equals to zero | ||
|
||
# Min/max | ||
2/2 calls have a send count min of 1 | ||
|
||
2/2 calls have a recv count min of 1 | ||
|
||
2/2 calls have a send count min of 0 (excluding zero) | ||
|
||
2/2 calls have a recv count min of 0 (excluding zero) | ||
|
||
2/2 calls have a send count max of 1 | ||
|
||
2/2 calls have a recv count max of 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Raw counters | ||
|
||
Number of ranks: 3 | ||
Datatype size: 8 | ||
Datatype size: 4 | ||
Alltoallv calls 0-1 | ||
Count: 2 calls - 0-1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Raw counters | ||
|
||
Number of ranks: 3 | ||
Datatype size: 8 | ||
Datatype size: 4 | ||
Alltoallv calls 0-1 | ||
Count: 2 calls - 0-1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/alltoallv_multicomms_c/expectedOutput/recv-counters.job0.rank2.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Raw counters | ||
|
||
Number of ranks: 2 | ||
Datatype size: 8 | ||
Datatype size: 4 | ||
Alltoallv calls 0-1 | ||
Count: 2 calls - 0, 2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/alltoallv_multicomms_c/expectedOutput/send-counters.job0.rank2.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Raw counters | ||
|
||
Number of ranks: 2 | ||
Datatype size: 8 | ||
Datatype size: 4 | ||
Alltoallv calls 0-1 | ||
Count: 2 calls - 0, 2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.