Check this machine
environmentInspects machine resources and solver backends, using an optional problem YAML to estimate run times per backend before starting a topology optimization job.
Instructions
Facts about this machine and the solver backends. Changes nothing.
Use it to answer "can this machine run it, and how fast?", or before a long run. Tell the user the numbers that matter.
yaml_path: optional problem YAML (relative paths start at the work folder). With it, problem holds the time estimate for each backend (model values, not promises).
Reply keys: resource topopt://replies/environment (the meaning of each key).
If TOPOPT_PYTHON names another Python, the data is for that Python (run_interpreter says so).
recommendations are offers as data: when a faster backend is possible but not installed (pypardiso on Linux x86_64, the Accelerate shim on a Mac), each has a reason, the command and license_note (speedup_factor when it is measured).
This tool installs and builds nothing. If the user agrees, you run the command. Say the reason (and the speed-up) first. gpu_solver is a fact, not an offer. auto takes a GPU that passes a short self-test, and goes on with the CPU solver (auto_choice.cpu_solver) from the last checkpoint if gpu-mg fails during a run. settings.solver: gpu-mg asks for it on any OpenCL device (run_topopt has no solver argument: write it in the YAML) and has no fallback. The OpenCL device list and the self-test run in a child process (limit 60 s). At the limit opencl.problem says so, and auto takes the CPU rule; TOPOPT_AUTO_GPU=0 skips the wait.
A gpu-mg run that stops with "did not reach the relative residual" lists its options in the error (settings.gpu_tol, settings.gpu_backward_error, settings.gpu_max_iter in case B, a stiffer start design, another solver); the residual history is in gpu_mg.jsonl of the run folder.
gpu-mg takes springs, joints and per-axis supports (a fixed entry with axes), alone or together. In case C (no 64-bit float on the device) the joint term is computed in 32-bit float and the inner PCG removes the rigid modes of each body and 6 harmonic columns for each bonded patch, and solves them in 64-bit on the host: check prints the beam over the bond stiffness with the cases that were measured on pocl and on one Intel Arc iGPU (one host each; revision 133e5a1; a cube that only a joint holds solved at 9.9e-12 and above with the rigid modes removed, and at 3.3e-7 and above without; a part with two tube joints and no fixed region solved with the harmonic columns and stopped without them) and the memory of the columns, which the memory estimate does not count. These are facts, not a limit. A run that stops gives the ratio and the options (another solver, gpu_case B on a device with 64-bit float, a stiffer beam).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| yaml_path | No |