fix build
This commit is contained in:
parent
7479791f6a
commit
d45fca0298
@ -18,14 +18,14 @@ rank = rabit.get_rank()
|
|||||||
a = np.zeros(n)
|
a = np.zeros(n)
|
||||||
|
|
||||||
def prepare(a):
|
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
|
# must take in reference and modify the reference
|
||||||
for i in xrange(n):
|
for i in xrange(n):
|
||||||
a[i] = rank + i
|
a[i] = rank + i
|
||||||
|
|
||||||
print '@node[%d] before-allreduce: a=%s' % (rank, str(a))
|
print('@node[%d] before-allreduce: a=%s' % (rank, str(a)))
|
||||||
a = rabit.allreduce(a, rabit.MAX, prepare_fun = prepare)
|
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)
|
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()
|
rabit.finalize()
|
||||||
|
|||||||
@ -347,6 +347,5 @@ class SerializeReducer {
|
|||||||
};
|
};
|
||||||
} // namespace rabit
|
} // namespace rabit
|
||||||
// implementation of template functions
|
// implementation of template functions
|
||||||
#include "./internal/
|
#include "./internal/rabit-inl.h"
|
||||||
rabit-inl.h"
|
|
||||||
#endif // RABIT_RABIT_H_ // NOLINT(*)
|
#endif // RABIT_RABIT_H_ // NOLINT(*)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user