Skip to content

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

Closed
ltan1ms wants to merge 2 commits intoBANN_save_load_one_filefrom
ltan1ms/thread_context_for_omp
Closed

thread context for omp parallel to pass thread local allocator#644
ltan1ms wants to merge 2 commits intoBANN_save_load_one_filefrom
ltan1ms/thread_context_for_omp

Conversation

@ltan1ms
Copy link
Copy Markdown
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 thread include/thread_context.h
Comment on lines +1 to +2
#ifndef _THREAD_CONTEXT_H_
#define _THREAD_CONTEXT_H_
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed now.

Comment thread src/index.cpp
diskann::cout << "Starting final cleanup.." << std::flush;
}
#ifdef _ANN_ALLOCATOR
#pragma omp parallel for schedule(dynamic, 2048) firstprivate(context)
Copy link
Copy Markdown

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
Copy Markdown
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.

@harsha-simhadri
Copy link
Copy Markdown
Contributor

@ltan1ms feel free to merge into BANN branch. if not relevant anymore, please close PR

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.

3 participants