kernel: turn global GAP and module states back into static globals#6376
kernel: turn global GAP and module states back into static globals#6376
Conversation
|
Note to self: if we decide to merge this, then make sure to increment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6376 +/- ##
=======================================
Coverage 78.69% 78.69%
=======================================
Files 684 683 -1
Lines 292892 292901 +9
Branches 8665 8658 -7
=======================================
+ Hits 230494 230509 +15
+ Misses 60577 60570 -7
- Partials 1821 1822 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
... at least in plain GAP; keep them as before in HPC-GAP. The whole concept was invented to allow HPC-GAP to have thread local GAP and module state. In plain GAP, though, it introduced some minor overhead. Changing this here allows us to avoid the overhead, and it also prevents GAPState from becoming larger than 32kb. This can happen on platforms with a large jmp_buf (e.g., powerpc64).
e902c84 to
eef8286
Compare
| #ifdef HPCGAP | ||
| // number of bytes this module needs for its per-thread module state | ||
| // Only used in HPC-GAP, but not behind an #ifdef guard to avoid API | ||
| // breakage for C++ kernel extensions | ||
| UInt moduleStateSize; | ||
|
|
||
| // if this is not zero, then the module state offset is stored into | ||
| // the address this points at | ||
| // Only used in HPC-GAP, but not behind an #ifdef guard to avoid API | ||
| // breakage for C++ kernel extensions | ||
| Int * moduleStateOffsetPtr; | ||
| #endif |
There was a problem hiding this comment.
@ChrisJefferson FYI I've decided to disable the module state in "plain" GAP and only keep it for HPC-GAP (but not initModuleState because that is actually used even in "plain" GAP.
No GAP packages use it -- only PackageMaker's C++ template code as well as the gapbind14 kernel extension in Semigroups (which is just a demo, so it's not a big issue). I've already changes this in PackageMaker, and also submitter semigroups/Semigroups#1179
... at least in plain GAP; keep them as before in HPC-GAP.
The whole concept was invented to allow HPC-GAP to have thread local GAP and module state. In plain GAP, though, it introduced some minor overhead.
Changing this here allows us to avoid the overhead, and it also prevents GAPState from becoming larger than 32kb. This can happen on platforms with a large jmp_buf (e.g., powerpc64).
Alternative to and hence closes #6373