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

#2382: ccm-lb: add backoff to avoid performance issues w/locking #2383

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

lifflander
Copy link
Collaborator

Fixes #2382

@lifflander lifflander linked an issue Dec 18, 2024 that may be closed by this pull request
@lifflander lifflander force-pushed the 2382-fix-performance-issues-with-ccm-lb branch from 2ea8a29 to ccb3bb1 Compare December 18, 2024 23:42
@lifflander
Copy link
Collaborator Author

This might need a more complete treatment with a increasing backoff, but for now this code is running well.

Copy link

github-actions bot commented Dec 18, 2024

Pipelines results

PR tests (gcc-12, ubuntu, mpich, verbose, kokkos)

Build for 900f9aa (2024-12-23 22:43:15 UTC)

Compilation - successful

Testing - passed

Build log


@lifflander lifflander force-pushed the 2382-fix-performance-issues-with-ccm-lb branch from 023b907 to 1889b34 Compare December 23, 2024 22:09
@lifflander lifflander force-pushed the 2382-fix-performance-issues-with-ccm-lb branch from e7bd01a to 900f9aa Compare December 23, 2024 22:43
@lifflander lifflander marked this pull request as ready for review December 24, 2024 01:29
@cz4rs cz4rs self-requested a review January 7, 2025 18:30
Optional('lb_iterations'): [
{
'id': int,
'tasks': [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct. I wonder if it is possible to avoid repetition by having task defined separately 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this might work:

Task = {
    'entity': And({
        Optional('collection_id'): int,
        'home': int,
        Optional('id'): int,
        Optional('seq_id'): int,
        Optional('index'): [int],
        'type': str,
        'migratable': bool,
        Optional('objgroup_id'): int
    }, validate_ids),
    'node': int,
    'resource': str,
    Optional('subphases'): [
        {
            'id': int,
            'time': float,
        }
    ],
    'time': float,
    Optional('user_defined'): dict,
    Optional('attributes'): dict
}
                        'tasks': [
                            Task,
                        ],

auto info = makeClusterSummary(id);
cur_clusters_.emplace(id, std::move(info));

//computeClusterSummary();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented out code.

);
}

auto iter = try_locks_.begin();
auto lock = *iter;
try_locks_.erase(iter);

if (lock.forced_release) {
std::this_thread::sleep_for(std::chrono::microseconds(100));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic number: put a comment why 100 is good.

Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Needs a rebase too.

For any potential reviewer: using Hide whitespace helps a lot 😉

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.

Fix performance issues with CCM-LB
2 participants