Skip to content
Snippets Groups Projects
Commit 20529ba7 authored by Jammer, Tim's avatar Jammer, Tim
Browse files

change generation of header

parent 033d4322
Branches
No related tags found
No related merge requests found
......@@ -21,6 +21,9 @@ class Instruction(object):
def set_has_error(self, has_error: bool = True):
self._has_error = has_error
def has_error(self):
return self._has_error
def get_identifier(self) -> str:
return self._identifier
......
......@@ -7,13 +7,7 @@ from scripts.Infrastructure.Instruction import Instruction
from scripts.Infrastructure.MPICall import MPICall
from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory
template = """// @{generatedby}@
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: @{desc}@
Version of MPI: @{version}@
"""
THIS BLOCK IS CURRENTLY NOT USED:
BEGIN_MPI_FEATURES
P2P!basic: @{p2pfeature}@
......@@ -25,6 +19,13 @@ BEGIN_MPI_FEATURES
COLL!tools: Yes
RMA: Lacking
END_MPI_FEATURES
"""
template = """/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: @{desc}@
Version of MPI: @{version}@
BEGIN_MBB_TESTS
$ mpirun -np @{min_num_ranks}@ ${EXE}
......@@ -123,6 +124,16 @@ class TemplateManager:
code_string = ""
current_rank = 'all'
has_error = False
for i in self._instructions:
if i.has_error():
has_error = True
short_short_descr = self._descr_short.split("-")[0]
outcome_str = "OK"
if has_error:
outcome_str = "ERROR " + short_short_descr
instr_copy = []
if self._allow_reorder:
# "bucket-sort" the instructions to group those from different ranks together
......@@ -186,10 +197,12 @@ class TemplateManager:
return (template
.replace("@{min_num_ranks}@", str(self._min_ranks))
.replace("@{outcome}@", outcome_str)
.replace("@{stack_vars}@", stack_vars_str)
.replace("@{mpi_init}@", init_string)
.replace("@{mpi_finalize}@", finalize_string)
.replace("@{desc}@", self._descr_full)
.replace("@{errormsg}@", self._descr_short)
.replace("@{version}@", version)
.replace("@{test_code}@", code_string))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment