• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aiidateam / aiida_core / 6648
74%
develop: 74%

Build:
Build:
LAST BUILD BRANCH: fix_3032_doc_working_importexport
DEFAULT BRANCH: develop
Ran 04 Jul 2019 12:55PM UTC
Jobs 4
Files 403
Run time 6min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6648

Pull #3121

travis-ci

web-flow
Short circuit execution of calculation functions when caching

The caching of `CalcFunctionNodes` was working properly, however, the
process would still be executed afterwards. Somewhat surprisingly this
did not seem to cause obvious side effects or exceptions elsewhere. The
symptom that brought this to light is the fact that the result node that
was returned was unstored, despite the actual outputs being stored and
recorded properly. The origin of the problem is that the caching takes
place in the `Node.store` method, which is called indirectly by the
`Process.on_entered` when the process is created. However, in the case
that the node is created from a cached node, the `Process` is not
informed and merrily continues on its way calling `run`.

This problem was already addressed in the `CalcJob` class, where in the
`run` method the node was checked whether it already had an exit status
attribute. This would mean the node was cached from an already finished
calculation and so the method returns immediately. Note that this works,
because for a `ProcessNode` to be even considered a valid cache node, it
has to be `finished_ok` meaning it always has an `exit_status` attribute.
See the `ProcessNode.is_valid_cache` property.

To fix the problem for calculation functions, we simply add the same
check. Note that we cannot easily abstract this to the parent `Process`
class and have the sub classes call the super first, because they will
then have to check the result of the super call and return the value if
it is not `None`, which is not necessarily a cleaner solution then the
code duplication solution chosen here.

Another thing to keep in mind is that this is now only done for the
`FunctionProcess` and `CalcJob` process classes so the check is not
applied for the `WorkChain`. However, for now this is not problematic
since `WorkChainNodes` are not cachable anyway.
Pull Request #3121: Short circuit execution of calculation functions when caching

2 of 2 new or added lines in 1 file covered. (100.0%)

23945 of 32211 relevant lines covered (74.34%)

2.75 hits per line

Jobs
ID Job ID Ran Files Coverage
5 6648.5 (TEST_AIIDA_BACKEND=django TEST_TYPE="tests") 04 Jul 2019 12:55PM UTC 0
68.07
Travis Job 6648.5
6 6648.6 (TEST_AIIDA_BACKEND=django TEST_TYPE="tests") 04 Jul 2019 01:00PM UTC 0
68.02
Travis Job 6648.6
7 6648.7 (TEST_AIIDA_BACKEND=sqlalchemy TEST_TYPE="tests") 04 Jul 2019 12:59PM UTC 0
69.64
Travis Job 6648.7
8 6648.8 (TEST_AIIDA_BACKEND=sqlalchemy TEST_TYPE="tests") 04 Jul 2019 01:00PM UTC 0
69.6
Travis Job 6648.8
Source Files on build 6648
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6648
  • Pull Request #3121
  • PR Base - develop (#6647)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc