Skip to content

StructuredQuadBox mesh cache filename omits the element resolution: concurrent runs at different resolutions collide #618

Description

@lmoresi

meshing/cartesian.py builds the cache path as

uw_filename = f"{mesh_file_dir()}/uw_structuredQuadBox_minC{minCoords}_maxC{maxCoords}.msh"

so elementRes is not part of the name. Every StructuredQuadBox on the same
box writes and reads one file, whatever its resolution:

.meshes/uw_structuredQuadBox_minC(0.0, 0.0)_maxC(1.0, 1.0).msh

The annulus does not have this problem — uw_annulus_ro1.0_ri0.5_csize0.05.msh
carries its cell size.

How it bites

Two processes on the same machine — a resolution sweep and a probe, say — race on
that one path. One writes a 16×16 mesh while the other is reading it for a 32×32
run. Nothing raises: you get a solve on the wrong mesh, or on a half-written file.

Observed as a marginal Nitsche free-slip solve on SolCx flipping between
converged and DIVERGED_LINE_SEARCH across otherwise identical runs, on two
different builds, for as long as concurrent res=16 probes were running against
the same box. It cost a round of re-measurement to notice, because a line-search
failure looks like a property of the method.

Suggested fix

Put the resolution in the name, as the annulus puts its cell size:

res = "x".join(str(int(n)) for n in elementRes)
uw_filename = f"{mesh_file_dir()}/uw_structuredQuadBox_minC{minCoords}_maxC{maxCoords}_res{res}.msh"

qdegree, simplex and any other geometry-changing argument deserve the same
treatment — the rule is that anything that changes the mesh belongs in the key.

Underworld development team with AI support from Claude Code

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