From: zab Date: Mon, 20 Oct 2003 21:50:42 +0000 (+0000) Subject: - add an explanatory comment and turn tabs into spaces X-Git-Tag: v1_7_0_51~2^7~374 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e5a7e354835de1f22609f3413f879dcb22a58652;p=fs%2Flustre-release.git - add an explanatory comment and turn tabs into spaces --- diff --git a/lustre/tests/write_disjoint.c b/lustre/tests/write_disjoint.c index 65eadf4..3ccb0e1 100644 --- a/lustre/tests/write_disjoint.c +++ b/lustre/tests/write_disjoint.c @@ -1,3 +1,18 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * Each loop does 3 things: + * - rank 0 truncates to 0 + * - all ranks agree on a random chunk size + * - all ranks race to write their pattern to their chunk of the file + * - rank 0 makes sure that the resulting file size is ranks * chunk size + * - rank 0 makes sure that everyone's patterns went to the right place + * + * compile: mpicc -g -Wall -o write_disjoint write_disjoint.c + * run: mpirun -np N -machlist write_disjoint + * or: pdsh -w write_disjoint + * or: prun -n N [-N M] write_disjoint + */ #include #include #include @@ -13,93 +28,93 @@ int main( int argc,char *argv[] ) { - int i, n, fd, chunk_size, file_size; - int rank, noProcessors, ret, done; - off_t offset; - char **chunk_buf; - char *read_buf; - struct stat stat_buf; + int i, n, fd, chunk_size, file_size; + int rank, noProcessors, ret, done; + off_t offset; + char **chunk_buf; + char *read_buf; + struct stat stat_buf; - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &noProcessors); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - chunk_buf = (char**)malloc(noProcessors * sizeof(void*)); - for( i=0; i