Skip to content
Snippets Groups Projects
Commit 56875d35 authored by Andreas Dilger's avatar Andreas Dilger
Browse files

Branch b1_6

Quiet build warnings when building MPI test programs.
parent 13ac2fa2
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,7 @@ int main(int argc, char ** argv) ...@@ -56,6 +56,7 @@ int main(int argc, char ** argv)
if (strcmp(argv[1], "-o") == 0) { if (strcmp(argv[1], "-o") == 0) {
do_open = 1; do_open = 1;
tgt = NULL;
} else if (strncmp(argv[1], "-l", 2) == 0 && argv[1][2]) { } else if (strncmp(argv[1], "-l", 2) == 0 && argv[1][2]) {
tgt = argv[1] + 2; tgt = argv[1] + 2;
do_link = 1; do_link = 1;
......
...@@ -106,7 +106,7 @@ void grouplock_test1(char *filename, int fd, char *errmsg) ...@@ -106,7 +106,7 @@ void grouplock_test1(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag1, flag2; int flag1, flag2;
/* reading task will tell us when it completes */ /* reading task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1); MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */ /* 2nd locking task will tell us when it completes */
...@@ -140,7 +140,7 @@ void grouplock_test1(char *filename, int fd, char *errmsg) ...@@ -140,7 +140,7 @@ void grouplock_test1(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag1; int flag1;
do { do {
iter--; iter--;
if (!iter) { if (!iter) {
...@@ -217,7 +217,7 @@ void grouplock_test2(char *filename, int fd, char *errmsg) ...@@ -217,7 +217,7 @@ void grouplock_test2(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag1, flag2, flag3; int flag1, flag2, flag3;
/* 2nd locking task will tell us when it completes */ /* 2nd locking task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1); MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 3nd locking task will tell us when it completes */ /* 3nd locking task will tell us when it completes */
...@@ -284,7 +284,7 @@ void grouplock_test2(char *filename, int fd, char *errmsg) ...@@ -284,7 +284,7 @@ void grouplock_test2(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag3; int flag3;
do { do {
iter--; iter--;
if (!iter) { if (!iter) {
...@@ -366,7 +366,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg) ...@@ -366,7 +366,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag1, flag2; int flag1, flag2;
/* reading task will tell us when it completes */ /* reading task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1); MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */ /* 2nd locking task will tell us when it completes */
...@@ -400,7 +400,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg) ...@@ -400,7 +400,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag1; int flag1;
do { do {
iter--; iter--;
usleep(100); usleep(100);
...@@ -418,7 +418,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg) ...@@ -418,7 +418,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg)
filename, rc); filename, rc);
FAIL(errmsg); FAIL(errmsg);
} }
do { do {
iter--; iter--;
if (!iter) { if (!iter) {
...@@ -435,7 +435,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg) ...@@ -435,7 +435,7 @@ void grouplock_test3(char *filename, int fd, char *errmsg)
} }
/* /*
* process1 attempts CW(gid=1) -- granted * process1 attempts CW(gid=1) -- granted
* process2 attempts PR on non-blocking fd -> should return -EWOULDBLOCK * process2 attempts PR on non-blocking fd -> should return -EWOULDBLOCK
* process3 attempts CW(gid=2) on non-blocking fd -> should return -EWOULDBLOCK * process3 attempts CW(gid=2) on non-blocking fd -> should return -EWOULDBLOCK
...@@ -501,7 +501,7 @@ void grouplock_test4(char *filename, int fd, char *errmsg) ...@@ -501,7 +501,7 @@ void grouplock_test4(char *filename, int fd, char *errmsg)
int flag1, flag2; int flag1, flag2;
MPI_Request req1, req2; MPI_Request req1, req2;
int temp1, temp2; int temp1, temp2;
/* reading task will tell us when it completes */ /* reading task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1); MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */ /* 2nd locking task will tell us when it completes */
...@@ -536,9 +536,7 @@ void grouplock_test4(char *filename, int fd, char *errmsg) ...@@ -536,9 +536,7 @@ void grouplock_test4(char *filename, int fd, char *errmsg)
*/ */
void grouplock_test5(char *filename, int fd, char *errmsg) void grouplock_test5(char *filename, int fd, char *errmsg)
{ {
int rc, count, gid = 1; int rc, gid = 1;
char buf[LPGL_FILEN];
char zeros[LPGL_FILEN];
MPI_Request req1, req2; MPI_Request req1, req2;
int temp1, temp2; int temp1, temp2;
...@@ -565,7 +563,7 @@ void grouplock_test5(char *filename, int fd, char *errmsg) ...@@ -565,7 +563,7 @@ void grouplock_test5(char *filename, int fd, char *errmsg)
if (rank == 0) { if (rank == 0) {
int iter = MAX_WAITING_TIME; int iter = MAX_WAITING_TIME;
int flag1, flag2; int flag1, flag2;
/* 3rd locking task will tell us when it completes */ /* 3rd locking task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1); MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */ /* 2nd locking task will tell us when it completes */
...@@ -592,7 +590,7 @@ void grouplock_test5(char *filename, int fd, char *errmsg) ...@@ -592,7 +590,7 @@ void grouplock_test5(char *filename, int fd, char *errmsg)
filename, rc); filename, rc);
FAIL(errmsg); FAIL(errmsg);
} }
do { do {
iter--; iter--;
if (!iter) { if (!iter) {
...@@ -615,8 +613,6 @@ void grouplock_test5(char *filename, int fd, char *errmsg) ...@@ -615,8 +613,6 @@ void grouplock_test5(char *filename, int fd, char *errmsg)
} }
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
} }
/* /*
...@@ -653,7 +649,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg) ...@@ -653,7 +649,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg)
/* To not do lots of separate tests with lots of fd opening/closing, /* To not do lots of separate tests with lots of fd opening/closing,
different parts of this test are performed in different processes */ different parts of this test are performed in different processes */
if (rank == 0 || rank == 1 ) { if (rank == 0 || rank == 1 ) {
if ((rc = ioctl(fd, LL_IOC_GROUP_LOCK, gid)) == -1) { if ((rc = ioctl(fd, LL_IOC_GROUP_LOCK, gid)) == -1) {
sprintf(errmsg, "ioctl GROUP_LOCK of file %s return %d", sprintf(errmsg, "ioctl GROUP_LOCK of file %s return %d",
...@@ -668,7 +664,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg) ...@@ -668,7 +664,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg)
if (errno != EINVAL) { if (errno != EINVAL) {
sprintf(errmsg, "Double GROUP lock failed with errno %d instead of EINVAL\n", errno); sprintf(errmsg, "Double GROUP lock failed with errno %d instead of EINVAL\n", errno);
FAIL(errmsg); FAIL(errmsg);
} }
} else { } else {
FAIL("Taking second GROUP lock on same fd succeed\n"); FAIL("Taking second GROUP lock on same fd succeed\n");
} }
...@@ -680,7 +676,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg) ...@@ -680,7 +676,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg)
if (errno != EINVAL) { if (errno != EINVAL) {
sprintf(errmsg, "Double GROUP lock different gid failed with errno %d instead of EINVAL\n", errno); sprintf(errmsg, "Double GROUP lock different gid failed with errno %d instead of EINVAL\n", errno);
FAIL(errmsg); FAIL(errmsg);
} }
} else { } else {
FAIL("Taking second GROUP lock on same fd, different gid, succeed\n"); FAIL("Taking second GROUP lock on same fd, different gid, succeed\n");
} }
...@@ -693,7 +689,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg) ...@@ -693,7 +689,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg)
sprintf(errmsg, "GROUP unlock with wrong gid failed with errno %d instead of EINVAL\n", sprintf(errmsg, "GROUP unlock with wrong gid failed with errno %d instead of EINVAL\n",
errno); errno);
FAIL(errmsg); FAIL(errmsg);
} }
} else { } else {
FAIL("GROUP unlock with wrong gid succeed\n"); FAIL("GROUP unlock with wrong gid succeed\n");
} }
...@@ -714,7 +710,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg) ...@@ -714,7 +710,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg)
sprintf(errmsg, "GROUP unlock on never locked fd failed with errno %d instead of EINVAL\n", sprintf(errmsg, "GROUP unlock on never locked fd failed with errno %d instead of EINVAL\n",
errno); errno);
FAIL(errmsg); FAIL(errmsg);
} }
} else { } else {
FAIL("GROUP unlock on never locked fd succeed\n"); FAIL("GROUP unlock on never locked fd succeed\n");
} }
...@@ -723,7 +719,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg) ...@@ -723,7 +719,7 @@ void grouplock_errorstest(char *filename, int fd, char *errmsg)
void grouplock_file(char *name, int items) void grouplock_file(char *name, int items)
{ {
int i, fd; int fd;
char filename[MAX_FILENAME_LEN]; char filename[MAX_FILENAME_LEN];
char errmsg[MAX_FILENAME_LEN+20]; char errmsg[MAX_FILENAME_LEN+20];
...@@ -821,7 +817,6 @@ int main(int argc, char *argv[]) ...@@ -821,7 +817,6 @@ int main(int argc, char *argv[])
{ {
char c; char c;
int i, iterations = 1; int i, iterations = 1;
int tr = 1;
/* Check for -h parameter before MPI_Init so the binary can be /* Check for -h parameter before MPI_Init so the binary can be
called directly, without, for instance, mpirun */ called directly, without, for instance, mpirun */
...@@ -875,8 +870,8 @@ int main(int argc, char *argv[]) ...@@ -875,8 +870,8 @@ int main(int argc, char *argv[])
} }
if (testdir == NULL && rank == 0) { if (testdir == NULL && rank == 0) {
fprintf(stderr, "Please specify a test directory! (\"%s -h\" for help)\n", fprintf(stderr, "Please specify a test directory! "
argv[0]); "(\"%s -h\" for help)\n", argv[0]);
MPI_Abort(MPI_COMM_WORLD, 2); MPI_Abort(MPI_COMM_WORLD, 2);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment