Check for out-of-bounds array rank.
authorOrion Lawlor <olawlor@acm.org>
Wed, 25 Sep 2002 18:26:11 +0000 (18:26 +0000)
committerOrion Lawlor <olawlor@acm.org>
Wed, 25 Sep 2002 18:26:11 +0000 (18:26 +0000)
src/libs/ck-libs/ampi/ampiimpl.h

index f466d2c652e8d3d28ebddef547ff4357bfd49f43..5766cdbedfd0c68a5953acfa68d9294db219157b 100644 (file)
@@ -40,6 +40,9 @@ public:
        
        //Get the array index for rank r in this communicator
        int getIndexForRank(int r) const {
+#ifndef CMK_OPTIMIZE
+               if (r>=size) CkAbort("AMPI> You passed in an out-of-bounds process rank!");
+#endif
                if (isWorld) return r;
                else return indices[r];
        }