Simfwk as a solver (Architect 2.0)
Last update: 16.07.2025Based on the architect 2.0 solver interface, a derived simfwk-solver can be created to take the job scheduled by TSA. Mandatory information for simfwk_cli includes input scenarios and output directory, which must be provided by the TSA job. For other optional arguments and scheduling configurations, simfwk_cli will use default input files stored in the solver image unless specified by the TSA job.
Create base image
Dependencies
The simfwk package, which contains binaries and all runtime dependencies, needs to be installed in the image. Additionally, the following build-time dependencies should be included in the Dockerfile:
License client binaries
The license client binaries are also contained inside the simfwk installation package. Depending on the version, the client must be copied to the expected directory /ansys_inc/<version>.
In this release, the license client version v231 is applied and should be copied to the expected path in the image:
Default data
Currently, TSA cannot hand over all input or static data files required by simfwk, i.e., scheduling config based on different setups should be copied inside the image as default data. Based on how the solver binding is implemented and how the TSA job is configured, the user can select if any default input files should be applied.
In the simfwk-solver image, all default data (Catalogs, Maps, scheduling configs, user settings, and driver input) are copied in the image as follows:
Manage I/O files
It is important to have the input and output directories from the TSA job and manage them correctly in solver binding. Make sure simfwk_cli takes the correct input files from the input data directory if the default data shall not be used. The output files (kpi, simulation log, and trace) will be dumped in the given output directory if it is provided by the argument -o <output-directory>.
The names of generated output files are fixed and cannot be customized. In the current solver binding, they are defined as global parameters:
If any need to rename those file after simulation is done, i.e. after simfwk_cli returns 0, it can be done manually though.
Running simfwk_cli as subprocess
According to the new solver architecture, the simfwk solver shall be running as a subprocess inside the python binding script and fill the arguments parameter with expected value:
Simulation log
With different return codes, the console output of the simfwk process shall be appended to the simulation log so that it can be captured eventually by TSA and forwarded to the frontend for the user.
Handling MCAP files
If the MCAP trace file is enabled, a file simout_trace.mcap is created after the simulation is correctly finished. The size of this binary is quite large without any post-processing, but it can be shrunk significantly after compression using 7z. TSA also requires a compressed file with the extension simout_trace.7z, which it collects and forwards to the frontend for the users.
This step can be done with the following commands in the python solver binding:
Note that the subprocess command defined in trace_compression_command requires the installation of package p7zip-full in docker image, this shall be addressed in the base image dependency
How to add standalone activities to your simulation
If any standalone activities are defined in the scheduling configuration, you must execute them in the background as another subprocess BEFORE the simfwk_cli process. To address this, you can use the subprocess.Popen command in the solver binding, for instance:
This ensures that the dependent standalone activity process is running in the background so that the simfwk_cli can be executed correctly.