aiidateam / aiida-firecrest

AiiDA Transport/Scheduler plugins for interfacing with FirecREST (https://products.cscs.ch/firecrest/)
MIT License
2 stars 3 forks source link

Parent `remote_folder` is not copied in (post scf) nscf `PwCalculation` #37

Closed mikibonacci closed 2 months ago

mikibonacci commented 3 months ago

I had an issue in running some aiida-quantumespresso scf+nscf steps. This is related to the copy of the parent remote_folder from scf (PwCalculation done successfully) remote folder to the nscf (PwCalculation just submitted). Basically it seems that the /out cannot be copied to the new folder.

*** 5 LOG MESSAGES:
+-> WARNING at 2024-07-02 12:29:12.776303+00:00
 | [submission of calculation 46277] Unable to copy remote resource from /scratch/snx3000/mbonacci/aiida_lab_prod_run_firecrest/e3/ee/27b3-f1e1-4cf1-92f0-1ea27b64e355/./out/* to ./out/! NOT Stopping but just ignoring!.

+ 4 logs related to QE parser failures (expected since no remote_folder is copied and nscf fails)

To reproduce the problem is sufficient to set a builder for an nscf PwCalculation, putting also a remote_folder as builder.parent_folder (remote_folder being output of the scf PwCalculation), ans submit it.

Pinning @khsrali

khsrali commented 3 months ago

thanks a lot @mikibonacci to make it easier to reproduce can you copy your script here? --suppose I have the pk of a successful PwCalculation--

mikibonacci commented 3 months ago

Suppose you have the already done PwCalculation (scf). We use PwBaseWorkChain to be faster in generating the builder (we use the get_builder_from_protocol), and also we don't put nscf in the calculation, we just run another scf (so we avoid to modify the parameters dictionary - does not matter for this test):

from aiida.engine import run, submit
from aiida import orm
from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain

scf = orm.load_node(pk) # we load the scf PwCalculation

# now we generate the builder for the new run 
builder = PwBaseWorkChain.get_builder_from_protocol(
                code = scf.inputs.code,
                structure = scf.inputs.structure,
                protocol='fast',
)

# crucial: here we set the parent folder
builder.pw.parent_folder = scf.outputs.remote_folder

# metadata, if needed
builder.pw.metadata = scf.inputs.metadata

run = submit(builder)
print(f'Running another scf PwBaseWorkChain at {run.pk}')
khsrali commented 2 months ago

Thanks a lot @mikibonacci for reporting this, As we understood together, the problem was aiida-quantumespresso is making remote_copy_list with glob patterns, I added an update on aiida-firecrest right now on my fork, which can support this: https://github.com/aiidateam/aiida-firecrest/commit/f7519a4478a70f786b63d164afc177202d7ff265

Just tested now, and the problem is resolved.

mikibonacci commented 2 months ago

Thanks a lot @khsrali ! I will test also myself as soon as I can, but if for you is good, great!