Skip to content

Fix task creation#354

Open
ladinesa wants to merge 1 commit intodevelopfrom
fix-workflow
Open

Fix task creation#354
ladinesa wants to merge 1 commit intodevelopfrom
fix-workflow

Conversation

@ladinesa
Copy link
Copy Markdown
Collaborator

@ladinesa ladinesa commented Mar 18, 2026

Purpose

Fix reported issue with recursive sections in workflow tasks.

Scope

Included

Out of scope

Context & Links

"outputs": [
      {
        "name": "MD results",
        "section": "#/workflow2/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Geometry optimization results",
        "section": "#/workflow2/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/tasks/0/results"
      },
      {
        "name": "Outputs",
        "section": "#/data/outputs/10"

Reviewer Notes

Anything reviewers should pay special attention to? Trade-offs, known limitations, or areas of uncertainty.

Status

  • Draft / In progress
  • Ready for review
  • Blocked (explain):

Breaking Changes

  • None
  • (explain):

Dependencies / Blockers

  • None
  • Open design questions (explain):
  • External dependencies (explain):

Testing / Validation

How was this change validated?

  • None (explain):
  • Unit tests
  • Integration tests
  • Manual testing (explain):
    Run gromacs tests data.

Copy link
Copy Markdown
Collaborator

@Bernadette-Mohr Bernadette-Mohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the fix, and went through all the auxillary parsers and the gromacs parser (which is using the mapping parser).

Unfortunately, the situation has not changed at all.

Here is the archive I have generated: https://drive.google.com/file/d/1cZsXPK7SvIF0YxT61GU7x-ndcclk987N/view?usp=sharing
with the gromacs parser at it's current state: FAIRmat-NFDI/nomad-parser-plugins-simulation#156
The test data is still tests/data/gromacs/water/reference_s.log.

I HAVE AN IDEA: it might be an artefact from the Gromacs schema. I will look into it.

@Bernadette-Mohr
Copy link
Copy Markdown
Collaborator

Bernadette-Mohr commented Mar 23, 2026

I HAVE AN IDEA: it might be an artefact from the Gromacs schema. I will look into it.

Let me describe what I am seeing:

  • My test data is of a production run (integrator md), so the workflow should be recognized as MolecularDynamics, I should not be seeing GeometryOptimization in the archive at all.
  • workflow2 is correctly MolecularDynamics, but tasks/0 inside it is GeometryOptimization. This means map_tasks is adding a GeometryOptimization instance as a task to MolecularDynamics.
  • In the Gromacs schema (https://github.com/FAIRmat-NFDI/nomad-parser-plugins-simulation/tree/gromacs-parser_results), these two annotations have LOG_KEY annotation '@':
397 add_mapping_annotation(geometry_optimization.GeometryOptimization.m_def, LOG_KEY, '@')
399 add_mapping_annotation(molecular_dynamics.MolecularDynamics.m_def, LOG_KEY, '@')
  • When processing MolecularDynamics, the third lookup level in build_section_mapper finds GeometryOptimization as a valid Task dependency with LOG_KEY and adds it to tasks. Same recursion also happens inside only MolecularDynamics or GeometryOptimization — they find themselves as a Task dependency and nest again.

My current fix follows the pattern established in the FHI-aims parser (comment in fhiaims.py, l. 198). Annotating SimulationWorkflow.tasks with a Level 1 annotation (.tasks path) for both LOG_KEY and EDR_KEY prevents Level 3 from running for the tasks SubSection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants