UM-Bridge / umbridge

UM-Bridge (the UQ and Model Bridge) provides a unified interface for numerical models that is accessible from virtually any programming language or framework.
https://um-bridge-benchmarks.readthedocs.io/en/docs/
MIT License
32 stars 14 forks source link

Refactor waiting for url files to use C++ instead of bash #42

Closed linusseelinger closed 10 months ago

linusseelinger commented 10 months ago

Now that we use C++17 standard, go wtih std::filesystem::exists("helloworld.txt"); in waitForFile instead of a bash loop (which may be more system dependent than C++ standard library).

Make sure the timeout actually works then, currently the loop is just infinite due to the bash call never completing if the file doesn't show up.

Fix how the amount of time passed is computed: steady_clock::now does not necessarily return seconds. See for example the second answer in https://stackoverflow.com/questions/728068/how-to-calculate-a-time-difference-in-c for computing a duration in modern c++