CkIO: Sanity check assertions
authorPhil Miller <mille121@illinois.edu>
Thu, 8 Aug 2013 16:35:53 +0000 (11:35 -0500)
committerPhil Miller <mille121@illinois.edu>
Tue, 20 Aug 2013 23:29:10 +0000 (18:29 -0500)
src/libs/ck-libs/io/ckio.C

index bfc5352616f981db03b036c947bed27491d0f78c..cb6c515ab939a38ef5536db0dc8779c922ad7524 100644 (file)
@@ -182,6 +182,9 @@ namespace Ck { namespace IO {
           Options &opts = files[session.file].opts;
           size_t stripe = opts.peStripe;
 
+          CkAssert(offset >= session.offset);
+          CkAssert(offset + bytes <= session.offset + session.bytes);
+
           size_t sessionStripeBase = (session.offset / stripe) * stripe;
 
           while (bytes > 0) {
@@ -271,6 +274,8 @@ namespace Ck { namespace IO {
           , complete(complete_)
         {
           CkAssert(file->fd != -1);
+          CkAssert(myOffset >= sessionOffset);
+          CkAssert(myOffset + myBytes <= sessionOffset + sessionBytes);
         }
 
         WriteSession(CkMigrateMessage *m) { }