Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cwishard committed Mar 9, 2023
2 parents 77a47ab + 820b826 commit fa27dcd
Show file tree
Hide file tree
Showing 14 changed files with 420 additions and 535 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
ax.set_yticks([1, 2, 4, 6, 8, 12, 16, 20, 24])
ax.set_xticks([1, 2, 4, 6, 8, 12, 16, 20, 24])
ax.grid(True)
ax.set_xlabel("Number of CPUs", fontsize=axes_fontsize)
ax.set_ylabel("Speedup (relative to Swift-SyMBA)", fontsize=axes_fontsize)
ax.set_xlabel("Number of cores", fontsize=axes_fontsize)
ax.set_ylabel("Speedup (relative to Swift)", fontsize=axes_fontsize)
ax.set_facecolor("white")
plt.plot(swest[n]['N cores'], swift[n]['wall time(s)'][0] / swest[n]['wall time(s)'], alpha=0.5, linewidth=6, label="Swiftest")
plt.plot(swomp[n]['N cores'], swift[n]['wall time(s)'][0] / swomp[n]['wall time(s)'], c="darkgreen", alpha=0.5, linewidth=6, label="Swifter-OMP")
Expand Down
38 changes: 10 additions & 28 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,29 +283,19 @@ def __init__(self,read_param: bool = False,
execute. If false, will start a new run. If the file given by `output_file_name` exists, it will be replaced
when the run is executed.
Parameter input file equivalent: `OUT_STAT`
interaction_loops : {"TRIANGULAR","FLAT","ADAPTIVE"}, default "TRIANGULAR"
interaction_loops : {"TRIANGULAR","FLAT"}, default "TRIANGULAR"
> *Swiftest Experimental feature*
Specifies which algorithm to use for the computation of body-body gravitational forces.
* "TRIANGULAR" : Upper-triangular double-loops .
* "FLAT" : Body-body interation pairs are flattened into a 1-D array.
* "ADAPTIVE" : Periodically times the TRIANGULAR and FLAT methods and determines which one to use based on
the wall time to complete the loop. *Note:* Using ADAPTIVE means that bit-identical repeatability cannot
be assured, as the choice of algorithm depends on possible external factors that can influence the wall
time calculation. The exact floating-point results of the interaction will be different between the two
algorithm types.
Parameter input file equivalent: `INTERACTION_LOOPS`
encounter_check_loops : {"TRIANGULAR","SORTSWEEP","ADAPTIVE"}, default "TRIANGULAR"
encounter_check_loops : {"TRIANGULAR","SORTSWEEP"}, default "TRIANGULAR"
> *Swiftest Experimental feature*
Specifies which algorithm to use for checking whether bodies are in a close encounter state or not.
* "TRIANGULAR" : Upper-triangular double-loops.
* "SORTSWEEP" : A Sort-Sweep algorithm is used to reduce the population of potential close encounter bodies.
This algorithm is still in development, and does not necessarily speed up the encounter checking.
Use with caution.
* "ADAPTIVE" : Periodically times the TRIANGULAR and SORTSWEEP methods and determines which one to use based
on the wall time to complete the loop. *Note:* Using ADAPTIVE means that bit-identical repeatability cannot
be assured, as the choice of algorithm depends on possible external factors that can influence the wall
time calculation. The exact floating-point results of the interaction will be different between the two
algorithm types.
Parameter input file equivalent: `ENCOUNTER_CHECK`
dask : bool, default False
Use Dask to lazily load data (useful for very large datasets)
Expand Down Expand Up @@ -1072,8 +1062,8 @@ def set_feature(self,
rhill_present: bool | None = None,
restart: bool | None = None,
tides: bool | None = None,
interaction_loops: Literal["TRIANGULAR", "FLAT", "ADAPTIVE"] | None = None,
encounter_check_loops: Literal["TRIANGULAR", "SORTSWEEP", "ADAPTIVE"] | None = None,
interaction_loops: Literal["TRIANGULAR", "FLAT"] | None = None,
encounter_check_loops: Literal["TRIANGULAR", "SORTSWEEP"] | None = None,
encounter_save: Literal["NONE", "TRAJECTORY", "CLOSEST", "BOTH"] | None = None,
verbose: bool | None = None,
simdir: str | os.PathLike = None,
Expand Down Expand Up @@ -1128,28 +1118,18 @@ def set_feature(self,
Includes big bodies when performing a discard (Swifter only)
rhill_present: bool, optional
Include the Hill's radius with the input files.
interaction_loops : {"TRIANGULAR","FLAT","ADAPTIVE"}, default "TRIANGULAR"
interaction_loops : {"TRIANGULAR","FLAT"}, default "TRIANGULAR"
*Swiftest Experimental feature*
Specifies which algorithm to use for the computation of body-body gravitational forces.
* "TRIANGULAR" : Upper-triangular double-loops .
* "FLAT" : Body-body interation pairs are flattened into a 1-D array.
* "ADAPTIVE" : Periodically times the TRIANGULAR and FLAT methods and determines which one to use based on
the wall time to complete the loop. *Note:* Using ADAPTIVE means that bit-identical repeatability cannot
be assured, as the choice of algorithm depends on possible external factors that can influence the wall
time calculation. The exact floating-point results of the interaction will be different between the two
algorithm types.
encounter_check_loops : {"TRIANGULAR","SORTSWEEP","ADAPTIVE"}, default "TRIANGULAR"
encounter_check_loops : {"TRIANGULAR","SORTSWEEP"}, default "TRIANGULAR"
*Swiftest Experimental feature*
Specifies which algorithm to use for checking whether bodies are in a close encounter state or not.
* "TRIANGULAR" : Upper-triangular double-loops.
* "SORTSWEEP" : A Sort-Sweep algorithm is used to reduce the population of potential close encounter bodies.
This algorithm is still in development, and does not necessarily speed up the encounter checking.
Use with caution.
* "ADAPTIVE" : Periodically times the TRIANGULAR and SORTSWEEP methods and determines which one to use based
on the wall time to complete the loop. *Note:* Using ADAPTIVE means that bit-identical repeatability cannot
be assured, as the choice of algorithm depends on possible external factors that can influence the wall
time calculation. The exact floating-point results of the interaction will be different between the two
algorithm types.
tides: bool, optional
Turns on tidal model (IN DEVELOPMENT - IGNORED)
Yarkovsky: bool, optional
Expand Down Expand Up @@ -1250,7 +1230,8 @@ def set_feature(self,
update_list.append("restart")

if interaction_loops is not None:
valid_vals = ["TRIANGULAR", "FLAT", "ADAPTIVE"]
valid_vals = ["TRIANGULAR", "FLAT"]
interaction_loops = interaction_loops.upper()
if interaction_loops not in valid_vals:
msg = f"{interaction_loops} is not a valid option for interaction loops."
msg += f"\nMust be one of {valid_vals}"
Expand All @@ -1262,7 +1243,8 @@ def set_feature(self,
update_list.append("interaction_loops")

if encounter_check_loops is not None:
valid_vals = ["TRIANGULAR", "SORTSWEEP", "ADAPTIVE"]
valid_vals = ["TRIANGULAR", "SORTSWEEP"]
encounter_check_loops = encounter_check_loops.upper()
if encounter_check_loops not in valid_vals:
msg = f"{encounter_check_loops} is not a valid option for interaction loops."
msg += f"\nMust be one of {valid_vals}"
Expand Down
3 changes: 0 additions & 3 deletions src/base/base_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ module base

! The following are used internally, and are not set by the user, but instead are determined by the input value of INTERACTION_LOOPS
logical :: lflatten_interactions = .false. !! Use the flattened upper triangular matrix for pl-pl interaction loops
logical :: ladaptive_interactions = .false. !! Adaptive interaction loop is turned on (choose between TRIANGULAR and FLAT based on periodic timing tests)
logical :: lencounter_sas_plpl = .false. !! Use the Sort and Sweep algorithm to prune the encounter list before checking for close encounters
logical :: lencounter_sas_pltp = .false. !! Use the Sort and Sweep algorithm to prune the encounter list before checking for close encounters
logical :: ladaptive_encounters_plpl = .false. !! Adaptive encounter checking is turned on (choose between TRIANGULAR or SORTSWEEP based on periodic timing tests)
logical :: ladaptive_encounters_pltp = .false. !! Adaptive encounter checking is turned on (choose between TRIANGULAR or SORTSWEEP based on periodic timing tests)

! Logical flags to turn on or off various features of the code
logical :: lrhill_present = .false. !! Hill radii are given as an input rather than calculated by the code (can be used to inflate close encounter regions manually)
Expand Down
Loading

0 comments on commit fa27dcd

Please sign in to comment.