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
[TESTS] SMPI/MPICH3: Fix failing rma test
[simgrid.git]
/
teshsuite
/
smpi
/
mpich3-test
/
rma
/
adlb_mimic1.c
diff --git
a/teshsuite/smpi/mpich3-test/rma/adlb_mimic1.c
b/teshsuite/smpi/mpich3-test/rma/adlb_mimic1.c
index 22767fb7a7467d5b5885bd685b8901dc9f848006..661f72f64eaeefd8f8e917e3ed22be73580996c1 100644
(file)
--- a/
teshsuite/smpi/mpich3-test/rma/adlb_mimic1.c
+++ b/
teshsuite/smpi/mpich3-test/rma/adlb_mimic1.c
@@
-12,8
+12,8
@@
#include "mpitest.h"
#define NUM_TIMES 500
#include "mpitest.h"
#define NUM_TIMES 500
-#define MAX_BUF_SIZE (400 * 1024 * 1024) /* 400 MB */
-#define PUT_SIZE (1024 * 1024) /* 1MB */
+#define MAX_BUF_SIZE (400 * 1024 * 1024)
/* 400 MB */
+#define PUT_SIZE (1024 * 1024)
/* 1MB */
/*
static char MTEST_Descrip[] = "ADLB mimic test";
/*
static char MTEST_Descrip[] = "ADLB mimic test";
@@
-61,36
+61,34
@@
int main(int argc, char **argv)
MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
if (comm_size <= 2) {
MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
if (comm_size <= 2) {
-
fprintf( stderr, "This test requires at least 3 processes\n"
);
-
MPI_Abort( MPI_COMM_WORLD, 1
);
+
fprintf(stderr, "This test requires at least 3 processes\n"
);
+
MPI_Abort(MPI_COMM_WORLD, 1
);
}
max_buf_size = comm_size * put_size;
if (max_buf_size > MAX_BUF_SIZE) {
}
max_buf_size = comm_size * put_size;
if (max_buf_size > MAX_BUF_SIZE) {
- fprintf( stderr, "Too many processes in COMM_WORLD (max is %d)\n",
- MAX_BUF_SIZE / put_size );
- MPI_Abort( MPI_COMM_WORLD, 1 );
+ fprintf(stderr, "Too many processes in COMM_WORLD (max is %d)\n", MAX_BUF_SIZE / put_size);
+ MPI_Abort(MPI_COMM_WORLD, 1);
}
/* If alloc mem returns an error (because too much memory is requested */
}
/* If alloc mem returns an error (because too much memory is requested */
- MPI_Errhandler_set(
MPI_COMM_WORLD, MPI_ERRORS_RETURN
);
+ MPI_Errhandler_set(
MPI_COMM_WORLD, MPI_ERRORS_RETURN
);
rc = MPI_Alloc_mem(max_buf_size, MPI_INFO_NULL, (void *) &rma_win_addr);
if (rc) {
rc = MPI_Alloc_mem(max_buf_size, MPI_INFO_NULL, (void *) &rma_win_addr);
if (rc) {
-
MTestPrintErrorMsg( "Unable to MPI_Alloc_mem space (not an error)", rc
);
-
MPI_Abort( MPI_COMM_WORLD, 0
);
+
MTestPrintErrorMsg("Unable to MPI_Alloc_mem space (not an error)", rc
);
+
MPI_Abort(MPI_COMM_WORLD, 0
);
}
memset(rma_win_addr, 0, max_buf_size);
}
memset(rma_win_addr, 0, max_buf_size);
- MPI_Win_create((void *) rma_win_addr, max_buf_size, 1, MPI_INFO_NULL,
- MPI_COMM_WORLD, &win);
+ MPI_Win_create((void *) rma_win_addr, max_buf_size, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win);
/* Note that it is not necessary to use MPI_Alloc_mem for the memory that
/* Note that it is not necessary to use MPI_Alloc_mem for the memory that
-
is not part of the MPI_Win. */
+
*
is not part of the MPI_Win. */
rc = MPI_Alloc_mem(put_size, MPI_INFO_NULL, (void *) &local_buf);
if (rc) {
rc = MPI_Alloc_mem(put_size, MPI_INFO_NULL, (void *) &local_buf);
if (rc) {
-
MTestPrintErrorMsg( "Unable to MPI_Alloc_mem space (not an error)", rc
);
-
MPI_Abort( MPI_COMM_WORLD, 0
);
+
MTestPrintErrorMsg("Unable to MPI_Alloc_mem space (not an error)", rc
);
+
MPI_Abort(MPI_COMM_WORLD, 0
);
}
for (i = 0; i < put_size; i++)
}
for (i = 0; i < put_size; i++)
@@
-98,7
+96,7
@@
int main(int argc, char **argv)
MPI_Barrier(MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
- if (comm_rank == 0) { /* target */
+ if (comm_rank == 0) {
/* target */
for (i = 0; i < (NUM_TIMES * (comm_size - 2)); i++) {
/* Wait for a message from the server to notify me that
* someone put some data in my window */
for (i = 0; i < (NUM_TIMES * (comm_size - 2)); i++) {
/* Wait for a message from the server to notify me that
* someone put some data in my window */
@@
-108,9
+106,8
@@
int main(int argc, char **argv)
* data in my local window. Check the last byte to make
* sure we got it correctly. */
MPI_Win_lock(MPI_LOCK_SHARED, 0, 0, win);
* data in my local window. Check the last byte to make
* sure we got it correctly. */
MPI_Win_lock(MPI_LOCK_SHARED, 0, 0, win);
- MPI_Get((void *) &check, 1, MPI_CHAR, 0,
- ((by_rank + 1) * put_size) - 1, 1,
- MPI_CHAR, win);
+ MPI_Get((void *) &check, 1, MPI_CHAR, 0,
+ ((by_rank + 1) * put_size) - 1, 1, MPI_CHAR, win);
MPI_Win_unlock(0, win);
/* If this is not the value I expect, count it as an error */
MPI_Win_unlock(0, win);
/* If this is not the value I expect, count it as an error */
@@
-125,13
+122,12
@@
int main(int argc, char **argv)
}
}
}
}
- else if (comm_rank == 1) { /* server */
+ else if (comm_rank == 1) {
/* server */
for (i = 0; i < (NUM_TIMES * (comm_size - 2)); i++) {
/* Wait for a message from any of the origin processes
* informing me that it has put data to the target
* process */
for (i = 0; i < (NUM_TIMES * (comm_size - 2)); i++) {
/* Wait for a message from any of the origin processes
* informing me that it has put data to the target
* process */
- MPI_Recv(NULL, 0, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD,
- &status);
+ MPI_Recv(NULL, 0, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status);
by_rank = status.MPI_SOURCE;
/* Tell the target process that it should be seeing some
by_rank = status.MPI_SOURCE;
/* Tell the target process that it should be seeing some
@@
-140,12
+136,12
@@
int main(int argc, char **argv)
}
}
}
}
- else { /* origin */
+ else {
/* origin */
for (i = 0; i < NUM_TIMES; i++) {
/* Put some data in the target window */
MPI_Win_lock(MPI_LOCK_SHARED, 0, 0, win);
for (i = 0; i < NUM_TIMES; i++) {
/* Put some data in the target window */
MPI_Win_lock(MPI_LOCK_SHARED, 0, 0, win);
- MPI_Put(local_buf, put_size, MPI_CHAR, 0, comm_rank * put_size,
- put_size, MPI_CHAR, win);
+ MPI_Put(local_buf, put_size, MPI_CHAR, 0, comm_rank * put_size,
+
put_size, MPI_CHAR, win);
MPI_Win_unlock(0, win);
/* Tell the server that the put has completed */
MPI_Win_unlock(0, win);
/* Tell the server that the put has completed */