{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Large-Scale Population Synthesis on HPC Facilities 🚀\n", "\n", "\n", "This tutorial will cover how to setup and run a large, multi-metallicity population run on a HPC with slurm.\n", "We will dive deeper into the `population_params.ini` file and how the `Population` class works for multi-metallicity populations." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialization File for multi-metallicity runs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's copy the default population synthesis `ini` file to your working directory.\n", "Make sure you're on a cluster to be able to run and submit the jobs!\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "import shutil\n", "from posydon.config import PATH_TO_POSYDON\n", "\n", "path_to_params = os.path.join(PATH_TO_POSYDON, \"posydon/popsyn/population_params_default.ini\")\n", "shutil.copyfile(path_to_params, './population_params.ini')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Open the `population_params.ini` file and you should see all 8 currently supported metallicities present. \n", "\n", "```\n", "metallicity = [2., 1., 0.45, 0.2, 0.1, 0.01, 0.001, 0.0001]\n", "```\n", "\n", "For our test run, we do not require a large population, so set the number of binaries to 1000.\n", "You might also want to make sure the `dump_rate` is set to 100 binaries for this example.\n", "\n", "\n", "```\n", "dump_rate = 100\n", "...\n", "number_of_binaries = 1000\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup the Population Synthesis Run" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "POSYDON provides `posydon-popsyn setup` as a command line script that you can use to setup a (multi-metallicity) population run on a HPC facility.\n", "This will split each metallicity into a separate slurm job-array and a dependent job which will automatically merge the output of the separate jobs.\n", "This removes the need to manually setup each slurm job.\n", "Below are two examples, but you might need to adjust the inputs for your email, cluster and available partitions.\n", "\n", "