Skip to content

Commit 90d0967

Browse files
committed
added some scripts to /perf
1 parent ebbe221 commit 90d0967

6 files changed

+115
-0
lines changed

.hgignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ build/*
77
*.hdf5
88
*.npz
99
*.pdf
10+
*.eps
1011
*.txt
1112
*.h5
1213
*.png

perf/run_ares.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
scriptname=$1
4+
Niter=$2
5+
fnout=${scriptname/py/eps}
6+
7+
python -m cProfile -o output.pstats $scriptname $Niter
8+
gprof2dot -f pstats output.pstats | dot -Teps -o $fnout
9+

perf/test_gs_basic.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
3+
test_speed_gs_basic.py
4+
5+
Author: Jordan Mirocha
6+
Affiliation: McGill
7+
Created on: Thu 8 Aug 2019 18:30:02 EDT
8+
9+
Description:
10+
11+
"""
12+
13+
import sys
14+
import ares
15+
16+
N = int(sys.argv[1])
17+
18+
for i in range(N):
19+
print("Running iteration {}/{}".format(i+1, N))
20+
sim = ares.simulations.Global21cm(verbose=False, progress_bar=False)
21+
sim.run()
22+
23+

perf/test_gs_lfcal.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
3+
test_speed_gs_lfcal.py
4+
5+
Author: Jordan Mirocha
6+
Affiliation: McGill
7+
Created on: Thu 8 Aug 2019 18:30:02 EDT
8+
9+
Description:
10+
11+
"""
12+
13+
import sys
14+
import ares
15+
16+
N = int(sys.argv[1])
17+
pars = ares.util.ParameterBundle('mirocha2017:base')
18+
pars['verbose'] = False
19+
pars['progress_bar'] = False
20+
21+
for i in range(N):
22+
print("Running iteration {}/{}".format(i+1, N))
23+
sim = ares.simulations.Global21cm(**pars)
24+
sim.run()
25+
26+

perf/test_sam_hists.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
3+
test_sam_histories.py
4+
5+
Author: Jordan Mirocha
6+
Affiliation: McGill
7+
Created on: Thu 8 Aug 2019 18:38:06 EDT
8+
9+
Description:
10+
11+
"""
12+
13+
import sys
14+
import ares
15+
16+
N = int(sys.argv[1])
17+
pars = ares.util.ParameterBundle('in_prep:base').pars_by_pop(0, 1)
18+
pars['verbose'] = False
19+
pars['progress_bar'] = False
20+
21+
for i in range(N):
22+
print("Running iteration {}/{}".format(i+1, N))
23+
pop = ares.populations.GalaxyPopulation(**pars)
24+
hist = pop.histories
25+
26+
27+
28+
29+

perf/test_sam_synth.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
3+
test_sam_synth.py
4+
5+
Author: Jordan Mirocha
6+
Affiliation: McGill
7+
Created on: Thu 8 Aug 2019 18:38:13 EDT
8+
9+
Description:
10+
11+
"""
12+
13+
import sys
14+
import ares
15+
16+
N = int(sys.argv[1])
17+
pars = ares.util.ParameterBundle('in_prep:base').pars_by_pop(0, 1)
18+
pars['verbose'] = False
19+
pars['progress_bar'] = False
20+
21+
for i in range(N):
22+
print("Running iteration {}/{}".format(i+1, N))
23+
pop = ares.populations.GalaxyPopulation(**pars)
24+
L = pop.Luminosity(z=6., wave=1600.)
25+
26+
27+

0 commit comments

Comments
 (0)