Configuration of LPs
The configuration of LPs, LP parameterization, and miscellaneous simulation parameters are specified by the CODES configuration system, which uses a structured configuration file. The configuration format allows categories, and optionally subgroups within the category, of key-value pairs for configuration. The LPGROUPS category defines the LP configuration. The PARAMS category is currently used for networking and ROSS-specific parameters. User-defined categories can also be used.
The configuration system additionally allows LP specialization via the usage of "annotations". This allows two otherwise identical LPs to have different parameterizations. Annotations have a simple "@" syntax appended to the LP fields, and are optional.
CODES currently exposes a small number of ROSS simulation engine options within the configuration file. These are "PARAMS:message_size" and "PARAMS:pe_mem_factor". The "message_size" parameter indicates the upper bound of event sizes that ROSS is expected to handle, while the "pe_mem_factor" parameter indicates the multiplier to the number of events allocated per ROSS PE (an MPI rank). Both of these exist to support the static allocation scheme ROSS uses for efficiency - both LP states and the maximum population of events are allocated statically at the beginning of the simulation.
The API is located at codes/configuration.h, which provides various types of access into the simulation configuration. Detailed configuration files can be found at doc/example/example.conf and doc/example_heterogeneous/example.conf.
The codes-mapping API maps user LPs to global LP IDs, providing numerous options for modulating the namespace under which the mapping is conducted. Mapping is performed on a per-group or per-LP-type basis, with numerous further filtering options including on an LPs annotation. Finally, the mapping API provides LP counts using the aforementioned filtering options.
The API can be found at codes/codes_mapping.h. doc/example/example.c shows a simple example of the mapping functionality, while the test program tests/mapping_test.c with configuration file tests/conf/mapping_test.conf extensively demonstrates the mapping API.
LP mapping context
In many cases (the resource and local storage model LPs, and modelnet in codes-net), the mapping from caller to callee LPs are implicit. The codes-mapping context API (codes/codes-mapping-context.h) provides various options for influencing these mappings, as well as providing the capability to bypass codes-mapping and send messages directly to an LP. The test file tests/map-ctx-test.c, along with the config file tests/conf/map-ctx-test.conf provides the best usage examples.
LP messaging conventions
Models in CODES that have a request-response form of communication resembling that of RPCs follow a specific convention, defined in codes/codes-callback.h. The header documents the convention. The current best example usage is in the CODES sources themselves, i.e. in codes/resource-lp.h, src/util/resource-lp.c, codes/local-storage-model.h, and src/util/local-storage-model.c.