You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/compasHPC.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,8 +79,8 @@ to your `~/.bash_profile` or equivalent.
79
79
Make a copy of the `stroopwafelInterface.py` file in the `defaults/` folder into your current directory, and set the `run_on_helios` parameter to `True`.
80
80
Set any other stroopwafel parameters as you see fit.
81
81
82
-
If you have many non-default COMPAS arguments, you are encouraged to set them in a `pythonSubmit.py` file in the same directory,
83
-
and set the `usePythonSubmit` parameter to `True`.
82
+
If you have many non-default COMPAS arguments, you are encouraged to set them in a `runSubmit.py` file in the same directory,
83
+
and set the `usePythonSubmit` parameter to `True`, and adapt `stroopwafelInterface.py` accordingly, given that is still under development.
This time we not only want to get the output from COMPAS on the host machine, we also want to supply a `pythonSubmit.py` to the container from the host machine.
78
+
This time we not only want to get the output from COMPAS on the host machine, we also want to supply a `runSubmit.py` to the container from the host machine.
@@ -83,13 +84,13 @@ set the environment variable `VAR_VAME` to `value`
83
84
`teamcompas/compas`
84
85
the image to run
85
86
86
-
`python3 /app/starts/pythonSubmit.py`
87
+
`python3 /app/starts/runSubmit.py`
87
88
the command to run when the container starts
88
89
89
90
90
91
#### Run the COMPAS executable
91
92
92
-
To run the COMPAS executable directly (i.e. without `pythonSubmit.py`)
93
+
To run the COMPAS executable directly (i.e. without `runSubmit.py`)
93
94
```
94
95
docker run \
95
96
--rm \
@@ -136,12 +137,12 @@ More info on `docker run` [here](https://docs.docker.com/engine/reference/run/)
136
137
137
138
NOTE 1:
138
139
139
-
Two new environment variables have been added, both of these apply to `pythonSubmit.py` only and are non-breaking changes.
140
+
Two new environment variables have been added, both of these apply to `runSubmit.py` only and are non-breaking changes.
140
141
141
-
`COMPAS_EXECUTABLE_PATH` is an addition to the default `pythonSubmit.py` that overrides where `pythonSubmit.py` looks for the compiled COMPAS.
142
+
`COMPAS_EXECUTABLE_PATH` is an addition to the default `runSubmit.py` that overrides where `runSubmit.py` looks for the compiled COMPAS.
142
143
This override exists purely for ease-of-use from the command line.
143
144
144
-
`COMPAS_LOGS_OUTPUT_DIR_PATH` is also an addition to the default `pythonSubmit.py` that overrides where logs are placed.
145
+
`COMPAS_LOGS_OUTPUT_DIR_PATH` is also an addition to the default `runSubmit.py` that overrides where logs are placed.
145
146
The override exists because the mounted directory (option `-v`) is created before COMPAS runs. COMPAS sees that the directory where it's supposed to put logs already exists, so it created a different (i.e. non-mapped) directory to deposit logs in.
146
147
147
148
@@ -154,16 +155,16 @@ All container output will be hidden.
154
155
An example where this would be useful is if you were running 4 instances of COMPAS at once.
155
156
You could copy/paste the following into the terminal...
@@ -124,15 +125,53 @@ If you do not have python3 installed, install it by following the instructions b
124
125
125
126
126
127
## 2. Evolving your first binary
127
-
To start using COMPAS, you will need the python script `pythonSubmitDemo.py`, which specifies all the program options (physics assumptions, output types) and runs COMPAS in the terminal. Although the primary functionality of COMPAS is to evolve a whole population of binary stars rapidly, for now, let's focus on evolving a single stellar system and examining the detailed output.
128
+
129
+
### 2.1 Running COMPAS out-of-the-box
130
+
To start using COMPAS, and after the source code has been compiled, you need to go to `$COMPAS_ROOT_DIR/preProcessing/` and run the `runSubmit.py`, which reads the options from `compasConfigDefault.yaml` and overwrite the COMPAS defaults when specified.
131
+
The `compasConfigDefault.yaml` specifies all the program options (physics assumptions, output types) and runs COMPAS in the terminal.
132
+
Your output should be similar to following.
133
+
134
+
$ python3 runSubmit.py
135
+
python_version = 3
136
+
compas_executable_override None
137
+
grid_filename None
138
+
$COMPAS_ROOT_DIR/src/COMPAS --LONG-COMMAND-LINE
139
+
140
+
COMPAS v02.25.10
141
+
Compact Object Mergers: Population Astrophysics and Statistics
If that is the case, you have succesfully installed COMPAS and ran your fist binary.
159
+
160
+
As of v02.25.10, the `runSubmit.py` and `compasConfigDefault.yaml` combo are the preferred way to set up runs using python, instead of the prevously used `pythonSubmit.py` (and their adaptations).
161
+
We will eventually update the documentation to reflect this, but for now the references to `pythonSubmit.py` or `pythonSubmitDemo.py` refer to the combined options and commands python script that has been tested and used in releases previous than v02.25.10, including those of the methods paper.
162
+
The `pythonSubmit.py`, `pythonSubmitDemo.py`, and their functionality, will eventually be fully replaced by the `runSubmit.py` and `compasConfigDefault.yaml` combo.
163
+
164
+
### 2.2 Running COMPAS from a grid file
165
+
166
+
We will now try to run a binary using a grid file. For this, you will need the python script `pythonSubmitDemo.py`, which specifies all the program options (physics assumptions, output types) and runs COMPAS in the terminal. For now, let's focus on evolving a single stellar system and examining the detailed output.
128
167
129
168
To start, change to the `examples/methods_paper_plots/detailed_evolution/` directory:
130
169
131
170
cd $COMPAS_ROOT_DIR/examples/methods_paper_plots/detailed_evolution/
132
171
133
-
Here, you will find the script `pythonSubmitDemo.py` for this demo.
172
+
Here, you will find the script `pythonSubmitDemo.py` for this demo. This file is an older version of the `runSubmit.py` and `compasConfigDefault.yaml`
173
+
134
174
135
-
### 2.1 Running COMPAS from a grid file
136
175
In population synthesis, the initial stellar population is usually generated by drawing the primary mass, secondary mass, semi-major axis, and eccentricity from their respective distributions specified in the program options. However, we illustrate COMPAS's ability to specify a grid of initial values for single and binary star evolution using COMPAS's grid functionality.
137
176
138
177
An example grid file, `Grid_demo.txt`, has been included in the current `detailed_evolution` directory. Open it with a text editor to view it:
@@ -144,7 +183,7 @@ An example grid file, `Grid_demo.txt`, has been included in the current `detaile
144
183
145
184
It should be clear that this grid file specifies a binary of zero-age main sequence stars with primary mass 35.4 Msol, secondary mass 29.3 Msol, metallicity 0.001, zero eccentricity, semi-major axis of 1.02 AU, and kick velocities for each component. For more detailed documentation of COMPAS's grid functionality for both single and binary stars, please see [Specifications](./COMPAS_Doc.pdf).
146
185
147
-
To tell the python submit script to take its input from this grid file, you usually need to open `$COMPAS_ROOT_DIR/preProcessing/pythonSubmit.py` with a text editor, and specify the grid filename `grid_filename = 'Grid_demo.txt'`. And to print the time evolution of binary properties, we need to turn on detailed output: `detailed_output = True`. COMPAS can produce logfiles of different types: HDF5, CSV, TSV, and TXT, which can be chosen by editing the line `logfile_type = 'HDF5'` (the default type is HDF5). For this demo, this has all been done for you in the file `pythonSubmitDemo.py` found in the current directory.
186
+
To tell the python submit script to take its input from this grid file, you usually need to open `$COMPAS_ROOT_DIR/preProcessing/compasConfigDefault.yaml` with a text editor, and specify the grid filename `grid: 'Grid_demo.txt'`. And to print the time evolution of binary properties, we need to turn on detailed output: `detailed-output: True`. COMPAS can produce logfiles of different types: HDF5, CSV, TSV, and TXT, which can be chosen by editing the line `logfile-type = 'HDF5'` (the default type is HDF5). For this demo, you can use the `pythonSubmitDemo.py` found in the current directory; this is a good option for v02.25.10 and previous releases. Alternatively, for more recent releases, you could choose to try and adapt the same options from the `$COMPAS_ROOT_DIR/preProcessing/compasConfigDefault.yaml` and the run via `$COMPAS_ROOT_DIR/preProcessing/runSubmit.py` script.
148
187
149
188
Now let's run COMPAS!
150
189
@@ -172,7 +211,7 @@ Now let's run COMPAS!
172
211
Congratulations! You've just made a binary black hole. And it didn't even take a second.
173
212
174
213
175
-
### 2.2 Examining detailed output
214
+
### 2.3 Examining detailed output
176
215
The COMPAS run just now produces a new directory `COMPAS_Output`, inside which you will find the following files/directories (here we assume `logfile_type = 'h5'` in the python submit file):
177
216
178
217
*`COMPAS_Output.h5`: The primary output file, containing hdf5 data groups for the relevant output physics. By default, and for a sufficiently large simulation, this will include `BSE_Common_Envelopes`, `BSE_Double_Compact_Objects`, `BSE_Supernovae`, and `BSE_System_Parameters`.
0 commit comments