ó —Àv]c@@spdZddlmZddlZddlZddlZddlmZddlm Z d„Z d„Z dS( s% DMLC submission script, MPI version i(tabsolute_importN(tThreadi(ttrackercC@sd}tjdkrPx4|jƒD]&\}}|d|t|ƒf7}q"W|Stjddgdtjdtjƒjƒ\}}d|krÉx‰|jƒD]&\}}|d |t|ƒf7}qœWnRd |krxC|jƒD]&\}}|d|t|ƒf7}qâWn td ƒ‚|S( sZget the mpirun command for setting the envornment support both openmpi and mpich2 ttwin32s -env %s %stmpiruns --versiontstdouttstderrsOpen MPIs -x %s=%stmpichsUnknown MPI Version( tsystplatformtitemststrt subprocesstPopentPIPEt communicatet RuntimeError(tenvstcmdtktvtoutterr((s1/tmp/pip-install-Qvdv_2/mxnet/dmlc_tracker/mpi.pyt get_mpi_env s   ! ! c@sA‡fd†}tjˆjˆjd|ddjˆjƒƒdS(sSubmission script with MPI.c@sd„}d}ˆjdk r.dˆj}n|ddjˆjƒ7}d|d<|dkrïtjd|ƒd |d s