Skip to content

Mf type erased binding - #897

Draft
crimson11 wants to merge 11 commits into
mainfrom
mf_type_erased_binding
Draft

Mf type erased binding#897
crimson11 wants to merge 11 commits into
mainfrom
mf_type_erased_binding

Conversation

@crimson11

Copy link
Copy Markdown
Contributor

No description provided.

Currently we determine shm-sizes of the
CTRL and DATA shm-objects by a simulation run.
I.e. we initialize the content of both section
1st within a heap-allocated resource. At the end
we use the sizes to correctly size the shm-objects.
This "SIMULATION" method is exact but has high runtime costs
and might consume lots of memory during startup.

This change now redesigns the containers/dynamic data
types being used within the DATA section, to use only
classes, which we are in control of and where we exactly
know based on our configuration, who much size they will
need. Thus the whole simulation canbe skipped and we calculate
the size correctly from the configuration settins for the
service instance.

We re-introduce therefore the ESTIMATION mode in parallel
to the SIMULATION mode.
Added analytical estimate/ANALYSIS mode for the
shm-size calculation for the CONTROL
section.
Adapted signature of LinearSearchMap to
support custom KeqEqual just like
std::unordered_map.
In the skeleton component tests we were
testing the lola::Skeleton with a event and field
service element. But we only provided the config/
deployment info for these elements, but did never
register them at their parent Skeleton. Thus, essential
tests checking the shm-size calculation were off!

The tests now correctly register the elements.
Fixed review comments for ne ANALYSIS based
size calculations.
Added unit test for parsing of new ANALYSIS mode.
Moved the shm-size calc for ServiceDataStorage and
ServiceDataControl out of SkeletonMemoryManager
to the correspoinding data structures itself.
Added death-test for LinearSearchMap for capacity
overflow.

SkeletonMemoryManager now uses
GetServiceElementInstanceDeployment helper.
Added tests for ServiceDataControl for size
calculation.
Added tests for ServiceDataStorage for size
calculation.
Added additional skeleton component tests to verify,
that the size resulting from analysis is not extensively
overshooting the (real) size determined by simulation.
Some overshoot is acceptable as we have to take into
account worst case padding taking place in an allocation.

To support better testing, the methods to calculate size
for ServiceDataControl and ServiceDataStorage by analysis
now return a pair of sizes: Minimal size (no additional
padding needed) and worst case size (each allocation needs
max. padding).

Unit tests take now take benefit of these changes, to
verify, that the size delta for a shm-object between
simulation and analysis is NOT greater than the diff
between min/worst-case size of the analysis.
const SkeletonEventProperties& element_properties)
EventDataStorage<memory::shared::PolymorphicOffsetPtrAllocator<std::max_align_t>>*
SkeletonMemoryManager::RetrieveGenericEventDataFromOpenedSharedMemory(const ElementFqId element_fq_id,
const SkeletonEventProperties& element_properties)
{
return ShmSizeCalculationMode::kSimulation;
}
else if (shm_size_calc_mode_value == kShmSizeCalcModeAnalysis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants