pestpp icon indicating copy to clipboard operation
pestpp copied to clipboard

PESTPP-GLM failing in 5.1.16 on Linux

Open ecudhi opened this issue 2 years ago • 0 comments

Hi. I've just updated from version 5.0.0 to 5.1.16 and am having trouble running pestpp-glm with Panther on Linux. The error message I get is:

04/26/22 06:59:07 processing template files with 1 threads... thread 0 processed 1 template files 04/26/22 06:59:07 done, took 0.012 seconds 04/26/22 06:59:07 calling forward run command(s) 04/26/22 06:59:07 calling forward run command: 'run_model.bat' exit_code: 3434 status: 256 exception raised by run thread: waitpid() returned error status for command: run_model.bat

I had a look at the code, and located the problem in model_interface.cpp, line 751

int status = 0;
pid_t exit_code = waitpid(command_pid, &status, WNOHANG);
//if the process ended, break
if ((exit_code == -1) || (status != 0))
{
  finished->set(true);
  cout << "exit_code: " << exit_code << endl;
  cout << "status: " << status << endl;
  throw std::runtime_error("waitpid() returned error status for command: " + cmd_string);
}

The condition in the if statement met, because in my case status is non-zero. In version 5.0.0 the status clause was not present in the condition. Looking at the documentation for waitpid(...), maybe status being non-zero does not necessarily indicate an error? Perhaps replacing status != 0 with !WIFEXITED(status) would be a better solution?

ecudhi avatar Apr 26 '22 10:04 ecudhi