Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
datascience
balsamDEPRECATED
Commits
6246d7ee
Commit
6246d7ee
authored
Feb 02, 2018
by
Michael Salim
Browse files
insert benchmark: run dummy mpi4py/balsam prior to experiment
parent
213b886f
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/benchmarks/bench_insertion.py
View file @
6246d7ee
...
...
@@ -20,8 +20,24 @@ class TestInsertion(BalsamTestCase):
max_workers
=
self
.
launcherInfo
.
num_workers
worker_counts
=
takewhile
(
lambda
x
:
x
<=
max_workers
,
(
2
**
i
for
i
in
range
(
20
)))
ranks_per_node
=
[
4
,
8
,
16
,
32
]
self
.
experiments
=
list
(
reversed
(
list
(
product
(
worker_counts
,
ranks_per_node
))))
#ranks_per_node = [4, 8, 16, 32]
ranks_per_node
=
[
32
]
self
.
experiments
=
product
(
worker_counts
,
ranks_per_node
)
# Load mpi4py/Balsam on compute nodes prior to experiments
hello
=
find_spec
(
"tests.benchmarks.concurrent_insert.hello"
).
origin
python
=
sys
.
executable
app_cmd
=
f
"
{
python
}
{
hello
}
"
mpi_str
=
self
.
launcherInfo
.
mpi_cmd
(
self
.
launcherInfo
.
workerGroup
.
workers
,
app_cmd
=
app_cmd
,
envs
=
{},
num_ranks
=
max_workers
,
ranks_per_node
=
1
,
threads_per_rank
=
1
,
threads_per_core
=
1
)
stdout
,
elapsed_time
=
util
.
cmdline
(
mpi_str
)
def
test_concurrent_mpi_insert
(
self
):
'''Timing: many MPI ranks simultaneously call dag.add_job'''
...
...
@@ -56,8 +72,7 @@ class TestInsertion(BalsamTestCase):
threads_per_rank
=
1
,
threads_per_core
=
1
)
cmdline
=
f
"time -p (
{
mpi_str
}
)"
stdout
,
elapsed_time
=
util
.
cmdline
(
cmdline
)
stdout
,
elapsed_time
=
util
.
cmdline
(
mpi_str
)
success
=
list
(
l
for
l
in
stdout
.
split
(
'
\n
'
)
if
'added job: success'
in
l
)
self
.
assertEqual
(
len
(
success
),
total_ranks
)
...
...
tests/benchmarks/concurrent_insert/hello.py
View file @
6246d7ee
print
(
"hello world"
)
from
mpi4py
import
MPI
import
balsam.launcher.dag
as
dag
comm
=
MPI
.
COMM_WORLD
rank
=
comm
.
Get_rank
()
count
=
dag
.
BalsamJob
.
objects
.
all
().
count
()
print
(
"Hello from {rank}, Jobs count is {count}"
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment