Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to compact modeling logic #96

Merged
merged 41 commits into from
Oct 11, 2024
Merged

Updates to compact modeling logic #96

merged 41 commits into from
Oct 11, 2024

Conversation

whart222
Copy link
Collaborator

This includes a bunch of updates to coek to extend the API of map and array logic, and to fix issues with the compact expression logic.

Note that a major memory management bug was identified and resolved. However, this likely will result in a runtime degradation b.c. of frequent generation of small vectors.

This also includes various updates to poek that expose more functionality in coek, especially related to the initialization of compact expressions.

This simplifies the use of coek intrinsics in cases where
expressions result in double values, which we can directly evaluate.
This API mimics the API of smoek.  We'll see if we keep this, but it
seems to make sense.
... to avoid overloading with other coek functions.
1. Removing void* references to Var/Param reference types

2. Using shared pointer references instead, to ensure proper memory
mangement.

3. MANY follow-on changes were required to implement this change.

4. A key change is the reversion of IndexVector to std::vector<int>.
The simple memory management used in IndexVector is not sufficient to
handle the potential for dynamic alloction/decallocation of
IndexVectors.

NOTE: These changes will likely incur a performance penalty in coek
(especialy #4).  But the earlier code design did not work properly when
using mapped variables and parameters.
An integer value needs to be coerced correctly.
Using a base class to avoid cross-includes between the API and AST
directories.
1. Reworking build logic to default build without spack.

2. "Fixing" iterator logic in pybind11 variables.  This is still
        broken, since this doesn't work for multi-dimensional
        variable arrays.
This mimics the logic used for add_variable
1. Include name and fixed values when expanding variables

2. Various API extensions

3. Always store variable_map,variable_array, parameter_map and parameter_array objects on a Model object.

4. Added missing Model::add_parameter methods

5. Many extensions to pybind11 to capture compact models.
1. Adding missing data() functions

2. Fixed walker errors with DataRefTerms

3. Added tests for data() logic
Adding a few tests, but not enough
Now support the use of SequenceContexts
NOTE: This requires changing the Model object, so const-ness
was removed from associated printing methods.
IndexSequence iterates over the IndexParameters associated with a
ConcreteSet.  Hence, this provides a more generic iterator concept than
ExpressionSequence.
1. Fixing compact walker.

2. Updating tests
1. Extending pycoek to setup data/param/var data with
        SequenceContext objects

2. Enable expand() logic for Parameter's
1. Exposing coek::DataPortal within pycoek

2. Enabling initialization of ParameterMap with a dictionary.

   Note:  There's also a preliminary hook for DataMap, but that's
        not working yet.
1. Fixing typename in indexed_container

2. Fixing logic associated with expansion of var/obj/con components
1. Fixing initialization of parameter values

2. Fixing bugs in compact LP writer
@whart222 whart222 merged commit 8e08b31 into dev Oct 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant