i-RIC / iriclib

1 stars 3 forks source link

iRIC_Check_Cancel() behavior improvement #42

Closed kskinoue0612 closed 6 years ago

kskinoue0612 commented 6 years ago

iRIC_Check_Cancel() now returns 0 if ".cancel" file does not exists, and returns 1 if exists.

The solver calls iRIC_Check_Cancel(), and if 1 is returned, it calls STOP.

But sometimes, it causes that CGNS file is not closed properly, corrupted, and it becomes impossible to open the CGNS file.

To avoid such situations, we can ask all solver developers to add line to call cg_close_f before calling STOP. But it will take time to get all solvers updated.

So I propose that we change iRIC_Check_Cancel() behavior:

With this modification, when user clicks on "Stop" button on iRIC GUI, we can safely stop solver after closing CGNS files.

The advantage is that we can just replace iRIClib DLL, and do not have to ask solver developers to do anything.