none
Control is not rendering back to WaitForExit() RRS feed

  • Question

  • Team,

    I'm developing an application using Windows HPC Server MPI. I'm using the mpiexec executable to run my executable in parallel in two machines.

    I'm using the following code to host in multiple machines,

    HPCMPIExecPath = @"C:\Program Files\Microsoft HPC Pack 2008 SDK\Bin\mpiexec.exe";
    HostProcessInfo = "mpiexec -hosts 2 machine1.domain.com  machine2.domain.com";
    MPIEngineExePath = "\"" + @"C:\Test\Sample.exe" + "\"";

    string arguments = string.Format("{0} {1} {2}", HostProcessInfo, MPIEngineExePath, "Invoke Job");

    Process mpiexec = new Process();
    ProcessStartInfo pinfo = new ProcessStartInfo(HPCMPIExecPath);

    pinfo.WindowStyle = ProcessWindowStyle.Hidden;
    pinfo.Verb = "runas";
    pinfo.WorkingDirectory = Environment.CurrentDirectory;
    pinfo.UseShellExecute = false;
    pinfo.RedirectStandardError = true;
    pinfo.RedirectStandardOutput = true;
    pinfo.Arguments = arguments;

    mpiexec.StartInfo = pinfo;
    mpiexec.OutputDataReceived += new DataReceivedEventHandler(StandardOutputHandler);
    mpiexec.ErrorDataReceived += new DataReceivedEventHandler(StandardOutputHandler);

    mpiexec.Start();

    int procId = mpiexec.Id;

    mpiexec.WaitForExit();

    Now, what happens is, after the process has started, the executable executes successfully, and the control has to come back to WaitForExit for further processing, rather is waits infinitely and the control is not rendered to the client code.

    I change the behavior to look like mpiexec.WaitForExit(15000), now the control is coming back for further execution.

    The .smpd is running in domain account of the user in both the machines.

    Need helps ?

    Thanks & Regards,


    Prasenna

    Thursday, June 28, 2012 12:35 PM

All replies

  • Team,

    I'm developing an application using Windows HPC Server MPI. I'm using the mpiexec executable to run my executable in parallel in two machines.

    I'm using the following code to host in multiple machines,

    HPCMPIExecPath = @"C:\Program Files\Microsoft HPC Pack 2008 SDK\Bin\mpiexec.exe";
    HostProcessInfo = "mpiexec -hosts 2 machine1.domain.com  machine2.domain.com";
    MPIEngineExePath = "\"" + @"C:\Test\Sample.exe" + "\"";

    string arguments = string.Format("{0} {1} {2}", HostProcessInfo, MPIEngineExePath, "Invoke Job");

    Process mpiexec = new Process();
    ProcessStartInfo pinfo = new ProcessStartInfo(HPCMPIExecPath);

    pinfo.WindowStyle = ProcessWindowStyle.Hidden;
    pinfo.Verb = "runas";
    pinfo.WorkingDirectory = Environment.CurrentDirectory;
    pinfo.UseShellExecute = false;
    pinfo.RedirectStandardError = true;
    pinfo.RedirectStandardOutput = true;
    pinfo.Arguments = arguments;

    mpiexec.StartInfo = pinfo;
    mpiexec.OutputDataReceived += new DataReceivedEventHandler(StandardOutputHandler);
    mpiexec.ErrorDataReceived += new DataReceivedEventHandler(StandardOutputHandler);

    mpiexec.Start();

    int procId = mpiexec.Id;

    mpiexec.WaitForExit();

    Now, what happens is, after the process has started, the executable executes successfully, and the control has to come back to WaitForExit for further processing, rather is waits infinitely and the control is not rendered to the client code.

    I change the behavior to look like mpiexec.WaitForExit(15000), now the control is coming back for further execution.

    The .smpd is running in domain account of the user in both the machines.

    Need helps ?

    Thanks & Regards,


    Prasenna



    Prasenna

    Thursday, June 28, 2012 12:35 PM