Skip to content

Commit f236838

Browse files
authored
lammps-migration-net: add migration + compute and network bound benchmark (#26)
* lammps: add migration + network bound benchmark * nits: run python format
1 parent 2ad15f2 commit f236838

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

.github/workflows/tests.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
run: ./bin/inv_wrapper.sh lammps lammps --native
8989
- name: "Build LAMMPS with migration"
9090
run: ./bin/inv_wrapper.sh lammps --migration lammps --native --migration
91+
- name: "Build LAMMPS with migration and network phase"
92+
run: ./bin/inv_wrapper.sh lammps --migration-net lammps --native --migration-net
9193
- name: "Build Lulesh"
9294
run: ./bin/inv_wrapper.sh lulesh lulesh --native
9395
- name: "Build TensorFlow"
@@ -131,7 +133,7 @@ jobs:
131133
env:
132134
CONAN_CACHE_MOUNT_SOURCE: ~/.conan
133135
FAASM_INI_FILE: ./faasm.ini
134-
FAASM_VERSION: 0.17.0
136+
FAASM_VERSION: 0.20.1
135137
FAASM_WASM_VM: ${{ matrix.faasm_wasm_vm }}
136138
steps:
137139
- uses: csegarragonz/set-compose-version-action@main
@@ -262,6 +264,9 @@ jobs:
262264
- name: "Run LAMMPS migration binary"
263265
timeout-minutes: 1
264266
run: faasmctl invoke lammps migration --cmdline '-in faasm://lammps-data/in.controller.wall' --mpi-world-size 4 --input-data '1 2'
267+
- name: "Run LAMMPS migration-net binary"
268+
timeout-minutes: 1
269+
run: faasmctl invoke lammps migration-net --cmdline '-in faasm://lammps-data/in.controller.wall' --mpi-world-size 4 --input-data '1 2'
265270
# 08/12/2023 - LULESH is broken with a memory leak
266271
# - name: "Run LULESH"
267272
# timeout-minutes: 1

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@
3939
[submodule "examples/polybench"]
4040
path = examples/polybench
4141
url = https://github.com/faasm/polybench.git
42+
[submodule "examples/lammps-migration-net"]
43+
path = examples/lammps-migration-net
44+
url = https://github.com/faasm/lammps.git
45+
branch = faasm-migration-net

examples/lammps-migration-net

Submodule lammps-migration-net added at cc66496

tasks/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def cli(ctx, service, clean=False):
4646
"EXAMPLES_BUILD_VERSION": get_version(),
4747
}
4848
)
49-
docker_cmd = "docker compose up -d --no-recreate"
49+
docker_cmd = "docker compose up -d --no-recreate {}".format(service)
5050
run(docker_cmd, shell=True, check=True, cwd=PROJ_ROOT, env=build_env)
5151

5252
docker_cmd = "docker compose exec -it {} bash".format(service)

tasks/lammps.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212

1313
@task(default=True)
14-
def build(ctx, clean=False, native=False, migration=False):
14+
def build(
15+
ctx, clean=False, native=False, migration=False, migration_net=False
16+
):
1517
"""
1618
Build the LAMMPS molecule dynamics simulator.
1719
@@ -21,6 +23,8 @@ def build(ctx, clean=False, native=False, migration=False):
2123
"""
2224
if migration:
2325
lammps_dir = join(EXAMPLES_DIR, "lammps-migration")
26+
if migration_net:
27+
lammps_dir = join(EXAMPLES_DIR, "lammps-migration-net")
2428
else:
2529
lammps_dir = join(EXAMPLES_DIR, "lammps")
2630
cmake_dir = join(lammps_dir, "cmake")
@@ -80,8 +84,13 @@ def build(ctx, clean=False, native=False, migration=False):
8084
)
8185

8286
if not native:
83-
# Copy the binary to lammps/main/function.wasm
84-
lammps_func_name = "migration" if migration else "main"
87+
# Copy the binary to lammps/main/function.wasm`
88+
if migration:
89+
lammps_func_name = "migration"
90+
elif migration_net:
91+
lammps_func_name = "migration-net"
92+
else:
93+
lammps_func_name = "main"
8594
lammps_func = join(build_dir, "lmp")
8695

8796
if in_docker():

tasks/util.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ def run_docker_build_cmd(cmd_list, cwd=None, env=None):
4343
docker_cmd = [
4444
"docker exec",
4545
"--workdir {}".format(cwd) if cwd is not None else "",
46-
" ".join(['--env {}="{}"'.format(k, env[k]) for k in env])
47-
if env is not None
48-
else "",
46+
(
47+
" ".join(['--env {}="{}"'.format(k, env[k]) for k in env])
48+
if env is not None
49+
else ""
50+
),
4951
EXAMPLES_BUILD_IMAGE_CTR,
5052
cmd,
5153
]

0 commit comments

Comments
 (0)