ó —Ŕv]c@sćdZddlZddlZddlZddlZddlZejjejje ƒƒZ ejj ejj e dƒƒd„Z d„Zd„ZedkrâdZejd ed ejƒejejeƒeƒndS( s Launch a distributed job i˙˙˙˙Ns../3rdparty/dmlc-core/trackerc Csůdt|jƒdt|jƒd|jd|jd|jg }t|ƒ}xVdddgD]E}x<||D]0}|jd |jd d ƒƒ|j|ƒqlWq[W||j 7}yd d l m }Wnt k rĺdGHdGH‚nX|j |ƒ}|S(s-convert from mxnet's opts to dmlc's opts s --num-workerss --num-serverss --clusters --host-files--sync-dst-dirt env_servert env_workertenvs--t_t-i˙˙˙˙(toptss9Can't load dmlc_tracker package. Perhaps you need to runs+ git submodule update --init --recursive(tstrt num_workerst num_serverstlauncherthostfilet sync_dst_dirtvarstappendtreplacetcommandt dmlc_trackerRt ImportErrortget_opts(Rtargstdoptstkeytvt dmlc_opts((s3/tmp/pip-install-Qvdv_2/mxnet/mxnet/tools/launch.pyRs&     c Cs°tjddƒ}|jdddtdtddƒ|jd d dtdd ƒ|jd d dtddƒ|jddtddƒ|jddtddddddddgddƒ|jddddgddƒ|jddddgddƒ|jd dddgdd!ƒ|jd"d#d$dd%ƒ|jƒ\}}|j|7_|jdkrn|j |_nt |ƒ}|j dks˜|j d&kr;|j dkrÇd'd(lm}|j|ƒqŹ|j dkröd'd)lm}|j|ƒqŹ|j dkr%d'd*lm}|j|ƒqŹtd+|j ƒ‚nq|j dkrjd'd,lm}|j|ƒnB|j dkr™d'd-lm}|j|ƒntd+|j ƒ‚dS(.Nt descriptionsLaunch a distributed jobs-ns --num-workerstrequiredttypethelps%number of worker nodes to be launcheds-ss --num-serverssdnumber of server nodes to be launched, in default it is equal to NUM_WORKERSs-Hs --hostfilespthe hostfile of slave machines which will run the job. Required for ssh and mpi launchers--sync-dst-dirsœif specificed, it will sync the current directory into slave machines's SYNC_DST_DIR if ssh launcher is useds --launchertdefaulttsshtchoicestlocaltmpitsgetyarnsthe launcher to uses --env-servertactionR s1Given a pair of environment_variable:value, sets this value of environment variable for the server processes. This overrides values of those environment variable on the machine where this script is run from. Example OMP_NUM_THREADS:3s --env-workers1Given a pair of environment_variable:value, sets this value of environment variable for the worker processes. This overrides values of those environment variable on the machine where this script is run from. Example OMP_NUM_THREADS:3s--envsgiven a environment variable, passes their values from current system to all workers and servers. Not necessary when launcher is local as in that case all environment variables which are set are copied.Rtnargst+s!command for launching the programtNonei˙˙˙˙(R"(R(R!s"Unknown submission cluster type %s(R(R (targparsetArgumentParsert add_argumenttTruetintRtparse_known_argsRRR&RRt host_filetclusterRR"tsubmitRR!t RuntimeErrorRR (tparserRtunknownR"RR!RR ((s3/tmp/pip-install-Qvdv_2/mxnet/mxnet/tools/launch.pytmain9sV cCstjdƒtjdƒdS(Ns Stop launcheri(tloggingtinfotsystexit(tsignaltframe((s3/tmp/pip-install-Qvdv_2/mxnet/mxnet/tools/launch.pytsignal_handlerxs t__main__s%%(asctime)s %(levelname)s %(message)stformattlevel(t__doc__R'tosR6R8R4tpathtabspathtdirnamet__file__t curr_pathR tjoinRR3R:t__name__tfmtt basicConfigtINFOtSIGINT(((s3/tmp/pip-install-Qvdv_2/mxnet/mxnet/tools/launch.pyts     ?