Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status CLI: fix speed measurement #6442

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get_horizons_data(reductions_file):
mA = horizon_params["AhA ChristodoulouMass"].iloc[0]
mB = horizon_params["AhB ChristodoulouMass"].iloc[0]
if "AhA DimensionfulSpinVector_x" in horizon_params.columns:
sA = np.concat(
sA = np.array(
Comment on lines 156 to +157
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the test not have caught this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test doesn't write spins to file atm

[horizon_params.index]
+ [
horizon_params[f"AhA DimensionfulSpinVector_{xyz}"]
Expand Down
6 changes: 3 additions & 3 deletions tests/tools/Test_Status.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ def tearDown(self):
def test_evolution_status(self):
executable_status = match_executable_status("EvolveSomething")
status = executable_status.status(self.input_file, self.work_dir)
self.assertEqual(status, {"Time": 2.0, "Speed": 2640.0})
self.assertEqual(status, {"Time": 2.0, "Speed": 2400.0})
self.assertEqual(executable_status.format("Time", 1.5), "1.5")
self.assertEqual(executable_status.format("Speed", 1.2), "1.2")

def test_evolve_bbh_status(self):
executable_status = match_executable_status("EvolveGhBinaryBlackHole")
status = executable_status.status(self.input_file, self.work_dir)
self.assertEqual(status["Time"], 2.0)
self.assertEqual(status["Speed"], 2640.0)
self.assertEqual(status["Speed"], 2400.0)
self.assertEqual(status["Orbits"], 0.5)
self.assertEqual(status["Separation"], 2.0)
self.assertEqual(status["3-Index Constraint"], 1.0e-4)
Expand All @@ -137,7 +137,7 @@ def test_evolve_single_bh_status(self):
executable_status = match_executable_status("EvolveGhSingleBlackHole")
status = executable_status.status(self.input_file, self.work_dir)
self.assertEqual(status["Time"], 2.0)
self.assertEqual(status["Speed"], 2640.0)
self.assertEqual(status["Speed"], 2400.0)
self.assertEqual(status["Constraint Energy"], 1.0e-3)

def test_elliptic_status(self):
Expand Down
30 changes: 11 additions & 19 deletions tools/Status/ExecutableStatus/ExecutableStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,11 @@ def time_status(
)
time_window = time_steps[time_steps["Time"] >= start_time]
dt_sim = time_window.iloc[-1]["Time"] - time_window.iloc[0]["Time"]
dt_wall_min = (
time_window.iloc[-1]["Minimum Walltime"]
- time_window.iloc[0]["Minimum Walltime"]
)
dt_wall_max = (
dt_wall = (
time_window.iloc[-1]["Maximum Walltime"]
- time_window.iloc[0]["Maximum Walltime"]
)
speed = (
(dt_sim / dt_wall_min + dt_sim / dt_wall_max)
/ 2.0
* 60.0
* 60.0
)
speed = dt_sim / dt_wall * 3600.0
result["Speed"] = speed
except:
logger.debug("Unable to estimate simulation speed.", exc_info=True)
Expand Down Expand Up @@ -265,15 +256,16 @@ def get_time_steps(reductions_file):
)
st.plotly_chart(fig)
run_speed = (
(
time_steps.index.diff() / time_steps["Maximum Walltime"].diff()
+ time_steps.index.diff()
/ time_steps["Minimum Walltime"].diff()
)
/ 2
* 3600
)
time_steps.index.diff() / time_steps["Maximum Walltime"].diff()
) * 3600
fig = px.line(run_speed.rolling(30, min_periods=1).mean())
fig.add_scatter(
x=run_speed.index,
y=run_speed,
mode="lines",
opacity=0.5,
name="Instantaneous speed",
)
fig.update_layout(
xaxis_title="Time [M]",
yaxis_title="Simulation speed [M/h]",
Expand Down
Loading