From 3de360460f8809d794737b177fb48e969542b326 Mon Sep 17 00:00:00 2001 From: Hayden Monk Date: Thu, 11 Apr 2024 10:03:27 -0400 Subject: [PATCH] mesa model and parallel tutorials --- docs/Tutorials/Mesa_model.ipynb | 50 + docs/Tutorials/Running_in_Parallel.ipynb | 114 +++ .../Tutorial_data/end_core_h_burn.mod | 864 ++++++++++++++++++ .../h_minus_cross_section_wbr.dat | 74 ++ .../Tutorial_data/mesa_model_example.yml | 24 + .../Tutorial_data/opacity_example.yml | 24 + .../Tutorial_data/stardis_config_parallel.yml | 22 + docs/Tutorials/Tutorial_data/sun.mod | 310 +++++++ 8 files changed, 1482 insertions(+) create mode 100644 docs/Tutorials/Mesa_model.ipynb create mode 100644 docs/Tutorials/Running_in_Parallel.ipynb create mode 100644 docs/Tutorials/Tutorial_data/end_core_h_burn.mod create mode 100644 docs/Tutorials/Tutorial_data/h_minus_cross_section_wbr.dat create mode 100644 docs/Tutorials/Tutorial_data/mesa_model_example.yml create mode 100644 docs/Tutorials/Tutorial_data/opacity_example.yml create mode 100644 docs/Tutorials/Tutorial_data/stardis_config_parallel.yml create mode 100644 docs/Tutorials/Tutorial_data/sun.mod diff --git a/docs/Tutorials/Mesa_model.ipynb b/docs/Tutorials/Mesa_model.ipynb new file mode 100644 index 00000000..b78a721a --- /dev/null +++ b/docs/Tutorials/Mesa_model.ipynb @@ -0,0 +1,50 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Using a MESA model" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using a MESA model entails a few changes in the utilization of STARDIS. Firstly, you must change the model type to 'mesa' under the 'model' section, like this: \n", + "\n", + "```\n", + "model:\n", + " type: mesa\n", + " fname: end_core_h_burn.mod\n", + "```\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, you can now specify the outmost depth point for the simulation using the 'truncate_to_shell' parameter. It defaults to -99, which tells the model to use all shells. Place the parameter in the 'model' section, like this: \n", + "```\n", + "model:\n", + " type: mesa\n", + " fname: end_core_h_burn.mod\n", + " truncate_to_shell: 40\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/Tutorials/Running_in_Parallel.ipynb b/docs/Tutorials/Running_in_Parallel.ipynb new file mode 100644 index 00000000..1a8fd787 --- /dev/null +++ b/docs/Tutorials/Running_in_Parallel.ipynb @@ -0,0 +1,114 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Running the Simulation in Parallel" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can change the number of threads that STARDIS uses with the n_threads keyword. \n", + "A few things to remember when running STARDIS in parallel: \n", + " \n", + "If no n_threads argument is provided, it defaults to 1 and runs in series. \n", + " \n", + "Set n_threads to 0 to use all available threads. \n", + " \n", + "The n_threads argument must be between the config version and the atom data, like this: \n", + "```\n", + "stardis_config_version: 1.0 \n", + "n_threads: 4 \n", + "atom_data: kurucz_cd23_chianti_H_He.h5\n", + "```\n", + "\n", + "In the [stardis_config_parallel](stardis_config_parallel.yml) file, an n_threads value of 4 is added to the example config. Try running this code yourself to see how n_threads affects STARDIS's efficiency." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "25723fa78e8d43ef8129a7667a39ebf8", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Iterations: 0/? [00:00