I am running CP2K on Eiger, and CSCS provides the latest versions of CP2K via User Environments (UENV).
The process requires users to pull the image for a specific code (such as CP2K) and start the environment. However, the executable path only becomes available after the environment is activated. This causes an issue when testing the code in AiiDA:
$ verdi code test 13939
Critical: validation failed: The provided remote absolute path `/user-environment/env/cp2k/bin/cp2k.psmp` does not exist on the computer.
Despite the error during the test, the CP2K calculations run successfully.
To help others, here’s the YAML file I use to set up the CP2K code with uenv:
Hi Xing, this can be a problem. If you load the env manually in eiger and then copy to a dir cp2k.psmp, and afterwards defien the aiida code keeping the loading of the env in the code definition but putting filepath_executable: /mydir/cp2k.psmp would work?
Hi @cpignedoli, thanks for the suggestion! I tried, and it works.
Since this issue only impacts the verdi code test command, we need to improve the error message for clarity:
Critical: validation failed: The provided remote absolute path `/user-environment/env/cp2k/bin/cp2k.psmp` does not exist on the computer.
This may be because the environment is not activated. The code may still work when executed.
Would it be safe enough to also run all the prepend text before trying the code? Or there are cases in which this is a bad idea? If we think it’s risky because people might put in there things with a side effect (creating folders etc.), maybe we can have it as an option --with-prepend, and the error message can say “This may be because the environment is not activated; you can try to run verdi code test with the --with-prepend option to also run the prepend commands” (or something like this). If it’s safe, then can you check if running the prepend would solve the issue?
Think it may be a good idea to improve the error message, but we have to be careful about the wording. The “loading of an environment” can be a bit specific here. There are a multitude of ways that the path can be updated to include more binaries. For example, another common case is the loading of modules that make executables available.