From 8ad272c34b9b0f3608b9b35a05f7206314c8c691 Mon Sep 17 00:00:00 2001 From: carns Date: Wed, 3 Feb 2010 19:32:00 +0000 Subject: [PATCH] Added sanity test in darshan parser to throw an error if the log file appears to contain file records with bogus rank information git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@176 3b7491f3-a168-0410-bf4b-c445ed680a29 --- darshan-parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/darshan-parser.c b/darshan-parser.c index 6cf0f15..3283bae 100644 --- a/darshan-parser.c +++ b/darshan-parser.c @@ -29,6 +29,7 @@ int main(int argc, char **argv) int* devs; char** mnt_pts; char** fs_types; + int last_rank = 0; if(argc != 2) { @@ -154,6 +155,14 @@ int main(int argc, char **argv) { char* mnt_pt = NULL; char* fs_type = NULL; + + if(cp_file.rank != -1 && cp_file.rank < last_rank) + { + fprintf(stderr, "Error: log file contains out of order rank data.\n"); + return(-1); + } + if(cp_file.rank != -1) + last_rank = cp_file.rank; for(i=0; i