Closed markusdregi closed 3 years ago
There are 2 reasons why the function step does not work on the PBS cluster.
function_steps
module where the user-defined functions should be added is not available on the execution nodes. The reason for this is that it seems it is not straight forward to pickle a function that is not defined in the __main__
module, together with its dependencies (ref: https://stackoverflow.com/questions/26389981/serialize-a-python-function-with-dependencies). Found one way to avoid this issue using the dill package to load the function source code and execute it in the main module (working example https://github.com/DanSava/ert/commit/8a0998c3912afb29623662eaa170393e129075a3). This approach requires a discussion, there might be better ways to use cloudpickel to avoid the use of dill
to get the function source, but I could not find them. I tested the example locally by starting a dask-scheduler and 2 workers to be used by prefect. Reading through https://docs.prefect.io/core/advanced_tutorials/task-guide.html, it seems that they mention anything about the above problems in the documentation. They mention that inputs and outputs need to be cloudpicklable here, but I cant find any limitations on functions (except the warning about the signature). Did you say that you were looking into what prefect actually does @DanSava, because I think that could be interesting to know? 🤔
Or actually the combination of tasks and cloudpickle is mentioned here. Might be that our use of attributes to transport the function is the problem here?
Re-run the function_evaluation
case on the PBS cluster after the fix https://github.com/equinor/ert/pull/1546 and also the record transmitting PR was merged and now it completes successfully.
Closing the issue.
Describe the bug Function step does not run on Azure cluster.
ModuleNotFoundError("No module named 'function_steps'")
To Reproduce Steps to reproduce the behavior:
ssh <azure-machine>
git clone https://github.com/equinor/ert.git
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
cd ert
pip install .
cd examples/polynomial
ert3 init
Change local to pbs in experiments/function_evaluation/ensemble.yml
ert3 run function_evaluation
Expected behaviour Running successfully
Enviromment
master