From ab7e61d2b1a38387f81ee44b09770cfaf11d5ff8 Mon Sep 17 00:00:00 2001 From: RyanGroneck Date: Mon, 18 Nov 2024 11:43:47 -0500 Subject: [PATCH] =?UTF-8?q?new=20Documentation=20for=20setting=20amount=20?= =?UTF-8?q?of=20threads=20used=20in=20STARDIS=20simul=E2=80=A6=20(#228)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- docs/index.rst | 1 + .../stardis_in_parallel.ipynb | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 docs/using_stardis_in_parallel/stardis_in_parallel.ipynb diff --git a/docs/index.rst b/docs/index.rst index 3327b50f..7e76e1c4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,6 +10,7 @@ This is the documentation for STARDIS. Quickstart Downloading and Installation Physics of STARDIS + Using STARDIS in Parallel Example Notebooks Contributing Bibliography diff --git a/docs/using_stardis_in_parallel/stardis_in_parallel.ipynb b/docs/using_stardis_in_parallel/stardis_in_parallel.ipynb new file mode 100644 index 00000000..b2afe6ee --- /dev/null +++ b/docs/using_stardis_in_parallel/stardis_in_parallel.ipynb @@ -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: ' 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 +}