Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Melson
frss
Commits
ee94e22a
Commit
ee94e22a
authored
Feb 3, 2022
by
Tobias Melson
Browse files
Options
Downloads
Patches
Plain Diff
Parse and check test output
parent
0849fe74
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#121524
failed
Feb 3, 2022
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+2
-1
2 additions, 1 deletion
.gitlab-ci.yml
check_test_output.py
+40
-0
40 additions, 0 deletions
check_test_output.py
test.f90
+1
-1
1 addition, 1 deletion
test.f90
with
43 additions
and
2 deletions
.gitlab-ci.yml
+
2
−
1
View file @
ee94e22a
...
@@ -7,6 +7,7 @@ before_script:
...
@@ -7,6 +7,7 @@ before_script:
-
module purge
-
module purge
-
module load intel/21.3.0
-
module load intel/21.3.0
-
module load impi/2021.3
-
module load impi/2021.3
-
module load anaconda/3
build_lib
:
build_lib
:
tags
:
tags
:
...
@@ -15,4 +16,4 @@ build_lib:
...
@@ -15,4 +16,4 @@ build_lib:
-
make clean
-
make clean
-
make
-
make
-
make test
-
make test
-
mpiexec -n 1 ./test.x
-
mpiexec -n 1 ./test.x
| ./check_test_output.py
This diff is collapsed.
Click to expand it.
check_test_output.py
0 → 100755
+
40
−
0
View file @
ee94e22a
#!/usr/bin/env python3
import
sys
import
re
def
expect_non_mpi
(
line
):
assert
(
line
.
startswith
(
'
RSS:
'
))
def
expect_mpi
(
line
):
assert
(
line
.
startswith
(
'
MPI rank: 0
'
))
def
convert_int
(
mem
):
return
int
(
mem
.
rstrip
(
'
M
'
))
def
extract_mem
(
line
):
pattern
=
re
.
compile
(
'
[1-9][0-9]*M
'
)
matches
=
re
.
findall
(
pattern
,
line
)
assert
(
len
(
matches
)
==
2
)
return
convert_int
(
matches
[
0
]),
convert_int
(
matches
[
1
])
def
assert_approx
(
value1
,
value2
):
assert
(
abs
(
value2
-
value1
)
<=
1
)
lines
=
sys
.
stdin
.
readlines
()
expect_non_mpi
(
lines
[
0
])
for
line
in
lines
[
1
:]:
expect_mpi
(
line
)
rss0
,
hwm0
=
extract_mem
(
lines
[
1
])
assert
(
hwm0
==
rss0
)
rss1
,
hwm1
=
extract_mem
(
lines
[
2
])
assert
(
hwm1
==
rss1
)
assert_approx
(
rss1
,
rss0
+
100
)
rss2
,
hwm2
=
extract_mem
(
lines
[
3
])
assert_approx
(
rss2
,
rss0
)
assert
(
hwm2
==
hwm1
)
This diff is collapsed.
Click to expand it.
test.f90
+
1
−
1
View file @
ee94e22a
...
@@ -10,7 +10,7 @@ program test
...
@@ -10,7 +10,7 @@ program test
call
frss_print_rank
(
0
)
call
frss_print_rank
(
0
)
allocate
(
array
(
1
0000000
))
allocate
(
array
(
1
3107200
))
! 100M
array
(:)
=
0.d0
array
(:)
=
0.d0
call
frss_print
()
call
frss_print
()
...
...
...
...
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
sign in
to comment