Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-2446 build: Update Whamcloud copyright messages for Intel
[fs/lustre-release.git]
/
lustre
/
tests
/
mpi
/
write_disjoint.c
diff --git
a/lustre/tests/mpi/write_disjoint.c
b/lustre/tests/mpi/write_disjoint.c
index
8ddc497
..
77ee332
100644
(file)
--- a/
lustre/tests/mpi/write_disjoint.c
+++ b/
lustre/tests/mpi/write_disjoint.c
@@
-1,6
+1,4
@@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@
-28,6
+26,8
@@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-88,6
+88,7
@@
int main (int argc, char *argv[]) {
ssize_t ret;
char *filename = "/mnt/lustre/write_disjoint";
int numloops = 1000;
ssize_t ret;
char *filename = "/mnt/lustre/write_disjoint";
int numloops = 1000;
+ int random = 0;
error = MPI_Init(&argc, &argv);
if (error != MPI_SUCCESS)
error = MPI_Init(&argc, &argv);
if (error != MPI_SUCCESS)
@@
-133,12
+134,23
@@
int main (int argc, char *argv[]) {
if (ret != 0)
rprintf(rank, n, "truncate() returned %s\n",
strerror(errno) );
if (ret != 0)
rprintf(rank, n, "truncate() returned %s\n",
strerror(errno) );
+ random = rand();
}
}
- CHUNK_SIZE(n) = rand() % CHUNK_MAX_SIZE;
+ MPI_Bcast(&random, 1, MPI_INT, 0, MPI_COMM_WORLD);
+ CHUNK_SIZE(n) = random % CHUNK_MAX_SIZE;
if (n % 1000 == 0 && rank == 0)
printf("loop %d: chunk_size %lu\n", n, CHUNK_SIZE(n));
if (n % 1000 == 0 && rank == 0)
printf("loop %d: chunk_size %lu\n", n, CHUNK_SIZE(n));
+ if (stat(filename, &stat_buf) < 0)
+ rprintf(rank, n, "error stating %s: %s\n",
+ filename, strerror(errno));
+
+ if (stat_buf.st_size != 0)
+ rprintf(rank, n, "filesize = %lu. "
+ "Should be zero after truncate\n",
+ stat_buf.st_size);
+
MPI_Barrier(MPI_COMM_WORLD);
/* Do the race */
MPI_Barrier(MPI_COMM_WORLD);
/* Do the race */
@@
-194,7
+206,8
@@
int main (int argc, char *argv[]) {
for (i = 0; i < noProcessors; i++) {
char command[4096];
for (i = 0; i < noProcessors; i++) {
char command[4096];
- int j, rc;
+ int j;
+
if (!memcmp(read_buf + (i * CHUNK_SIZE(n)),
chunk_buf[i], CHUNK_SIZE(n)))
continue;
if (!memcmp(read_buf + (i * CHUNK_SIZE(n)),
chunk_buf[i], CHUNK_SIZE(n)))
continue;
@@
-219,7
+232,7
@@
int main (int argc, char *argv[]) {
}
sprintf(command, "od -Ad -a %s", filename);
}
sprintf(command, "od -Ad -a %s", filename);
- r
c
= system(command);
+ r
et
= system(command);
rprintf(0, n, "data check error - exiting\n");
}
}
rprintf(0, n, "data check error - exiting\n");
}
}