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

Equation for computing remaining time during epsilon initialization is wrong #2694

Open
electroflow opened this issue Oct 31, 2023 · 1 comment
Labels

Comments

@electroflow
Copy link

Thank you for your amazing software package. It is no big issue but I am always a bit irritated when seeing the progress estimates when running meep e.g.

subpixel-averaging is 6.68749% done, 55.8381 s remaining
subpixel-averaging is 12.2589% done, 28.6371 s remaining
subpixel-averaging is 17.3983% done, 19.0087 s remaining
subpixel-averaging is 22.3127% done, 13.9325 s remaining
subpixel-averaging is 27.155% done, 10.7399 s remaining
subpixel-averaging is 31.8264% done, 8.57822 s remaining
subpixel-averaging is 36.3807% done, 7.00073 s remaining
subpixel-averaging is 40.8811% done, 5.78909 s remaining
subpixel-averaging is 45.3184% done, 4.82662 s remaining
subpixel-averaging is 49.7377% done, 4.04236 s remaining
subpixel-averaging is 54.1751% done, 3.38955 s remaining
subpixel-averaging is 58.4594% done, 2.84773 s remaining
subpixel-averaging is 62.9417% done, 2.35727 s remaining
subpixel-averaging is 67.2891% done, 1.9467 s remaining
subpixel-averaging is 71.8794% done, 1.56742 s remaining
subpixel-averaging is 76.7488% done, 1.21236 s remaining
subpixel-averaging is 81.4291% done, 0.913055 s remaining
subpixel-averaging is 86.4875% done, 0.62555 s remaining
subpixel-averaging is 91.9509% done, 0.350244 s remaining
subpixel-averaging is 98.1164% done, 0.0767999 s remaining

The reason the remaining time does not fall linearly as expected is equation

(npixels - ipixel) * (wall_time() - last_output_time) / ipixel);

I think it should be normalized not to ipixel but rather the amount of pixels since the last pixel. I think something like

    if (verbosity > 0 && (ipixel + 1) % 1000 == 0 &&
        wall_time() > last_output_time + MEEP_MIN_OUTPUT_TIME) {
      master_printf("%s is %g%% done, %g s remaining\n",
                    use_anisotropic_averaging ? "subpixel-averaging" : "grid initialization",
                    ipixel * 100.0 / npixels,
                    (npixels - ipixel) * (wall_time() - last_output_time) / (ipixel - last_ipixel));
      last_output_time = wall_time();
      last_ipixel = ipixel;
    }

might do the job.

@electroflow electroflow changed the title Equation for computing remaining time is wrong Equation for computing remaining time during epsilon initialization is wrong Oct 31, 2023
@stevengj
Copy link
Collaborator

Good catch. Could you submit a PR?

@stevengj stevengj added the bug label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants