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

Commit

Permalink
Added new swiftest_performance example
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Mar 4, 2023
1 parent a731ec0 commit 115fe37
Show file tree
Hide file tree
Showing 154 changed files with 1,198,804 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
!Chambers2013
!solar_impact
!Swifter_Swiftest
!swiftest_performance
3 changes: 3 additions & 0 deletions examples/swiftest_performance/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!symba-performance-comparison_JOSS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*
!.gitignore
!Jul27_Test
!parallel-performance-plots.py
!README.txt
!swift
!swifter-omp
!swiftest
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*
!.gitignore
!Initial_Conditions_README
!Jul27_1k_fully.in
!Jul27_2k_fully.in
!Jul27_4k_fully.in
!Jul27_8k_fully.in
!Jul27_16k_fully.in
!Jul27_32k_fully.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Jul27_TEST Initial Conditions

- All particles are of equal mass
- Particle Density : 5 g/cm^3
- Disk Mass : 5 * M_earth
- a : Surface mass density (slope = -1.5) for (0.5 <= a <= 4.0)
- e : Gaussian disribution (mean = 0.005, sigma = 0.002)
- inc : Guassian disribution (mean = 0.5, sigma = 0.2)
- Angular Orbital Elements : Random uniform disribution

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh
This file is part of Swiftest.
Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Swiftest.
If not, see: https://www.gnu.org/licenses.

README.txt

Swiftest Example : Fragmentation
Author : David Minton
Date : March 4, 2023

Included in the symba-performance-comparison_JOSS example directory are the following files and directories:

- README.txt : This file
Jul27_Test/ : Initial conditions directory
├─ Initial_Conditions_README : Description of initial conditions files
├─ Jul27_1k_fully.in : Initial conditions for 1k fully interacting bodies
├─ Jul27_2k_fully.in : Initial conditions for 2k fully interacting bodies
├─ Jul27_4k_fully.in : Initial conditions for 4k fully interacting bodies
├─ Jul27_8k_fully.in : Initial conditions for 8k fully interacting bodies
├─ Jul27_16k_fully.in : Initial conditions for 16k fully interacting bodies
├─ Jul27_32k_fully.in : Initial conditions for 32k fully interacting bodies
swift/
swifter-omp/
swiftest/
- parallel-performance-plots.py : A Python Script that generates plots that compare the time test results for the different versions of SyMBA

This example is intended to be run with Swiftest, Swifter-OMP, and Swift SyMBA.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
swomp = {}
swest = {}
swift = {}
npl = [1, 2, 4, 8, 16, 32]
ymax = [24, 24, 24, 24, 24, 24]

for n in npl:
swomp[n] = pd.read_csv(f"swifter-omp/pl{n:02d}k/swifter-{n}k-timehist.log")
swest[n] = pd.read_csv(f"swiftest/pl{n:02d}k/swiftest-{n}k-timehist.log")
swift[n] = pd.read_csv(f"swift/pl{n:02d}k/swift-{n}k-timehist.log")


CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
y1style =(0, (5, 1)) # densly dashed line

x1line = np.arange(1,24)
y1line = np.full_like(x1line, 1.0)

for i,n in enumerate(npl):
nsteps = 1000
axes_fontsize = 32
legend_fontsize = 24
fig = plt.figure(1, figsize=(14,10), facecolor="white")
ax = fig.add_subplot(111)
plt.setp(ax.get_xticklabels(), fontsize=axes_fontsize)
plt.setp(ax.get_yticklabels(), fontsize=axes_fontsize)
ax.set_ylim([0,ymax[i]])
ax.set_xlabel("Number of CPUs", fontsize=axes_fontsize)
ax.set_ylabel("Speedup (relative to Swift-SyMBA)", 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")
plt.plot(x1line, y1line, c='k', linestyle=y1style, linewidth = 3, label ="Swift")
idealx = swest[n]['N cores']
idealy = swest[n]['N cores'] * swift[n]['wall time(s)'][0] / swest[n]['wall time(s)'][0]
plt.plot(idealx, idealy, c='k', linestyle=':', linewidth = 3, label ="ideal")
if n < 0:
plt.legend(loc='upper right', fontsize=legend_fontsize, markerscale=20)
else:
plt.legend(loc='upper left', fontsize=legend_fontsize, markerscale=20)
plt.title(f"{n}k fully interacting bodies with SyMBA", fontsize=axes_fontsize)
fig.savefig(f"swiftest_vs_swifter_{n}k.png")
plt.close(fig)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*
!.gitignore
!pl01k
!pl02k
!pl04k
!pl08k
!pl16k
!pl32k
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*
!.gitignore
!conver2swift.py
!enc.in
!Jul27_1k_fully.in
!param.in
!param.swift.in
!pl.in
!runjob.sh
!start.in
!tp.in
Loading

0 comments on commit 115fe37

Please sign in to comment.