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
Add new entry in Release_Notes.
[simgrid.git]
/
teshsuite
/
smpi
/
mpich3-test
/
rma
/
test5.c
diff --git
a/teshsuite/smpi/mpich3-test/rma/test5.c
b/teshsuite/smpi/mpich3-test/rma/test5.c
index
4cc02cf
..
56b293a
100644
(file)
--- a/
teshsuite/smpi/mpich3-test/rma/test5.c
+++ b/
teshsuite/smpi/mpich3-test/rma/test5.c
@@
-3,7
+3,7
@@
* (C) 2001 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
* (C) 2001 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
-#include "mpi.h"
+#include "mpi.h"
#include "stdio.h"
#include "mpitest.h"
#include "squelch.h"
#include "stdio.h"
#include "mpitest.h"
#include "squelch.h"
@@
-12,17
+12,17
@@
#define SIZE 2000
#define SIZE 2000
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[])
+{
int rank, nprocs, i, A[SIZE], B[SIZE];
MPI_Comm CommDeuce;
MPI_Win win;
int errs = 0;
int rank, nprocs, i, A[SIZE], B[SIZE];
MPI_Comm CommDeuce;
MPI_Win win;
int errs = 0;
- MTest_Init(&argc,
&argv);
+ MTest_Init(&argc,
&argv);
- MPI_Comm_size(MPI_COMM_WORLD,
&nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD,
&nprocs);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2) {
printf("Run this program with 2 or more processes\n");
if (nprocs < 2) {
printf("Run this program with 2 or more processes\n");
@@
-33,34
+33,34
@@
int main(int argc, char *argv[])
if (rank < 2) {
if (rank == 0) {
if (rank < 2) {
if (rank == 0) {
- for (i
=0; i<
SIZE; i++)
+ for (i
= 0; i <
SIZE; i++)
B[i] = 500 + i;
B[i] = 500 + i;
- MPI_Win_create(B, SIZE
*
sizeof(int), sizeof(int), MPI_INFO_NULL, CommDeuce, &win);
+ MPI_Win_create(B, SIZE
*
sizeof(int), sizeof(int), MPI_INFO_NULL, CommDeuce, &win);
MPI_Win_fence(0, win);
MPI_Win_fence(0, win);
- for (i
=0; i<
SIZE; i++) {
- A[i] = i
+
100;
+ for (i
= 0; i <
SIZE; i++) {
+ A[i] = i
+
100;
MPI_Get(&A[i], 1, MPI_INT, 1, i, 1, MPI_INT, win);
}
MPI_Win_fence(0, win);
MPI_Get(&A[i], 1, MPI_INT, 1, i, 1, MPI_INT, win);
}
MPI_Win_fence(0, win);
- for (i
=0; i<
SIZE; i++)
+ for (i
= 0; i <
SIZE; i++)
if (A[i] != 1000 + i) {
if (A[i] != 1000 + i) {
- SQUELCH(
printf("Rank 0: A[%d] is %d, should be %d\n", i, A[i], 1000+i);
);
+ SQUELCH(
printf("Rank 0: A[%d] is %d, should be %d\n", i, A[i], 1000 + i);
);
errs++;
}
}
if (rank == 1) {
errs++;
}
}
if (rank == 1) {
- for (i
=0; i<
SIZE; i++)
+ for (i
= 0; i <
SIZE; i++)
A[i] = 1000 + i;
A[i] = 1000 + i;
- MPI_Win_create(A, SIZE
*
sizeof(int), sizeof(int), MPI_INFO_NULL, CommDeuce, &win);
+ MPI_Win_create(A, SIZE
*
sizeof(int), sizeof(int), MPI_INFO_NULL, CommDeuce, &win);
MPI_Win_fence(0, win);
MPI_Win_fence(0, win);
- for (i
=0; i<
SIZE; i++) {
- B[i] = i
+
200;
+ for (i
= 0; i <
SIZE; i++) {
+ B[i] = i
+
200;
MPI_Get(&B[i], 1, MPI_INT, 0, i, 1, MPI_INT, win);
}
MPI_Win_fence(0, win);
MPI_Get(&B[i], 1, MPI_INT, 0, i, 1, MPI_INT, win);
}
MPI_Win_fence(0, win);
- for (i
=0; i<
SIZE; i++)
+ for (i
= 0; i <
SIZE; i++)
if (B[i] != 500 + i) {
if (B[i] != 500 + i) {
- SQUELCH(
printf("Rank 1: B[%d] is %d, should be %d\n", i, B[i], 500+i);
);
+ SQUELCH(
printf("Rank 1: B[%d] is %d, should be %d\n", i, B[i], 500 + i);
);
errs++;
}
}
errs++;
}
}
@@
-69,6
+69,6
@@
int main(int argc, char *argv[])
}
MPI_Comm_free(&CommDeuce);
MTest_Finalize(errs);
}
MPI_Comm_free(&CommDeuce);
MTest_Finalize(errs);
- MPI_Finalize();
- return 0;
-}
+ MPI_Finalize();
+ return 0;
+}