-
Notifications
You must be signed in to change notification settings - Fork 15
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
Removing MPError class in favor of baseclasses Error. #12
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0dd6ade
Removing MPError class in favor of baseclasses Error
eirikurj 1c83807
Adding baseclasses Error import
eirikurj 17622b5
Updating setup.py to include mdolab-baseclasses. Adjusting the API do…
eirikurj aeb345b
Fix typos
eirikurj 8b7f0da
Bump version
eirikurj 6037e39
Minor adjustments to docs
eirikurj e9aecfd
Adding simple example
eirikurj 8d11e20
Adding missing doc file examples.rst
eirikurj 98e5ee6
Changing the required baseclasses version
eirikurj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
.. _multipoint_API: | ||
|
||
API Reference | ||
============= | ||
API | ||
=== | ||
|
||
.. currentmodule:: multipoint.multiPointSparse | ||
|
||
.. autoclass:: multipoint.multiPointSparse | ||
.. autoclass:: multiPointSparse | ||
:members: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
""" | ||
This example demonstrates how to add processor sets and perform operations | ||
on a specific group of processors within a set. | ||
|
||
To run locally do: ``mpirun -np 10 --oversubscribe python ex1.py``. | ||
""" | ||
# rst init (begin) | ||
# ============================================================================== | ||
# Import modules | ||
# ============================================================================== | ||
from mpi4py import MPI | ||
from multipoint import multiPointSparse | ||
|
||
# rst init (end) | ||
# ============================================================================== | ||
# Processor allocation | ||
# ============================================================================== | ||
# Instantiate the multipoint object | ||
MP = multiPointSparse(MPI.COMM_WORLD) | ||
|
||
# Add all processor sets and create the communicators | ||
MP.addProcessorSet("codeA", 3, [3, 2, 1]) | ||
MP.addProcessorSet("codeB", 1, 4) | ||
comm, setComm, setFlags, groupFlags, ptID = MP.createCommunicators() | ||
|
||
# Extract setName on a given processor for convenience | ||
setName = MP.getSetName() | ||
|
||
# Create all directories for all groups in all sets | ||
ptDirs = MP.createDirectories("./output") | ||
|
||
# For information, print out all values on all processors | ||
print( | ||
f"setName={setName}, comm.rank={comm.rank}, comm.size={comm.size}, setComm.rank={setComm.rank}, setComm.size={setComm.size}, setFlags={setFlags}, groupFlags={groupFlags}, ptID={ptID}" | ||
) | ||
# rst alloc (end) | ||
# ============================================================================== | ||
# Problem setup | ||
# ============================================================================== | ||
# To perform operations on all processors in a set we can use the setFlags | ||
if setFlags["codeA"]: # Alternatively, setName == "codeA" could be used here | ||
# ... | ||
# To access a particular group within the set can be done using the ptID | ||
# Here we access only the processors in the first group | ||
if 0 == ptID: | ||
print(f"setName={setName} comm.rank={comm.rank} ptID={ptID}") | ||
|
||
# To access all groups (but still a specific one) we simply loop over the size of the set | ||
for i in range(setComm.size): | ||
if i == ptID: | ||
print(f"setName={setName} comm.rank={comm.rank} ptID={ptID} i={i}") | ||
|
||
# Similarly, for the other processor set | ||
if setFlags["codeB"]: | ||
for i in range(setComm.size): | ||
if i == ptID: | ||
print(f"setName={setName} comm.rank={comm.rank} ptID={ptID} i={i}") | ||
# rst problem (end) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "1.3.0" | ||
__version__ = "1.3.1" | ||
|
||
|
||
from .multiPointSparse import multiPointSparse | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you are missing the
examples.rst
file that calls theex1.py
script vialiteralinclude
. The examples are not showing up in the docs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to commit that one. Should be there now.