Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Default Machine Setting #383

Merged
merged 32 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1f66a18
Feature: add default machine
technic960183 Dec 5, 2024
b0573ce
Remove --machine=eureka_intel
technic960183 Dec 5, 2024
adddaf5
Generalize system setting and update code style
ChunYen-Chen Dec 13, 2024
3f22d24
Fix bug and imporve the flow of the code.
technic960183 Dec 13, 2024
3df4413
Generalized `set_settings.sh`
technic960183 Dec 13, 2024
7fd4994
Add new options and improve the cli
technic960183 Dec 14, 2024
691e9eb
Remove option for testing
technic960183 Dec 18, 2024
103af05
Merge branch 'main' into add_default_machine
technic960183 Dec 26, 2024
209ea75
Update wiki for setting default machine
technic960183 Dec 26, 2024
095cd84
Apply easy suggestions from the reviewer
technic960183 Dec 31, 2024
afdb160
Correct the return value of a bash function
technic960183 Jan 8, 2025
2fe9a1d
Remove verbose mode output
technic960183 Jan 8, 2025
3ab32b5
Add `print_key` and remove `PADDED_KEYS`
technic960183 Jan 8, 2025
bf4c196
Fix overwriting in the read-only action
technic960183 Jan 8, 2025
a160c1a
Organize the code with comments chunks
technic960183 Jan 8, 2025
c7ca863
Put checking to section `VALIDATE PARAMETERS`
technic960183 Jan 8, 2025
8302b8b
Move `set_settings.sh` from `tool/` to `tool/config/`
technic960183 Jan 8, 2025
5dc80f7
Merge branch 'main' into add_default_machine
technic960183 Jan 8, 2025
1207766
Update wiki for a better reading flow
technic960183 Jan 8, 2025
9de77ac
Add python version check to `configure.py`
technic960183 Jan 8, 2025
af7fa6e
Apply easy suggestions from code review
technic960183 Jan 15, 2025
f876723
Remove override of `_get_option_tuples`
technic960183 Jan 15, 2025
4bad5b3
Completely remove `--verbose` and `-v` options
technic960183 Jan 15, 2025
6ccdb02
Rename the local variables to all lowercase
technic960183 Jan 15, 2025
435d58e
Merge branch 'main' into add_default_machine
technic960183 Jan 16, 2025
3e885b7
Add links between wiki pages
technic960183 Jan 16, 2025
9d30e5d
Update wiki and style
technic960183 Jan 17, 2025
dfe756f
Apply suggestions from code review
technic960183 Jan 20, 2025
4cfbca9
Fix wiki link and indentation
technic960183 Jan 20, 2025
7e39dcd
Fix overwriting problem of the default setting
technic960183 Jan 20, 2025
948ed71
style applied from code review
technic960183 Jan 21, 2025
833f44a
style
technic960183 Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ GAMER_ExtractProfile
.vscode
src/Makefile
src/Makefile.log
src/.local_settings
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/DiskHeating/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true --particle=true --store_par_acc=true \
--gsl=true --max_patch=20000000
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/ExtPot/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM
${PYTHON} configure.py --model=ELBDM
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/HaloMerger/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true --particle=true --gsl=true
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/IsolatedHalo/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --fftw=FFTW3 --double=true \
${PYTHON} configure.py --hdf5=true --gpu=true --fftw=FFTW3 --double=true \
--model=ELBDM --gravity=true --comoving=true
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/LSS/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true --comoving=true
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/LSS_Hybrid/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --elbdm_scheme=ELBDM_HYBRID --wave_scheme=WAVE_GRAMFE --gramfe_scheme=GRAMFE_MATMUL \
--gravity=true --comoving=true --gsl=true --spectral_interpolation=true
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/Perturbation/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --elbdm_scheme=ELBDM_HYBRID --wave_scheme=WAVE_GRAMFE --gramfe_scheme=GRAMFE_MATMUL \
--gravity=true --comoving=false --gsl=true --spectral_interpolation=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 \
--model=ELBDM --elbdm_scheme=ELBDM_WAVE \
--gravity=true --comoving=false
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/PlaneWave/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM --double=True --passive=1
${PYTHON} configure.py --model=ELBDM --double=True --passive=1
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM --double=True --hdf5=true --fftw=FFTW3
${PYTHON} configure.py --model=ELBDM --double=True --hdf5=true --fftw=FFTW3
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true --comoving=true
2 changes: 1 addition & 1 deletion example/test_problem/ELBDM/Soliton/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=ELBDM --gravity=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM --hdf5=true
${PYTHON} configure.py --model=ELBDM --hdf5=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM --elbdm_scheme=ELBDM_HYBRID --hdf5=true --mpi=true
${PYTHON} configure.py --model=ELBDM --elbdm_scheme=ELBDM_HYBRID --hdf5=true --mpi=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM --hdf5=true
${PYTHON} configure.py --model=ELBDM --hdf5=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=ELBDM --elbdm_scheme=ELBDM_HYBRID --hdf5=true --mpi=true
${PYTHON} configure.py --model=ELBDM --elbdm_scheme=ELBDM_HYBRID --hdf5=true --mpi=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true --model=HYDRO \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true --model=HYDRO \
--particle=true --gravity=true --flu_scheme=MHM --flux=HLLC \
--passive=1 --par_attribute=1 --dual=DE_ENPY --star_formation=true --grackle=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/AcousticWave/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --double=True "$@"
${PYTHON} configure.py --model=HYDRO --double=True "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/BlastWave/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --hdf5=true "$@"
${PYTHON} configure.py --model=HYDRO --hdf5=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Bondi/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --fftw=FFTW3 \
${PYTHON} configure.py --hdf5=true --gpu=true --fftw=FFTW3 \
--model=HYDRO --gravity=true --dual=DE_ENPY "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/CDM_LSS/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=HYDRO --particle=true --gravity=true --comoving=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/CMZ/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --fftw=FFTW3 \
${PYTHON} configure.py --hdf5=true --gpu=true --fftw=FFTW3 \
--model=HYDRO --gravity=true --eos=ISOTHERMAL --barotropic=true \
--flu_scheme=MHM --flux=HLLC --passive=1 --par_attribute=1 "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/CR_Diffusion/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --flu_scheme=MHM_RP --flux=HLLD --mhd=true \
${PYTHON} configure.py --model=HYDRO --flu_scheme=MHM_RP --flux=HLLD --mhd=true \
--cosmic_ray=true --eos=COSMIC_RAY --cr_diffusion=true --hdf5=true "$@"
4 changes: 2 additions & 2 deletions example/test_problem/Hydro/CR_ShockTube/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --flu_scheme=MHM_RP --mhd=false --flux=HLLE \
${PYTHON} configure.py --model=HYDRO --flu_scheme=MHM_RP --mhd=false --flux=HLLE \
--cosmic_ray=true --eos=COSMIC_RAY "$@"
#${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --flu_scheme=MHM_RP --mhd=true --flux=HLLD \
#${PYTHON} configure.py --model=HYDRO --flu_scheme=MHM_RP --mhd=true --flux=HLLD \
# --cosmic_ray=true --eos=COSMIC_RAY "$@"
4 changes: 2 additions & 2 deletions example/test_problem/Hydro/CR_SoundWave/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --flu_scheme=MHM_RP --mhd=false --flux=HLLE \
${PYTHON} configure.py --model=HYDRO --flu_scheme=MHM_RP --mhd=false --flux=HLLE \
--double=true --cosmic_ray=true --eos=COSMIC_RAY "$@"
#${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --flu_scheme=MHM_RP --mhd=true --flux=HLLD \
#${PYTHON} configure.py --model=HYDRO --flu_scheme=MHM_RP --mhd=true --flux=HLLD \
# --double=true --cosmic_ray=true --eos=COSMIC_RAY "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Caustic/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --double=True "$@"
${PYTHON} configure.py --model=HYDRO --double=True "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/ClusterMerger/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=HYDRO --particle=true --gravity=true --passive=2 "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --fftw=FFTW3 --model=HYDRO --eos=GAMMA --mpi=true "$@"
${PYTHON} configure.py --fftw=FFTW3 --model=HYDRO --eos=GAMMA --mpi=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Gravity/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --gpu=true --hdf5=true --fftw=FFTW3 --model=HYDRO --gravity=true "$@"
${PYTHON} configure.py --gpu=true --hdf5=true --fftw=FFTW3 --model=HYDRO --gravity=true "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --gpu=true --fftw=FFTW3 --double=true \
${PYTHON} configure.py --gpu=true --fftw=FFTW3 --double=true \
--model=HYDRO --gravity=true --eos=GAMMA "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Jet/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --mpi=true --fftw=FFTW3 \
${PYTHON} configure.py --hdf5=true --gpu=true --mpi=true --fftw=FFTW3 \
--model=HYDRO --gravity=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/JetICMWall/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --gpu=true --model=HYDRO \
${PYTHON} configure.py --mpi=true --hdf5=true --gpu=true --model=HYDRO \
--srhd=true --eos=TAUBMATHEWS --flux=HLLC --flu_scheme=MHM \
--passive=4 "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --mpi=true --fftw=FFTW3 --model=HYDRO "$@"
${PYTHON} configure.py --hdf5=true --gpu=true --mpi=true --fftw=FFTW3 --model=HYDRO "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/MHD_ABC/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --mpi=true \
${PYTHON} configure.py --hdf5=true --gpu=true --mpi=true \
--model=HYDRO --mhd=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/MHD_LinearWave/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --double=true --model=HYDRO --mhd=true --eos=GAMMA "$@"
${PYTHON} configure.py --double=true --model=HYDRO --mhd=true --eos=GAMMA "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --hdf5=true --gpu=true --mpi=true \
${PYTHON} configure.py --hdf5=true --gpu=true --mpi=true \
--model=HYDRO --mhd=true "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true --gsl=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true --gsl=true \
--model=HYDRO --particle=true --gravity=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/ParticleTest/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=HYDRO --particle=true --tracer=true --gravity=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Plummer/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=HYDRO --particle=true --gravity=true "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Riemann/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO "$@"
${PYTHON} configure.py --model=HYDRO "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --model=HYDRO --srhd=true --double=true --eos=TAUBMATHEWS --flux=HLLC --flu_scheme=MHM --slope=PLM "$@"
${PYTHON} configure.py --model=HYDRO --srhd=true --double=true --eos=TAUBMATHEWS --flux=HLLC --flu_scheme=MHM --slope=PLM "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--model=HYDRO --gravity=true --comoving=true --dual=DE_ENPY "$@"
2 changes: 1 addition & 1 deletion example/test_problem/Hydro/Zeldovich/generate_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

PYTHON=python3

${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \
--gsl=true --double=true --model=HYDRO --gravity=true \
--comoving=true --dual=DE_ENPY --particle=true "$@"
43 changes: 39 additions & 4 deletions src/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
GAMER_CONFIG_DIR = os.path.join("..", "configs")
GAMER_MAKE_BASE = "Makefile_base"
GAMER_MAKE_OUT = "Makefile"
GAMER_LOCAL_SETTING = ".local_settings"
GAMER_GLOBAL_SETTING = "~/.config/gamer/global_settings"
GAMER_DESCRIPTION = "Prepare a customized Makefile for GAMER.\nDefault values are marked by '*'.\nUse -lh to show a detailed help message.\n"
GAMER_EPILOG = "2023 Computational Astrophysics Lab, NTU. All rights reserved.\n"

Expand Down Expand Up @@ -371,8 +373,8 @@ def load_arguments():

# machine config setup
parser.add_argument( "--machine", type=str, metavar="MACHINE",
default="eureka_intel",
help="Select the MACHINE.config file under ../configs directory.\nChoice: [eureka_intel, YOUR_MACHINE_NAME] => "
default=None,
help="Select the MACHINE.config file under ../configs directory.\nChoice: [eureka_intel, spock_intel, YOUR_MACHINE_NAME, ...] => "
)

# A. options of diffierent physical models
Expand Down Expand Up @@ -729,8 +731,11 @@ def load_config( config ):
paths, compilers = {}, {"CXX":"", "CXX_MPI":""}
flags = {"CXXFLAG":"", "OPENMPFLAG":"", "LIBFLAG":"", "NVCCFLAG_COM":"", "NVCCFLAG_FLU":"", "NVCCFLAG_POT":""}
gpus = {"GPU_COMPUTE_CAPABILITY":""}
with open( config, 'r') as f:
lines = f.readlines()
if os.path.isfile( config ):
with open( config, 'r') as f:
lines = f.readlines()
else:
raise FileNotFoundError("The config file <%s> does not exist."%(config))

for line in lines:
temp = list( filter( None, re.split(" |:=|\n", line) ) ) # separate by " " and ":="
Expand Down Expand Up @@ -760,6 +765,9 @@ def load_config( config ):
return paths, compilers, flags, gpus

def set_conditional_defaults( args ):
if args['machine'] is None:
args['machine'] = get_machine()

if args["unsplit_gravity"] is None:
args["unsplit_gravity"] = (args["model"] == "HYDRO")

Expand All @@ -784,6 +792,33 @@ def set_conditional_defaults( args ):
args["barotropic"] = (args["eos"] == "ISOTHERMAL")
return args

def get_machine():
'''
When the `--machine` flag is not given, this function will be called
and return the default machine in the following order:
1. Read the local setting located at `GAMER_LOCAL_SETTING`.
2. Read the global setting located at `GAMER_GLOBAL_SETTING`.
3. Fall back to `eureka_intel` for backward compatibility.
'''
# Check if GAMER_LOCAL_SETTING exists
local_setting = GAMER_LOCAL_SETTING
if os.path.isfile(local_setting):
with open(local_setting, 'r') as f:
for line in f:
tokens = line.strip().split()
if len(tokens) >= 2 and tokens[0] == 'machine_name':
return tokens[1]
# Check if GAMER_GLOBAL_SETTING exists
global_setting = os.path.expanduser(GAMER_GLOBAL_SETTING)
if os.path.isfile(global_setting):
with open(global_setting, 'r') as f:
for line in f:
tokens = line.strip().split()
if len(tokens) >= 2 and tokens[0] == 'machine_name':
return tokens[1]
# Fall back to `eureka_intel` for backward compatibility
return 'eureka_intel'

def set_gpu( gpus, flags, args ):
gpu_opts = {}
compute_capability = gpus["GPU_COMPUTE_CAPABILITY"]
Expand Down
Loading