-
Notifications
You must be signed in to change notification settings - Fork 631
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
slow initialization of prism objects with large number of vertices #1271
Comments
The performance bottleneck is due to subpixel smoothing which even though it is parallelized (as mentioned in Features/Subpixel Smoothing) is still performance constrained by the one chunk in the cell division which contains the most interface pixels. To verify this feature, we time the calls to Line 434 in fb58a86
using: double start_time = wall_time();
set_epsilon(mat, use_anisotropic_averaging, tol, maxeval);
printf("set_epsilon:, %d, %g s\n",my_rank(),wall_time()-start_time); The times for
Currently, because only the master process outputs its wall-clock time for Line 459 in fb58a86
It might be helpful to print the max and min times for |
I think the issue is that the algorithms we are currently using to test whether a point is in a prism etcetera scale linearly with the number of vertices. There might be faster algorithms, although they may require fancier data structures. We could put an |
For a 3d test case involving multiple
Prism
objects containing a total of 500+ vertices with subpixel smoothing and equal-chunk splitting, themeep_geom::set_materials_from_geometry
call inpython/meep.i
dominates the wall-clock time (> 99%) forinit_sim()
:meep/python/meep.i
Lines 1646 to 1648 in fb58a86
(Originally in #1255, we had thought that the performance bottleneck was due to
meep_mpb_eps
insrc/mpb.cpp
which turned out not to be the case as shown in #1257:comment.)To demonstrate that
set_materials_from_geometry
is the bottleneck, we run a parallel simulation with 15 processors/chunks and timeall_wait()
calls before and after the call toset_materials_from_geometry
and also have each process print out how long it spent on this function.The output demonstrates that there is a large variation in the runtimes among the 15 processes (which is expected since only certain chunks intersect the
Prism
objects). The slowest (rank 0) and fastest (rank 11) processes have runtimes which vary by a factor of 355.(The total time for
init_sim()
which includes an eigenmode source is228.4403471946716 s
.)Is there anything that can be done to speed up
set_materials_from_geometry
for this use case?The text was updated successfully, but these errors were encountered: