U  g7@sddlZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z e dZ dddZddZd d Zd d Zd dZddZdS)N)MPIMixed MPIDisabledOpenMPDisabledlsf_cray_intelcCs@|dkr t}tjdg}tjj|d|d}|}|}dS)z%!Runs the "sync" command as an exe().Nz /bin/syncT)capturelogger) module_loggerprodutilprogRunnerpipelinePipeline to_stringpoll)rsyncpversionstatusrK/lfs/h1/ops/prod/packages/hmon.v3.2.7/ush/produtil/mpi_impl/inside_aprun.pyrunsyncs rcCs*tjdd}|r&t|}|dkr&dSdS)NZ INSIDE_APRUNrTF)osenvirongetint) inside_aprunrrrdetects rcCs$|dk r t|}|dkr tddS)a!When more than one thread is requested, this raises OpenMPDisabled to indicate OpenMP is not allowed. @param arg An produtil.prog.Runner or produtil.mpiprog.MPIRanksBase object tree @param threads the number of threads, or threads per rank, an integerNrzFYou cannot start a new OpenMP program from within an aprun invocation.)rr)argthreadsrrropenmp!sr!cKs tddS)zT!Raises an exception to indicate MPI is not supported @param arg,kwargs Ignored.zCYou cannot start a new MPI program from within an aprun invocation.N)r)rkwargsrrr mpirunner.sr#cCsdS)z0!Returns False to indicate MPI is not supported.Frrrrr can_run_mpi3sr$cKstjjt|gf|S)z!Returns an ImmutableRunner that will run the specified program. @returns an empty list @param exe The executable to run on compute nodes. @param kwargs Ignored.)r r ImmutableRunnerstr)exer"rrr make_bigexe7sr()N)rsocketloggingprodutil.fileopr produtil.progprodutil.mpiprogprodutil.pipeline mpi_impl_baserrr getLoggerr rrr!r#r$r(rrrr s