Skip to content

Bring the code_aster adapter up to the level of code_saturne #32

Description

@florian-simvia

Where code_aster stands today

CodeAsterAdapter implements the run lifecycle and nothing else. Measured on
main with the _provides introspection the capability work added:

Domain Method or declaration code_saturne code_aster
Status read_progress yes
Residuals find_residuals_files, parse_live_residuals yes
Probes list_probe_files, list_profile_files, locate_probe_files yes
Performance find_performance_log, parse_performance, performance_columns yes
Live control apply_control, control_actions yes
Restart build_restart_args, read_restart_origin yes
GUI gui_argv yes
Slurm build_slurm_script, mpi_env yes
Files locate_case_file, find_run_config yes
Doctor doctor_checks yes
Declarations anomaly_file_names 4 entries 2 (base default)
Declarations cleanup_log_names 6 entries 2 (base default)
Declarations template_input_names 2 entries empty

Derived capabilities, which is what the dashboard now shows:

  • code_saturne: compare, control, gui, performance, probes, residuals, restart
  • code_aster: compare

So a code_aster user gets four panels (Status, Compare, Log Tail, Recent
Errors) and three buttons (Run, Kill, Clean).

Parity is not "implement all eighteen"

Some of these are meaningless for code_aster and should stay unimplemented on
purpose. A linear static analysis has no residual curve to plot, and the
capability mechanism already handles that correctly: an unimplemented method
means the panel simply does not appear.

The first task of this issue is therefore a triage, not code. For each row
above, decide: meaningful for code_aster, meaningless, or meaningful but out of
scope for now. That triage needs someone who knows code_aster; the rest is
mechanical once it is settled.

Blocker: DIAGNOSTIC JOB is never found in the shipped example

Independent of parity, and worth fixing first because it makes the shipped
example misreport every run.

_ensure_mess_entry injects F mess RESU/LOGS/run_solver.log R 6 into the
.export only when the file declares no F mess line at all
(code_aster.py:76). The shipped examples/codeaster-cube/TEMPLATE/study.export
declares one on line 18:

F mess output.mess R 6

So the injection is skipped, code_aster writes its message file to
output.mess, and detect_outcome looks at
RESU/LOGS/run_solver.log (code_aster.py:168), which never exists. It returns
None for ever, and the case is finalised by the PID-death fallback as
FAILED — even after a perfect run.

The integration test does not catch it: tests/integration/test_code_aster_adapter.py
builds an .export with no F mess line, so it exercises the branch where
the injection happens. It is also gated behind CSAUTO_CODE_ASTER_DOCKER_TESTS=1
and never runs in CI.

Two candidate fixes, both needing a code_aster opinion: rewrite the existing
F mess line rather than leaving it, or have detect_outcome read the path the
.export actually declares instead of a hardcoded one. The second is cleaner
and also handles hand-written templates.

Three more design questions in the current adapter

Each needs a decision from someone who knows the solver:

  1. shared_dir_names = ("MESH", "RESU") while results_dirname = "RESU".
    The two meanings collide: shared dirs are template-level directories
    symlinked into the runs dir and bind-mounted read-write into every
    container, while results_dirname is per-case. As written, if a RESU
    directory sits beside the template, every case would write its results into
    the same shared directory. csauto prepare already warns
    source directory missing for copy RESU: RESU on the shipped example.

  2. run_argv returns [] and build_run_command is overridden wholesale,
    so code_aster bypasses the generic runtime wrapping in execution.py that
    code_saturne and the stub use. That may be unavoidable given run_aster's
    shape, but it means container mounts, labels and cleanup are reimplemented
    rather than shared, and the two implementations can drift.

  3. Shell quoting in build_run_command. The docker and singularity commands
    are assembled as a bash -c string mixing quoted fragments (bind_links,
    solver_cmd) and unquoted ones (container_case, the --label value). A
    runs directory containing a space breaks the command.

Suggested order

  1. The F mess blocker, plus an integration test that uses an .export with an
    existing F mess line, so the shipped example's shape is covered.
  2. The triage above, recorded in this issue as a checklist.
  3. anomaly_file_names and cleanup_log_names, which today miss
    RESU/LOGS/run_solver.log. Cheap, and they immediately improve the Recent
    Errors and Clean panels.
  4. read_progress, so the status table shows advancement instead of an empty
    column.
  5. Whatever the triage keeps, in descending user value. performance_columns
    and apply_control are likely the next two.
  6. The three design questions, each as its own PR.

Definition of done

  • Every capability code_aster can meaningfully feed is implemented, and every
    one it cannot is documented in this issue as a deliberate omission.
  • csauto doctor on a code_aster campaign reports the panels and capabilities
    that triage decided on.
  • examples/codeaster-cube runs to completion and is reported DONE, verified
    with the docker image rather than by reading the code.
  • The integration test covers the shipped example's .export shape and runs in
    CI, or the reason it cannot is written down.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions