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

ThreadPool::default_nthread is public and static #509

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/madness/world/parsec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ namespace madness {
if (*made_new_ctx) {
parsec_context_wait(ctx);
parsec_fini(&ctx);
if (nullptr != madness_comm_thread_es) {
ctx = nullptr;
}
if (nullptr != madness_comm_thread_es) {
/* madness_comm_thread_es is just a copy of ES[0]. Resources (including es->profiling_es) are
* actually freed during parsec_fini. Just need to free memory allocated to store it. */
free(madness_comm_thread_es);
madness_comm_thread_es = nullptr;
}
ctx = nullptr;
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/madness/world/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,12 @@ namespace madness {
void operator=(const ThreadPool&) = delete;
void operator=(ThreadPool&&) = delete;

private:
/// Get the number of threads from the environment.

/// \return The number of threads.
static int default_nthread();

private:
friend class WorldTaskQueue;

// Thread pool data
Expand All @@ -1147,11 +1152,6 @@ namespace madness {
/// \param[in] nthread Description needed.
ThreadPool(int nthread=-1);

/// Get the number of threads from the environment.

/// \return The number of threads.
int default_nthread();

/// Run the next task.

/// \todo Verify and complete this documentation.
Expand Down
Loading