Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MPI-BugBench
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
High Performance Computing - Public
MPI-BugBench
Commits
1747635a
Verified
Commit
1747635a
authored
1 year ago
by
Simon Schwitanski
Browse files
Options
Downloads
Patches
Plain Diff
InstructionBlock: Add get_operations and register_operations for lists of operations
parent
b3a7aed6
No related branches found
No related tags found
3 merge requests
!9
Infrastructure: Type Hints, Instruction class and lists of instructions
,
!8
Draft: RMA
,
!7
InstructionBlock: Add get_operations and register_operations for lists of operations
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Infrastructure/InstructionBlock.py
+24
-0
24 additions, 0 deletions
scripts/Infrastructure/InstructionBlock.py
with
24 additions
and
0 deletions
scripts/Infrastructure/InstructionBlock.py
+
24
−
0
View file @
1747635a
...
...
@@ -50,6 +50,20 @@ class InstructionBlock:
self
.
operations
[
as_int
]
=
[]
self
.
operations
[
as_int
].
append
(
op
)
def
register_operations
(
self
,
ops
,
kind
=
'
all
'
):
"""
Registers a list of operations based on rank.
Parameters:
- ops: The operations to register.
- kind: Rank to execute the operation (
'
all
'
,
'
not0
'
, or integer).
- all: all Ranks execute this operation
- not0: all Ranks but the Root (rank 0) execute
- Or the integer of the rank that should execute
"""
for
op
in
ops
:
self
.
register_operation
(
op
,
kind
)
def
get_version
(
self
):
"""
Retrieves the minimum required MPI version.
...
...
@@ -115,6 +129,16 @@ class InstructionBlock:
"""
return
self
.
operations
[
kind
][
index
]
def
get_operations
(
self
,
kind
=
'
all
'
):
"""
Retrieve all operations registered for the given kind.
Parameters:
- kind (
'
all
'
,
'
not0
'
or integer): which ranks should execute the operation
Returns:
str: List of all operations with given kind
"""
return
self
.
operations
[
kind
]
def
replace_operation
(
self
,
op
,
kind
=
'
all
'
,
index
=
0
):
"""
Replace the operation registered. will Raise IndexError if not present
...
...
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