Hi everyone
I have an external .aiida archive containing a bunch of calculations done - by other people - with a workchain I wrote, which I then found to have a bug. Since such bug manifested itself only seldomly in the practice, a large part of these calculations gave valid results and only a small fraction must be repeated. My idea was then to import the archive and relaunch everything with the debugged workchain; having enabled caching on my profile, I was expecting that
i) once imported into my database, previously external nodes are treated as if I myself produced them
ii) all calculations not affected by the bug, being provided the same input, are thus fetched from the cache instead of being actually run
To test this behaviour, I created on purpose an .aiida archive with only one call of the workchain (the last I had submitted myself), removing the corresponding node from the process list, and imported it back (node 47304 below). Since I hadnāt changed the workchain in the meantime, I then tried to resubmit it (47370) expecting the caching mechanism to take care of it. Yet, the calculation called by the workchain was run from scratch. At this point, I tried to run it once again (47393) and this time the calculation was correctly picked up from the cache.
47304 2D ago AmarantaWorkChain Finished [11]
47309 2D ago run_ase_calculation Finished [0]
47370 33m ago AmarantaWorkChain Finished [11]
47372 33m ago run_ase_calculation Finished [0]
47393 4s ago AmarantaWorkChain Finished [11]
47395 3s ago run_ase_calculation Finished [0]
I then checked the hash and is_valid_cache attributes for the three calculation nodes:
In [1]: m,n,o = load_node(47309), load_node(47372), load_node(47395)
In [2]: m.base.caching.get_hash()
Out[2]: ā18ee3e98b06fa157428b9595ce8ab53ac5f03b2f6cfa4f1bbfee1c77c7b0c693ā
In [3]: n.base.caching.get_hash()
Out[3]: ā18ee3e98b06fa157428b9595ce8ab53ac5f03b2f6cfa4f1bbfee1c77c7b0c693ā
In [4]: o.base.caching.get_hash()
Out[4]: ā18ee3e98b06fa157428b9595ce8ab53ac5f03b2f6cfa4f1bbfee1c77c7b0c693ā
In [5]: m.base.caching.is_valid_cache
Out[5]: True
In [6]: n.base.caching.is_valid_cache
Out[6]: True
In [7]: o.base.caching.is_valid_cache
Out[7]: True
To my surprise, each of them ā and the imported one 47309, specifically ā is valid cache indeed and the hashes are the same, yet the imported nodes are not correctly picked up. Do you have any idea of why?
(In passing: the workchain - still bugged - is running in āsafe modeā, just executing the first calculation, and this is why its status is Finished [11] (most required output is not produced). Still, the caching mechanism holds for calculations only and here the calculations finished correctly [0] so Iām assuming this is not an issue)
Thanks a lot for your help
Best regards
Federico Orlando
P.S. at present, the workchain (still bugged) is running in āsafe modeā, just executing the first calculation, and that is why the status is Finished [11] (most required output is not produced). Stil, the caching mechanism holds for calculations only and here the calculation finished correctly [0]