-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added address resolution from MPI rank
- Loading branch information
Showing
15 changed files
with
315 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* (C) 2024 The University of Chicago | ||
* | ||
* See COPYRIGHT in top-level directory. | ||
*/ | ||
#ifndef __BEDROCK_MPI_H | ||
#define __BEDROCK_MPI_H | ||
|
||
#include <bedrock/Exception.hpp> | ||
#include <thallium.hpp> | ||
|
||
namespace bedrock { | ||
|
||
class DependencyFinder; | ||
class Server; | ||
struct MPIEnvImpl; | ||
|
||
class MPIEnv { | ||
|
||
friend class Server; | ||
friend class DependencyFinder; | ||
|
||
public: | ||
|
||
MPIEnv(const MPIEnv&) = default; | ||
MPIEnv(MPIEnv&&) = default; | ||
MPIEnv& operator=(const MPIEnv&) = default; | ||
MPIEnv& operator=(MPIEnv&&) = default; | ||
|
||
/** | ||
* @brief The last call to the destructor will finalize MPI if it has been | ||
* initialized by Bedrock. | ||
*/ | ||
~MPIEnv(); | ||
|
||
/** | ||
* @brief Returns true if Bedrock was built with MPI support. | ||
* If it hasn't, all the methods bellow will throw an Exception. | ||
* | ||
* @param engine Thallium engine. | ||
*/ | ||
bool isEnabled() const; | ||
|
||
/** | ||
* @brief Return the size of MPI_COMM_WORLD. | ||
*/ | ||
int globalSize() const; | ||
|
||
/** | ||
* @brief Return the rank of the current process in MPI_COMM_WORLD. | ||
*/ | ||
int globalRank() const; | ||
|
||
/** | ||
* @brief Return the Mercury address of the given rank. | ||
* | ||
* @param rank Rank of the process. | ||
*/ | ||
const std::string& addressOfRank(int rank) const; | ||
|
||
private: | ||
|
||
/** | ||
* @brief This constructor will initialize MPI if it hasn't been initialized. | ||
*/ | ||
MPIEnv(); | ||
|
||
MPIEnv(std::shared_ptr<MPIEnvImpl> s) | ||
: self(std::move(s)) {} | ||
|
||
operator std::shared_ptr<MPIEnvImpl>() const { | ||
return self; | ||
} | ||
|
||
std::shared_ptr<MPIEnvImpl> self; | ||
}; | ||
|
||
} // namespace bedrock | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.