Skip to content

Commit

Permalink
Merge pull request #509 from m-a-d-n-e-s-s/evaleev/feature/ThreadPool…
Browse files Browse the repository at this point in the history
…-default_nthread-is-static

`ThreadPool::default_nthread` is public and static
  • Loading branch information
evaleev authored Nov 2, 2023
2 parents 03c82cf + 41375b2 commit 69ace58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
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

0 comments on commit 69ace58

Please sign in to comment.