Command line utilities

MESA grid overseer

This program will run a MESA grid created with wsssss.inlists.create_grid module.

usage: mesa-go [-h] [--sub-dirs [SUB_DIRS ...]]
               [--base-work-dir BASE_WORK_DIR] [--restart [RESTART]]
               [--source SOURCE] [--cmd-pre CMD_PRE]
               [--cmd-pre-each CMD_PRE_EACH] [--cmd-main CMD_MAIN]
               [--cmd-post-each CMD_POST_EACH] [--cmd-post CMD_POST]
               [--verbose] [--num-mesa NUM_MESA]
               [--OMP_NUM_THREADS OMP_NUM_THREADS] [--debug]
               [--skip-if-file-exists SKIP_IF_FILE_EXISTS]
               [--log-path LOG_PATH] [--task-share]
               [grid_dir]

Positional Arguments

grid_dir

The directory which contains each run for MESA to run in a separate sub-directory.

Default: '.'

Named Arguments

--sub-dirs, -d

The names of the sub directories if they are not named 0000 0001 etc.

Default: ''

--base-work-dir, -b

Directory to use as the base work directory. A copy will be made and star executed in this directory.

Default: '$MESA_DIR/star/work'

--restart, -re

Restart from the last photo in each run’s photos directory. If no photo is found, start a new run. If a check-grid grid_restart file is passed, use that instead.

Default: False

--source

Source this file before running star.

Default: ''

--cmd-pre

Command to run before starting the grid. Can be a file.

Default: ''

--cmd-pre-each

Command to run directly before starting star in each directory. Can be a file.

Default: ''

--cmd-main

Command to run MESA. Defaults to ./rn.

Default: './rn'

--cmd-post-each

Command to run directly after star has finished in each directory. Can be a file.

Default: ''

--cmd-post

Command to run after the grid is finished. Can be a file.

Default: ''

--verbose, -v

Print info about what the script is doing.

Default: False

--num-mesa, -n

Number of instances of MESA to run at once.

Default: 1

--OMP_NUM_THREADS, -j

Value of the OMP_NUM_THREADS environment variable to set before running star. num-mesa times OMP_NUM_THREADS cannot be larger than nproc. Defaults to multiprocessing.cpu_count() if OMP_NUM_THREADS environment variable is not set.

Default: 2

--debug

Print info about what the script is doing.

Default: False

--skip-if-file-exists

Skip running MESA in this work_dir if this file exists in work_dir. Can use MESAGO_LOG_FILE to look for log file generated by this script.WORK_DIR and RUN_NAME will be replaced with the run_name, so WORK_DIR/out_RUN_NAME becomes $GRID_DIR/0000/out_0000.

Default: ''

--log-path

Log file path, WORK_DIR, and RUN_NAME will be replaced by their corresponding values.

Default: 'out_RUN_NAME'

--task-share

Set the slurm task-id and only do runs assigned to that task-id.

Default: False

MESA grid check

This program will check whether a grid has run successfully.

usage: check-grid [-h] [--verbose] [--subdirs [SUBDIRS ...]]
                  [--history-file HISTORY_FILE] [--exclude [EXCLUDE ...]]
                  [--out-file OUT_FILE] [--slurm-stats-dir SLURM_STATS_DIR]
                  [--make-restart-file MAKE_RESTART_FILE] [--no-slurm]
                  [--list-all]
                  [grid_dir]

Positional Arguments

grid_dir

The directory which contains each run for MESA to run in a separate sub-directory.

Default: '.'

Named Arguments

--verbose, -v

Default: False

--subdirs, -d

The names of the sub directories if they are not named 0000 0001 etc.

Default: ''

--history-file, -f

Name of the MESA history file in the LOGS directory. {} will be expanded to the directory name.

Default: 'history.data'

--exclude

Directory names to exclude from sub-dirs (i.e. do not contain MESA runs).

Default: ['figs', 'template_11701', 'slurm*']

--out-file, -o

File format for MESA out files (from eg ./rn | tee out_file). Curly braces will be expanded with with the directory name.

Default: '../out_{}'

--slurm-stats-dir, -s

Directory containing the slurm output (.err, .stats, .out files) for a job.

Default: 'slurm_out'

--make-restart-file, -r

Make a file which contains which subdir needs to restart from what photo.Pass pre-CHeX to only restart runs which did not finish CHeX, pass redoRC to restartbefore CHeB or all to do for all.

Default: ''

--no-slurm

Run the check ignoring any slurm output.

Default: False

--list-all

Print all termination reasons.

Default: False

Gyre driver

This program will run GYRE, estimating appropriate number of scan points for different angular orders l and range of frequency.

usage: gyre-driver [-h] [--gyre {G4,G5,G6,G7,G8,G9}] [--pmode] [--save-modes]
                   [--verbose] [--parts] [--source SOURCE] [--lenient]
                   [--out-dir OUT_DIR] [--in-dir IN_DIR] [--base-in BASE_IN]
                   [--nosort] [--no-merge] [--batch BATCH] [--skip-calc]
                   [--skip-existing] [--min-numax MIN_NUMAX] [--version]
                   [--summary-item-list SUMMARY_ITEM_LIST]
                   [--n-sig-lo N_SIG_LO] [--n-sig-hi N_SIG_HI]
                   [--f-nfreq F_NFREQ] [--summary-suffix SUMMARY_SUFFIX]
                   [--no-output]
                   ll {FGONG,MESA,LOSC} [files ...]

Positional Arguments

ll

Degrees of modes to scan. eg. 012 or mode0. Including mode overrides –save-modes.

filetype

Possible choices: FGONG, MESA, LOSC

Filetype of profiles that gyre will read.

Default: 'MESA'

files

Paths to profile files for gyre to use.

Named Arguments

--gyre

Possible choices: G4, G5, G6, G7, G8, G9

Which version of gyre to use.

Default: 'G9'

--pmode

If set, scan for modes around the expected frequencies.

Default: False

--save-modes

Save mode profiles.

Default: False

--verbose, -v

Print info about gyre runs.

Default: False

--parts, -p

Run each frequency scan window individually. This is probably a bit faster.

Default: False

--source

Source this file before running gyre.

Default: ''

--lenient

If set, will not stop gyre_driver if the version of gyre given to –gyre is different than the version found in $GYRE_DIR.

Default: False

--out-dir

Directory in which to save output.

Default: 'gyre_out'

--in-dir

Directory in which to save inlist files.

Default: 'gyre_in'

--base-in

Path to the base inlist to use.

Default: ''

--nosort

Don’t sort input files by profile number.

Default: False

--no-merge, -m

Don’t merge the final summary files into a single file.

Default: False

--batch

Split scans into batches of up to N frequencies in order to get around memory issues with broken prune_modes in 5.2.

--skip-calc

Do everything except run gyre for l >= 1. Useful to only generate inlists.

Default: False

--skip-existing

Skip running gyre for existing runs. Only works if summary files are merged.

Default: False

--min-numax

Models with numax in uHz lower than this will only calculate l=0 modes.

Default: 0

--version

show program’s version number and exit

--summary-item-list

Summary item list for gyre.

Default: 'l,n_pg,n_p,n_g,freq,E_norm,M_star,R_star,L_star,E'

--n-sig-lo

Number of power envelope sigma to look for modes below numax.

Default: 2

--n-sig-hi

Number of power envelope sigma to look for modes above numax.

Default: 2

--f-nfreq

Factor to increase number of scan frequencies.

Default: 1

--summary-suffix

Merged summary file suffix.

Default: '.sgyre_l'

--no-output

If set, pipe all terminal output to /dev/null.

Default: False