TeamCOMPAS / COMPAS

COMPAS rapid binary population synthesis code
http://compas.science
MIT License
65 stars 66 forks source link

Emit gravitational radiation option in Config yaml file #1263

Closed brettppark closed 1 week ago

brettppark commented 2 weeks ago

Describe the bug

When i run COMPAS using single lines like ./compas --initial-mass-1 6 --initial-mass-2 4 --emit-gravitational-radiation True --evolve-double-white-dwarfs True, the Run_Details contains emit-gravitational-radiation True as we expect.

However when i run compas using grid files and configuration.yaml file with --emit-gravitational-radiation True , output files from this procedure at Run_Details files don't reflect this option as True.

Is it just error at recording Run_Details or really "--emit-gravitational-radiation True" is not reflected in the COMPAS run? Other options are well recorded at the file by the way.

To Reproduce

"Configuration.yaml" booleanChoices: --emit-gravitational-radiation: True
--evolve-main-sequence-mergers: True
--evolve-unbound-systems: False
--evolve-double-white-dwarfs: True
--allow-touching-at-birth: True
--include-WD-binaries-as-DCO: True

"Grid file" --initial-mass-1 6.244876822013 --initial-mass-2 0.191781187227 --semi-major-axis 29.996367503056 --metallicity 0.003000000000 ...

Run runSubmit.py which is at ./COMPAS/compas_python_utils/preprocessing

Expected behavior emit-gravitational-radiation should be True in Run_details

version

jeffriley commented 2 weeks ago

If I understand the problem correctly, the problem here is that a grid file could have records with --emit-gravitational-radiation true and --emit-gravitational-radiation false - there's only one Run_Details file per run - which option value should go in the Run_Details file?

The way it currently works, commandline options are recorded in the Run_Details file (this includes options set using the yaml file - all runSubmit does is construct a command with option values taken from the yaml file and execute it).

To see the options set at the grid file level (since, as noted above, the same options can have different values on different grid file lines), see the --add-options-to-sysparms option, described in the documentation here:

https://compas.readthedocs.io/en/latest/pages/User%20guide/Program%20options/program-options-list-defaults.html#options-props-a

If options are added to the system parameters file they can be queried on a per system level and, if a grid file was used, these are the option values that appear on the grid file line corresponding to the binary. All program option column headers start with PO_, so they are fairly easily identifiable. They are also listed here in the documentation:

https://compas.readthedocs.io/en/latest/pages/User%20guide/COMPAS%20output/standard-logfiles-record-specification-options.html

EDIT: if you use a grid file, but you want all records in the grid file to use (e.g.) --emit-gravitational-radiation true, don't list that option on each record of the grid file - put it on the commandline, and because it will not be overridden by the grid file record (because it doesn't appear there), it will default to the value specified on the commandline - then the value in Run_Details will be correct because the grid file is homogeneous wrt that option value.

But are you saying that you don't specify values for --emit-gravitational-radiation in the grid file, but Run_Details is still incorrect? That would mean the fallback of the option value to the commandline value is not working I think... Let me know if I've misunderstood the problem.

brettppark commented 1 week ago

Thank you for your response. I apologize for not explaining the problem in detail. To explain the problem again, I didn't put --emit-gravitational-radiation option into the grid file.

My quetions are:

  1. If i don't put a single line of --emit-gravitational-radiation option into the grid file lines or command line but put it into yaml file as True, then the whole grid file lines should be set --emit-gravitational-radiation as True and run compas with emitting gravitational radiation for all binaries (DCOs). Am i understanding the running process right way?

  2. If the above process is right, emit-gravitational-radiation should be recorded True in Run_Details file because i set it as True at the yaml file. However it isn't.

  3. If my understanding of this process is incorrect and following your advice, should i put --emit-gravitational-radiation True at every single line in the grid file? or command line?

jeffriley commented 1 week ago

Hi Brett,

You're right. If '--emit-gravitational-radiation true' is specified on the command line, e.g.

./compas --emit-gravitational-radiation true -n 10

then Run_Details contains the value "TRUE" for " --emit-gravitational-radiation", but if the value is left to default on the command line, e.g.

./compas --emit-gravitational-radiation -n 10

then Run_Details contains the value "FALSE" for " --emit-gravitational-radiation".

the runSubmit script does not add "TRUE" for boolean options - it uses the default format.

I won't get a chance to look at this properly for a day or two. Changing runSubmit to add "True" instead of '' to boolean options that are supposed to be true would fix the problem, but this (I think) is changed functionality and I'll need to determine what changed and when.

Jeff

--

Dr Jeff Riley Monash University, Australia Ph: +61 (0)407 811 282 @.***

On Tue, 5 Nov 2024 at 22:38, brettppark @.***> wrote:

Thank you for your response. I apologize for not explaining the problem in detail. To explain the problem again, I didn't put --emit-gravitational-radiation option into the grid file.

My quetions are:

1.

If i don't put a single line of --emit-gravitational-radiation option into the grid file lines or command line but put it into yaml file as True, then the whole grid file lines should be set --emit-gravitational-radiation as True and run compas with emitting gravitational radiation for all binaries (DCOs). Am i understanding the running process right way? 2.

If the above process is right, emit-gravitational-radiation should be recorded True in Run_Details file because i set it as True at the yaml file. However it isn't. 3.

If my understanding of this process is incorrect and following your advice, should i put --emit-gravitational-radiation True at every single line in the grid file? or command line?

— Reply to this email directly, view it on GitHub https://github.com/TeamCOMPAS/COMPAS/issues/1263#issuecomment-2456941645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGM5XNQW6773K77E7LIP24LZ7CU3NAVCNFSM6AAAAABQZECH26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJWHE2DCNRUGU . You are receiving this because you commented.Message ID: @.***>

jeffriley commented 1 week ago

Fixed in https://github.com/TeamCOMPAS/COMPAS/pull/1275 (v03.07.04)

Problem was that --emit-gravitational-radiation, along with two other recently added boolean options (--enhance-CHE-lifetimes-luminosities and --scale-CHE-mass-loss-with-surface-helium-abundance had their implicit_value() set incorrectly in Options.cpp - now fixed.