if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag1, flag2;
-
+
/* reading task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */
if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag1;
-
+
do {
iter--;
if (!iter) {
if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag1, flag2, flag3;
-
+
/* 2nd locking task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 3nd locking task will tell us when it completes */
if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag3;
-
+
do {
iter--;
if (!iter) {
if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag1, flag2;
-
+
/* reading task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */
if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag1;
-
+
do {
iter--;
usleep(100);
filename, rc);
FAIL(errmsg);
}
-
+
do {
iter--;
if (!iter) {
}
-/*
+/*
* process1 attempts CW(gid=1) -- granted
* process2 attempts PR on non-blocking fd -> should return -EWOULDBLOCK
* process3 attempts CW(gid=2) on non-blocking fd -> should return -EWOULDBLOCK
int flag1, flag2;
MPI_Request req1, req2;
int temp1, temp2;
-
+
/* reading task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */
*/
void grouplock_test5(char *filename, int fd, char *errmsg)
{
- int rc, count, gid = 1;
- char buf[LPGL_FILEN];
- char zeros[LPGL_FILEN];
+ int rc, gid = 1;
MPI_Request req1, req2;
int temp1, temp2;
if (rank == 0) {
int iter = MAX_WAITING_TIME;
int flag1, flag2;
-
+
/* 3rd locking task will tell us when it completes */
MPI_Irecv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, &req1);
/* 2nd locking task will tell us when it completes */
filename, rc);
FAIL(errmsg);
}
-
+
do {
iter--;
if (!iter) {
/* To not do lots of separate tests with lots of fd opening/closing,
different parts of this test are performed in different processes */
-
+
if (rank == 0 || rank == 1 ) {
if ((rc = ioctl(fd, LL_IOC_GROUP_LOCK, gid)) == -1) {
sprintf(errmsg, "ioctl GROUP_LOCK of file %s return %d",
if (errno != EINVAL) {
sprintf(errmsg, "Double GROUP lock failed with errno %d instead of EINVAL\n", errno);
FAIL(errmsg);
- }
+ }
} else {
FAIL("Taking second GROUP lock on same fd succeed\n");
}
if (errno != EINVAL) {
sprintf(errmsg, "Double GROUP lock different gid failed with errno %d instead of EINVAL\n", errno);
FAIL(errmsg);
- }
+ }
} else {
FAIL("Taking second GROUP lock on same fd, different gid, succeed\n");
}
sprintf(errmsg, "GROUP unlock with wrong gid failed with errno %d instead of EINVAL\n",
errno);
FAIL(errmsg);
- }
+ }
} else {
FAIL("GROUP unlock with wrong gid succeed\n");
}
sprintf(errmsg, "GROUP unlock on never locked fd failed with errno %d instead of EINVAL\n",
errno);
FAIL(errmsg);
- }
+ }
} else {
FAIL("GROUP unlock on never locked fd succeed\n");
}
void grouplock_file(char *name, int items)
{
- int i, fd;
+ int fd;
char filename[MAX_FILENAME_LEN];
char errmsg[MAX_FILENAME_LEN+20];
{
char c;
int i, iterations = 1;
- int tr = 1;
/* Check for -h parameter before MPI_Init so the binary can be
called directly, without, for instance, mpirun */
}
if (testdir == NULL && rank == 0) {
- fprintf(stderr, "Please specify a test directory! (\"%s -h\" for help)\n",
- argv[0]);
+ fprintf(stderr, "Please specify a test directory! "
+ "(\"%s -h\" for help)\n", argv[0]);
MPI_Abort(MPI_COMM_WORLD, 2);
}