diff --git a/guide/lazy_allreduce.py b/guide/lazy_allreduce.py index a195f58d2..2b60a8cf4 100755 --- a/guide/lazy_allreduce.py +++ b/guide/lazy_allreduce.py @@ -18,14 +18,14 @@ rank = rabit.get_rank() a = np.zeros(n) def prepare(a): - print '@node[%d] run prepare function' % rank + print('@node[%d] run prepare function' % rank) # must take in reference and modify the reference for i in xrange(n): - a[i] = rank + i - -print '@node[%d] before-allreduce: a=%s' % (rank, str(a)) + a[i] = rank + i + +print('@node[%d] before-allreduce: a=%s' % (rank, str(a))) a = rabit.allreduce(a, rabit.MAX, prepare_fun = prepare) -print '@node[%d] after-allreduce-max: a=%s' % (rank, str(a)) +print('@node[%d] after-allreduce-max: a=%s' % (rank, str(a))) a = rabit.allreduce(a, rabit.SUM) -print '@node[%d] after-allreduce-sum: a=%s' % (rank, str(a)) +print('@node[%d] after-allreduce-sum: a=%s' % (rank, str(a))) rabit.finalize() diff --git a/include/rabit/rabit.h b/include/rabit/rabit.h index 70660eafe..cf79bd638 100644 --- a/include/rabit/rabit.h +++ b/include/rabit/rabit.h @@ -347,6 +347,5 @@ class SerializeReducer { }; } // namespace rabit // implementation of template functions -#include "./internal/ -rabit-inl.h" +#include "./internal/rabit-inl.h" #endif // RABIT_RABIT_H_ // NOLINT(*)