Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-gdt
Commits
456b69a4
Unverified
Commit
456b69a4
authored
8 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[cmake] adds prototype work dist script
parent
3a7b3de0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/scripts/distribute_testing.py
+74
-0
74 additions, 0 deletions
cmake/scripts/distribute_testing.py
dune/gdt/test/CMakeLists.txt
+4
-10
4 additions, 10 deletions
dune/gdt/test/CMakeLists.txt
with
78 additions
and
10 deletions
cmake/scripts/distribute_testing.py
0 → 100644
+
74
−
0
View file @
456b69a4
#!/usr/bin/env python3
import
os
import
pickle
import
sys
from
pprint
import
pprint
import
subprocess
import
time
from
contextlib
import
contextmanager
import
binpacking
MAXTIME
=
45
*
60
pickle_file
=
'
totals.pickle
'
@contextmanager
def
elapsed_timer
():
clock
=
time
.
time
start
=
clock
()
elapser
=
lambda
:
clock
()
-
start
yield
lambda
:
elapser
()
end
=
clock
()
elapser
=
lambda
:
end
-
start
def
redo_timings
(
argv
):
builddir
=
argv
[
1
]
builder_count
=
argv
[
2
]
binaries
=
argv
[
3
].
split
(
'
;
'
)
# list comes with a leading empty entry
testnames
=
argv
[
4
].
split
(
'
/
'
)[
1
:]
os
.
chdir
(
builddir
)
compiles
=
{}
testtimes
=
{}
testlimit
=
-
1
binaries
=
binaries
[:
testlimit
]
testnames
=
testnames
[:
testlimit
]
totals
=
{}
for
binary
in
binaries
:
with
elapsed_timer
()
as
timer
:
subprocess
.
check_call
([
'
ninja
'
,
'
-j1
'
,
binary
])
compiles
[
binary
]
=
timer
()
totals
[
binary
]
=
compiles
[
binary
]
for
binary
,
teststrings
in
zip
(
binaries
,
testnames
):
testtimes
[
binary
]
=
0
pprint
(
teststrings
.
split
(
'
/
'
))
for
test
in
teststrings
.
split
(
'
/
'
):
with
elapsed_timer
()
as
timer
:
subprocess
.
check_call
([
'
ctest
'
,
'
-j1
'
,
'
-R
'
,
test
])
testtimes
[
binary
]
+=
timer
()
totals
[
binary
]
=
testtimes
[
binary
]
print
(
'
compiles
'
)
pprint
(
compiles
)
print
(
'
testtimes
'
)
pprint
(
testtimes
)
print
(
'
totals
'
)
pprint
(
totals
)
pickle
.
dump
(
totals
,
open
(
os
.
path
.
join
(
builddir
,
pickle_file
),
'
wb
'
))
return
totals
try
:
builddir
=
sys
.
argv
[
1
]
totals
=
pickle
.
load
(
open
(
os
.
path
.
join
(
builddir
,
pickle_file
),
'
rb
'
))
except
FileNotFoundError
:
totals
=
redo_timings
(
sys
.
argv
)
b
=
list
(
totals
.
values
())
bins
=
binpacking
.
to_constant_volume
(
b
,
MAXTIME
)
pprint
(
bins
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dune/gdt/test/CMakeLists.txt
+
4
−
10
View file @
456b69a4
...
...
@@ -17,18 +17,12 @@ set(DXT_TRAVIS_BUILDER 18)
set
(
current_idx 0
)
foreach
(
target
${
dxt_test_binaries
}
)
math
(
EXPR list_idx
"
${
current_idx
}
%
${
DXT_TRAVIS_BUILDER
}
"
)
list
(
APPEND test_names_numbered_
${
list_idx
}
${
target
}
)
foreach
(
testname
${
dxt_test_names_
${
target
}}
)
set_tests_properties
(
${
testname
}
PROPERTIES LABELS
"builder_
${
list_idx
}
"
)
endforeach
()
MATH
(
EXPR current_idx
"
${
current_idx
}
+1"
)
set
(
all_sorted_testnames
"
${
all_sorted_testnames
}
/
${
dxt_test_names_
${
target
}}
"
)
endforeach
(
target
${
dxt_test_binaries
}
)
# message(STATUS "LL ${all_sorted_testnames}")
MATH
(
EXPR max_idx
"
${
DXT_TRAVIS_BUILDER
}
-1"
)
foreach
(
idx RANGE 0
${
max_idx
}
1
)
add_custom_target
(
test_binaries_builder_
${
idx
}
DEPENDS
${
test_names_numbered_
${
idx
}}
)
endforeach
(
idx RANGE 0
${
max_idx
}
1
)
add_custom_target
(
refresh_test_timings python3
${
CMAKE_SOURCE_DIR
}
/cmake/scripts/distribute_testing.py
"
${
CMAKE_BINARY_DIR
}
"
${
DXT_TRAVIS_BUILDER
}
"
${
dxt_test_binaries
}
"
"
${
all_sorted_testnames
}
"
VERBATIM
)
# link spe10 data file if present
if
(
NOT
${
SPE10MODEL1DATA
}
STREQUAL
"SPE10MODEL1DATA-NOTFOUND"
)
...
...
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