Run one binary on your laptop for debugging

For debugging purposes you might want to run a single binary on your laptop to test a quick modification of the inlists, run_star_extras.f or run_binary_extras.f. Assume we want to run the same binary as in the previous tutorial. To use the POSYDON API to run a single binary, you can use the following command:

posydon-setup-grid --grid-type fixed --inifile HMS-HMS_yggdrasil.ini --submission-type shell

Similar to before, in our directorty we have:

[1]:
!ls
binary           grid_test.csv          laptop.ipynb  star1
grid_command.sh  HMS-HMS_yggdrasil.ini  mk            star2

We now export the SLURM_ARRAY_TASK_ID enviroment variable corresponding to the csv index of the grid_test.csv we want to run, 0 in this case in the temrinal:

export $SLURM_ARRAY_TASK_ID=0

We can now run the MESA binary simulation in the terminal with the following command:

chmod +x grid_command.sh
./grid_command.sh

The terminal will not display an output, the screen output is saved to an out.txt file in the simulation directory.

[6]:
!ls
binary
grid_command.sh
grid_test.csv
HMS-HMS_yggdrasil.ini
laptop.ipynb
mk
star1
star2
Zbase_0.0014_m1_30.0000_m2_21.0000_initial_z_1.4200e-03_initial_period_in_days_1.0000e+01_grid_index_0
[7]:
!ls Zbase_0.0014_m1_30.0000_m2_21.0000_initial_z_1.4200e-03_initial_period_in_days_1.0000e+01_grid_index_0
binary_history_columns.list  inlist_grid_star1_binary_controls
binary_history.data          inlist_grid_star2_binary_controls
history_columns.list         LOGS1
initial_star1.mod            LOGS2
initial_star2.mod            out.txt
inlist                       profile_columns.list
inlist_grid_points           tmp.hdf5
[10]:
!head -n 200 Zbase_0.0014_m1_30.0000_m2_21.0000_initial_z_1.4200e-03_initial_period_in_days_1.0000e+01_grid_index_0/out.txt


 read /srv/beegfs/scratch/shares/astro/posydon/simone/documentation/running_mesa/running_on_laptop/binary/inlist_project
 read inlist_grid_points
                                         version_number       11701
 read inlist_grid_star1_binary_controls
 set_eos_PC_parameters
                             mass_fraction_limit_for_PC    1.0000000000000000D-03
                                       logRho1_PC_limit    2.9990000000000001D+00
                                       logRho2_PC_limit    2.7999999999999998D+00
                                     log_Gamma_all_HELM    1.0000000000000000D+00
                                       log_Gamma_all_PC    1.3010299956000000D+00
                                 PC_Gamma_start_crystal    1.5000000000000000D+02
                                  PC_Gamma_full_crystal    1.7500000000000000D+02
                                               PC_min_Z    9.9900000000000000D-01
 change rates preference to           2
                                        set_initial_age    0.0000000000000000D+00
                               set_initial_model_number           0
 change to "approx21.net"
 number of species          21
 new_rotation_flag T
                                 new_surface_rotation_v           0    0.0000000000000000D+00    0.0000000000000000D+00
 net name approx21.net
 rotation_flag T
 species
     1   neut
     2   h1
     3   prot
     4   he3
     5   he4
     6   c12
     7   n14
     8   o16
     9   ne20
    10   mg24
    11   si28
    12   s32
    13   ar36
    14   ca40
    15   ti44
    16   cr48
    17   cr56
    18   fe52
    19   fe54
    20   fe56
    21   ni56

 kappa_file_prefix gs98
 kappa_lowT_prefix lowT_fa05_gs98
                                        OMP_NUM_THREADS           4




 read inlist_grid_star2_binary_controls
 set_eos_PC_parameters
                             mass_fraction_limit_for_PC    1.0000000000000000D-03
                                       logRho1_PC_limit    2.9990000000000001D+00
                                       logRho2_PC_limit    2.7999999999999998D+00
                                     log_Gamma_all_HELM    1.0000000000000000D+00
                                       log_Gamma_all_PC    1.3010299956000000D+00
                                 PC_Gamma_start_crystal    1.5000000000000000D+02
                                  PC_Gamma_full_crystal    1.7500000000000000D+02
                                               PC_min_Z    9.9900000000000000D-01
 change rates preference to           2
                                        set_initial_age    0.0000000000000000D+00
                               set_initial_model_number           0
 change to "approx21.net"
 number of species          21
 new_rotation_flag T
                                 new_surface_rotation_v           0    0.0000000000000000D+00    0.0000000000000000D+00
 net name approx21.net
 rotation_flag T
 species
     1   neut
     2   h1
     3   prot
     4   he3
     5   he4
     6   c12
     7   n14
     8   o16
     9   ne20
    10   mg24
    11   si28
    12   s32
    13   ar36
    14   ca40
    15   ti44
    16   cr48
    17   cr56
    18   fe52
    19   fe54
    20   fe56
    21   ni56

 kappa_file_prefix gs98
 kappa_lowT_prefix lowT_fa05_gs98
                                        OMP_NUM_THREADS           4





                                                     m2    2.1000000000000000D+01
                                                     m1    3.0000000000000000D+01
                                 initial_period_in_days    1.0000000000000000D+01
                             initial_separation_in_Rsun    7.2417496333000003D+01
                                        jdot_multiplier    1.0000000000000000D+00
                                                     fr    1.0000000000000000D-02



 The binary terminal output contains the following information

      'step' is the number of steps since the start of the run,
      'lg_dt' is log10 timestep in years,
      'age_yr' is the simulated years since the start run,
      'M1+M2' is the total mass of the system (Msun),
      'M1' is the mass of the primary (Msun)
      'M2' is the mass of the secondary (Msun)
      'separ' is the semi-major axis of the orbit (Rsun),
      'R1' is the radius of the primary (Rsun)
      'R2' is the radius of the secondary (Rsun)
      'Porb' is the orbital period (days),
      'P1' is the rotation period of star 1 (days, zero if not modeling rotation),
      'P2' is the rotation period of star 2 (days, zero if not modeling rotation),
      'e' orbital eccentricity,
      'dot_e' time derivative of e (1/yr),
      'Eorb' orbital energy G*M1*M2/2*separation (ergs),
      'M2/M1' mass ratio,
      'vorb1' orbital velocity of star 1 (km/s),
      'vorb2' orbital velocity of star 2 (km/s),
      'pm_i' index of star evolved as point mass, zero if both stars are modeled,
      'RL1' Roche lobe radius of star 1 (Rsun),
      'Rl2' Roche lobe radius of star 2 (Rsun),
      'donor_i' index of star taken as donor,
      'RL_gap1' (R1-Rl1)/Rl1,
      'RL_gap2' (R2-Rl2)/Rl2,
      'dot_Mmt', mass transfer rate (Msun/yr),
      'dot_M1', time derivative for the mass of star 1 (Msun/yr),
      'dot_M2', time derivative for the mass of star 2 (Msun/yr),
      'eff', mass transfer efficiency, computed as -dot_M2/dot_M1 (zero if dot_M1=0),
      'dot_Medd', Eddington accretion rate (Msun/yr),
      'L_acc', accretion luminosity when accreting to a point mass (ergs/s),
      'Jorb', orbital angular momentum (g*cm^2/s)
      'spin1', spin angular momentum of star 1 (g*cm^2/s),
      'spin2', spin angular momentum of star 2 (g*cm^2/s),
      'dot_J', time derivative of Jorb (g*cm^2/s^2),
      'dot_Jgr', time derivative of Jorb due to gravitational waves (g*cm^2/s^2),
      'dot_Jml', time derivative of Jorb due to mass loss (g*cm^2/s^2),
      'dot_Jmb', time derivative of Jorb due to magnetic braking (g*cm^2/s^2),
      'dot_Jls', time derivative of Jorb due to spin-orbit coupling (g*cm^2/s^2),
      'rlo_iters', number of iterations for implicit calculation of mass transfer,

 All this and more can be saved in binary_history.data during the run.
 num_steps_to_relax_rotation          50
        relax to omega: wanted-current, current, wanted           1    7.2722052166430393D-06    0.0000000000000000D+00    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           2    7.1239371671217664D-06    1.4826804952127298D-07    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           3    6.9775031537422630D-06    2.9470206290077610D-07    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           4    6.8325228134160023D-06    4.3968240322703724D-07    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           5    6.6880335934326623D-06    5.8417162321037739D-07    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           6    6.5429720944820478D-06    7.2923312216099155D-07    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           7    6.3960414376057951D-06    8.7616377903724423D-07    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           8    6.2481185101766360D-06    1.0240867064664032D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted           9    6.0988144371784416D-06    1.1733907794645978D-06    7.2722052166430393D-06
         10   7.649681  4.541E+04   5.083637   5.083787  30.000000  30.000000   0.746765   0.000508   0.251100   0.747141  -6.159624   2598      0
   3.021836   0.768039   0.749893 -23.011309   3.935137 -99.000000   0.000000   0.251795   0.000441   0.001420   0.251427   0.009963      3      0
 2.3543E+03  16.667399   5.081908   1.622938   4.361599  -8.707435   0.000000   0.000004   0.000133   0.000071  1.432E-03  0.000E+00  max increase

        relax to omega: wanted-current, current, wanted          10    5.9494923842667907D-06    1.3227128323762491D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          11    5.8047902383525235D-06    1.4674149782905158D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          12    5.6656472219130140D-06    1.6065579947300258D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          13    5.5253850379006039D-06    1.7468201787424357D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          14    5.3813998139082310D-06    1.8908054027348084D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          15    5.2360332812183832D-06    2.0361719354246558D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          16    5.0905569484589031D-06    2.1816482681841367D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          17    4.9451036922867509D-06    2.3271015243562889D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          18    4.7996593421142631D-06    2.4725458745287766D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          19    4.6542152662843934D-06    2.6179899503586464D-06    7.2722052166430393D-06
         20   7.648797  4.525E+04   5.069089   5.069239  30.000000  30.000000   0.746765   0.000508   0.251100   0.747141  -6.164975   2613      0
   6.032136   0.764405   0.746596 -23.057888   3.920548 -99.000000   0.000000   0.251795   0.000441   0.001420   0.251427   0.009955      2      0
 2.1539E+06  16.663052   5.069239   1.607921   4.359365  -8.704639   0.000000   0.000004   0.000133   0.000071  1.432E-03  0.000E+00  max increase

        relax to omega: wanted-current, current, wanted          20    4.5087711728839026D-06    2.7634340437591372D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          21    4.3633267819036798D-06    2.9088784347393599D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          22    4.2178823225008446D-06    3.0543228941421948D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          23    4.0724377789053992D-06    3.1997674377376405D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          24    3.9269931252400189D-06    3.3452120914030209D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          25    3.7815483288686108D-06    3.4906568877744285D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          26    3.6361034654341649D-06    3.6361017512088744D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          27    3.4906587737615971D-06    3.7815464428814422D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          28    3.3452144110082463D-06    3.9269908056347930D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          29    3.1997702456217982D-06    4.0724349710212411D-06    7.2722052166430393D-06
         30   7.648797  4.525E+04   5.069078   5.069228  30.000000  30.000000   0.746765   0.000508   0.251100   0.747141  -6.164960   2610      0
   9.042435   0.764409   0.746606 -23.057923   3.920536 -99.000000   0.000000   0.251795   0.000441   0.001420   0.251427   0.009955      2      0
 2.2053E+09  16.663054   5.069228   1.607910   4.359335  -8.704658   0.000000   0.000004   0.000133   0.000071  1.432E-03  0.000E+00  max increase

        relax to omega: wanted-current, current, wanted          30    3.0543261335993711D-06    4.2178790830436683D-06    7.2722052166430393D-06
        relax to omega: wanted-current, current, wanted          31    2.9088820289801618D-06    4.3633231876628776D-06    7.2722052166430393D-06

Congratulation, you now know how to harvast the power of POSYDON to run a grid of simulations on a supercomputer!