Skip to content

Commit

Permalink
new Documentation for setting amount of threads used in STARDIS simul… (
Browse files Browse the repository at this point in the history
#228)

* new Documentation for setting amount of threads used in STARDIS simulation

* more info added: parallelized stuff and when to use

* direcotry managment and added to index.rst

* name change: Using Stardis in Parallel
  • Loading branch information
RyanGroneck authored Nov 18, 2024
1 parent ec588eb commit ab7e61d
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This is the documentation for STARDIS.
Quickstart <quickstart/quickstart>
Downloading and Installation <installation>
Physics of STARDIS <physics/physics_of_stardis>
Using STARDIS in Parallel <using_stardis_in_parallel/stardis_in_parallel>
Example Notebooks <example_notebooks/rotation_broadening>
Contributing <contributing>
Bibliography <bibliography>
Expand Down
61 changes: 61 additions & 0 deletions docs/using_stardis_in_parallel/stardis_in_parallel.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Setting number of threads used in running a STARDIS simulation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When you run a STARDIS simulation, the yaml file determines how many threads are used. By default, it will only use 1 thread. The more threads you set a simulation to use, the more computing power the simulation will take advantage of for calculating line opacity and ray tracing steps (as both of these are parallelized in STARDIS). **Setting n_threads to 0 will make the simulation use all available threads.**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here is a what a yaml file that has the STARDIS simulation use 3 threads will look like\n",
"\n",
"``` yaml\n",
"stardis_config_version: 1.0\n",
"n_threads: 3 # <----------- add your 'n_threads: <integer>' here\n",
"atom_data: kurucz_cd23_chianti_H_He.h5\n",
"model:\n",
" ...\n",
"```\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"One reason you may want to consider increasing threads used is when computing spectra with large numbers (i.e. 10,000 or more) of wavelength points."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "stardis",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit ab7e61d

Please sign in to comment.