add auto caching of python in hadoop script, mock test module to python, with checkpt

This commit is contained in:
tqchen
2015-01-13 14:29:10 -08:00
parent 877fc42e40
commit 3419cf9aa7
10 changed files with 104 additions and 144 deletions

View File

@@ -5,8 +5,9 @@ demo python script of rabit
import os
import sys
import numpy as np
# add path to wrapper
sys.path.append(os.path.dirname(__file__) + '/../wrapper')
# 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')
import rabit
rabit.init()
@@ -15,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: a=%s' % (rank, str(a))

View File

@@ -5,7 +5,8 @@ demo python script of rabit
import os
import sys
# add path to wrapper
sys.path.append(os.path.dirname(__file__) + '/../wrapper')
# for normal run without tracker script, add following line
# sys.path.append(os.path.dirname(__file__) + '/../wrapper')
import rabit
rabit.init()