Python bindings to libyogrt, a library to efficiently query resource managers for the time remaining in a job. This is useful for managing activities like checkpoint/restart, which you may want to do before a job allocation completes.
You must install libyogrt yourself. (If you are on an LLNL system, it is probably already installed.) Then:
# (clone PyYogrt)
cd pyyogrt
pip install .
(In the future, PyYogrt will be available in PyPI.)
PyYogrt attempts to find libyogrt automatically using standard search paths and compiler information. If this fails, you can try setting the following environment variables:
YOGRT_INCLUDE_PATH
: Path to the directory containingyogrt.h
.YOGRT_LIBRARY_PATH
: Path to the directory containinglibyogrt.so
.
import yogrt
# Get remaining time in seconds:
remaining = yogrt.get_remaining()
See help(yogrt)
or the libyogrt documentation for other methods, but get_remaining()
is all you need most of the time.