rename master to tracker, to emphasie rabit is p2p in computing
This commit is contained in:
parent
67b68ceae6
commit
dc12958fc7
@ -112,7 +112,7 @@ class SlaveEntry:
|
|||||||
self.wait_accept = len(badset) - len(conset)
|
self.wait_accept = len(badset) - len(conset)
|
||||||
return rmset
|
return rmset
|
||||||
|
|
||||||
class Master:
|
class Tracker:
|
||||||
def __init__(self, port = 9000, port_end = 9999):
|
def __init__(self, port = 9000, port_end = 9999):
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
for port in range(port, port_end):
|
for port in range(port, port_end):
|
||||||
@ -172,7 +172,7 @@ def mpi_submit(nslave, args):
|
|||||||
return subprocess.check_call(cmd, shell = True)
|
return subprocess.check_call(cmd, shell = True)
|
||||||
|
|
||||||
def submit(nslave, args, fun_submit = mpi_submit):
|
def submit(nslave, args, fun_submit = mpi_submit):
|
||||||
master = Master()
|
master = Tracker()
|
||||||
submit_thread = Thread(target = fun_submit, args = (nslave, args + master.slave_args()))
|
submit_thread = Thread(target = fun_submit, args = (nslave, args + master.slave_args()))
|
||||||
submit_thread.start()
|
submit_thread.start()
|
||||||
master.accept_slaves(nslave)
|
master.accept_slaves(nslave)
|
||||||
@ -8,7 +8,7 @@ import os
|
|||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
sys.path.append('./src/')
|
sys.path.append('./src/')
|
||||||
import rabit_master as master
|
import rabit_tracker as tracker
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Hadoop Streaming submission script')
|
parser = argparse.ArgumentParser(description='Hadoop Streaming submission script')
|
||||||
parser.add_argument('-s', '--nslaves', required=True, type=int)
|
parser.add_argument('-s', '--nslaves', required=True, type=int)
|
||||||
@ -28,5 +28,5 @@ def hadoop_streaming(nslaves, slave_args):
|
|||||||
subprocess.check_call(cmd, shell = True)
|
subprocess.check_call(cmd, shell = True)
|
||||||
|
|
||||||
start = time.time()
|
start = time.time()
|
||||||
master.submit(args.nslaves, [], fun_submit= hadoop_streaming)
|
tracker.submit(args.nslaves, [], fun_submit= hadoop_streaming)
|
||||||
print 'All run took %s' % (time.time() - start)
|
print 'All run took %s' % (time.time() - start)
|
||||||
@ -9,7 +9,7 @@ import subprocess
|
|||||||
# import the tcp_master.py
|
# import the tcp_master.py
|
||||||
# add path to sync
|
# add path to sync
|
||||||
sys.path.append(os.path.dirname(__file__)+'/src/')
|
sys.path.append(os.path.dirname(__file__)+'/src/')
|
||||||
import rabit_master as master
|
import rabit_tracker as tracker
|
||||||
|
|
||||||
#
|
#
|
||||||
# Note: this submit script is only used for example purpose
|
# Note: this submit script is only used for example purpose
|
||||||
@ -33,4 +33,4 @@ if __name__ == '__main__':
|
|||||||
print 'Usage: <nslave> <cmd>'
|
print 'Usage: <nslave> <cmd>'
|
||||||
exit(0)
|
exit(0)
|
||||||
# call submit, with nslave, the commands to run each job and submit function
|
# call submit, with nslave, the commands to run each job and submit function
|
||||||
master.submit(int(sys.argv[1]), sys.argv[2:], fun_submit= mpi_submit)
|
tracker.submit(int(sys.argv[1]), sys.argv[2:], fun_submit= mpi_submit)
|
||||||
Loading…
x
Reference in New Issue
Block a user