A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
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
aa797a9
..
06a23b4
100644
(file)
--- a/
src/smpi/colls/coll_tuned_topo.cpp
+++ b/
src/smpi/colls/coll_tuned_topo.cpp
@@
-19,8
+19,8
@@
* Additional copyrights may follow
*/
* Additional copyrights may follow
*/
-#include "coll
s_private.h
"
-#include "coll
_tuned_topo.h
"
+#include "coll
_tuned_topo.hpp
"
+#include "coll
s_private.hpp
"
/*
* Some static helpers.
*/
/*
* 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) */
{
/* 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 ?
}
/*
}
/*