Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpc4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HPC4NS
hpc4neuro
Commits
5c4f9962
Commit
5c4f9962
authored
Nov 16, 2019
by
Fahad Khalid
Browse files
Options
Downloads
Patches
Plain Diff
Added the API docs in plain text format since GitLab does not render HTML.
parent
e213bb72
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
README.md
+1
-1
1 addition, 1 deletion
README.md
doc/text/index.txt
+61
-0
61 additions, 0 deletions
doc/text/index.txt
with
63 additions
and
1 deletion
.gitignore
+
1
−
0
View file @
5c4f9962
...
...
@@ -128,3 +128,4 @@ dmypy.json
# PyCharm
.idea
/doc/_build/
/doc/text/.doctrees/
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
5c4f9962
...
...
@@ -110,4 +110,4 @@ static and dynamic decoration syntax:
### API documentation
API documentation for
`slns.distribution`
is available
[
here
](
doc/html/index.html
)
.
\ No newline at end of file
API documentation for
`slns.distribution`
is available
[
here
](
doc/text/index.txt
)
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
doc/text/index.txt
0 → 100644
+
61
−
0
View file @
5c4f9962
SLNS Python Utilities's API documentation
*****************************************
class slns.distribution.DataDistributor(mpi_comm, shutdown_on_error=False)
A callable that serves as a decorator for any function that returns
an iterable of data items, and needs its functionality to be
extended such that the iterable returned is not the entire
collection, but rather only a part of the collection that is to be
processed by the local MPI rank.
Therefore, this decorator converts a function into one that can be
used for distributed processing with MPI.
__call__(data_loader, shuffle=False)
Decorates the given function so that instead of returning all
the data_items, the given function returns only those data_items
that are to be processed by the local MPI rank. All the MPI
communication details are handled internally, so that the caller
need not implement these.
Parameters:
* **data_loader** -- Any function that returns a sized
iterable of data_items, i.e., it should be possible to call
iter() and len() on the object returned from the function.
A function that does not return a sized iterable causes an
error. Also, if the number of items in the iterable is less
than the No. of MPI ranks, an error is generated.
* **shuffle** -- If True, the iterable of all data items is
shuffled before distribution amongst MPI ranks. RNG used is
from the 'random' package in the Python standard library.
Raises:
**slns.errors import DataDistributionError** -- can be raised
if 'shutdown on error' is not requested at the time of object
creation.
Returns:
Decorated function. The function when called returns a list
of data items to be processed by the local MPI rank.
class slns.distribution.ErrorHandler
Set of functions that can gracefully handle exceptions/errors in
MPI programs running with one or more ranks.
static exit_all_ranks(error, mpi_comm)
Ensures a clean program exit by synchronizing all MPI ranks
available via the given communicator. Also, writes the message
string from the given error object to stderr.
Parameters:
* **error** -- Object, either of type Exception, or a type
derived from Exception.
* **mpi_comm** -- Object of type mpi4py.MPI.Comm that
represents the communicator for all the ranks to which the
given error matters.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment