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

Benchmark/Accelerate total calculations #12

Open
erwanp opened this issue Aug 13, 2021 · 0 comments
Open

Benchmark/Accelerate total calculations #12

erwanp opened this issue Aug 13, 2021 · 0 comments
Labels

Comments

@erwanp
Copy link
Member

erwanp commented Aug 13, 2021

An example based on @BlehMaks 's test case . I use print_perf_profile for each slab, scaled on the max of all spectra.

for s in slabsTool.slabs.values(): 
    s.print_perf_profile(precision=int(16*s.conditions["calculation_time"]/max([si.conditions["calculation_time"] for si in slabsTool.slabs.values()])))

I get:

slbPlasmaCO2 profiler :
    spectrum_calculation      0.908s ████████████████
        check_line_databank             0.000s 
        check_non_eq_param              0.000s 
        reinitialize                    0.036s 
            copy_database                   0.036s 
            memory_usage_warning            0.000s 
            reset_population                0.000s 
        calc_noneq_population           0.645s ███████████
            part_function                   0.363s ██████
            others                          0.282s ████
        scaled_non_eq_linestrength      0.006s 
            map_part_func                   0.002s 
            corrected_population_se         0.004s 
        calc_emission_integral          0.018s 
        calc_lineshift                  0.001s 
        calc_hwhm                       0.015s 
        generate_wavenumber_arrays      0.001s 
        calc_line_broadening            0.164s ██
            precompute_DLM_lineshapes       0.008s 
            DLM_Initialized_vectors         0.000s 
            DLM_closest_matching_line       0.009s 
            DLM_Distribute_lines            0.007s 
            DLM_convolve                    0.140s ██
        calc_other_spectral_quan        0.004s 
        generate_spectrum_obj           0.001s 
        others                          0.299s █████
slbPlasmaCO profiler :
    spectrum_calculation      0.188s ███
        check_line_databank             0.000s 
        check_non_eq_param              0.001s 
        reinitialize                    0.008s 
            copy_database                   0.005s 
            memory_usage_warning            0.003s 
            reset_population                0.000s 
        calc_noneq_population           0.032s 
            part_function                   0.017s 
            others                          0.015s 
        scaled_non_eq_linestrength      0.003s 
            map_part_func                   0.000s 
            corrected_population_se         0.003s 
        calc_emission_integral          0.012s 
        calc_lineshift                  0.001s 
        calc_hwhm                       0.012s 
        generate_wavenumber_arrays      0.001s 
        calc_line_broadening            0.105s █
            precompute_DLM_lineshapes       0.005s 
            DLM_Initialized_vectors         0.000s 
            DLM_closest_matching_line       0.001s 
            DLM_Distribute_lines            0.001s 
            DLM_convolve                    0.097s █
            others                          0.001s 
        calc_other_spectral_quan        0.004s 
        generate_spectrum_obj           0.001s 
        others                          0.025s 
slbShellCO2 profiler :
    spectrum_calculation      0.159s ██
        check_line_databank             0.001s 
        reinitialize                    0.032s 
            copy_database                   0.029s 
            memory_usage_warning            0.003s 
            reset_population                0.000s 
        scaled_eq_linestrength          0.007s 
        calc_lineshift                  0.000s 
        calc_hwhm                       0.015s 
        generate_wavenumber_arrays      0.001s 
        calc_line_broadening            0.088s █
            precompute_DLM_lineshapes       0.008s 
            DLM_Initialized_vectors         0.000s 
            DLM_closest_matching_line       0.005s 
            DLM_Distribute_lines            0.003s 
            DLM_convolve                    0.071s 
            others                          0.001s 
        calc_other_spectral_quan        0.002s 
        generate_spectrum_obj           0.000s 
        others                          0.014s 
slbShellCO profiler :
    spectrum_calculation      0.099s █
        check_line_databank             0.000s 
        reinitialize                    0.005s 
            copy_database                   0.002s 
            memory_usage_warning            0.003s 
            reset_population                0.000s 
        scaled_eq_linestrength          0.003s 
        calc_lineshift                  0.001s 
        calc_hwhm                       0.022s 
        generate_wavenumber_arrays      0.002s 
        calc_line_broadening            0.052s 
            precompute_DLM_lineshapes       0.004s 
            DLM_Initialized_vectors         0.000s 
            DLM_closest_matching_line       0.000s 
            DLM_Distribute_lines            0.001s 
            DLM_convolve                    0.045s 
            others                          0.002s 
        calc_other_spectral_quan        0.001s 
        generate_spectrum_obj           0.001s 
        others                          0.014s 
slbRoomCO2 profiler :
    spectrum_calculation      0.151s ██
        check_line_databank             0.001s 
        reinitialize                    0.035s 
            copy_database                   0.032s 
            memory_usage_warning            0.003s 
            reset_population                0.000s 
        scaled_eq_linestrength          0.005s 
        calc_lineshift                  0.001s 
        calc_hwhm                       0.015s 
        generate_wavenumber_arrays      0.001s 
        calc_line_broadening            0.083s █
            precompute_DLM_lineshapes       0.009s 
            DLM_Initialized_vectors         0.000s 
            DLM_closest_matching_line       0.004s 
            DLM_Distribute_lines            0.003s 
            DLM_convolve                    0.067s 
        calc_other_spectral_quan        0.003s 
        generate_spectrum_obj           0.001s 
        others                          0.006s 

So here more than half of the computation time is spent on calculation non-eq . Can be improved by activating parsum_mode='tabulation' radis/radis#316 if not stuck on Windows (radis/radis#338)

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

1 participant