A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge branch 'killgraskill'
[simgrid.git]
/
teshsuite
/
smpi
/
mpich-test
/
coll
/
coll13.c
diff --git
a/teshsuite/smpi/mpich-test/coll/coll13.c
b/teshsuite/smpi/mpich-test/coll/coll13.c
index
2bbb4e3
..
28e656d
100644
(file)
--- a/
teshsuite/smpi/mpich-test/coll/coll13.c
+++ b/
teshsuite/smpi/mpich-test/coll/coll13.c
@@
-19,11
+19,11
@@
int main( int argc, char *argv[] )
{
int rank, size;
int chunk = 4096;
- int i;
+ int i
,j
;
int *sb;
int *rb;
- int status, gstatus;
-
+ int status, gstatus
, endstatus
;
+ endstatus=0;
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&size);
@@
-41,44
+41,74
@@
int main( int argc, char *argv[] )
MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
}
}
-
- sb = (int *)malloc(size*chunk*sizeof(int));
- if ( !sb ) {
- perror( "can't allocate send buffer" );
- MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
- }
- rb = (int *)malloc(size*chunk*sizeof(int));
- if ( !rb ) {
- perror( "can't allocate recv buffer");
- free(sb);
- MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+
+
+ /*
+ SMPI addition : we want to test all three alltoall algorithms, thus we use three diffrent sizes
+ this is the code that handles these cases
+ if (sendsize < 200 && size > 12) {
+ retval =
+ smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ comm);
+ } else if (sendsize < 3000) {
+ retval =
+ smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
+ sendtype, recvbuf,
+ recvcount, recvtype, comm);
+ } else {
+ retval =
+ smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ comm);
}
- for ( i=0 ; i < size*chunk ; ++i ) {
- sb[i] = rank + 1;
- rb[i] = 0;
- }
-
- /* fputs("Before MPI_Alltoall\n",stdout); */
+
+
+ */
+
+
+ int sizes [3] ={ 4096, 64, 32};
+ for ( j=0 ; j < 3 ; j++ ) {
+ sb = (int *)malloc(size*sizes[j]*sizeof(int));
+ if ( !sb ) {
+ perror( "can't allocate send buffer" );
+ MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+ }
+ rb = (int *)malloc(size*sizes[j]*sizeof(int));
+ if ( !rb ) {
+ perror( "can't allocate recv buffer");
+ free(sb);
+ MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+ }
+ for ( i=0 ; i < size*sizes[j] ; ++i ) {
+ sb[i] = rank + 1;
+ rb[i] = 0;
+ }
- /* This should really send MPI_CHAR, but since sb and rb were allocated
+ /* fputs("Before MPI_Alltoall\n",stdout); */
+ MPI_Barrier(MPI_COMM_WORLD );
+ /* This should really send MPI_CHAR, but since sb and rb were allocated
as chunk*size*sizeof(int), the buffers are large enough */
-
status = MPI_Alltoall(sb,chunk,MPI_INT,rb,chunk
,MPI_INT,
- MPI_COMM_WORLD);
+
status = MPI_Alltoall(sb,sizes[j],MPI_INT,rb,sizes[j]
,MPI_INT,
+
MPI_COMM_WORLD);
- /* fputs("Before MPI_Allreduce\n",stdout); */
- MPI_Allreduce( &status, &gstatus, 1, MPI_INT, MPI_SUM,
- MPI_COMM_WORLD );
+
/* fputs("Before MPI_Allreduce\n",stdout); */
+
MPI_Allreduce( &status, &gstatus, 1, MPI_INT, MPI_SUM,
+
MPI_COMM_WORLD );
+ MPI_Barrier(MPI_COMM_WORLD );
/* fputs("After MPI_Allreduce\n",stdout); */
+ if (rank == 0 && gstatus != 0) endstatus ++;
+
+ free(sb);
+ free(rb);
+ }
+
if (rank == 0) {
-
if (g
status == 0) printf( " No Errors\n" );
-
else
-
printf("all_to_all returned %d\n",g
status);
+
if (end
status == 0) printf( " No Errors\n" );
+ else
+
printf("all_to_all returned %d erros\n",end
status);
}
-
- free(sb);
- free(rb);
-
MPI_Finalize();
return(EXIT_SUCCESS);