Skip to content

Compute modules in SAM

Darice L Guittet edited this page Jun 6, 2024 · 6 revisions

Compute modules in SSC are a structure that contain complete functions calculating large sections of a model in SAM.

Please see SSC Compute Modules for background and instruction on how to create a new compute module in SSC.

After a new compute module is created and set up in SSC, getting the compute module to be accessible via the SAM GUI or PySAM requires further steps. In SAM, a compute module is run within a "Configuration", which are defined in the startup.lk script. The addconfig function creates a new configuration, the name of which is called the "config name" in this document.

Adding a new compute module to SAM

  1. Setup the configuration in the startup.lk script: UI pages. Setup the defaults.

  2. Build sam_api with export_config. First refresh the CMake build if this is not automated. The export_config project needs to be run first, and will generate the SAM_api and PySAM files for the new configuration. You will notice new files in the sam/api/include, sam/api/modules and if you have provided Default files for the configuration, sam/api/api_autogen/library/defaults. There will also be new files in pysam/docs, pysam/modules, and pysam/stubs.

  3. Update table in PySAM's config_to_cmod_name to add the new compute module into table that matches it with its SAM configuration.

  4. Update table in PySAM's module_doc to describe the new SAM Configuration.

  5. Add an Example or a Test to PySAM