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
GitLab 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
92f7fa9c
Commit
92f7fa9c
authored
1 year ago
by
Jammer, Tim
Browse files
Options
Downloads
Patches
Plain Diff
added Instruction class (
#6
)
parent
5e272eef
Branches
Branches containing commit
No related tags found
1 merge request
!9
Infrastructure: Type Hints, Instruction class and lists of instructions
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/Infrastructure/AllocCall.py
+5
-2
5 additions, 2 deletions
scripts/Infrastructure/AllocCall.py
scripts/Infrastructure/Instruction.py
+13
-0
13 additions, 0 deletions
scripts/Infrastructure/Instruction.py
scripts/Infrastructure/MPICall.py
+5
-1
5 additions, 1 deletion
scripts/Infrastructure/MPICall.py
with
23 additions
and
3 deletions
scripts/Infrastructure/AllocCall.py
+
5
−
2
View file @
92f7fa9c
#! /usr/bin/python3
#! /usr/bin/python3
from
typing_extensions
import
override
from
scripts.Infrastructure.Instruction
import
Instruction
alloc_template
=
"""
alloc_template
=
"""
@{TYPE}@* @{NAME}@ = (@{TYPE}@*) @{FUNCTION}@(@{NUM}@ @{SEP}@ sizeof(@{TYPE}@));
@{TYPE}@* @{NAME}@ = (@{TYPE}@*) @{FUNCTION}@(@{NUM}@ @{SEP}@ sizeof(@{TYPE}@));
...
@@ -20,8 +22,8 @@ alloc_template = """
...
@@ -20,8 +22,8 @@ alloc_template = """
"""
"""
class
AllocCall
:
class
AllocCall
(
Instruction
)
:
@override
def
__init__
(
self
,
type
,
num_elements
,
name
=
"
buf
"
,
use_malloc
=
False
):
def
__init__
(
self
,
type
,
num_elements
,
name
=
"
buf
"
,
use_malloc
=
False
):
"""
"""
Creates a New allocation Call
Creates a New allocation Call
...
@@ -37,6 +39,7 @@ class AllocCall:
...
@@ -37,6 +39,7 @@ class AllocCall:
self
.
_num_elements
=
num_elements
self
.
_num_elements
=
num_elements
self
.
_name
=
name
self
.
_name
=
name
@override
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
_use_malloc
:
if
self
.
_use_malloc
:
delim
=
'
*
'
delim
=
'
*
'
...
...
This diff is collapsed.
Click to expand it.
scripts/Infrastructure/Instruction.py
0 → 100644
+
13
−
0
View file @
92f7fa9c
#! /usr/bin/python3
class
Instruction
(
object
):
"""
Base class to represent an Instruction
"""
def
__init__
(
self
,
str_representation
):
self
.
_str_representation
=
str_representation
def
__str__
(
self
):
return
self
.
_str_representation
This diff is collapsed.
Click to expand it.
scripts/Infrastructure/MPICall.py
+
5
−
1
View file @
92f7fa9c
#! /usr/bin/python3
#! /usr/bin/python3
from
typing_extensions
import
override
from
scripts.Infrastructure.Instruction
import
Instruction
from
scripts.Infrastructure.Variables
import
ERROR_MARKER_COMMENT
from
scripts.Infrastructure.Variables
import
ERROR_MARKER_COMMENT
class
MPI_Call
:
class
MPI_Call
(
Instruction
)
:
@override
def
__init__
(
self
,
function
,
args
,
version
):
def
__init__
(
self
,
function
,
args
,
version
):
self
.
_function
=
function
self
.
_function
=
function
self
.
_args
=
args
self
.
_args
=
args
self
.
_version
=
version
self
.
_version
=
version
self
.
_has_error
=
False
self
.
_has_error
=
False
@override
def
__str__
(
self
):
def
__str__
(
self
):
s
=
self
.
_function
+
"
(
"
s
=
self
.
_function
+
"
(
"
for
k
,
v
in
self
.
_args
.
items
():
for
k
,
v
in
self
.
_args
.
items
():
...
...
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