update doc

This commit is contained in:
tqchen
2015-01-03 05:20:18 -08:00
parent be355c1e60
commit 1b4921977f
11 changed files with 149 additions and 349 deletions

View File

@@ -37,7 +37,7 @@ def exec_cmd(cmd, taskid):
# Note: this submit script is only used for demo purpose
# submission script using pyhton multi-threading
#
def mthread_submit(nslave, slave_args):
def mthread_submit(nslave, worker_args):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
@@ -48,7 +48,7 @@ def mthread_submit(nslave, slave_args):
"""
procs = {}
for i in range(nslave):
procs[i] = Thread(target = exec_cmd, args = (args.command + slave_args, i))
procs[i] = Thread(target = exec_cmd, args = (args.command + worker_args, i))
procs[i].start()
for i in range(nslave):
procs[i].join()

View File

@@ -65,11 +65,11 @@ args = parser.parse_args()
if args.jobname is None:
args.jobname = ('Rabit(nworker=%d):' % args.nworker) + args.command[0].split('/')[-1];
def hadoop_streaming(nworker, slave_args):
def hadoop_streaming(nworker, worker_args):
cmd = '%s jar %s -D mapred.map.tasks=%d' % (args.hadoop_binary, args.hadoop_streaming_jar, nworker)
cmd += ' -D mapred.job.name=%d' % (a)
cmd += ' -input %s -output %s' % (args.input, args.output)
cmd += ' -mapper \"%s\" -reducer \"/bin/cat\" ' % (' '.join(args.command + slave_args))
cmd += ' -mapper \"%s\" -reducer \"/bin/cat\" ' % (' '.join(args.command + worker_args))
fset = set()
if args.auto_file_cache:
for f in args.command:

View File

@@ -22,7 +22,7 @@ args = parser.parse_args()
#
# submission script using MPI
#
def mpi_submit(nslave, slave_args):
def mpi_submit(nslave, worker_args):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
@@ -31,11 +31,11 @@ def mpi_submit(nslave, slave_args):
args arguments to launch each job
this usually includes the parameters of master_uri and parameters passed into submit
"""
sargs = ' '.join(args.command + slave_args)
sargs = ' '.join(args.command + worker_args)
if args.hostfile is None:
cmd = ' '.join(['mpirun -n %d' % (nslave)] + args.command + slave_args)
cmd = ' '.join(['mpirun -n %d' % (nslave)] + args.command + worker_args)
else:
' '.join(['mpirun -n %d --hostfile %s' % (nslave, args.hostfile)] + args.command + slave_args)
' '.join(['mpirun -n %d --hostfile %s' % (nslave, args.hostfile)] + args.command + worker_args)
print cmd
subprocess.check_call(cmd, shell = True)