Giter Site home page Giter Site logo

Comments (1)

autocorr avatar autocorr commented on August 27, 2024 1

Hi! Thank you, and thanks for pointing that out, the actual documentation uses Documenter.jl and is located at https://autocorr.github.io/Jadex.jl/dev/ from the little "docs" badge, not on ReadTheDocs. Looks like I left that in from when I assumed I'd be using ReadTheDocs (it is simpler to execute Julia code on the build server using GitHub actions and that's what the tutorial on Documenter.jl uses).

The documentation is not especially thorough. If you don't need the highest performance, then following the "Quickstart guide" should be sufficient: results are returned in a DataFrame. But if you're planning on using it for MCMC (judging by your other work!), you'll want to use in-place operations on the solution to avoid allocations and garbage collection, e.g.:

using Jadex
mol = Specie("hco+@xpol", datadir="path/to/LAMDA/files")
rdf = RunDef(mol, density=Dict("h2" => 1e4), tkin=20.0, cdmol=1e13, deltav=1.0)
sol = Solution(rdf)
solve!(sol, rdf)

# One can get excitation temperature and optical depth directly from the solution:
my_tau = sol.τl[3]  # HCO+ 3-2
my_tex = sol.tex[3]

# If one needs the radiation temperature and integrated intensities, then optionally run
# `get_results` and a `DataFrame` is allocated:
df = get_results(sol, rdf)

# Reset the solution and fill it with zeros so it can be re-used with new `rdf` when
# calling `solve!(sol, rdf)`.
reset!(sol)

If you make a representative RunDef to initialize the Solution with, it can be used in-place in succeeding operations. It makes multi-threaded, multi-chain MCMC runs more complex though as in-place operations won't be thread-safe (one would need an array of sol instances indexed by the thread-ID, or to use process based parallelism that copies all objects at the start).

Note that the run definition RunDef allocates a little bit, so this does add some garbage collection overhead, but I've noticed the GC clean-up didn't add much overhead in this use-case. The multi-threaded grid computation would benefit from in-place operations on the RunDef however, since all threads share the same GC and clean-up calls are thread locking.

Clear skies,
Brian

from jadex.jl.

Related Issues (3)

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.