Fix dune-python raise condition
fixes #295 (closed) fixes ci-config#3 (closed)
In order to fix raise conditions in the internal dune-python builds, we have to fix parts of the locking and compilation process.
- If two python scripts try to use the same module and the module is not yet present, they both detect that they have to build the module. The
cmakesetup is protected by an exclusive lock, but when the second process finally acquires the lock, the module is already present and the build finishes immediately, leading to_io.BufferedReadererror. - For the actual compilation the module is protected by a shared lock. This ensures that there are no parallel explicit
cmakecalls (via 1.) whilemakeis running. In the case of parallel builds, we can now have the situation, that two processes try to build something and for what ever reason,cmakeimplicitly triggers an implicit reconfiguration. This fails with these strangeFindMPIerror.
This MR implements the following fixes:
-
after acquiring the the exclusive lock, we recheck presence of the module and potentially skip the setup phase. -
also the implicit cmakeruns must be protected by a lock. I propose to do the locking internally in the dune-python module, instead of externally incmakebuilde.py.
Edited by Christian Engwer