aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
436 stars 190 forks source link

Setting parameters dynamically when script is executed #643

Closed RKBK closed 7 years ago

RKBK commented 7 years ago

Hi,

I'm using the ase plugin for ase-espresso (https://github.com/lmmentel/ase-espresso), and I want to set the argument "txt" as follows

'txt': os.environ['PWD'] + '/aiida.out'

In other words, os.environ['PWD'] needs to be executed when the script is run on the cluster. I do not know the folder name before it is submitted.

How can I achieve this?

(I need to do this because ase-espresso dumps the logfile in a subfolder by default, and I want to redirect that logfile to aiida.out in the submission directory so that aiida can find it and allow me to look at it by doing verdi calculation outputcat ID)

sphuber commented 7 years ago

The working directory will depend on the submission script for the scheduler. For the aiida-quantumespresso plugin, this script will tell the executable to run it from its current working directory. As a result, in the input file, we can simply specify ./aiida.out to have the output written to a file in the top level of the submission directory. I think you should be able to do the same.

ltalirz commented 7 years ago

Closing this issue, please let us know if the solution by @sphuber does not solve the problem.