Git Product home page Git Product logo

Comments (9)

Rogerthatx avatar Rogerthatx commented on August 20, 2024

Update: apparently, the problem happens when mspectrum starts to calculate emission lines. If I calculate only the continuum, then the calculations are faster. But if I set DoLines = True the routine takes every available core.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

Hi Rogelio,

in mspectrum you can set the keyword argument proc = 2, or whatever number of cores you want it to use. The current default value is 3.

hope this helps,

Ken

from chiantipy.

Rogerthatx avatar Rogerthatx commented on August 20, 2024

This happens even if I set to 2 the number of cores. Does the keyword argument proc refers to the physical processors of the machine? Or is meant to be the total number of available cpus? When I run the routine in a machine with 48 cpus and I set proc = 10, this happens, again only when I set Dolines = True. If I only calculate the continuum, the mspectrum respects the maximum number of processes I set with the proc argument.

-Rogelio.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

It should set the number of cores that you want to use.

Ken

from chiantipy.

wtbarnes avatar wtbarnes commented on August 20, 2024

@Rogerthatx What happens if you compute the intensity for a single ion, ie without using the mspectrum class? I think it may be that the NumPy linalg.solve call used for the level populations may implicitly use all available cores depending on how you've installed NumPy. As such, you would see all cores being used independent of what option you're passing to nproc

from chiantipy.

Rogerthatx avatar Rogerthatx commented on August 20, 2024

When I calculate the intensity for a single ion with ch.ion, it does not change the cpu load, the calculations are done instantly. I did another test,first I calculated the intensity, and then I calculated the spectrum of a single ion with my_ion.spectrum(wvl). The calculations are done almost instantly but this function seem to be taking all the cores for a moment to do the calculations.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

I checked whether setting proc is effective and it seems that it is now working correctly. On my cpu, setting proc=4 and all 6 cores are used.

I am looking into this.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

also, if you only calculate the line radiations (doLine = False), the only a single core is involved.

still checking

from chiantipy.

kdere avatar kdere commented on August 20, 2024

I have been looking into the matter and doing some testing. It seems that it is not possible to limit the multiprocessing queues to a single core. Also, sometimes you do not get increased speed for some problems. You might want to time the single processor spectrum vs. mspectrum for a small problems (set minAbund = 1.e-4, a small number of wavelengths ...) and see which is faster etc.

There is a bug in mspectrum and will try to chase that down

Ken

from chiantipy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.