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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: accelerate partition function calculations #550

Open
Rockyuo666 opened this issue Mar 19, 2023 · 4 comments
Open

馃殌 Feature: accelerate partition function calculations #550

Rockyuo666 opened this issue Mar 19, 2023 · 4 comments
Labels
enhancement New feature or request performance

Comments

@Rockyuo666
Copy link

馃敄 Feature description

How to accelerate the compute time when I use radis for multi spectrum calculating with different Tvib銆乀rot銆乵ole fraction and pressure? The time of Calculated nonequilibrium populations and Checked nonequilibrium parameters cost much time when running, How can I reduce its time.

馃憠 Why you want this feature!!

I want to use radis for multiprocessing computeing for different spectrum, but the time consuming is unacceptable.

@Rockyuo666 Rockyuo666 added the enhancement New feature or request label Mar 19, 2023
@erwanp
Copy link
Member

erwanp commented Mar 20, 2023

Hello! There can be two sources of performance cost :

  • fetching energies to augment the database for non LTE parameters
  • then partition functions will be the limiting factor in your case, because unlike under equilibrium they cannot be tabulated

Good news, we have already worked on this :

  • by using a SpectrumFactory for batch processing, the energies will be fetched only once
  • last year we implemented an "on the fly tabulation" of non equilibrium partitiob functions.

By using both batch processing non LTE spectra should be almost as fast as equilibrium.

I can't remember the commands top of my head, have a look into the docs, also see #316

@Rockyuo666
Copy link
Author

but why when I set persum_mode="tabulation",it reports error with:NotImplementedError

@erwanp erwanp changed the title 馃殌 Feature: 馃殌 Feature: accelerate partition function calculations Apr 6, 2023
@erwanp
Copy link
Member

erwanp commented Apr 6, 2023

Hello @Rockyuo666 can you share your input script ?

@minouHub
Copy link
Collaborator

minouHub commented May 7, 2023

@Rockyuo666, I tried the following example and it worked. Are you still having performance issues or bugs?

from radis import SpectrumFactory

wmin, wmax = 2383.8, 2384.9
sf = SpectrumFactory(wavenum_min=wmin,
                     wavenum_max=wmax,
                      molecule='CO2',
                     isotope='1',
                     truncation=2.5,  # cm-1
                     medium='air',   
                     path_length=10.32, #cm
                     wstep=0.001, 
                     )
conditions = {'mole_fraction':0.2, 'pressure':1,
              'Ttrans':2000, 'Trot':2100, 'Tvib':1500}


sf.verbose = 3
# sf.load_databank("HITEMP-CO2-TEST") # my personal database
sf.fetch_databank("hitemp", load_columns='noneq') # my personal database
sf.df0.drop(sf.df0.index[sf.df0['v1u']==-1], inplace=True)
s = sf.non_eq_spectrum(**conditions)  # initialize energies, etc.
s.plot('absorbance')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

3 participants