0

currently,MPI is started like this:

QStringList params = QStringList{"mpiexec.exe", "-hosts", QString::number(nodes.size()), ips,
                        solver.exe,
                        "--mpi", "-p", QString::number(coreNum),
                        "../transfer/project/project.json"};

QString param;
for (auto& p : params)
   param += p + " ";

start("C:/Windows/System32/cmd.exe /C " + param);

The problem is that only cmd.exe's process handler will be returned,so after solver.exe finised,cmd.exe exits,but both mpiexec.exe and solver.exe won't.Due to the process handlers of the both can't be gotten,no way to stop them.

The question is that,with QT5+Windows,by these invocation chain:

 cmd.exe  ----->  mpiexec.exe  -------> solver.exe

How to start mpiexe.exe to ensure both mpiexec.exe and solver.exe can be stopped after solver.exe finished?

Alex Luya
  • 9,412
  • 15
  • 59
  • 91

0 Answers0