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
7b684fd6
Commit
7b684fd6
authored
1 year ago
by
Jammer, Tim
Browse files
Options
Downloads
Patches
Plain Diff
added identifier for instructions
parent
d918d38f
No related branches found
No related tags found
1 merge request
!14
Infrastructure: Remove Instructionblock
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/Infrastructure/AllocCall.py
+3
-2
3 additions, 2 deletions
scripts/Infrastructure/AllocCall.py
scripts/Infrastructure/Instruction.py
+10
-1
10 additions, 1 deletion
scripts/Infrastructure/Instruction.py
scripts/Infrastructure/MPICall.py
+2
-3
2 additions, 3 deletions
scripts/Infrastructure/MPICall.py
with
15 additions
and
6 deletions
scripts/Infrastructure/AllocCall.py
+
3
−
2
View file @
7b684fd6
...
@@ -25,7 +25,8 @@ alloc_template = """
...
@@ -25,7 +25,8 @@ alloc_template = """
class
AllocCall
(
Instruction
):
class
AllocCall
(
Instruction
):
@override
@override
def
__init__
(
self
,
type
:
str
,
num_elements
:
str
,
name
:
str
=
"
buf
"
,
use_malloc
:
bool
=
False
):
def
__init__
(
self
,
type
:
str
,
num_elements
:
str
,
name
:
str
=
"
buf
"
,
use_malloc
:
bool
=
False
,
identifier
:
str
=
None
):
"""
"""
Creates a New allocation Call
Creates a New allocation Call
...
@@ -35,7 +36,7 @@ class AllocCall(Instruction):
...
@@ -35,7 +36,7 @@ class AllocCall(Instruction):
name: name of buffer variable
name: name of buffer variable
use_malloc: True: use Malloc, False: use calloc for allocation
use_malloc: True: use Malloc, False: use calloc for allocation
"""
"""
super
().
__init__
(
""
)
super
().
__init__
(
""
,
identifier
)
self
.
_use_malloc
=
use_malloc
self
.
_use_malloc
=
use_malloc
self
.
_type
=
type
self
.
_type
=
type
self
.
_num_elements
=
num_elements
self
.
_num_elements
=
num_elements
...
...
This diff is collapsed.
Click to expand it.
scripts/Infrastructure/Instruction.py
+
10
−
1
View file @
7b684fd6
#! /usr/bin/python3
#! /usr/bin/python3
from
scripts.Infrastructure.Variables
import
ERROR_MARKER_COMMENT_BEGIN
,
ERROR_MARKER_COMMENT_END
from
scripts.Infrastructure.Variables
import
ERROR_MARKER_COMMENT_BEGIN
,
ERROR_MARKER_COMMENT_END
class
Instruction
(
object
):
class
Instruction
(
object
):
"""
"""
Base class to represent an Instruction
Base class to represent an Instruction
the identifier is used, in order to reference that instruction in the Template Manager (e.g. to change it). can be None
"""
"""
def
__init__
(
self
,
str_representation
):
def
__init__
(
self
,
str_representation
:
str
,
identifier
:
str
=
None
):
self
.
_str_representation
=
str_representation
self
.
_str_representation
=
str_representation
self
.
_has_error
=
False
self
.
_has_error
=
False
self
.
_identifier
=
identifier
def
set_has_error
(
self
,
has_error
:
bool
=
True
):
def
set_has_error
(
self
,
has_error
:
bool
=
True
):
self
.
_has_error
=
has_error
self
.
_has_error
=
has_error
def
get_identifier
(
self
)
->
str
:
return
self
.
_identifier
def
set_identifier
(
self
,
identifier
:
str
):
self
.
_identifier
=
identifier
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
_has_error
:
if
self
.
_has_error
:
return
ERROR_MARKER_COMMENT_BEGIN
+
self
.
_str_representation
+
ERROR_MARKER_COMMENT_END
return
ERROR_MARKER_COMMENT_BEGIN
+
self
.
_str_representation
+
ERROR_MARKER_COMMENT_END
...
...
This diff is collapsed.
Click to expand it.
scripts/Infrastructure/MPICall.py
+
2
−
3
View file @
7b684fd6
...
@@ -9,12 +9,11 @@ from scripts.Infrastructure.Variables import ERROR_MARKER_COMMENT_BEGIN, ERROR_M
...
@@ -9,12 +9,11 @@ from scripts.Infrastructure.Variables import ERROR_MARKER_COMMENT_BEGIN, ERROR_M
class
MPICall
(
Instruction
):
class
MPICall
(
Instruction
):
@override
@override
def
__init__
(
self
,
function
:
str
,
args
:
typing
.
OrderedDict
[
str
,
str
],
version
:
str
):
def
__init__
(
self
,
function
:
str
,
args
:
typing
.
OrderedDict
[
str
,
str
],
version
:
str
,
identifier
:
str
=
None
):
super
().
__init__
(
""
)
super
().
__init__
(
""
,
identifier
)
self
.
_function
=
function
self
.
_function
=
function
self
.
_args
=
args
self
.
_args
=
args
self
.
_version
=
version
self
.
_version
=
version
self
.
_has_error
=
False
@override
@override
def
__str__
(
self
):
def
__str__
(
self
):
...
...
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