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 'master' into clean_events
[simgrid.git]
/
teshsuite
/
smpi
/
mpich3-test
/
datatype
/
hindexed-zeros.c
diff --git
a/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c
b/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c
index
db9d165
..
90a4cd0
100644
(file)
--- a/
teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c
+++ b/
teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c
@@
-11,12
+11,13
@@
static int verbose = 0;
static int verbose = 0;
+int main(int argc, char *argv[]);
int parse_args(int argc, char **argv);
int hindexed_zerotype_test(void);
int hindexed_sparsetype_test(void);
struct test_struct_1 {
int parse_args(int argc, char **argv);
int hindexed_zerotype_test(void);
int hindexed_sparsetype_test(void);
struct test_struct_1 {
- int a,
b,c,
d;
+ int a,
b, c,
d;
};
int main(int argc, char *argv[])
};
int main(int argc, char *argv[])
@@
-28,23
+29,25
@@
int main(int argc, char *argv[])
parse_args(argc, argv);
/* To improve reporting of problems about operations, we
parse_args(argc, argv);
/* To improve reporting of problems about operations, we
-
change the error handler to errors return */
- MPI_Comm_set_errhandler(
MPI_COMM_WORLD, MPI_ERRORS_RETURN
);
+
*
change the error handler to errors return */
+ MPI_Comm_set_errhandler(
MPI_COMM_WORLD, MPI_ERRORS_RETURN
);
err = hindexed_zerotype_test();
err = hindexed_zerotype_test();
- if (verbose && err) fprintf(stderr, "error in hindexed_zerotype_test\n");
+ if (verbose && err)
+ fprintf(stderr, "error in hindexed_zerotype_test\n");
errs += err;
err = hindexed_sparsetype_test();
errs += err;
err = hindexed_sparsetype_test();
- if (verbose && err) fprintf(stderr, "error in hindexed_sparsetype_test\n");
+ if (verbose && err)
+ fprintf(stderr, "error in hindexed_sparsetype_test\n");
errs += err;
/* print message and exit */
if (errs) {
errs += err;
/* print message and exit */
if (errs) {
- fprintf(stderr, "Found %d errors\n", errs);
+
fprintf(stderr, "Found %d errors\n", errs);
}
else {
}
else {
- printf(" No Errors\n");
+
printf(" No Errors\n");
}
MPI_Finalize();
return 0;
}
MPI_Finalize();
return 0;
@@
-59,73
+62,73
@@
int hindexed_zerotype_test(void)
MPI_Request request;
MPI_Status status;
MPI_Request request;
MPI_Status status;
- int blks[]
= { 0, 0, 0 };
+ int blks[] = { 0, 0, 0 };
MPI_Aint disps[] = { 0, 4, 16 };
err = MPI_Type_hindexed(3, blks, disps, MPI_INT, &mytype);
if (err != MPI_SUCCESS) {
MPI_Aint disps[] = { 0, 4, 16 };
err = MPI_Type_hindexed(3, blks, disps, MPI_INT, &mytype);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Type_hindexed returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Type_hindexed returned error\n");
+
}
}
MPI_Type_commit(&mytype);
err = MPI_Irecv(NULL, 2, mytype, 0, 0, MPI_COMM_SELF, &request);
if (err != MPI_SUCCESS) {
}
MPI_Type_commit(&mytype);
err = MPI_Irecv(NULL, 2, mytype, 0, 0, MPI_COMM_SELF, &request);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Irecv returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Irecv returned error\n");
+
}
}
err = MPI_Send(NULL, 1, mytype, 0, 0, MPI_COMM_SELF);
if (err != MPI_SUCCESS) {
}
err = MPI_Send(NULL, 1, mytype, 0, 0, MPI_COMM_SELF);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Send returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Send returned error\n");
+
}
}
err = MPI_Wait(&request, &status);
if (err != MPI_SUCCESS) {
}
err = MPI_Wait(&request, &status);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Wait returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Wait returned error\n");
+
}
}
/* verify count and elements */
err = MPI_Get_count(&status, mytype, &count);
if (err != MPI_SUCCESS) {
}
/* verify count and elements */
err = MPI_Get_count(&status, mytype, &count);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Get_count returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Get_count returned error\n");
+
}
}
if (count != 0) {
}
if (count != 0) {
- errs++;
- if (verbose) {
- fprintf(stderr, "count = %d; should be 0\n", count);
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "count = %d; should be 0\n", count);
+
}
}
err = MPI_Get_elements(&status, mytype, &elements);
if (err != MPI_SUCCESS) {
}
err = MPI_Get_elements(&status, mytype, &elements);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Get_elements returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Get_elements returned error\n");
+
}
}
if (elements != 0) {
}
if (elements != 0) {
- errs++;
- if (verbose) {
- fprintf(stderr, "elements = %d; should be 0\n", elements);
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "elements = %d; should be 0\n", elements);
+
}
}
}
-
//
MPI_Type_free(&mytype);
+ MPI_Type_free(&mytype);
return errs;
}
return errs;
}
@@
-142,92
+145,92
@@
int hindexed_sparsetype_test(void)
MPI_Request request;
MPI_Status status;
MPI_Request request;
MPI_Status status;
- int sendbuf[6]
= { 1, 2, 3, 4, 5, 6 };
+ int sendbuf[6] = { 1, 2, 3, 4, 5, 6 };
int recvbuf[16];
int correct[16] = { 1, -2, 4, -4, 2, 3, 5, -8, -9, -10, 6,
int recvbuf[16];
int correct[16] = { 1, -2, 4, -4, 2, 3, 5, -8, -9, -10, 6,
- -12, -13, -14, -15, -16 };
+ -12, -13, -14, -15, -16
+ };
- int blks[]
= { 1, 0, 2,
1 };
- MPI_Aint disps[] = { 0, 1
*sizeof(int), 4*sizeof(int), 2*
sizeof(int) };
+ int blks[]
= { 1, 0, 2,
1 };
+ MPI_Aint disps[] = { 0, 1
* sizeof(int), 4 * sizeof(int), 2 *
sizeof(int) };
err = MPI_Type_hindexed(4, blks, disps, MPI_INT, &mytype);
if (err != MPI_SUCCESS) {
err = MPI_Type_hindexed(4, blks, disps, MPI_INT, &mytype);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Type_hindexed returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Type_hindexed returned error\n");
+
}
}
MPI_Type_commit(&mytype);
}
MPI_Type_commit(&mytype);
- for (i=0; i < 16; i++) recvbuf[i] = -(i+1);
+ for (i = 0; i < 16; i++)
+ recvbuf[i] = -(i + 1);
err = MPI_Irecv(recvbuf, 2, mytype, 0, 0, MPI_COMM_SELF, &request);
if (err != MPI_SUCCESS) {
err = MPI_Irecv(recvbuf, 2, mytype, 0, 0, MPI_COMM_SELF, &request);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Irecv returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Irecv returned error\n");
+
}
}
err = MPI_Send(sendbuf, 6, MPI_INT, 0, 0, MPI_COMM_SELF);
if (err != MPI_SUCCESS) {
}
err = MPI_Send(sendbuf, 6, MPI_INT, 0, 0, MPI_COMM_SELF);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Send returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Send returned error\n");
+
}
}
err = MPI_Wait(&request, &status);
if (err != MPI_SUCCESS) {
}
err = MPI_Wait(&request, &status);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Wait returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Wait returned error\n");
+
}
}
}
-
+
/* verify data */
/* verify data */
- for (i=0; i < 16; i++) {
- if (recvbuf[i] != correct[i]) {
- errs++;
- if (verbose) {
- fprintf(stderr, "recvbuf[%d] = %d; should be %d\n",
- i, recvbuf[i], correct[i]);
- }
- }
+ for (i = 0; i < 16; i++) {
+ if (recvbuf[i] != correct[i]) {
+ errs++;
+ if (verbose) {
+ fprintf(stderr, "recvbuf[%d] = %d; should be %d\n", i, recvbuf[i], correct[i]);
+ }
+ }
}
/* verify count and elements */
err = MPI_Get_count(&status, mytype, &count);
if (err != MPI_SUCCESS) {
}
/* verify count and elements */
err = MPI_Get_count(&status, mytype, &count);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Get_count returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Get_count returned error\n");
+
}
}
if (count != MPI_UNDEFINED) {
}
if (count != MPI_UNDEFINED) {
- errs++;
- if (verbose) {
- fprintf(stderr, "count = %d; should be MPI_UNDEFINED (%d)\n",
- count, MPI_UNDEFINED);
- }
+ errs++;
+ if (verbose) {
+ fprintf(stderr, "count = %d; should be MPI_UNDEFINED (%d)\n", count, MPI_UNDEFINED);
+ }
}
err = MPI_Get_elements(&status, mytype, &elements);
if (err != MPI_SUCCESS) {
}
err = MPI_Get_elements(&status, mytype, &elements);
if (err != MPI_SUCCESS) {
- errs++;
- if (verbose) {
- fprintf(stderr, "MPI_Get_elements returned error\n");
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "MPI_Get_elements returned error\n");
+
}
}
if (elements != 6) {
}
if (elements != 6) {
- errs++;
- if (verbose) {
- fprintf(stderr, "elements = %d; should be 6\n", elements);
- }
+
errs++;
+
if (verbose) {
+
fprintf(stderr, "elements = %d; should be 6\n", elements);
+
}
}
}
-
//
MPI_Type_free(&mytype);
+ MPI_Type_free(&mytype);
return errs;
}
return errs;
}
@@
-236,18
+239,18
@@
int hindexed_sparsetype_test(void)
int parse_args(int argc, char **argv)
{
/*
int parse_args(int argc, char **argv)
{
/*
- int ret;
-
- while ((ret = getopt(argc, argv, "v")) >= 0)
- {
-
switch (ret) {
-
case 'v':
-
verbose = 1;
-
break;
-
}
- }
- */
+
*
int ret;
+ *
+
*
while ((ret = getopt(argc, argv, "v")) >= 0)
+
*
{
+
*
switch (ret) {
+
*
case 'v':
+
*
verbose = 1;
+
*
break;
+
*
}
+
*
}
+
*/
if (argc > 1 && strcmp(argv[1], "-v") == 0)
if (argc > 1 && strcmp(argv[1], "-v") == 0)
- verbose = 1;
+
verbose = 1;
return 0;
}
return 0;
}