Skip to content

thread context for omp parallel to pass thread local allocator #644

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

Open
wants to merge 2 commits into
base: BANN_save_load_one_file
Choose a base branch
from

Conversation

ltan1ms
Copy link
Contributor

@ltan1ms ltan1ms commented Apr 8, 2025

  • Does this PR have a descriptive title that could go in our release notes?
  • Does this PR add any new dependencies?
  • Does this PR modify any existing APIs?
    • Is the change to the API backwards compatible?
  • Should this result in any changes to our documentation, either updating existing docs or adding new ones?

Reference Issues/PRs

What does this implement/fix? Briefly explain your changes.

Any other comments?

@ltan1ms ltan1ms requested a review from amrmorsey April 8, 2025 23:08
Comment on lines +1 to +2
#ifndef _THREAD_CONTEXT_H_
#define _THREAD_CONTEXT_H_

Choose a reason for hiding this comment

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

Will using #pragma once instead be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, will add.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed now.

@@ -1605,7 +1613,11 @@ template <typename T, typename TagT, typename LabelT> void Index<T, TagT, LabelT
{
diskann::cout << "Starting final cleanup.." << std::flush;
}
#ifdef _ANN_ALLOCATOR
#pragma omp parallel for schedule(dynamic, 2048) firstprivate(context)

Choose a reason for hiding this comment

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

Should we also call OmpParallelContext context; here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's defined by line 1573.

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