Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • dc-oman1/swiftsim
  • swift/swiftsim
  • pdraper/swiftsim
  • tkchan/swiftsim
  • dc-turn5/swiftsim
5 results
Select Git revision
Show changes
Commits on Source (4118)
...@@ -3,4 +3,17 @@ Language: Cpp ...@@ -3,4 +3,17 @@ Language: Cpp
BasedOnStyle: Google BasedOnStyle: Google
KeepEmptyLinesAtTheStartOfBlocks: true KeepEmptyLinesAtTheStartOfBlocks: true
PenaltyBreakAssignment: 2 PenaltyBreakAssignment: 2
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
SortPriority: 3
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
- Regex: '<[[:alnum:].]+>'
Priority: 5
- Regex: '.*'
Priority: 2
SortPriority: 0
- Regex: config.h
Priority: 1
... ...
...@@ -13,6 +13,10 @@ config.sub ...@@ -13,6 +13,10 @@ config.sub
ltmain.sh ltmain.sh
libtool libtool
build build
swift
swift_mpi
fof
fof_mpi
src/version_string.h src/version_string.h
swift*.tar.gz swift*.tar.gz
...@@ -22,40 +26,66 @@ doc/html/ ...@@ -22,40 +26,66 @@ doc/html/
doc/latex/ doc/latex/
doc/man/ doc/man/
doc/Doxyfile doc/Doxyfile
doc/RTD/source/SubgridModels/*/*.png
doc/RTD/source/RadiativeTransfer/full_dependency_graph_RT.png
examples/swift
examples/swift_mpi
examples/fof
examples/fof_mpi
examples/*/*/*.xmf examples/*/*/*.xmf
examples/*/*/*.dat examples/*/*/*.dat
examples/*/*/*.png examples/*/*/*.png
examples/*/*/*.pdf
examples/*/*/*.mp4 examples/*/*/*.mp4
examples/*/*/*.txt examples/*/*/*.txt
examples/*/*/*.rst examples/*/*/*.rst
examples/*/*/*.hdf5 examples/*/*/*.hdf5
examples/*/*/*.csv examples/*/*/*.csv
examples/*/*/*.dot examples/*/*/*.dot
examples/*/*/partition_fixed_costs.h examples/**/cell_hierarchy.html
examples/*/*/energy.txt
examples/**/task_level.txt
examples/*/*/timesteps_*.txt
examples/**/timesteps.txt
examples/**/SFR.txt
examples/**/statistics.txt
examples/**/partition_fixed_costs.h
examples/*/*/memuse_report-step*.dat examples/*/*/memuse_report-step*.dat
examples/*/*/memuse_report-step*.log examples/*/*/memuse_report-step*.log
examples/*/*/restart/* examples/*/*/restart/*
examples/*/*/used_parameters.yml
examples/*/stf_output* examples/*/stf_output*
examples/*/stf.* examples/*/stf.*
examples/*/fof_output* examples/*/fof_output*
examples/*/log* examples/*/log*
examples/*/*/used_parameters.yml
examples/*/*/unused_parameters.yml examples/*/*/unused_parameters.yml
examples/*/*/fof_used_parameters.yml
examples/*/*/fof_unused_parameters.yml
examples/*/*.mpg examples/*/*.mpg
examples/*/*/gravity_checks_*.dat examples/*/*/gravity_checks_*.dat
examples/*/*/coolingtables.tar.gz examples/*/*/coolingtables.tar.gz
examples/*/*/coolingtables examples/*/*/coolingtables
examples/*/*/yieldtables.tar.gz examples/*/*/yieldtables.tar.gz
examples/*/*/yieldtables examples/*/*/yieldtables
examples/*/*/photometry.tar.gz
examples/*/*/photometry
examples/*/*/plots
examples/*/*/snapshots
examples/*/*/restart
examples/Cooling/CoolingRates/cooling_rates examples/Cooling/CoolingRates/cooling_rates
examples/Cooling/CoolingRates/cooling_element_*.dat examples/Cooling/CoolingRates/cooling_element_*.dat
examples/Cooling/CoolingRates/cooling_output.dat examples/Cooling/CoolingRates/cooling_output.dat
examples/SubgridTests/StellarEvolution/StellarEvolutionSolution* examples/SubgridTests/StellarEvolution/StellarEvolutionSolution*
examples/SubgridTests/CosmologicalStellarEvolution/StellarEvolutionSolution*
examples/SmallCosmoVolume/SmallCosmoVolume_DM/power_spectra
examples/SmallCosmoVolume/SmallCosmoVolume_cooling/snapshots/
examples/SmallCosmoVolume/SmallCosmoVolume_hydro/snapshots/
examples/**/CloudyData_UVB=HM2012.h5
examples/**/CloudyData_UVB=HM2012_shielded.h5
examples/**/CloudyData_UVB=HM2012_high_density.h5
examples/**/chemistry-AGB+OMgSFeZnSrYBaEu-16072013.h5
examples/**/POPIIsw.h5
examples/**/GRACKLE_INFO
examples/**/snap/
examples/SinkParticles/HomogeneousBox/snapshot_0003restart.hdf5
tests/testActivePair tests/testActivePair
tests/testActivePair.sh tests/testActivePair.sh
...@@ -104,14 +134,23 @@ tests/testReading ...@@ -104,14 +134,23 @@ tests/testReading
tests/testSingle tests/testSingle
tests/testTimeIntegration tests/testTimeIntegration
tests/testSPHStep tests/testSPHStep
tests/testExp
tests/testErfc
tests/testKernel tests/testKernel
tests/testKernelGrav tests/testKernelGrav
tests/testKernelLongGrav
tests/testFFT tests/testFFT
tests/testInteractions tests/testInteractions
tests/testInteractions.sh tests/testInteractions.sh
tests/testSymmetry tests/testSymmetry
tests/testDistance
tests/testHydroMPIrules
tests/testMaths tests/testMaths
tests/testAtomic
tests/testRandom tests/testRandom
tests/testRandomSpacing
tests/testRandomPoisson
tests/testRandomCone
tests/testThreadpool tests/testThreadpool
tests/testParser tests/testParser
tests/testFeedback tests/testFeedback
...@@ -126,9 +165,11 @@ tests/test125cells.sh ...@@ -126,9 +165,11 @@ tests/test125cells.sh
tests/test125cellsPerturbed.sh tests/test125cellsPerturbed.sh
tests/testParser.sh tests/testParser.sh
tests/testReading.sh tests/testReading.sh
tests/testNeutrinoCosmology.sh
tests/testSelectOutput.sh tests/testSelectOutput.sh
tests/unused_parser_output.yml tests/unused_parser_output.yml
tests/used_parser_output.yml tests/used_parser_output.yml
tests/output_list_params.yml
tests/testAdiabaticIndex tests/testAdiabaticIndex
tests/testRiemannExact tests/testRiemannExact
tests/testRiemannTRRS tests/testRiemannTRRS
...@@ -138,9 +179,10 @@ tests/testVoronoi1D ...@@ -138,9 +179,10 @@ tests/testVoronoi1D
tests/testVoronoi2D tests/testVoronoi2D
tests/testVoronoi3D tests/testVoronoi3D
tests/testDump tests/testDump
tests/testLogger tests/testCSDS
tests/benchmarkInteractions tests/benchmarkInteractions
tests/testGravityDerivatives tests/testGravityDerivatives
tests/testGravitySpeed
tests/testPotentialSelf tests/testPotentialSelf
tests/testPotentialPair tests/testPotentialPair
tests/testEOS tests/testEOS
...@@ -152,7 +194,12 @@ tests/testOutputList ...@@ -152,7 +194,12 @@ tests/testOutputList
tests/testCbrt tests/testCbrt
tests/testFormat.sh tests/testFormat.sh
tests/testCooling tests/testCooling
tests/testComovingCooling
tests/testHashmap tests/testHashmap
tests/testNeutrinoCosmology
tests/testNeutrinoFermiDirac
tests/testLog
tests/testTimeline
tests/*.png tests/*.png
tests/*.txt tests/*.txt
...@@ -164,14 +211,21 @@ theory/SPH/Flavours/sph_flavours.pdf ...@@ -164,14 +211,21 @@ theory/SPH/Flavours/sph_flavours.pdf
theory/SPH/EoS/eos.pdf theory/SPH/EoS/eos.pdf
theory/SPH/*.pdf theory/SPH/*.pdf
theory/paper_pasc/pasc_paper.pdf theory/paper_pasc/pasc_paper.pdf
theory/Multipoles/alpha_derivatives.pdf
theory/Multipoles/alpha_powers.pdf
theory/Multipoles/chi_derivatives.pdf
theory/Multipoles/sigma_derivatives.pdf
theory/Multipoles/fmm.pdf theory/Multipoles/fmm.pdf
theory/Multipoles/fmm_standalone.pdf theory/Multipoles/fmm_standalone.pdf
theory/Multipoles/potential.pdf theory/Multipoles/potential.pdf
theory/Multipoles/potential_long.pdf theory/Multipoles/potential_long.pdf
theory/Multipoles/potential_short.pdf theory/Multipoles/potential_short.pdf
theory/Multipoles/force_short.pdf theory/Multipoles/force_short.pdf
theory/Multipoles/mac_potential.pdf
theory/Cosmology/cosmology.pdf theory/Cosmology/cosmology.pdf
theory/Cooling/eagle_cooling.pdf theory/Cooling/eagle_cooling.pdf
theory/Gizmo/gizmo-implementation-details/gizmo-implementation-details.pdf
theory/RadiativeTransfer/GEARRT/GEARRT.pdf
m4/libtool.m4 m4/libtool.m4
m4/ltoptions.m4 m4/ltoptions.m4
...@@ -193,6 +247,7 @@ src/equation_of_state/planetary/*.txt ...@@ -193,6 +247,7 @@ src/equation_of_state/planetary/*.txt
# Intel compiler optimization reports # Intel compiler optimization reports
*.optrpt *.optrpt
*.opt.yaml
# Object files # Object files
.deps/ .deps/
...@@ -238,6 +293,9 @@ src/equation_of_state/planetary/*.txt ...@@ -238,6 +293,9 @@ src/equation_of_state/planetary/*.txt
*.out *.out
*.toc *.toc
## Figures
*.svg
## Intermediate documents: ## Intermediate documents:
*.dvi *.dvi
*-converted-to.* *-converted-to.*
...@@ -345,3 +403,9 @@ sympy-plots-for-*.tex/ ...@@ -345,3 +403,9 @@ sympy-plots-for-*.tex/
# vim # vim
*.swp *.swp
# black formatting
black_formatting_env
# vscode
*.json
[submodule "csds"]
path = csds
url = https://gitlab.cosma.dur.ac.uk/lhausammann/csds-reader.git
Matthieu Schaller schaller@strw.leidenuniv.nl
Pedro Gonnet gonnet@google.com Pedro Gonnet gonnet@google.com
Matthieu Schaller matthieu.schaller@durham.ac.uk
Aidan Chalk aidan.chalk@durham.ac.uk Aidan Chalk aidan.chalk@durham.ac.uk
Peter W. Draper p.w.draper@durham.ac.uk Peter W. Draper p.w.draper@durham.ac.uk
Bert Vandenbroucke bert.vandenbroucke@gmail.com Bert Vandenbroucke bert.vandenbroucke@gmail.com
...@@ -13,3 +13,22 @@ Josh Borrow joshua.borrow@durham.ac.uk ...@@ -13,3 +13,22 @@ Josh Borrow joshua.borrow@durham.ac.uk
Loic Hausammann loic.hausammann@epfl.ch Loic Hausammann loic.hausammann@epfl.ch
Yves Revaz yves.revaz@epfl.ch Yves Revaz yves.revaz@epfl.ch
Jacob Kegerreis jacob.kegerreis@durham.ac.uk Jacob Kegerreis jacob.kegerreis@durham.ac.uk
Mladen Ivkovic mladen.ivkovic@durham.ac.uk
Stuart McAlpine stuart.mcalpine@helsinki.fi
Folkert Nobels nobels@strw.leidenuniv.nl
John Helly j.c.helly@durham.ac.uk
Alexei Borissov alexei.borissov@ed.ac.uk
Yannick Bahe bahe@strw.leidenuniv.nl
Roi Kugel kugel@strw.leidenuniv.nl
Evgenii Chaikin chaikin@strw.leidenuniv.nl
Sylvia Ploeckinger ploeckinger@lorentz.leidenuniv.nl
Willem Elbers willem.h.elbers@durham.ac.uk
TK Chan chantsangkeung@gmail.com
Marcel van Daalen daalen@strw.leidenuniv.nl
Filip Husko filip.husko@durham.ac.uk
Orestis Karapiperis karapiperis@lorentz.leidenuniv.nl
Stan Verhoeve s06verhoeve@gmail.com
Nikyta Shchutskyi shchutskyi@lorentz.leidenuniv.nl
Will Roper w.roper@sussex.ac.uk
Darwin Roduit darwin.roduit@alumni.epfl.ch
Jonathan Davies j.j.davies@ljmu.ac.uk
cff-version: 1.2.0
title: >-
SWIFT: SPH With Inter-dependent Fine-grained
Tasking
message: 'If you use this software, please cite it as below'
type: software
authors:
- given-names: Matthieu
family-names: Schaller
email: schaller@strw.leidenuniv.nl
affiliation: Leiden University
orcid: 'https://orcid.org/0000-0002-2395-4902'
- given-names: Gonnet
family-names: Pedro
- given-names: Peter
family-names: Draper
- given-names: Aidan
family-names: Chalk
- given-names: Bert
family-names: Vandenbroucke
- given-names: James
family-names: Willis
- given-names: Richard
family-names: Bower
- given-names: Josh
family-names: Borrow
- given-names: Loic
family-names: Hausammann
- given-names: Yves
family-names: Revaz
- given-names: Jacob
family-names: Kegerreis
- given-names: Mladen
family-names: Ivkovic
- given-names: Stuart
family-names: McAlpine
- given-names: Folkert
family-names: Nobels
- given-names: John
family-names: Helly
- given-names: Yannick
family-names: Bahé
- given-names: Willem
family-names: Elbers
- given-names: Filip
family-names: Husko
The SWIFT source code is using a variation of the 'Google' formatting style. The SWIFT source code is using a variation of the 'Google' formatting style.
The script 'format.sh' in the root directory applies the clang-format-5.0 The script 'format.sh' in the root directory applies the clang-format-18
tool with our style choices to all the SWIFT C source file. Please apply tool with our style choices to all the SWIFT C source file. Please apply
the formatting script to the files before submitting a merge request. the formatting script to the files before submitting a merge request.
The Python scripts in the repository use default formatting enforced by
'black'. Since 'black' formatting still strongly depends on the version,
we currently enforce use of 'black==19.3b0' using a virtual environment.
The setup of the virtual environment and formatting of all PYthon
scripts is done automatically by the Python formatting script
'format_python.sh'. Please apply this script before submitting a merge
request containing new or updated Python scripts.
The SWIFT code comes with a series of unit tests that are run automatically The SWIFT code comes with a series of unit tests that are run automatically
when a push to the master branch occurs. The suite can be run by doing a `make when a push to the master branch occurs. The suite can be run by doing a `make
check` in the root directory. Please check that the test suite still check` in the root directory. Please check that the test suite still
......
### GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this This version of the GNU Lesser General Public License incorporates
license document, but changing it is not allowed. the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
This version of the GNU Lesser General Public License incorporates the 0. Additional Definitions.
terms and conditions of version 3 of the GNU General Public License,
supplemented by the additional permissions listed below.
#### 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
As used herein, "this License" refers to version 3 of the GNU Lesser "The Library" refers to a covered work governed by this License,
General Public License, and the "GNU GPL" refers to version 3 of the other than an Application or a Combined Work as defined below.
GNU General Public License.
"The Library" refers to a covered work governed by this License, other An "Application" is any work that makes use of an interface provided
than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library. by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library. of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked with which the Combined Work was made is also called the "Linked
Version". Version".
The "Minimal Corresponding Source" for a Combined Work means the The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version. based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work. Application, but excluding the System Libraries of the Combined Work.
#### 1. Exception to Section 3 of the GNU GPL. 1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL. without being bound by section 3 of the GNU GPL.
#### 2. Conveying Modified Versions. 2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified facility is invoked), then you may convey a copy of the modified
version: version:
- a) under this License, provided that you make a good faith effort a) under this License, provided that you make a good faith effort to
to ensure that, in the event an Application does not supply the ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or whatever part of its purpose remains meaningful, or
- b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy. b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
#### 3. Object Code Incorporating Material from Library Header Files. 3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a The object code form of an Application may incorporate material from
header file that is part of the Library. You may convey such object a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following: (ten or fewer lines in length), you do both of the following:
- a) Give prominent notice with each copy of the object code that a) Give prominent notice with each copy of the object code that the
the Library is used in it and that the Library and its use are Library is used in it and that the Library and its use are
covered by this License. covered by this License.
- b) Accompany the object code with a copy of the GNU GPL and this
license document. b) Accompany the object code with a copy of the GNU GPL and this license
document.
#### 4. Combined Works.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of You may convey a Combined Work under terms of your choice that,
the Library contained in the Combined Work and reverse engineering for taken together, effectively do not restrict modification of the
debugging such modifications, if you also do each of the following: portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
- a) Give prominent notice with each copy of the Combined Work that the following:
the Library is used in it and that the Library and its use are
covered by this License. a) Give prominent notice with each copy of the Combined Work that
- b) Accompany the Combined Work with a copy of the GNU GPL and this the Library is used in it and that the Library and its use are
license document. covered by this License.
- c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among b) Accompany the Combined Work with a copy of the GNU GPL and this license
these notices, as well as a reference directing the user to the document.
copies of the GNU GPL and this license document.
- d) Do one of the following: c) For a Combined Work that displays copyright notices during
- 0) Convey the Minimal Corresponding Source under the terms of execution, include the copyright notice for the Library among
this License, and the Corresponding Application Code in a form these notices, as well as a reference directing the user to the
suitable for, and under terms that permit, the user to copies of the GNU GPL and this license document.
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the d) Do one of the following:
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source. 0) Convey the Minimal Corresponding Source under the terms of this
- 1) Use a suitable shared library mechanism for linking with License, and the Corresponding Application Code in a form
the Library. A suitable mechanism is one that (a) uses at run suitable for, and under terms that permit, the user to
time a copy of the Library already present on the user's recombine or relink the Application with a modified version of
computer system, and (b) will operate properly with a modified the Linked Version to produce a modified Combined Work, in the
version of the Library that is interface-compatible with the manner specified by section 6 of the GNU GPL for conveying
Linked Version. Corresponding Source.
- e) Provide Installation Information, but only if you would
otherwise be required to provide such information under section 6 1) Use a suitable shared library mechanism for linking with the
of the GNU GPL, and only to the extent that such information is Library. A suitable mechanism is one that (a) uses at run time
necessary to install and execute a modified version of the a copy of the Library already present on the user's computer
Combined Work produced by recombining or relinking the Application system, and (b) will operate properly with a modified version
with a modified version of the Linked Version. (If you use option of the Library that is interface-compatible with the Linked
4d0, the Installation Information must accompany the Minimal Version.
Corresponding Source and Corresponding Application Code. If you
use option 4d1, you must provide the Installation Information in e) Provide Installation Information, but only if you would otherwise
the manner specified by section 6 of the GNU GPL for conveying be required to provide such information under section 6 of the
Corresponding Source.) GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
#### 5. Combined Libraries. Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
You may place library facilities that are a work based on the Library you use option 4d0, the Installation Information must accompany
side by side in a single library together with other library the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your License, and convey such a combined library under terms of your
choice, if you do both of the following: choice, if you do both of the following:
- a) Accompany the combined library with a copy of the same work a) Accompany the combined library with a copy of the same work based
based on the Library, uncombined with any other library on the Library, uncombined with any other library facilities,
facilities, conveyed under the terms of this License. conveyed under the terms of this License.
- b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the b) Give prominent notice with the combined library that part of it
accompanying uncombined form of the same work. is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
#### 6. Revised Versions of the GNU Lesser General Public License. 6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library Each version is given a distinguishing version number. If the
as you received it specifies that a certain numbered version of the Library as you received it specifies that a certain numbered version
GNU Lesser General Public License "or any later version" applies to of the GNU Lesser General Public License "or any later version"
it, you have the option of following the terms and conditions either applies to it, you have the option of following the terms and
of that published version or of any later version published by the conditions either of that published version or of any later version
Free Software Foundation. If the Library as you received it does not published by the Free Software Foundation. If the Library as you
specify a version number of the GNU Lesser General Public License, you received it does not specify a version number of the GNU Lesser
may choose any version of the GNU Lesser General Public License ever General Public License, you may choose any version of the GNU Lesser
published by the Free Software Foundation. General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the permanent authorization for you to choose that version for the
......
...@@ -37,6 +37,8 @@ SWIFT has been successfully built and tested with the following compilers: ...@@ -37,6 +37,8 @@ SWIFT has been successfully built and tested with the following compilers:
- GCC 4.8.x - GCC 4.8.x
- Intel ICC 15.0.x - Intel ICC 15.0.x
- clang 3.4.x - clang 3.4.x
- aocc 3.x
- icx (oneAPI) 2022.x
More recent versions and slightly older ones should also be able to More recent versions and slightly older ones should also be able to
build the software. build the software.
...@@ -97,7 +99,7 @@ before you can build it. ...@@ -97,7 +99,7 @@ before you can build it.
- HDF5: - HDF5:
A HDF5 library (v. 1.8.x or higher) is required to read and A HDF5 library (v. 1.10.x or higher) is required to read and
write particle data. One of the commands "h5cc" or "h5pcc" write particle data. One of the commands "h5cc" or "h5pcc"
should be available. If "h5pcc" is located then a parallel should be available. If "h5pcc" is located then a parallel
HDF5 built for the version of MPI located should be HDF5 built for the version of MPI located should be
...@@ -180,7 +182,7 @@ before you can build it. ...@@ -180,7 +182,7 @@ before you can build it.
documentation. documentation.
- python: - python:
Examples and solution script use python and rely on the numpy Examples and solution script use python 3 and rely on the numpy
library version 1.8.2 or higher. library version 1.8.2 or higher.
...@@ -189,6 +191,14 @@ before you can build it. ...@@ -189,6 +191,14 @@ before you can build it.
================== ==================
The SWIFT source code uses a variation of 'Google' style. The script The SWIFT source code uses a variation of 'Google' style. The script
'format.sh' in the root directory applies the clang-format-5.0 tool with our 'format.sh' in the root directory applies the clang-format-18 tool with our
style choices to all the SWIFT C source file. Please apply the formatting style choices to all the SWIFT C source file. Please apply the formatting
script to the files before submitting a merge request. script to the files before submitting a merge request.
The Python scripts in the repository use default formatting enforced by
'black'. Since 'black' formatting still strongly depends on the version,
we currently enforce use of 'black==19.3b0' using a virtual environment.
The setup of the virtual environment and formatting of all PYthon
scripts is done automatically by the Python formatting script
'format_python.sh'. Please apply this script before submitting a merge
request containing new or updated Python scripts.
# This file is part of SWIFT. # This file is part of SWIFT.
# Copyright (c) 2012 pedro.gonnet@durham.ac.uk # Copyright (c) 2012 pedro.gonnet@durham.ac.uk
# 2015 matthieu.schaller@durham.ac.uk # 2015 schaller@strw.leidenuniv.nl
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -19,10 +19,87 @@ ...@@ -19,10 +19,87 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
# Show the way... # Show the way...
SUBDIRS = src argparse examples doc tests tools if HAVECSDS
SUBDIRS = csds
else
SUBDIRS =
endif
SUBDIRS += src argparse examples doc tests tools
if HAVEEAGLECOOLING if HAVEEAGLECOOLING
SUBDIRS += examples/Cooling/CoolingRates SUBDIRS += examples/Cooling/CoolingRates
DIST_SUBDIRS = $(SUBDIRS)
else
DIST_SUBDIRS = $(SUBDIRS) examples/Cooling/CoolingRates
endif
# Common flags
MYFLAGS =
# Add the source directory and the non-standard paths to the included library headers to CFLAGS
AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/argparse $(HDF5_CPPFLAGS) \
$(GSL_INCS) $(FFTW_INCS) $(NUMA_INCS) $(GRACKLE_INCS) \
$(CHEALPIX_CFLAGS) $(LUSTREAPI_CFLAGS)
AM_LDFLAGS = $(HDF5_LDFLAGS)
# Extra libraries.
EXTRA_LIBS = $(GSL_LIBS) $(HDF5_LIBS) $(FFTW_LIBS) $(NUMA_LIBS) $(PROFILER_LIBS) \
$(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) \
$(CHEALPIX_LIBS) $(LUSTREAPI_LIBS)
# MPI libraries.
MPI_LIBS = $(PARMETIS_LIBS) $(METIS_LIBS) $(MPI_THREAD_LIBS) $(FFTW_MPI_LIBS)
MPI_FLAGS = -DWITH_MPI $(PARMETIS_INCS) $(METIS_INCS) $(FFTW_MPI_INCS)
# Programs.
bin_PROGRAMS = swift
# Also build the FOF tool?
if HAVESTANDALONEFOF
bin_PROGRAMS += fof
endif
# Do we have the CSDS?
if HAVECSDS
LD_CSDS = csds/src/.libs/libcsds_writer.a
else
LD_CSDS =
endif
# Build MPI versions as well?
if HAVEMPI
bin_PROGRAMS += swift_mpi
if HAVESTANDALONEFOF
bin_PROGRAMS += fof_mpi
endif
endif
# engine_policy_setaffinity is available?
if HAVESETAFFINITY
ENGINE_POLICY_SETAFFINITY=| engine_policy_setaffinity
else
ENGINE_POLICY_SETAFFINITY=
endif endif
# Sources for swift
swift_SOURCES = swift.c
swift_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_keep $(ENGINE_POLICY_SETAFFINITY)"
swift_LDADD = src/libswiftsim.la argparse/libargparse.la $(VELOCIRAPTOR_LIBS) $(EXTRA_LIBS) $(LD_CSDS)
# Sources for swift_mpi, do we need an affinity policy for MPI?
swift_mpi_SOURCES = swift.c
swift_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) $(MPI_FLAGS) -DENGINE_POLICY="engine_policy_keep $(ENGINE_POLICY_SETAFFINITY)"
swift_mpi_LDADD = src/libswiftsim_mpi.la argparse/libargparse.la $(MPI_LIBS) $(VELOCIRAPTOR_MPI_LIBS) $(EXTRA_LIBS) $(LD_CSDS)
# Sources for fof
fof_SOURCES = swift_fof.c
fof_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_keep $(ENGINE_POLICY_SETAFFINITY)"
fof_LDADD = src/.libs/libswiftsim.a argparse/.libs/libargparse.a $(VELOCIRAPTOR_LIBS) $(EXTRA_LIBS) $(LD_CSDS)
# Sources for fof_mpi, do we need an affinity policy for MPI?
fof_mpi_SOURCES = swift_fof.c
fof_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) $(MPI_FLAGS) -DENGINE_POLICY="engine_policy_keep $(ENGINE_POLICY_SETAFFINITY)"
fof_mpi_LDADD = src/.libs/libswiftsim_mpi.a argparse/.libs/libargparse.a $(MPI_LIBS) $(VELOCIRAPTOR_MPI_LIBS) $(EXTRA_LIBS) $(LD_CSDS)
# Non-standard files that should be part of the distribution. # Non-standard files that should be part of the distribution.
EXTRA_DIST = INSTALL.swift .clang-format format.sh EXTRA_DIST = INSTALL.swift .clang-format format.sh
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/____/ |__/|__/___/_/ /_/ /____/ |__/|__/___/_/ /_/
SPH With Inter-dependent Fine-grained Tasking SPH With Inter-dependent Fine-grained Tasking
Version : 0.8.3 Version : 2025.04
Website: www.swiftsim.com Website: www.swiftsim.com
Twitter: @SwiftSimulation Twitter: @SwiftSimulation
...@@ -22,7 +22,7 @@ Parameters: ...@@ -22,7 +22,7 @@ Parameters:
-h, --help show this help message and exit -h, --help show this help message and exit
Simulation options: Simulation options:
-b, --feedback Run with stars feedback. -b, --feedback Run with stars feedback.
-c, --cosmology Run with cosmological time integration. -c, --cosmology Run with cosmological time integration.
--temperature Run with temperature calculation. --temperature Run with temperature calculation.
...@@ -30,21 +30,52 @@ Parameters: ...@@ -30,21 +30,52 @@ Parameters:
-D, --drift-all Always drift all particles even the ones -D, --drift-all Always drift all particles even the ones
far from active particles. This emulates far from active particles. This emulates
Gadget-[23] and GIZMO's default behaviours. Gadget-[23] and GIZMO's default behaviours.
-F, --star-formation Run with star formation. -F, --star-formation Run with star formation.
-g, --external-gravity Run with an external gravitational potential. -g, --external-gravity Run with an external gravitational potential.
-G, --self-gravity Run with self-gravity. -G, --self-gravity Run with self-gravity.
-M, --multipole-reconstruction Reconstruct the multipoles every time-step. -M, --multipole-reconstruction Reconstruct the multipoles every time-step.
-s, --hydro Run with hydrodynamics. -s, --hydro Run with hydrodynamics.
-S, --stars Run with stars. -S, --stars Run with stars.
-B, --black-holes Run with black holes. -B, --black-holes Run with black holes.
-u, --fof Run Friends-of-Friends algorithm and -k, --sinks Run with sink particles.
black holes seeding. -u, --fof Run Friends-of-Friends algorithm to
perform black hole seeding.
--lightcone Generate lightcone outputs.
-x, --velociraptor Run with structure finding. -x, --velociraptor Run with structure finding.
--line-of-sight Run with line-of-sight outputs.
--limiter Run with time-step limiter. --limiter Run with time-step limiter.
--sync Run with time-step synchronization
of particles hit by feedback events.
--csds Run with the Continuous Simulation Data
Stream (CSDS).
-R, --radiation Run with radiative transfer.
--power Run with power spectrum outputs.
Simulation meta-options:
--quick-lyman-alpha Run with all the options needed for the
quick Lyman-alpha model. This is equivalent
to --hydro --self-gravity --stars --star-formation
--cooling.
--eagle Run with all the options needed for the
EAGLE model. This is equivalent to --hydro
--limiter --sync --self-gravity --stars
--star-formation --cooling --feedback
--black-holes --fof.
--gear Run with all the options needed for the
GEAR model. This is equivalent to --hydro
--limiter --sync --self-gravity --stars
--star-formation --cooling --feedback.
--agora Run with all the options needed for the
AGORA model. This is equivalent to --hydro
--limiter --sync --self-gravity --stars
--star-formation --cooling --feedback.
Control options: Control options:
-a, --pin Pin runners using processor affinity. -a, --pin Pin runners using processor affinity.
--nointerleave Do not interleave memory allocations across
NUMA regions.
-d, --dry-run Dry run. Read the parameter file, allocates -d, --dry-run Dry run. Read the parameter file, allocates
memory but does not read the particles memory but does not read the particles
from ICs. Exits before the start of time from ICs. Exits before the start of time
...@@ -64,14 +95,24 @@ Parameters: ...@@ -64,14 +95,24 @@ Parameters:
read from the parameter file. Can be used read from the parameter file. Can be used
more than once {sec:par:value}. more than once {sec:par:value}.
-r, --restart Continue using restart files. -r, --restart Continue using restart files.
-t, --threads=<int> The number of threads to use on each MPI -t, --threads=<int> The number of task threads to use on each
rank. Defaults to 1 if not specified. MPI rank. Defaults to 1 if not specified.
--pool-threads=<int> The number of threads to use on each MPI
rank for the threadpool operations.
Defaults to the numbers of task threads
if not specified.
-T, --timers=<int> Print timers every time-step. -T, --timers=<int> Print timers every time-step.
-v, --verbose=<int> Run in verbose mode, in MPI mode 2 outputs -v, --verbose=<int> Run in verbose mode, in MPI mode 2 outputs
from all ranks. from all ranks.
-y, --task-dumps=<int> Time-step frequency at which task analysis -y, --task-dumps=<int> Time-step frequency at which task graphs
files and/or tasks are dumped. are dumped.
--cell-dumps=<int> Time-step frequency at which cell graphs
are dumped.
-Y, --threadpool-dumps=<int> Time-step frequency at which threadpool -Y, --threadpool-dumps=<int> Time-step frequency at which threadpool
tasks are dumped. tasks are dumped.
--dump-tasks-threshold=<flt> Fraction of the total step's time spent
in a task to trigger a dump of the task plot
on this step
See the file examples/parameter_example.yml for an example of parameter file. See the file examples/parameter_example.yml for an example of parameter file.
Various hints on settings needed to get various MPIs running with SWIFT.
Last update 5th May 2020.
## Intel MPI
_Intel MPI 2018_ usually runs without any needs for special settings.
_Intel MPI 2019 and 2020_ can run for small tests, but without flags will
generally deadlock in the MPI exchanges of the engine, or worse. In that case
try the following settings.
```
FI_OFI_RXM_RX_SIZE=4096
FI_OFI_RXM_TX_SIZE=4096
FI_UNIVERSE_SIZE=2048
```
If you want use the `release_mt` library, then you also need to use:
```
source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt
```
when initializing the library environment. Some success has also been seen
using the asynchronous progression settings:
```
I_MPI_ASYNC_PROGRESS=1
I_MPI_ASYNC_PROGRESS_THREADS=1
```
(note these are tested with `2019 update-4` and `2020 update-1` on Mellanox).
## OpenMPI
_Open MPI_ comes in many flavours with many combinations of underlying
transport libraries and running on many different fabrics. A complete
description of all combinations is beyond the scope of this guide.
On Mellanox hardware, we have had success running version 4.0 with the
UCX layer version 1.6 and using the following settings:
```
-mca coll_hcoll_enable 0
UCX_TLS=ud_x,shm,self
UCX_RC_MLX5_TM_ENABLE=n
UCX_DC_MLX5_TM_ENABLE=n
```
These environment variables (set on the Mellanox-base cosma system in Durham)
for version 4.0.5 with the UCX backend can also be useful:
```
OMPI_MCA_btl ^openib
OMPI_MCA_btl_openib_flags 1
OMPI_MCA_plm_rsh_num_concurrent 768
OMPI_MCA_mpool_rdma_rcache_size_limit 209715200
```
\ No newline at end of file
<a name="logo"/>
<div align="center">
<a href="https://www.swiftsim.com/" target="_blank">
<img src="https://swift.strw.leidenuniv.nl/SWIFT_banner.jpg" alt="SWIFT banner" width="1016" height="242"></img>
</a>
</div>
SWIFT: SPH WIth Fine-grained inter-dependent Tasking SWIFT: SPH WIth Fine-grained inter-dependent Tasking
==================================================== ====================================================
...@@ -11,7 +18,7 @@ More general information about SWIFT is available on the project ...@@ -11,7 +18,7 @@ More general information about SWIFT is available on the project
[webpages](http://www.swiftsim.com). [webpages](http://www.swiftsim.com).
For information on how to _run_ SWIFT, please consult the onboarding guide For information on how to _run_ SWIFT, please consult the onboarding guide
available [here](http://www.swiftsim.com/onboarding.pdf). This includes available [here](https://swift.strw.leidenuniv.nl/onboarding.pdf). This includes
dependencies, and a few examples to get you going. dependencies, and a few examples to get you going.
We suggest that you use the latest release branch of SWIFT, rather than the We suggest that you use the latest release branch of SWIFT, rather than the
...@@ -28,11 +35,53 @@ Please feel free to submit issues to this repository, or even pull ...@@ -28,11 +35,53 @@ Please feel free to submit issues to this repository, or even pull
requests. We will try to deal with them as soon as possible, but as the requests. We will try to deal with them as soon as possible, but as the
core development team is quite small this could take some time. core development team is quite small this could take some time.
Disclaimer
----------
We would like to emphasise that SWIFT comes without any warranty of accuracy,
correctness or efficiency. As mentioned in the license, the software comes
`as-is` and the onus is on the user to get meaningful results. Whilst the
authors will endeavour to answer questions related to using the code, we
recommend users build and maintain their own copies. This documentation contains
the most basic information to get started. Reading it and possibly also the
source code is the best way to start running simulations.
The users are responsible to understand what the code is doing and for the
results of their simulation runs.
Note also that the values of the parameters given in the examples are only
indicative. We recommend users experiment by themselves and a campaign of
experimentation with various values is highly encouraged. Each problem will
likely require different values and the sensitivity to the details of the
physical model is something left to the users to explore.
Acknowledgement & Citation
-------------------------
The SWIFT code was last described in this paper:
https://ui.adsabs.harvard.edu/abs/2023arXiv230513380S. The core solver, the
numerical methods as well as many extensions where described there. We ask users
running SWIFT for their research to please cite this paper when they present
their results.
In order to keep track of usage and measure the impact of the software, we
kindly ask users publishing scientific results using SWIFT to add the following
sentence to the acknowledgement section of their papers:
"The research in this paper made use of the SWIFT open-source
simulation code (http://www.swiftsim.com, Schaller et al. 2018)
version X.Y.Z."
with the version number set to the version used for the simulations and the
reference pointing to the ASCL entry of the code: https://ascl.net/1805.020.
Contribution Guidelines Contribution Guidelines
----------------------- -----------------------
The SWIFT source code uses a variation of the 'Google' formatting style. The SWIFT source code uses a variation of the 'Google' formatting style.
The script 'format.sh' in the root directory applies the clang-format-5.0 The script 'format.sh' in the root directory applies the clang-format-18
tool with our style choices to all the SWIFT C source file. Please apply tool with our style choices to all the SWIFT C source file. Please apply
the formatting script to the files before submitting a pull request. the formatting script to the files before submitting a pull request.
...@@ -57,7 +106,7 @@ Runtime parameters ...@@ -57,7 +106,7 @@ Runtime parameters
/____/ |__/|__/___/_/ /_/ /____/ |__/|__/___/_/ /_/
SPH With Inter-dependent Fine-grained Tasking SPH With Inter-dependent Fine-grained Tasking
Version : 0.8.3 Version : 2025.04
Website: www.swiftsim.com Website: www.swiftsim.com
Twitter: @SwiftSimulation Twitter: @SwiftSimulation
...@@ -73,7 +122,7 @@ Parameters: ...@@ -73,7 +122,7 @@ Parameters:
-h, --help show this help message and exit -h, --help show this help message and exit
Simulation options: Simulation options:
-b, --feedback Run with stars feedback. -b, --feedback Run with stars feedback.
-c, --cosmology Run with cosmological time integration. -c, --cosmology Run with cosmological time integration.
--temperature Run with temperature calculation. --temperature Run with temperature calculation.
...@@ -81,21 +130,52 @@ Parameters: ...@@ -81,21 +130,52 @@ Parameters:
-D, --drift-all Always drift all particles even the ones -D, --drift-all Always drift all particles even the ones
far from active particles. This emulates far from active particles. This emulates
Gadget-[23] and GIZMO's default behaviours. Gadget-[23] and GIZMO's default behaviours.
-F, --star-formation Run with star formation. -F, --star-formation Run with star formation.
-g, --external-gravity Run with an external gravitational potential. -g, --external-gravity Run with an external gravitational potential.
-G, --self-gravity Run with self-gravity. -G, --self-gravity Run with self-gravity.
-M, --multipole-reconstruction Reconstruct the multipoles every time-step. -M, --multipole-reconstruction Reconstruct the multipoles every time-step.
-s, --hydro Run with hydrodynamics. -s, --hydro Run with hydrodynamics.
-S, --stars Run with stars. -S, --stars Run with stars.
-B, --black-holes Run with black holes. -B, --black-holes Run with black holes.
-k, --sinks Run with sink particles.
-u, --fof Run Friends-of-Friends algorithm to -u, --fof Run Friends-of-Friends algorithm to
perform black hole seeding. perform black hole seeding.
--lightcone Generate lightcone outputs.
-x, --velociraptor Run with structure finding. -x, --velociraptor Run with structure finding.
--line-of-sight Run with line-of-sight outputs.
--limiter Run with time-step limiter. --limiter Run with time-step limiter.
--sync Run with time-step synchronization
of particles hit by feedback events.
--csds Run with the Continuous Simulation Data
Stream (CSDS).
-R, --radiation Run with radiative transfer.
--power Run with power spectrum outputs.
Simulation meta-options:
--quick-lyman-alpha Run with all the options needed for the
quick Lyman-alpha model. This is equivalent
to --hydro --self-gravity --stars --star-formation
--cooling.
--eagle Run with all the options needed for the
EAGLE model. This is equivalent to --hydro
--limiter --sync --self-gravity --stars
--star-formation --cooling --feedback
--black-holes --fof.
--gear Run with all the options needed for the
GEAR model. This is equivalent to --hydro
--limiter --sync --self-gravity --stars
--star-formation --cooling --feedback.
--agora Run with all the options needed for the
GEAR model. This is equivalent to --hydro
--limiter --sync --self-gravity --stars
--star-formation --cooling --feedback.
Control options: Control options:
-a, --pin Pin runners using processor affinity. -a, --pin Pin runners using processor affinity.
--nointerleave Do not interleave memory allocations across
NUMA regions.
-d, --dry-run Dry run. Read the parameter file, allocates -d, --dry-run Dry run. Read the parameter file, allocates
memory but does not read the particles memory but does not read the particles
from ICs. Exits before the start of time from ICs. Exits before the start of time
...@@ -115,14 +195,24 @@ Parameters: ...@@ -115,14 +195,24 @@ Parameters:
read from the parameter file. Can be used read from the parameter file. Can be used
more than once {sec:par:value}. more than once {sec:par:value}.
-r, --restart Continue using restart files. -r, --restart Continue using restart files.
-t, --threads=<int> The number of threads to use on each MPI -t, --threads=<int> The number of task threads to use on each
rank. Defaults to 1 if not specified. MPI rank. Defaults to 1 if not specified.
--pool-threads=<int> The number of threads to use on each MPI
rank for the threadpool operations.
Defaults to the numbers of task threads
if not specified.
-T, --timers=<int> Print timers every time-step. -T, --timers=<int> Print timers every time-step.
-v, --verbose=<int> Run in verbose mode, in MPI mode 2 outputs -v, --verbose=<int> Run in verbose mode, in MPI mode 2 outputs
from all ranks. from all ranks.
-y, --task-dumps=<int> Time-step frequency at which task analysis -y, --task-dumps=<int> Time-step frequency at which task graphs
files and/or tasks are dumped. are dumped.
--cell-dumps=<int> Time-step frequency at which cell graphs
are dumped.
-Y, --threadpool-dumps=<int> Time-step frequency at which threadpool -Y, --threadpool-dumps=<int> Time-step frequency at which threadpool
tasks are dumped. tasks are dumped.
--dump-tasks-threshold=<flt> Fraction of the total step's time spent
in a task to trigger a dump of the task plot
on this step
See the file examples/parameter_example.yml for an example of parameter file. See the file examples/parameter_example.yml for an example of parameter file.
```
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
* Use of this source code is governed by a MIT-style license that can be found * Use of this source code is governed by a MIT-style license that can be found
* in the LICENSE file. * in the LICENSE file.
*/ */
#include "../config.h"
#include "argparse.h" #include "argparse.h"
#include <config.h>
/* System includes */
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
......
...@@ -105,20 +105,13 @@ int argparse_help_cb(struct argparse *self, ...@@ -105,20 +105,13 @@ int argparse_help_cb(struct argparse *self,
const struct argparse_option *option); const struct argparse_option *option);
// built-in option macros // built-in option macros
#define OPT_END() \ #define OPT_END() {ARGPARSE_OPT_END, 0, NULL, NULL, 0, NULL, 0, 0}
{ ARGPARSE_OPT_END, 0, NULL, NULL, 0, NULL, 0, 0 } #define OPT_BOOLEAN(...) {ARGPARSE_OPT_BOOLEAN, __VA_ARGS__}
#define OPT_BOOLEAN(...) \ #define OPT_BIT(...) {ARGPARSE_OPT_BIT, __VA_ARGS__}
{ ARGPARSE_OPT_BOOLEAN, __VA_ARGS__ } #define OPT_INTEGER(...) {ARGPARSE_OPT_INTEGER, __VA_ARGS__}
#define OPT_BIT(...) \ #define OPT_FLOAT(...) {ARGPARSE_OPT_FLOAT, __VA_ARGS__}
{ ARGPARSE_OPT_BIT, __VA_ARGS__ } #define OPT_STRING(...) {ARGPARSE_OPT_STRING, __VA_ARGS__}
#define OPT_INTEGER(...) \ #define OPT_GROUP(h) {ARGPARSE_OPT_GROUP, 0, NULL, NULL, h, NULL, 0, 0}
{ ARGPARSE_OPT_INTEGER, __VA_ARGS__ }
#define OPT_FLOAT(...) \
{ ARGPARSE_OPT_FLOAT, __VA_ARGS__ }
#define OPT_STRING(...) \
{ ARGPARSE_OPT_STRING, __VA_ARGS__ }
#define OPT_GROUP(h) \
{ ARGPARSE_OPT_GROUP, 0, NULL, NULL, h, NULL, 0, 0 }
#define OPT_HELP() \ #define OPT_HELP() \
OPT_BOOLEAN('h', "help", NULL, "show this help message and exit", \ OPT_BOOLEAN('h', "help", NULL, "show this help message and exit", \
argparse_help_cb, 0, 0) argparse_help_cb, 0, 0)
......
#include "argparse.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "argparse.h"
static const char *const usages[] = { static const char *const usages[] = {
"test_argparse [options] [[--] args]", "test_argparse [options] [[--] args]",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Update generated configuration files, i.e. do work so that a # Update generated configuration files, i.e. do work so that a
# developer checkout can be configured. # developer checkout can be configured.
autoreconf --install --symlink autoreconf --install --symlink
exit exit
This diff is collapsed.
Subproject commit 0523433a7880e58e22b2215afd0104ea58786962
This diff is collapsed.
# This file is part of SWIFT. # This file is part of SWIFT.
# Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk), # Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk),
# Matthieu Schaller (matthieu.schaller@durham.ac.uk). # Matthieu Schaller (schaller@strw.leidenuniv.nl).
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
......