X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/863aeead864a309c494893a1b06ec33ed2b7daf1..d20f024dba9ff1e9c8822237caaf963b9e913889:/src/smpi/colls/coll_tuned_topo.cpp diff --git a/src/smpi/colls/coll_tuned_topo.cpp b/src/smpi/colls/coll_tuned_topo.cpp index aa797a9884..06a23b4019 100644 --- a/src/smpi/colls/coll_tuned_topo.cpp +++ b/src/smpi/colls/coll_tuned_topo.cpp @@ -19,8 +19,8 @@ * 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. */ @@ -52,7 +52,10 @@ static int calculate_num_nodes_up_to_level( int fanout, int level ) { /* 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 ? } /*