* Additional copyrights may follow
*/
-#include "colls_private.h"
-#include "coll_tuned_topo.h"
+#include "coll_tuned_topo.hpp"
+#include "colls_private.hpp"
/*
* Some static helpers.
*/
{
/* just use geometric progression formula for sum:
a^0+a^1+...a^(n-1) = (a^n-1)/(a-1) */
- return ((pown(fanout,level) - 1)/(fanout - 1));
+ if(fanout > 1)
+ return ((pown(fanout,level) - 1)/(fanout - 1));
+ else
+ return 0; // is this right ?
}
/*