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
a2ce1791
Commit
a2ce1791
authored
Feb 2, 2024
by
Jammer, Tim
Browse files
Options
Downloads
Patches
Plain Diff
added message race cases
parent
7baaa0dd
Branches
Branches containing commit
No related tags found
1 merge request
!6
More Work on infrastructure IV
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/errors/pt2pt/MessageRace.py
+115
-0
115 additions, 0 deletions
scripts/errors/pt2pt/MessageRace.py
with
115 additions
and
0 deletions
scripts/errors/pt2pt/MessageRace.py
0 → 100644
+
115
−
0
View file @
a2ce1791
#! /usr/bin/python3
from
scripts.Infrastructure.ErrorGenerator
import
ErrorGenerator
,
CorrectTestcase
from
scripts.Infrastructure.InstructionBlock
import
InstructionBlock
from
scripts.Infrastructure.MPICallFactory
import
MPICallFactory
,
CorrectMPICallFactory
from
scripts.Infrastructure.CorrectParameter
import
CorrectParameterFactory
,
get_matching_recv
from
scripts.Infrastructure.Template
import
TemplateManager
from
scripts.Infrastructure.TemplateFactory
import
get_send_recv_template
from
itertools
import
chain
class
MessageRaceErrorAnyTag
(
ErrorGenerator
):
# TODO do we need to generate it for all combinations of send and recv?
def
__init__
(
self
):
pass
def
get_num_errors
(
self
):
# send + receive = only check the first two functions
return
1
# the number of errors to produce in the extended mode (all possible combinations)
def
get_num_errors_extended
(
self
):
return
1
def
get_feature
(
self
):
return
[
"
P2P
"
]
def
generate
(
self
,
i
):
tm
=
TemplateManager
()
tm
.
set_description
(
"
MsgRace-ANY_TAG
"
,
"
order of messages is indeterministic, may lead to a deadlock
"
)
b
=
InstructionBlock
(
"
alloc
"
)
b
.
register_operation
(
CorrectParameterFactory
().
get_buffer_alloc
())
tm
.
register_instruction_block
(
b
)
b
=
InstructionBlock
(
"
MPICALL
"
)
# send part
b
.
register_operation
(
"
for(int i =0; i < 10; ++i) {
"
,
kind
=
1
)
b
.
register_operation
(
"
buf[0]=i;
"
,
kind
=
1
)
send_call
=
CorrectMPICallFactory
().
mpi_send
()
send_call
.
set_arg
(
"
tag
"
,
"
i
"
)
b
.
register_operation
(
send_call
,
kind
=
1
)
b
.
register_operation
(
"
}
"
,
kind
=
1
)
# recv part
b
.
register_operation
(
"
for(int i =0; i < 10; ++i) {
"
,
kind
=
0
)
recv_call
=
CorrectMPICallFactory
().
mpi_recv
()
recv_call
.
set_arg
(
"
tag
"
,
"
MPI_ANY_TAG
"
)
b
.
register_operation
(
recv_call
,
kind
=
0
)
b
.
register_operation
(
"
if(buf[0]!=i){
"
,
kind
=
0
)
additional_recv
=
CorrectMPICallFactory
().
mpi_recv
()
additional_recv
.
set_has_error
()
# additional recv leads to deadlock
b
.
register_operation
(
additional_recv
,
kind
=
0
)
b
.
register_operation
(
"
}
"
,
kind
=
0
)
# end if
b
.
register_operation
(
"
}
"
,
kind
=
0
)
# end for
tm
.
register_instruction_block
(
b
)
b
=
InstructionBlock
(
"
free
"
)
b
.
register_operation
(
CorrectParameterFactory
().
get_buffer_free
())
tm
.
register_instruction_block
(
b
)
return
tm
class
MessageRaceErrorAnysource
(
ErrorGenerator
):
# TODO do we need to generate it for all combinations of send and recv?
def
__init__
(
self
):
pass
def
get_num_errors
(
self
):
# send + receive = only check the first two functions
return
1
# the number of errors to produce in the extended mode (all possible combinations)
def
get_num_errors_extended
(
self
):
return
1
def
get_feature
(
self
):
return
[
"
P2P
"
]
def
generate
(
self
,
i
):
tm
=
TemplateManager
(
min_ranks
=
3
)
tm
.
set_description
(
"
MsgRace-ANY_SOURCE
"
,
"
order of messages is indeterministic, may lead to a deadlock
"
)
b
=
InstructionBlock
(
"
alloc
"
)
b
.
register_operation
(
CorrectParameterFactory
().
get_buffer_alloc
())
tm
.
register_instruction_block
(
b
)
b
=
InstructionBlock
(
"
MPICALL
"
)
# send part
b
.
register_operation
(
"
buf[0]=rank;
"
,
kind
=
'
not0
'
)
send_call
=
CorrectMPICallFactory
().
mpi_send
()
b
.
register_operation
(
send_call
,
kind
=
'
not0
'
)
# recv part
b
.
register_operation
(
"
for(int i =1; i < nprocs; ++i) {
"
,
kind
=
0
)
recv_call
=
CorrectMPICallFactory
().
mpi_recv
()
recv_call
.
set_arg
(
"
source
"
,
"
MPI_ANY_SOURCE
"
)
b
.
register_operation
(
recv_call
,
kind
=
0
)
b
.
register_operation
(
"
if(buf[0]!=i){
"
,
kind
=
0
)
additional_recv
=
CorrectMPICallFactory
().
mpi_recv
()
additional_recv
.
set_has_error
()
# additional recv leads to deadlock
b
.
register_operation
(
additional_recv
,
kind
=
0
)
b
.
register_operation
(
"
}
"
,
kind
=
0
)
# end if
b
.
register_operation
(
"
}
"
,
kind
=
0
)
# end for
tm
.
register_instruction_block
(
b
)
b
=
InstructionBlock
(
"
free
"
)
b
.
register_operation
(
CorrectParameterFactory
().
get_buffer_free
())
tm
.
register_instruction_block
(
b
)
return
tm
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