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

print more timing statistics #927

Merged
merged 2 commits into from
Jun 21, 2019
Merged

print more timing statistics #927

merged 2 commits into from
Jun 21, 2019

Conversation

stevengj
Copy link
Collaborator

Closes #924.

@stevengj
Copy link
Collaborator Author

Would be nice to verify that the standard deviation of the timing is related to load balancing.

For example, you could try running the benchmark in #681, where we know that split_by_cost improved the load balancing compared to split_by_effort, and verify that the timing variance goes down as well for split_by_cost.

@oskooi
Copy link
Collaborator

oskooi commented Jun 20, 2019

This seems to be working but the results for split_by_cost and split_by_effort are swapped which might indicate that there is a bug in the split_chunks_evenly parameter of the Simulation object that is mixing up the boolean values (i.e., split_chunks_evenly=True actually corresponds to split_by_cost rather than split_by_effort).

Running the unmodified example in #681 for the two cases and plotting the results (just the time-stepping portion of the simulation) is shown below.

split_by_effort

$ for n in `seq 4`; do mpirun -n ${n} python tall_skinny_cell_3d.py -e |grep "time stepping"; done
            time stepping: 1.68271 s
            time stepping: 0.966419 s +/- 0.00839127 s
            time stepping: 0.675613 s +/- 0.0180802 s
            time stepping: 0.553308 s +/- 0.0140741 s

split_by_cost

$ for n in `seq 4`; do mpirun -n ${n} python tall_skinny_cell_3d.py |grep "time stepping"; done
            time stepping: 1.68216 s
            time stepping: 1.57454 s +/- 0.0353577 s
            time stepping: 1.6826 s +/- 0.0899637 s
            time stepping: 1.73653 s +/- 0.0841767 s

time_split_cost_even

Note that the magnitude of the error bars for the "split_by_effort" case is smaller than those for "split_by_cost" which is expected if the results are swapped.

@stevengj
Copy link
Collaborator Author

stevengj commented Jun 21, 2019

Anyway, it seems like the variance is doing what it is supposed to: it is larger in the case with poorer load-balancing.

The surprise here is that split_by_cost is worse load-balancing, but that seems like a separate issue.

@stevengj stevengj merged commit c63a631 into master Jun 21, 2019
@stevengj stevengj deleted the timestats branch June 21, 2019 17:59
for (int i = 0; i <= Other; ++i) {
mean[i] /= n;
stddev[i] -= n*mean[i]*mean[i];
stddev[i] = n == 1 || stddev[i] <= 0 ? 0.0 : sqrt(stddev[i] / (n-1));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note that this is computing stddev = ∑(xᵢ-x̄)² / (n-1) = (∑xᵢ² - nx̄²) / (n-1)

@stevengj stevengj mentioned this pull request Jun 21, 2019
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* print more timing statistics

* whoops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

print more timing info
2 participants