fix build

This commit is contained in:
tqchen 2016-02-27 18:10:58 -08:00
parent 7479791f6a
commit d45fca0298
2 changed files with 7 additions and 8 deletions

View File

@ -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()

View File

@ -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(*)