|
| 1 | +# Live simulation dashboard |
| 2 | + |
| 3 | +FastMDXplora has two dashboard views: |
| 4 | + |
| 5 | +- **Results Dashboard**: the static `report/dashboard.html` written after |
| 6 | + analysis/report. It shows completed plots, generated files, report links, |
| 7 | + slides, and project bundles. |
| 8 | +- **Live Simulation**: a local-only localhost view that watches lightweight |
| 9 | + telemetry files while a simulation is running. |
| 10 | + |
| 11 | +The live dashboard does not replace the static report dashboard. It adds a |
| 12 | +separate monitoring view for progress, health messages, recent events, and |
| 13 | +available energy/temperature samples. |
| 14 | + |
| 15 | +## Recommended: start it with the workflow |
| 16 | + |
| 17 | +For normal runs, add `--dashboard` to the command that creates or watches the |
| 18 | +output folder. FastMDXplora starts the localhost dashboard before setup or |
| 19 | +simulation begins, prints the URL, and automatically enables live telemetry |
| 20 | +when simulation runs: |
| 21 | + |
| 22 | +```bash |
| 23 | +fastmdx explore --system local_pdbs/1L2Y.pdb \ |
| 24 | + --output local_runs/trpcage_live_full \ |
| 25 | + --include setup simulation analysis report \ |
| 26 | + --simulate-preset gentle \ |
| 27 | + --dashboard |
| 28 | +``` |
| 29 | + |
| 30 | +If the `fastmdx` console script is not on PATH, use the module entrypoint. |
| 31 | +This is also the recommended form for Windows PowerShell: |
| 32 | + |
| 33 | +```powershell |
| 34 | +python -m fastmdxplora.cli.main explore ` |
| 35 | + --system local_pdbs\1L2Y.pdb ` |
| 36 | + --output local_runs\trpcage_live_full ` |
| 37 | + --include setup simulation analysis report ` |
| 38 | + --simulate-preset gentle ` |
| 39 | + --dashboard |
| 40 | +``` |
| 41 | + |
| 42 | +The CLI prints the selected URL before the workflow starts: |
| 43 | + |
| 44 | +```text |
| 45 | +Live dashboard running at: http://127.0.0.1:8765 |
| 46 | +Watching output folder: local_runs/trpcage_live_full |
| 47 | +Open this URL in your browser to monitor the run. |
| 48 | +Press Ctrl+C to stop the dashboard after the workflow completes. |
| 49 | +``` |
| 50 | + |
| 51 | +By default the server binds to `127.0.0.1:8765`, so it is local to your |
| 52 | +machine. If the requested port is busy, FastMDXplora chooses the next |
| 53 | +available port and prints the actual URL: |
| 54 | + |
| 55 | +```text |
| 56 | +Live dashboard running at: http://127.0.0.1:8766 |
| 57 | +Requested port 8765 was busy, so FastMDXplora used 8766. |
| 58 | +Watching output folder: local_runs/my_run |
| 59 | +``` |
| 60 | + |
| 61 | +Use `--dashboard-port` or `--dashboard-host` to customize the bind address: |
| 62 | + |
| 63 | +```bash |
| 64 | +fastmdx explore --system protein.pdb --output local_runs/my_run --dashboard --dashboard-port 8770 |
| 65 | +``` |
| 66 | + |
| 67 | +Binding to all interfaces can expose the dashboard on your network: |
| 68 | + |
| 69 | +```bash |
| 70 | +fastmdx explore --system protein.pdb --output local_runs/my_run --dashboard --dashboard-host 0.0.0.0 |
| 71 | +``` |
| 72 | + |
| 73 | +FastMDXplora prints a warning when `--dashboard-host 0.0.0.0` is used. Prefer |
| 74 | +`--dashboard-host 127.0.0.1` for local-only access. |
| 75 | + |
| 76 | +By default the dashboard stays open after the workflow completes so you can |
| 77 | +inspect final Analysis Plots and Generated Files. Press Ctrl+C to stop it. Use |
| 78 | +`--dashboard-stop-on-complete` when you want the command to exit immediately |
| 79 | +after the workflow finishes. |
| 80 | + |
| 81 | +## Manual fallback for existing runs |
| 82 | + |
| 83 | +You can still reopen an existing output directory without running a workflow: |
| 84 | + |
| 85 | +```bash |
| 86 | +fastmdx dashboard serve --output local_runs/my_run |
| 87 | +``` |
| 88 | + |
| 89 | +If the `fastmdx` console script is not on PATH: |
| 90 | + |
| 91 | +```bash |
| 92 | +python -m fastmdxplora.cli.main dashboard serve --output local_runs/my_run |
| 93 | +``` |
| 94 | + |
| 95 | +## Live telemetry |
| 96 | + |
| 97 | +`--dashboard` automatically implies `--simulate-live-telemetry` when simulation |
| 98 | +runs. Existing explicit telemetry flags still work for tuning: |
| 99 | + |
| 100 | +```bash |
| 101 | +fastmdx explore --system protein.pdb \ |
| 102 | + --output local_runs/my_run \ |
| 103 | + --include setup simulation \ |
| 104 | + --dashboard \ |
| 105 | + --simulate-telemetry-interval 1000 |
| 106 | +``` |
| 107 | + |
| 108 | +The simulation phase writes: |
| 109 | + |
| 110 | +- `simulation/live_status.json` |
| 111 | +- `simulation/live_metrics.csv` |
| 112 | +- `simulation/live_events.log` |
| 113 | + |
| 114 | +Telemetry writing is intentionally lightweight and safe. If these files cannot |
| 115 | +be written, the simulation continues and the live dashboard simply reports |
| 116 | +unavailable data. |
| 117 | + |
| 118 | +## What the Live Simulation tab shows |
| 119 | + |
| 120 | +The live view polls the local output directory every few seconds and displays: |
| 121 | + |
| 122 | +- current stage and status |
| 123 | +- current step and planned step count when known |
| 124 | +- frame count when known |
| 125 | +- elapsed wall time and simulation time |
| 126 | +- OpenMM platform |
| 127 | +- latest checkpoint path when available |
| 128 | +- energy/temperature trends when telemetry has those values |
| 129 | +- recent events from `live_events.log` |
| 130 | +- protein preview image when a topology/PDB is available |
| 131 | +- optional local interactive 3D preview when a topology/PDB is available |
| 132 | +- plain-language health explanations |
| 133 | + |
| 134 | +Metrics are not invented. If a value has not been written yet, the dashboard |
| 135 | +shows `not available`. |
| 136 | + |
| 137 | +## Protein preview |
| 138 | + |
| 139 | +The Live Simulation tab tries to show a protein image as soon as a usable |
| 140 | +structure file exists. It checks common run artifacts such as |
| 141 | +`simulation/topology.pdb`, `setup/topology.pdb`, `setup/solvated.pdb`, and |
| 142 | +the original system path recorded in `manifest.json`. |
| 143 | + |
| 144 | +If PyMOL is installed, FastMDXplora uses it for a cartoon/ribbon render and |
| 145 | +adds extra camera padding so the whole protein is visible in the dashboard |
| 146 | +frame. Install PyMOL from conda-forge: |
| 147 | + |
| 148 | +```bash |
| 149 | +conda install -c conda-forge pymol-open-source |
| 150 | +``` |
| 151 | + |
| 152 | +or with micromamba: |
| 153 | + |
| 154 | +```bash |
| 155 | +micromamba install -c conda-forge pymol-open-source |
| 156 | +``` |
| 157 | + |
| 158 | +Protein preview generation requires PyMOL so the static image is an actual |
| 159 | +cartoon/ribbon render rather than a schematic placeholder. Preview files are |
| 160 | +written to `report/dashboard_assets/protein_preview.png` when report assets |
| 161 | +exist, or to `simulation/protein_preview.png` during setup/simulation-only |
| 162 | +runs. |
| 163 | + |
| 164 | +The preview panel uses a local vendored 3Dmol.js bundle for **Interactive 3D** |
| 165 | +when a structure file exists. That tab shows a rotatable cartoon representation |
| 166 | +with spectrum coloring and does not require a CDN or internet access. Use |
| 167 | +**Spin** to call the real 3Dmol viewer spin control, **Reset view** to zoom back |
| 168 | +to the full protein, and mouse controls to rotate or zoom. |
| 169 | + |
| 170 | +The **PyMOL Preview** tab remains available whenever the PyMOL PNG exists. That |
| 171 | +tab shows the PyMOL-rendered cartoon/ribbon image. If the bundled 3Dmol viewer |
| 172 | +asset is unavailable, the dashboard can fall back to a schematic CA/backbone |
| 173 | +trace, but that fallback is labeled as a schematic fallback, not as PyMOL. If no |
| 174 | +usable structure file exists yet, the panel says that the preview is |
| 175 | +unavailable. The panel polls for updates and includes a **Regenerate preview** |
| 176 | +button. |
| 177 | + |
| 178 | +The Results Dashboard tab also refreshes while the server is open. If analysis |
| 179 | +or report artifacts are generated after the server starts, the Generated Files, |
| 180 | +Analysis Plots, Report Artifacts, and embedded dashboard view update without |
| 181 | +restarting the server. Use the **Refresh** button for an immediate rescan. |
| 182 | + |
| 183 | +## Health messages |
| 184 | + |
| 185 | +FastMDXplora classifies common live issues: |
| 186 | + |
| 187 | +- **Numerical instability**: NaN/Inf positions or energies. Try a smaller |
| 188 | + timestep, lower temperature, stronger friction, the gentle preset, or check |
| 189 | + the input structure for clashes. |
| 190 | +- **Energy spike**: energy changed sharply between samples. This can indicate |
| 191 | + bad contacts, an unstable timestep, or pressure/temperature coupling issues. |
| 192 | +- **Temperature drift/spike**: temperature is far from the target. Try gentler |
| 193 | + heating, stronger friction, or a smaller timestep. |
| 194 | +- **Stale telemetry**: no live update was seen recently. The simulation may be |
| 195 | + slow, paused, or crashed. |
| 196 | + |
| 197 | +## Static dashboard behavior |
| 198 | + |
| 199 | +Opening `report/dashboard.html` after a run still shows the completed Results |
| 200 | +Dashboard. It now also includes a Live Simulation sidebar entry: |
| 201 | + |
| 202 | +- If telemetry exists, it shows the last recorded status. |
| 203 | +- If telemetry does not exist, it explains how to start |
| 204 | + `fastmdx explore ... --dashboard` or `fastmdx dashboard serve --output ...`. |
| 205 | + |
| 206 | +## Demo or preview output |
| 207 | + |
| 208 | +For a small demo run, use the gentle preset and telemetry: |
| 209 | + |
| 210 | +```bash |
| 211 | +fastmdx explore --system local_pdbs/1L2Y.pdb \ |
| 212 | + --output local_runs/live_demo \ |
| 213 | + --include setup simulation analysis report \ |
| 214 | + --simulate-preset gentle \ |
| 215 | + --dashboard |
| 216 | +``` |
0 commit comments