i-RIC / iriclib

1 stars 3 forks source link

Add function to lock CGNS file #18

Closed kskinoue0612 closed 6 years ago

kskinoue0612 commented 6 years ago

CGNS file (i. e. HDF5) should not be opened from other processes while a process is opening and writing something into the CGNS file.

To avoid such a situation, iriclib now has function iRIC_Check_Lock, iRIC_Write_Sol_Start() and iRIC_Write_Sol_End(), but the implementation of these functions are not very good.

Currently, the implementation is as follows:

But, these functions do not REALLY lock the files, so locking with these functions fails often, when calculation result saving process is repeated quickly.

To solve the issue, we should add REAL locking of the lock files "Case1.cgn.lock", using: