refactor: librabit

This commit is contained in:
tqchen
2016-02-27 10:14:26 -08:00
parent 73b6e9bbd0
commit 7479791f6a
33 changed files with 412 additions and 801 deletions

View File

@@ -7,7 +7,7 @@ import sys
import numpy as np
# import rabit, the tracker script will setup the lib path correctly
# for normal run without tracker script, add following line
# sys.path.append(os.path.dirname(__file__) + '/../wrapper')
# sys.path.append(os.path.dirname(__file__) + '/../python')
import rabit
rabit.init()
@@ -16,7 +16,7 @@ rank = rabit.get_rank()
a = np.zeros(n)
for i in xrange(n):
a[i] = rank + i
print '@node[%d] before-allreduce: a=%s' % (rank, str(a))
a = rabit.allreduce(a, rabit.MAX)
print '@node[%d] after-allreduce-max: a=%s' % (rank, str(a))