Skip to content

Commit

Permalink
Merge 4f5374c into 5faa1f4
Browse files Browse the repository at this point in the history
  • Loading branch information
greole authored Jan 10, 2024
2 parents 5faa1f4 + 4f5374c commit f125f99
Show file tree
Hide file tree
Showing 906 changed files with 169,788 additions and 76 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build-job-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
- name: Run obr script
run: |
cd LidDrivenCavity3D
python -m signac migrate -y
obr apply --file ../scripts/postProcessLogs.py --campaign ${{env.CAMPAIGN}}
- name: Run obr script
Expand All @@ -62,7 +63,7 @@ jobs:
- name: Create Plots
run: |
cd LidDrivenCavity3D/
python3 assets/plot.py
python3 assets/plot.py ${{env.CAMPAIGN}}
echo "# Plots" >> overview.md
echo "![Test Image 6](https://github.com/exasim-project/benchmark_data/blob/${GITHUB_HEAD_REF}/LidDrivenCavity3D/postProcessing/${{env.CAMPAIGN}}/unpreconditioned_TimeStep_over_nCells_c=nProcs_s=solver_p_cols=Host.png?raw=true)" >> overview.md
Expand All @@ -80,17 +81,6 @@ jobs:
git add postProcessing/${{env.CAMPAIGN}}
git commit --allow-empty -m "add campaign results"
# - name: Upload plots
# uses: actions/github-script@v6
# with:
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: `![Test Image 6](https://github.com/exasim-project/benchmark_data/blob/${env.GITHUB_HEAD_REF}/LidDrivenCavity3D/postProcessing/${env.CAMPAIGN}/unpreconditioned_TimeStep_over_nCells_c=nProcs_s=solver_p_cols=Host.png?raw=true)`
# })
- name: Push changes
uses: ad-m/github-push-action@master
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Merged [PR #5](https://github.com/exasim-project/benchmark_data/pull/5)
131 changes: 67 additions & 64 deletions LidDrivenCavity3D/assets/plot.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import sys
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import exasim_plot_helpers as eph

from pathlib import Path

script_dir = Path(__file__).parent
post_pro_dir = script_dir / "../postProcessing/ogl_170"
json_file = post_pro_dir / "results.json"
df = pd.read_json(json_file)


def plotter(
x, y, color, style, df, df_filter, size=None, col=None, log=None, plot_type="line"
x, y, color, style, df, df_filter, post_pro_dir, size=None, col=None, log=None, plot_type="line"
):
df = df_filter(df)

Expand Down Expand Up @@ -45,9 +40,6 @@ def __call__(self, df):
return self.func(df)


unprecond = lambda df: df[df["preconditioner"] == "none"]


def compute_speedup(df, bases, extra_filter=lambda df: df):
from copy import deepcopy

Expand All @@ -60,57 +52,68 @@ def compute_speedup(df, bases, extra_filter=lambda df: df):
return eph.helpers.compute_speedup(df_copy, bases, ignore_indices=[]).reset_index()



bases = [
{
"case": [
eph.helpers.DFQuery(idx="Host", val="nla"),
],
"base" : [
# TODO this needs to know nProcs beforehand
eph.helpers.DFQuery(idx="nProcs", val=32),
eph.helpers.DFQuery(idx="preconditioner", val="none"),
eph.helpers.DFQuery(idx="executor", val="CPU"),
]
},
{
"case": [
eph.helpers.DFQuery(idx="Host", val="hkn"),
],
"base" : [
# TODO this needs to know nProcs beforehand
eph.helpers.DFQuery(idx="nProcs", val=76),
eph.helpers.DFQuery(idx="preconditioner", val="none"),
eph.helpers.DFQuery(idx="executor", val="CPU"),
]
},
]


for x, c in [("nCells", "nProcs"), ("nProcs", "nCells")]:
for y in ["TimeStep", "SolveP"]:
plotter(
x=x,
y=y,
color=c,
style="solver_p",
plot_type="line",
col="Host",
log=True,
df=df,
df_filter=Df_filter("unpreconditioned", unprecond),
)

plotter(
x=x,
y=y,
color=c,
style="solver_p",
plot_type="line",
col="Host",
log=True,
df=df,
df_filter=Df_filter(
"unprecond_speedup", lambda df: compute_speedup(df, bases, unprecond)
),
)
def main(campaign):
script_dir = Path(__file__).parent
post_pro_dir = script_dir / "../postProcessing/{}".format(campaign)
json_file = post_pro_dir / "results.json"
df = pd.read_json(json_file)
unprecond = lambda df: df[df["preconditioner"] == "none"]

bases = [
{
"case": [
eph.helpers.DFQuery(idx="Host", val="nla"),
],
"base" : [
# TODO this needs to know nProcs beforehand
eph.helpers.DFQuery(idx="nProcs", val=32),
eph.helpers.DFQuery(idx="preconditioner", val="none"),
eph.helpers.DFQuery(idx="executor", val="CPU"),
]
},
{
"case": [
eph.helpers.DFQuery(idx="Host", val="hkn"),
],
"base" : [
# TODO this needs to know nProcs beforehand
eph.helpers.DFQuery(idx="nProcs", val=76),
eph.helpers.DFQuery(idx="preconditioner", val="none"),
eph.helpers.DFQuery(idx="executor", val="CPU"),
]
},
]


for x, c in [("nCells", "nProcs"), ("nProcs", "nCells")]:
for y in ["TimeStep", "SolveP"]:
plotter(
x=x,
y=y,
color=c,
style="solver_p",
post_pro_dir=post_pro_dir,
plot_type="line",
col="Host",
log=True,
df=df,
df_filter=Df_filter("unpreconditioned", unprecond),
)

# plotter(
# x=x,
# y=y,
# color=c,
# style="solver_p",
# post_pro_dir=post_pro_dir,
# plot_type="line",
# col="Host",
# log=True,
# df=df,
# df_filter=Df_filter(
# "unprecond_speedup", lambda df: compute_speedup(df, bases, unprecond)
# ),
# )

if __name__ == "__main__":
main(sys.argv[1])
Loading

0 comments on commit f125f99

Please sign in to comment.