First SCRIMP project with VS Code (v1.3.1) ========================================== .. important:: The **public Linux/AMD64 image** ``ghcr.io/g-haine/scrimp:1.3.0`` and stable Git tag ``v1.3.0`` are published. The image passed independent Ubuntu 24.04/AMD64 acceptance for the standalone project, MPI startup and native Heat--Wave Hamiltonian parity. Windows/macOS, ARM64 and graphical multi-process MPI debugging remain unqualified. .. important:: **v1.3.1 nonlinear partial mass:** explicit ``dt_variables=("p",)`` avoids the spurious ``p * d_t(h)`` contribution when the model requires ``h * d_t(p)``. Existing user models must opt in; see :doc:`nonlinear_mass`. What is on the user's computer? ------------------------------- **Docker with a precompiled image is the default v1.3.1 installation path.** The native Conda route remains available for existing users and advanced development. The user project ZIP is a separate `GitHub v1.3.1 Release asset `_. After installation the user has **three separate components**: 1. Local VS Code (Python and, for Docker, Dev Containers extensions). 2. The SCRIMP numerical environment (a Docker image containing SCRIMP, PETSc, SLEPc, GetFEM, Gmsh and Python; or a native Conda environment). 3. An **independent local project** holding their simulations, geometry inputs and persistent output files. The project is independent from SCRIMP's source repository. It works with both a precompiled and locally built Docker image; the same directory also works with a native Conda installation. The supplied project template creates this structure: .. code-block:: text MySCRIMPProject/ .devcontainer/devcontainer.json .vscode/launch.json .vscode/tasks.json .vscode/settings.json simulations/first_simulation.py simulations/mpi_check.py geometries/ outputs/ The first example is a genuine serial port-Hamiltonian mass-spring-damper simulation and saves outputs/oscillator.csv. The second script checks MPI startup, **not physical MPI parity**. Creating the independent workspace ---------------------------------- Download ``scrimp-project-template-v1.3.1.zip`` from the `v1.3.1 GitHub Release `_ and extract it as your own project. The official archive already selects ``ghcr.io/g-haine/scrimp:1.3.0`` in the Dev Container configuration. Maintainers can rebuild the user ZIP with: .. code-block:: bash python3 scripts/package-scrimp-project-template.py \ --image ghcr.io/g-haine/scrimp:1.3.0 This produces an archive only; it does not publish an image. For source customization (not required with the release ZIP): .. code-block:: bash BOOTSTRAP="$(mktemp -d -t scrimp-starter.XXXXXXXX)" git clone --depth 1 --branch v1.3.0 \ https://github.com/g-haine/scrimp.git "$BOOTSTRAP/source" python3 "$BOOTSTRAP/source/scripts/create-scrimp-project.py" \ "$HOME/MySCRIMPProject" \ --image ghcr.io/g-haine/scrimp:1.3.0 The BOOTSTRAP directory is a separate **newly created** temporary source checkout. The user's new project is in MySCRIMPProject and can be retained indefinitely. The temporary source checkout can be removed after successful project creation; never remove an existing user directory to make room for it. The generator refuses to overwrite any pre-existing directory and never copies the source repository's sandbox, output data or Git history. To package the user project from source: .. code-block:: bash python3 scripts/package-scrimp-project-template.py \ --image ghcr.io/g-haine/scrimp:1.3.0 A. Precompiled Docker installation (recommended) ------------------------------------------------ Pull the qualified, public Linux/AMD64 image: .. code-block:: bash docker pull ghcr.io/g-haine/scrimp:1.3.0 No compilation or SCRIMP source checkout is required. The image is stored in Docker's image store, *not* in the user's simulations folder. The official release ZIP selects the stable image by default. For a project generated from a historical source-tree template, explicitly use ``--image ghcr.io/g-haine/scrimp:1.3.0``. B. Locally compiled Docker installation --------------------------------------- A developer can rebuild the same candidate from a specific GitHub revision. The official build driver fetches that revision into a temporary checkout and stages only tracked, allowlisted source files into an isolated Docker context: .. code-block:: bash # In a temporary checkout of SCRIMP: bash scripts/build-v130-docker-candidate.sh bash scripts/smoke-v130-docker-candidate.sh **Dev Containers image selection (Linux validation finding):** Use an **explicit complete image reference** in ``.devcontainer/devcontainer.json``, including its tag: .. code-block:: json "image": "scrimp-mpi:v1.3.0-rc1" In the first VS Code GUI attempt, the template's expression `${localEnv:SCRIMP_DOCKER_IMAGE:scrimp-mpi:v1.3.0-rc1}` was incorrectly resolved to just `scrimp-mpi`. VS Code then attempted to fetch `scrimp-mpi:latest` from Docker Hub and failed. This was **not** a Docker permissions or SCRIMP runtime failure. The starter now uses the literal candidate tag. For a different built image, edit the ``image`` property or generate the project with ``--image IMAGE:TAG``. Projects created before the fix must update their **own copy** of devcontainer.json; pulling the SCRIMP Git repository does not modify existing independent projects. The initial ``scrimp-mpi:v1.3.0-rc1`` image **passed its first native Docker build and 1/2-rank CLI smoke on 19 November 2026**, including a scaffolded project and an actual serial oscillator simulation. That is *historical* qualification. The final ``dist-rc4`` image passed fresh-host GetFEM/PETSc/MUMPS and MPI acceptance; it was promoted **unchanged** to public ``ghcr.io/g-haine/scrimp:1.3.0``. Historic source templates may still reference a local ``rc1`` candidate; select the stable tag. The Docker build **does not access any local simulations**, even from a developer checkout. Explicit library development with uncommitted changes uses SCRIMP_DOCKER_SOURCE=local (still using physical source staging). A user only modifying simulations never rebuilds the image. VS Code workflow for either Docker installation ------------------------------------------------ 1. Install Docker and VS Code with Python and Dev Containers extensions. On Windows use Docker Desktop with WSL2; on macOS use Docker Desktop. Both paths are **best effort for existing users** and are not independent native Windows/macOS acceptance tests for v1.3.0. See :doc:`install` for executable shell commands, WSL2 volume guidance and the Apple Silicon image-architecture/emulation caveat. 2. Open **MySCRIMPProject** in VS Code (not SCRIMP's source checkout). 3. Choose **Dev Containers: Reopen in Container**. 4. Check the selected interpreter is /opt/conda/envs/scrimp/bin/python. 5. Run the following in the VS Code integrated terminal: .. code-block:: bash python simulations/first_simulation.py mpiexec -n 2 python simulations/mpi_check.py Python is installed, even if VS Code says "No Python found" ----------------------------------------------------------- .. important:: **Do not click "Install uv and Python"** when opening a SCRIMP Dev Container. The image **already contains Python**, installed in the named Micromamba environment ``scrimp`` along with SCRIMP, GetFEM, PETSc and SLEPc. Installing another Python with ``uv`` would create an unrelated interpreter and might leave VS Code running code outside the qualified numerical environment. During the first Linux Dev Containers GUI test (19 November 2026), VS Code displayed:: No Python found. Would you like to install uv and use it to install Python? This message comes from **VS Code's Python environment discovery / installation UI**, not from SCRIMP or the Python runtime. The subsequent integrated terminal showed ``(scrimp)``, and both ``python simulations/first_simulation.py`` and ``mpiexec -n 2 python simulations/mpi_check.py`` **passed**. Therefore that specific prompt was a **false negative for the already installed container interpreter**. **When this prompt appears:** 1. Select **Don't ask again** (or **Cancel** to dismiss without installing anything). Do not select **Install uv and Python**. 2. Wait until the Dev Container has fully opened and the Python extension has completed initialization. 3. Open a Python file, press **Ctrl+Shift+P**, select **Python: Select Interpreter**, then choose **Enter interpreter path** and enter ``/opt/conda/envs/scrimp/bin/python`` if that interpreter is not already selected. Depending on VS Code's extension version, the command/labels may differ slightly. 4. Confirm the environment in the **Dev Container's integrated terminal**, not in a host terminal: .. code-block:: bash python -c "import sys, scrimp; print(sys.executable); print('SCRIMP OK')" python simulations/first_simulation.py Expected first line of the interpreter check:: /opt/conda/envs/scrimp/bin/python 5. If the terminal test passes but **F5** still cannot find Python, check that the Microsoft **Python** and **Python Debugger** extensions are installed **in Dev Container: SCRIMP**, not only in the local VS Code window. Restart the Python extension / reload the VS Code window, and explicitly select the interpreter above. This is an editor integration problem, not an indication that the numerical image needs rebuilding. The starter's ``.devcontainer/devcontainer.json`` already declares ``python.defaultInterpreterPath`` as the Conda interpreter **inside the container**. VS Code's environment-discovery UI may still present a generic first-run message before selection completes. The native Conda installation path uses the **actual local** interpreter instead; do not force the container path into ``.vscode/settings.json`` shared by both modes. Python environment recognition and editable SCRIMP imports ---------------------------------------------------------- The Ubuntu Dev Containers tests revealed two **distinct** editor integration problems, even though SCRIMP executed and debugged: - Pylance initially reported ``Import "scrimp" could not be resolved``. The image uses ``pip install -e .``, with the editable sources located in ``/workspace/scrimp/scrimp/``. Adding ``python.analysis.extraPaths=/workspace/scrimp`` resolved the warning **in the actual VS Code GUI**. This does not suppress diagnostics for genuinely missing packages. - The separate `Python Environments` extension repeatedly proposed installing Python and later declared the selected interpreter invalid. **After clearing and reselecting the interpreter, the error persisted.** The Python extension logged both ``Active interpreter [/work]: /opt/conda/envs/scrimp/bin/python`` and ``No Python environment is set for this resource``. The executable is correct and already installed, but the environment manager fails to associate it with the workspace. SCRIMP uses Micromamba rather than a standard Conda executable. **Confirmed correction on Ubuntu (20 Nov 2026):** opt out of the new Python Environments integration **in this Dev Container only**, while retaining Microsoft's Python extension, Pylance and debugpy. When the user added the missing ``"python.useEnvironmentsExtension": false`` setting to their *existing local project* they reported that the interpreter warning disappeared. Pylance's missing-import warning had already been eliminated independently by ``extraPaths``. The Python extension documents its supported legacy setting ``python.useEnvironmentsExtension=false``. Similar invalid interpreter reports have been filed against Python Environments. The project template's ``.devcontainer/devcontainer.json`` now uses these ``customizations.vscode.settings``: .. code-block:: json { "python.defaultInterpreterPath": "/opt/conda/envs/scrimp/bin/python", "python.useEnvironmentsExtension": false, "python.interpreter.infoVisibility": "always", "python.analysis.extraPaths": ["/workspace/scrimp"], "python.terminal.activateEnvironment": false } There is **no need for** ``python-envs.globalSearchPaths`` when the new manager is disabled. The legacy Python extension should instead use the explicitly selected interpreter. Python itself and the SCRIMP image are unchanged; this setting does not uninstall any extension. **Update an existing project** (Git pull does not update its independent files): 1. Open ``/.devcontainer/devcontainer.json``. 2. Under ``customizations.vscode.settings``, add ``"python.useEnvironmentsExtension": false`` and remove ``"python-envs.globalSearchPaths"``. Keep the absolute ``python.defaultInterpreterPath``, ``python.analysis.extraPaths`` and the complete Docker image tag intact. 3. Select ``Developer: Reload Window`` in VS Code. If Dev Containers does not apply the remote settings, select ``Dev Containers: Rebuild and Reopen in Container``. This reuses the local image; it does **not** recompile any numerical dependencies or copy the user's simulations. 4. Open a Python file and check whether the invalid-interpreter notification is gone. If necessary, use ``Python: Clear Workspace Interpreter Setting``, then select ``/opt/conda/envs/scrimp/bin/python`` with ``Python: Select Interpreter``. The already validated F5 debugger and ``import scrimp`` should remain functional. **Observed Ubuntu Dev Containers acceptance: PASS.** After the setting was added to the user's existing project, VS Code stopped reporting the invalid interpreter. The serial simulation, 2-rank MPI startup and F5/debugpy run had already passed. The template contains the same settings for future projects. This is not yet a clean-room test on a new machine or a cross-platform compatibility claim. If a future extension update reintroduces the prompt, inspect the Python extension logs; do not install ``uv``, suppress real Pylance errors or modify the numerical image to work around an editor-only problem. All container-only absolute paths remain in Dev Container metadata, **not** the shared ``.vscode/settings.json``: native Conda installations select their own local interpreters. The host project is bind-mounted at /work. The first command writes MySCRIMPProject/outputs/oscillator.csv **on the host**. Closing VS Code or removing the container does not delete that file. The included VS Code Run and Debug configurations support **F5** for a serial simulation or the active Python file; MPI multiprocess debugging requires a separate setup. VS Code Tasks also provide the first simulation and a two-rank MPI smoke. **Verified on Ubuntu Dev Containers (20 November 2026):** the user opened `simulations/first_simulation.py`, started the `SCRIMP: first simulation` F5 configuration, and successfully stepped with **F10** from the DPHS initialization to the `p = S.State("p", "Momentum", "lumped")` instruction. The debugger's **Locals** pane showed the live `system` (DPHS) and `q` (State), and **Call Stack** contained `main()`. The terminal showed execution via `/opt/conda/envs/scrimp/bin/python` and the Python `debugpy` launcher. For a first debugging session: 1. Open `simulations/first_simulation.py` in VS Code. 2. Click in the gutter beside `system = S.DPHS("real")` to add a **red breakpoint**. 3. Press **F5** and select **SCRIMP: first simulation**. 4. When paused (yellow current-line arrow), press **F10** to step over one Python statement and expand `system` or `q` in the **Locals** pane to inspect their attributes. 5. Press **F5** to resume execution, or **Shift+F5** to stop the debugger. On **20 November 2026**, the user confirmed that execution resumed and the simulation finished normally after stepping and inspecting the state. This is a **serial Python debugging** validation. Debugging simultaneous MPI worker ranks, and breakpoints inside compiled GetFEM/PETSc/MUMPS C/C++/Fortran code, are different workflows and are **not** qualified by this Python test. Modern SCRIMP examples create **one** output tree per working directory: ``outputs//{png,svg,gif,mesh,log,npz,json}``. Importing SCRIMP does **not** pre-create generic ``outputs/log``, ``outputs/mesh``, ``outputs/png`` or ``outputs/pv`` siblings. Historical unscoped ``Domain`` and explicitly configured legacy output callers retain their old paths; existing archived user files are not deleted. Linux Dev Containers attempts to map the mambauser UID/GID to that of the host user. Test host output-directory permissions before large runs; Windows and macOS use different Docker Desktop volume semantics. CPU/NUMA selection should be recorded for performance benchmarks. Do not use MPI --oversubscribe as evidence of strong scaling: it is appropriate only for small functional tests when the host has too few CPUs. Using an existing local sandbox directory ----------------------------------------- Developers may already have many personal simulations under their SCRIMP source checkout's sandbox/. **They do not need to move or copy those files.** The Linux command-line runner binds the existing sandbox directory at /work at runtime: .. code-block:: bash cd ~/Simulations/scrimp SCRIMP_SIM_DIR="$PWD/sandbox" \ bash scripts/run-v130-docker-simulation.sh wave_1D.py This command is **not an image build**. The Python script is read from the local sandbox; its results stay under sandbox/outputs/. Change the script name to run another local simulation, or set SCRIMP_MPI_RANKS=2 for a script that is actually MPI-compatible. The runner is currently a Linux/macOS shell development convenience, **not** the final cross-platform user installer. It still requires a successfully built/pulled SCRIMP Docker image. C. Native Conda / source installation (without Docker) ------------------------------------------------------ Use the native build instructions in :doc:`install` for the intended platform. Then activate the installed Conda environment: .. code-block:: bash conda activate scrimp55 # for the native modern-stack example in install.rst cd ~/MySCRIMPProject python simulations/first_simulation.py mpiexec -n 2 python simulations/mpi_check.py Open this **same project** in VS Code, select **Python: Select Interpreter** and choose the Conda interpreter. Do not select Reopen in Container. Native installation is distinct from compiling a Docker image locally, which still targets a Linux container. Known limitations ----------------- - The candidate image **passed its Linux native build** and the 1/2-rank CLI smoke. A **real VS Code Dev Container session** on Ubuntu subsequently ran the 10-step oscillator, wrote the CSV to the host, and started SCRIMP on two MPI ranks. **Serial Python debugging has also passed** with F5, a breakpoint, F10 stepping, Locals, Call Stack and normal completion on resume. The developer also confirmed that ``python.useEnvironmentsExtension=false`` fixes editor interpreter recognition, while Pylance resolves SCRIMP via ``python.analysis.extraPaths``. Native compatibility, Windows/macOS/Apple Silicon remain **best-effort** supported user environments, not mandatory release gates nor independently qualified native runtimes. MPI multi-process debugging and model-specific physical power balance require separate qualification. - The public GHCR v1.3.0 image is available and Ubuntu/AMD64 qualified. The starter ZIP is distributed as a separate GitHub Release asset. - The introductory oscillator is a serial model; use validated PDE scripts for MPI and Hamiltonian/power-balance qualification. - The old >45 GB Docker-context regression is addressed by staging only approved Git-tracked source files in a separate temporary directory. User-owned mounted workspaces are never part of the image build. See the installation guide for the numerical stack, the release plan for remaining scientific acceptance tests and the developer Docker build guide for cache and provenance details.