fixed a bug in calcualting spanning tree parent, which looks like an ancient bug...
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 9 Nov 2007 19:01:40 +0000 (19:01 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 9 Nov 2007 19:01:40 +0000 (19:01 +0000)
src/conv-core/converse.h

index cfd7110fa94c3661a22cb692228b746b0bafcf55..404073187beb3d900d464fd86f97754a5ee5c22d 100644 (file)
@@ -771,7 +771,7 @@ extern void CsdSchedulePoll(void);
 #define CST_SP(n) (CmiNodeSpanTreeParent(n))
 #define CST_ND(p) (CmiNodeOf(p))
 #define CST_NS(p) (CmiNodeSize(CST_ND(p)))
-#define CmiSpanTreeParent(p) ((p)?(CST_R(p)?(CST_NF(CST_ND(p))+CST_R(p)/CST_W):CST_NF(CST_SP(CST_ND(p)))):(-1))
+#define CmiSpanTreeParent(p) ((p)?(CST_R(p)?(CST_NF(CST_ND(p))+(CST_R(p)-1)/CST_W):CST_NF(CST_SP(CST_ND(p)))):(-1))
 #define CST_C(p) (((CST_R(p)+1)*CST_W<CST_NS(p))?CST_W:(((CST_R(p)*CST_W+1)>=CST_NS(p))?0:((CST_NS(p)-1)-CST_R(p)*CST_W)))
 #define CST_SC(p) (CmiNumNodeSpanTreeChildren(CST_ND(p)))
 #define CmiNumSpanTreeChildren(p) (CST_R(p)?CST_C(p):(CST_SC(p)+CST_C(p)))