Skip to content

Fix lock contention#924

Merged
gertjanvanzwieten merged 4 commits intomainfrom
function
Jul 9, 2025
Merged

Fix lock contention#924
gertjanvanzwieten merged 4 commits intomainfrom
function

Conversation

@gertjanvanzwieten
Copy link
Contributor

No description provided.

@gertjanvanzwieten gertjanvanzwieten changed the title Introduce _pickle.Function Introduce _util.Function Jun 23, 2025
This patch replaces StringIO by string join to generate the script in
evaluable.compile.
@gertjanvanzwieten gertjanvanzwieten force-pushed the function branch 2 times, most recently from 95e7241 to 8b9130f Compare June 23, 2025 12:57
@gertjanvanzwieten gertjanvanzwieten changed the title Introduce _util.Function Introduce _util.function Jun 23, 2025
This patch introduces _util.function to replace the compilation code
from evaluable.compile.
@gertjanvanzwieten gertjanvanzwieten force-pushed the function branch 2 times, most recently from 7a2a0d2 to 05fcdab Compare July 8, 2025 13:41
@gertjanvanzwieten gertjanvanzwieten changed the title Introduce _util.function Fix lock contention Jul 8, 2025
In evaluable.compile, this patch replaces the single lock for all shared data
by a fine grained set of individual locks to reduce waiting times at high
processor counts.
This patch removes the lock around assignments, which are unnecessary by
definition, to remove some overhead associated with aqcuiring the lock. The
generated code changes as follows.

Before:

    # LoopSum e0; alloc
    with lock0:
        v0 = parallel.shempty((), dtype=float)

After:

    # LoopSum e0; alloc
    v0 = parallel.shempty((), dtype=float)
@gertjanvanzwieten gertjanvanzwieten merged commit 972089e into main Jul 9, 2025
22 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.

2 participants