Commit d891c77f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'master' into mark_tasks_in_drift

parents 08d5d289 58d36dd4
...@@ -155,6 +155,21 @@ LT_INIT ...@@ -155,6 +155,21 @@ LT_INIT
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_C_INLINE AC_C_INLINE
# If debugging try to show inlined functions.
if test "x$enable_debug" = "xyes"; then
# Show inlined functions.
if test "$ax_cv_c_compiler_vendor" = "gnu"; then
# Would like to use -gdwarf and let the compiler pick a good version
# but that doesn't always work.
AX_CHECK_COMPILE_FLAG([-gdwarf -fvar-tracking-assignments],
[inline_EXTRA_FLAGS="-gdwarf -fvar-tracking-assignments"],
[inline_EXTRA_FLAGS="-gdwarf-2 -fvar-tracking-assignments"])
CFLAGS="$CFLAGS $inline_EXTRA_FLAGS"
elif test "$ax_cv_c_compiler_vendor" = "intel"; then
CFLAGS="$CFLAGS -debug inline-debug-info"
fi
fi
# Define HAVE_POSIX_MEMALIGN if it works. # Define HAVE_POSIX_MEMALIGN if it works.
AX_FUNC_POSIX_MEMALIGN AX_FUNC_POSIX_MEMALIGN
...@@ -451,7 +466,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM( ...@@ -451,7 +466,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(
AC_MSG_RESULT($rtc_ok) AC_MSG_RESULT($rtc_ok)
# Add warning flags by default, if these can be used. Option =error adds # Add warning flags by default, if these can be used. Option =error adds
# -Werror to GCC, clang and Intel. Note do this last as compiler tests may # -Werror to GCC, clang and Intel. Note do this last as compiler tests may
# become errors, if that's an issue don't use CFLAGS for these, use an AC_SUBST(). # become errors, if that's an issue don't use CFLAGS for these, use an AC_SUBST().
AC_ARG_ENABLE([compiler-warnings], AC_ARG_ENABLE([compiler-warnings],
[AS_HELP_STRING([--enable-compiler-warnings], [AS_HELP_STRING([--enable-compiler-warnings],
...@@ -461,7 +476,7 @@ AC_ARG_ENABLE([compiler-warnings], ...@@ -461,7 +476,7 @@ AC_ARG_ENABLE([compiler-warnings],
[enable_warn="error"] [enable_warn="error"]
) )
if test "$enable_warn" != "no"; then if test "$enable_warn" != "no"; then
# AX_CFLAGS_WARN_ALL does not give good warning flags for the Intel compiler # AX_CFLAGS_WARN_ALL does not give good warning flags for the Intel compiler
# We will do this by hand instead and only default to the macro for unknown compilers # We will do this by hand instead and only default to the macro for unknown compilers
case "$ax_cv_c_compiler_vendor" in case "$ax_cv_c_compiler_vendor" in
...@@ -475,7 +490,7 @@ if test "$enable_warn" != "no"; then ...@@ -475,7 +490,7 @@ if test "$enable_warn" != "no"; then
AX_CFLAGS_WARN_ALL AX_CFLAGS_WARN_ALL
;; ;;
esac esac
# Add a "choke on warning" flag if it exists # Add a "choke on warning" flag if it exists
if test "$enable_warn" = "error"; then if test "$enable_warn" = "error"; then
case "$ax_cv_c_compiler_vendor" in case "$ax_cv_c_compiler_vendor" in
......
...@@ -8,7 +8,8 @@ iplot = 1 ; if iplot = 1, make plot of E/Lz conservation, else, simply compare f ...@@ -8,7 +8,8 @@ iplot = 1 ; if iplot = 1, make plot of E/Lz conservation, else, simply compare f
@physunits @physunits
indir = './' indir = './'
basefile = 'Disk-Patch-dynamic_' ;basefile = 'Disc-Patch-dynamic_'
basefile = 'Disc-Patch_'
; set properties of potential ; set properties of potential
uL = phys.pc ; unit of length uL = phys.pc ; unit of length
...@@ -16,18 +17,27 @@ uM = phys.msun ; unit of mass ...@@ -16,18 +17,27 @@ uM = phys.msun ; unit of mass
uV = 1d5 ; unit of velocity uV = 1d5 ; unit of velocity
; properties of patch ; properties of patch
surface_density = 10. surface_density = 100. ; surface density of all mass, which generates the gravitational potential
scale_height = 100. scale_height = 100.
z_disk = 200.; z_disk = 200. ;
fgas = 0.1 ; gas fraction
gamma = 5./3. gamma = 5./3.
; derived units ; derived units
constG = 10.^(alog10(phys.g)+alog10(uM)-2d0*alog10(uV)-alog10(uL)) ; constG = 10.^(alog10(phys.g)+alog10(uM)-2d0*alog10(uV)-alog10(uL)) ;
pcentre = [0.,0.,z_disk] * pc / uL pcentre = [0.,0.,z_disk] * pc / uL
utherm = !pi * constG * surface_density * scale_height / (gamma-1.) utherm = !pi * constG * surface_density * scale_height / (gamma-1.)
temp = (utherm*uV^2)*phys.m_h/phys.kb
soundspeed = sqrt(gamma * (gamma-1.) * utherm) soundspeed = sqrt(gamma * (gamma-1.) * utherm)
t_dyn = sqrt(scale_height / (constG * surface_density)) t_dyn = sqrt(scale_height / (constG * surface_density))
rho0 = fgas*(surface_density)/(2.*scale_height)
print,' dynamical time = ',t_dyn,' = ',t_dyn*UL/uV/(1d6*phys.yr),' Myr'
print,' thermal energy per unit mass = ',utherm
print,' central density = ',rho0,' = ',rho0*uM/uL^3/m_h,' particles/cm^3'
print,' central temperature = ',temp
lambda = 2 * !pi * phys.G^1.5 * (scale_height*uL)^1.5 * (surface_density * uM/uL^2)^0.5 * phys.m_h^2 / (gamma-1) / fgas
print,' lambda = ',lambda
stop
; ;
infile = indir + basefile + '*' infile = indir + basefile + '*'
spawn,'ls -1 '+infile,res spawn,'ls -1 '+infile,res
......
...@@ -56,9 +56,10 @@ print "UnitVelocity_in_cgs: ", const_unit_velocity_in_cgs ...@@ -56,9 +56,10 @@ print "UnitVelocity_in_cgs: ", const_unit_velocity_in_cgs
# parameters of potential # parameters of potential
surface_density = 10. surface_density = 100. # surface density of all mass, which generates the gravitational potential
scale_height = 100. scale_height = 100.
gamma = 5./3. gamma = 5./3.
fgas = 0.1 # gas fraction
# derived units # derived units
const_unit_time_in_cgs = (const_unit_length_in_cgs / const_unit_velocity_in_cgs) const_unit_time_in_cgs = (const_unit_length_in_cgs / const_unit_velocity_in_cgs)
...@@ -131,7 +132,7 @@ h = glass_h[0:numGas] ...@@ -131,7 +132,7 @@ h = glass_h[0:numGas]
numGas = numpy.shape(pos)[0] numGas = numpy.shape(pos)[0]
# compute furthe properties of ICs # compute furthe properties of ICs
column_density = surface_density * numpy.tanh(boxSize/2./scale_height) column_density = fgas * surface_density * numpy.tanh(boxSize/2./scale_height)
enclosed_mass = column_density * boxSize * boxSize enclosed_mass = column_density * boxSize * boxSize
pmass = enclosed_mass / numGas pmass = enclosed_mass / numGas
meanrho = enclosed_mass / boxSize**3 meanrho = enclosed_mass / boxSize**3
......
...@@ -13,4 +13,4 @@ The particle load of the main EAGLE simulation can be reproduced by ...@@ -13,4 +13,4 @@ The particle load of the main EAGLE simulation can be reproduced by
running these ICs on 64 cores. running these ICs on 64 cores.
MD5 checksum of the ICs: MD5 checksum of the ICs:
ada2c728db2bd2d77a20c4eef52dfaf1 EAGLE_ICs_25.hdf5 02cd1c353b86230af047b5d4ab22afcf EAGLE_ICs_25.hdf5
base = 'Feedback'
inf = 'Feedback_005.hdf5'
blast = [5.650488e-01, 5.004371e-01, 5.010494e-01] ; location of blast
pos = h5rd(inf,'PartType0/Coordinates')
vel = h5rd(inf,'PartType0/Velocities')
rho = h5rd(inf,'PartType0/Density')
utherm = h5rd(inf,'PartType0/InternalEnergy')
; shift to centre
for ic=0,2 do pos[ic,*] = pos[ic,*] - blast[ic]
;; distance from centre
dist = fltarr(n_elements(rho))
for ic=0,2 do dist = dist + pos[ic,*]^2
dist = sqrt(dist)
; radial velocity
vr = fltarr(n_elements(rho))
for ic=0,2 do vr = vr + pos[ic,*]*vel[ic,*]
vr = vr / dist
;
end
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1 # Grams
UnitLength_in_cgs: 1 # Centimeters
UnitVelocity_in_cgs: 1 # Centimeters per second
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
# Parameters governing the time integration
TimeIntegration:
time_begin: 0. # The starting time of the simulation (in internal units).
time_end: 5e-2 # The end time of the simulation (in internal units).
dt_min: 1e-7 # The minimal time-step size of the simulation (in internal units).
dt_max: 1e-4 # The maximal time-step size of the simulation (in internal units).
# Parameters governing the snapshots
Snapshots:
basename: Feedback # Common part of the name of output files
time_first: 0. # Time of the first output (in internal units)
delta_time: 1e-2 # Time difference between consecutive outputs (in internal units)
# Parameters governing the conserved quantities statistics
Statistics:
delta_time: 1e-3 # Time between statistics output
# Parameters for the hydrodynamics scheme
SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
delta_neighbours: 0.1 # The tolerance for the targetted number of neighbours.
max_smoothing_length: 0.1 # Maximal smoothing length allowed (in internal units).
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
# Parameters related to the initial conditions
InitialConditions:
file_name: ./Feedback.hdf5 # The file to read
# Parameters for feedback
SN:
time: 0.001 # time the SN explodes (internal units)
energy: 1.0 # energy of the explosion (internal units)
x: 0.5 # x-position of explostion (internal units)
y: 0.5 # y-position of explostion (internal units)
z: 0.5 # z-position of explostion (internal units)
###############################################################################
# This file is part of SWIFT.
# Copyright (c) 2013 Pedro Gonnet (pedro.gonnet@durham.ac.uk),
# Matthieu Schaller (matthieu.schaller@durham.ac.uk)
# 2016 Tom Theuns (tom.theuns@durham.ac.uk)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import h5py
import sys
from numpy import *
# Generates a swift IC file containing a cartesian distribution of particles
# at a constant density and pressure in a cubic box
# Parameters
periodic= 1 # 1 For periodic box
boxSize = 1.
L = int(sys.argv[1]) # Number of particles along one axis
rho = 1. # Density
P = 1.e-6 # Pressure
gamma = 5./3. # Gas adiabatic index
eta = 1.2349 # 48 ngbs with cubic spline kernel
fileName = "Feedback.hdf5"
#---------------------------------------------------
numPart = L**3
mass = boxSize**3 * rho / numPart
internalEnergy = P / ((gamma - 1.)*rho)
#--------------------------------------------------
#File
file = h5py.File(fileName, 'w')
# Header
grp = file.create_group("/Header")
grp.attrs["BoxSize"] = boxSize
grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0]
grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0]
grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0]
grp.attrs["Time"] = 0.0
grp.attrs["NumFilesPerSnapshot"] = 1
grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = 0
#Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
#Units
grp = file.create_group("/Units")
grp.attrs["Unit length in cgs (U_L)"] = 1.
grp.attrs["Unit mass in cgs (U_M)"] = 1.
grp.attrs["Unit time in cgs (U_t)"] = 1.
grp.attrs["Unit current in cgs (U_I)"] = 1.
grp.attrs["Unit temperature in cgs (U_T)"] = 1.
#Particle group
grp = file.create_group("/PartType0")
v = zeros((numPart, 3))
ds = grp.create_dataset('Velocities', (numPart, 3), 'f')
ds[()] = v
v = zeros(1)
m = full((numPart, 1), mass)
ds = grp.create_dataset('Masses', (numPart,1), 'f')
ds[()] = m
m = zeros(1)
h = full((numPart, 1), eta * boxSize / L)
ds = grp.create_dataset('SmoothingLength', (numPart,1), 'f')
ds[()] = h
h = zeros(1)
u = full((numPart, 1), internalEnergy)
ds = grp.create_dataset('InternalEnergy', (numPart,1), 'f')
ds[()] = u
u = zeros(1)
ids = linspace(0, numPart, numPart, endpoint=False).reshape((numPart,1))
ds = grp.create_dataset('ParticleIDs', (numPart, 1), 'L')
ds[()] = ids + 1
x = ids % L;
y = ((ids - x) / L) % L;
z = (ids - x - L * y) / L**2;
coords = zeros((numPart, 3))
coords[:,0] = z[:,0] * boxSize / L + boxSize / (2*L)
coords[:,1] = y[:,0] * boxSize / L + boxSize / (2*L)
coords[:,2] = x[:,0] * boxSize / L + boxSize / (2*L)
ds = grp.create_dataset('Coordinates', (numPart, 3), 'd')
ds[()] = coords
file.close()
...@@ -21,7 +21,7 @@ Snapshots: ...@@ -21,7 +21,7 @@ Snapshots:
# Parameters governing the conserved quantities statistics # Parameters governing the conserved quantities statistics
Statistics: Statistics:
delta_time: 1e-3 # Time between statistics output delta_time: 1e-5 # Time between statistics output
# Parameters for the hydrodynamics scheme # Parameters for the hydrodynamics scheme
SPH: SPH:
......
...@@ -76,6 +76,7 @@ void print_help_message() { ...@@ -76,6 +76,7 @@ void print_help_message() {
"Overwrite the CPU frequency (Hz) to be used for time measurements"); "Overwrite the CPU frequency (Hz) to be used for time measurements");
printf(" %2s %8s %s\n", "-g", "", printf(" %2s %8s %s\n", "-g", "",
"Run with an external gravitational potential"); "Run with an external gravitational potential");
printf(" %2s %8s %s\n", "-F", "", "Run with feedback ");
printf(" %2s %8s %s\n", "-G", "", "Run with self-gravity"); printf(" %2s %8s %s\n", "-G", "", "Run with self-gravity");
printf(" %2s %8s %s\n", "-n", "{int}", printf(" %2s %8s %s\n", "-n", "{int}",
"Execute a fixed number of time steps. When unset use the time_end " "Execute a fixed number of time steps. When unset use the time_end "
...@@ -147,6 +148,7 @@ int main(int argc, char *argv[]) { ...@@ -147,6 +148,7 @@ int main(int argc, char *argv[]) {
int nsteps = -2; int nsteps = -2;
int with_cosmology = 0; int with_cosmology = 0;
int with_external_gravity = 0; int with_external_gravity = 0;
int with_sourceterms = 0;
int with_cooling = 0; int with_cooling = 0;
int with_self_gravity = 0; int with_self_gravity = 0;
int with_hydro = 0; int with_hydro = 0;
...@@ -159,7 +161,7 @@ int main(int argc, char *argv[]) { ...@@ -159,7 +161,7 @@ int main(int argc, char *argv[]) {
/* Parse the parameters */ /* Parse the parameters */
int c; int c;
while ((c = getopt(argc, argv, "acCdDef:gGhn:st:v:y:")) != -1) switch (c) { while ((c = getopt(argc, argv, "acCdDef:FgGhn:st:v:y:")) != -1) switch (c) {
case 'a': case 'a':
with_aff = 1; with_aff = 1;
break; break;
...@@ -185,6 +187,9 @@ int main(int argc, char *argv[]) { ...@@ -185,6 +187,9 @@ int main(int argc, char *argv[]) {
return 1; return 1;
} }
break; break;
case 'F':
with_sourceterms = 1;
break;
case 'g': case 'g':
with_external_gravity = 1; with_external_gravity = 1;
break; break;
...@@ -444,6 +449,11 @@ int main(int argc, char *argv[]) { ...@@ -444,6 +449,11 @@ int main(int argc, char *argv[]) {
if (with_cooling) cooling_init(params, &us, &prog_const, &cooling_func); if (with_cooling) cooling_init(params, &us, &prog_const, &cooling_func);
if (with_cooling && myrank == 0) cooling_print(&cooling_func); if (with_cooling && myrank == 0) cooling_print(&cooling_func);
/* Initialise the feedback properties */
struct sourceterms sourceterms;
if (with_sourceterms) sourceterms_init(params, &us, &sourceterms);
if (with_sourceterms && myrank == 0) sourceterms_print(&sourceterms);
/* Construct the engine policy */ /* Construct the engine policy */
int engine_policies = ENGINE_POLICY | engine_policy_steal; int engine_policies = ENGINE_POLICY | engine_policy_steal;
if (with_drift_all) engine_policies |= engine_policy_drift_all; if (with_drift_all) engine_policies |= engine_policy_drift_all;
...@@ -452,13 +462,14 @@ int main(int argc, char *argv[]) { ...@@ -452,13 +462,14 @@ int main(int argc, char *argv[]) {
if (with_external_gravity) engine_policies |= engine_policy_external_gravity; if (with_external_gravity) engine_policies |= engine_policy_external_gravity;
if (with_cosmology) engine_policies |= engine_policy_cosmology; if (with_cosmology) engine_policies |= engine_policy_cosmology;
if (with_cooling) engine_policies |= engine_policy_cooling; if (with_cooling) engine_policies |= engine_policy_cooling;
if (with_sourceterms) engine_policies |= engine_policy_sourceterms;
/* Initialize the engine with the space and policies. */ /* Initialize the engine with the space and policies. */
if (myrank == 0) clocks_gettime(&tic); if (myrank == 0) clocks_gettime(&tic);
struct engine e; struct engine e;
engine_init(&e, &s, params, nr_nodes, myrank, nr_threads, with_aff, engine_init(&e, &s, params, nr_nodes, myrank, nr_threads, with_aff,
engine_policies, talking, &us, &prog_const, &hydro_properties, engine_policies, talking, &us, &prog_const, &hydro_properties,
&potential, &cooling_func); &potential, &cooling_func, &sourceterms);
if (myrank == 0) { if (myrank == 0) {
clocks_gettime(&toc); clocks_gettime(&toc);
message("engine_init took %.3f %s.", clocks_diff(&tic, &toc), message("engine_init took %.3f %s.", clocks_diff(&tic, &toc),
......
...@@ -12,6 +12,7 @@ Scheduler: ...@@ -12,6 +12,7 @@ Scheduler:
cell_max_size: 8000000 # (Optional) Maximal number of interactions per task if we force the split (this is the default value). cell_max_size: 8000000 # (Optional) Maximal number of interactions per task if we force the split (this is the default value).
cell_sub_size: 64000000 # (Optional) Maximal number of interactions per sub-task (this is the default value). cell_sub_size: 64000000 # (Optional) Maximal number of interactions per sub-task (this is the default value).
cell_split_size: 400 # (Optional) Maximal number of particles per cell (this is the default value). cell_split_size: 400 # (Optional) Maximal number of particles per cell (this is the default value).
cell_max_count: 10000 # (Optional) Maximal number of particles per cell allowed before triggering a sanitizing (this is the default value).
# Parameters governing the time integration # Parameters governing the time integration
TimeIntegration: TimeIntegration:
......
...@@ -131,8 +131,10 @@ def parse_files(): ...@@ -131,8 +131,10 @@ def parse_files():
file_list = [ file_list[j] for j in sorted_indices] file_list = [ file_list[j] for j in sorted_indices]
parse_header(file_list[0]) parse_header(file_list[0])
branch[i] = branch[i].replace("_", "\\_")
version.append(branch[i] + " " + revision[i] + "\n" + hydro_scheme[i] + version.append("$\\textrm{%s}$"%str(branch[i]) + " " + revision[i] + "\n" + hydro_scheme[i] +
"\n" + hydro_kernel[i] + r", $N_{ngb}=%d$"%float(hydro_neighbours[i]) + "\n" + hydro_kernel[i] + r", $N_{ngb}=%d$"%float(hydro_neighbours[i]) +
r", $\eta=%.3f$"%float(hydro_eta[i])) r", $\eta=%.3f$"%float(hydro_eta[i]))
times.append([]) times.append([])
...@@ -215,14 +217,21 @@ def plot_results(times,totalTime,speedUp,parallelEff): ...@@ -215,14 +217,21 @@ def plot_results(times,totalTime,speedUp,parallelEff):
pts = [1, 10**np.floor(np.log10(threadList[i][-1])+1)] pts = [1, 10**np.floor(np.log10(threadList[i][-1])+1)]
totalTimePlot.loglog(pts,totalTime[i][0]/pts, 'k--', lw=1., color='0.2') totalTimePlot.loglog(pts,totalTime[i][0]/pts, 'k--', lw=1., color='0.2')
totalTimePlot.loglog(threadList[i],totalTime[i],linestyle[i],label=version[i]) totalTimePlot.loglog(threadList[i],totalTime[i],linestyle[i],label=version[i])
y_min = 10**np.floor(np.log10(np.min(totalTime[:][-1])*0.6))
y_max = 1.2*10**np.floor(np.log10(np.max(totalTime[:][0]) * 1.5)+1)
totalTimePlot.set_xscale('log') totalTimePlot.set_xscale('log')
totalTimePlot.set_xlabel("${\\rm Threads}$", labelpad=0.) totalTimePlot.set_xlabel("${\\rm Threads}$", labelpad=0.)
totalTimePlot.set_ylabel("${\\rm Time~to~solution}~[{\\rm ms}]$", labelpad=0.) totalTimePlot.set_ylabel("${\\rm Time~to~solution}~[{\\rm ms}]$", labelpad=0.)
totalTimePlot.set_xlim([0.9, 10**(np.floor(np.log10(threadList[i][-1]))+0.5)]) totalTimePlot.set_xlim([0.9, 10**(np.floor(np.log10(threadList[i][-1]))+0.5)])
totalTimePlot.set_ylim([10**np.floor(np.log10(np.min(totalTime)*0.6)), 1.2*10**np.floor(np.log10(np.max(totalTime) * 1.5)+1)]) totalTimePlot.set_ylim(y_min, y_max)
ax2 = totalTimePlot.twinx()
ax2.set_yscale('log')
ax2.set_ylabel("${\\rm Time~to~solution}~[{\\rm hr}]$", labelpad=0.)
ax2.set_ylim(y_min / 3.6e6, y_max / 3.6e6)
totalTimePlot.legend(bbox_to_anchor=(1.14, 0.97), loc=2, borderaxespad=0.,prop={'size':12}, frameon=False) totalTimePlot.legend(bbox_to_anchor=(1.21, 0.97), loc=2, borderaxespad=0.,prop={'size':12}, frameon=False)
emptyPlot.axis('off') emptyPlot.axis('off')
for i, txt in enumerate(threadList[0]): for i, txt in enumerate(threadList[0]):
......
...@@ -56,8 +56,9 @@ pl.rcParams.update(PLOT_PARAMS) ...@@ -56,8 +56,9 @@ pl.rcParams.update(PLOT_PARAMS)
# Tasks and subtypes. Indexed as in tasks.h. # Tasks and subtypes. Indexed as in tasks.h.
TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair", "init", "ghost", TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair", "init", "ghost",
"kick", "kick_fixdt", "send", "recv", "grav_gather_m", "grav_fft", "extra_ghost", "kick", "kick_fixdt", "send", "recv",
"grav_mm", "grav_up", "grav_external", "count"] "grav_gather_m", "grav_fft", "grav_mm", "grav_up",
"grav_external", "cooling", "count"]
TASKCOLOURS = {"none": "black", TASKCOLOURS = {"none": "black",
"sort": "lightblue", "sort": "lightblue",
...@@ -67,6 +68,7 @@ TASKCOLOURS = {"none": "black", ...@@ -67,6 +68,7 @@ TASKCOLOURS = {"none": "black",
"sub_pair": "navy", "sub_pair": "navy",
"init": "indigo", "init": "indigo",
"ghost": "cyan", "ghost": "cyan",
"extra_ghost": "cyan",
"kick": "green", "kick": "green",
"kick_fixdt": "green", "kick_fixdt": "green",
"send": "yellow", "send": "yellow",
...@@ -76,6 +78,7 @@ TASKCOLOURS = {"none": "black", ...@@ -76,6 +78,7 @@ TASKCOLOURS = {"none": "black",
"grav_mm": "mediumturquoise", "grav_mm": "mediumturquoise",
"grav_up": "mediumvioletred", "grav_up": "mediumvioletred",
"grav_external": "darkred", "grav_external": "darkred",
"cooling": "darkblue",
"count": "powerblue"} "count": "powerblue"}
SUBTYPES = ["none", "density", "gradient", "force", "grav", "tend", "count"] SUBTYPES = ["none", "density", "gradient", "force", "grav", "tend", "count"]
...@@ -118,7 +121,7 @@ toc_step = int(full_step[5]) ...@@ -118,7 +121,7 @@ toc_step = int(full_step[5])
CPU_CLOCK = float(full_step[-1]) CPU_CLOCK = float(full_step[-1])
data = data[1:,:] data = data[1:,:]
print "CPU frequency:", CPU_CLOCK / 1.e9 print "CPU frequency:", CPU_CLOCK
# Avoid start and end times of zero. # Avoid start and end times of zero.
data = data[data[:,4] != 0] data = data[data[:,4] != 0]
...@@ -130,6 +133,7 @@ if delta_t == 0: ...@@ -130,6 +133,7 @@ if delta_t == 0:
dt = max(data[:,5]) - min(data[:,4]) dt = max(data[:,5]) - min(data[:,4])
if dt > delta_t: if dt > delta_t:
delta_t = dt delta_t = dt
print "Data range: ", delta_t / CPU_CLOCK * 1000, "ms"
# Once more doing the real gather and plots this time. # Once more doing the real gather and plots this time.
start_t = tic_step start_t = tic_step
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
""" """
Usage: Usage:
plot_tasks_MPI.py input.dat png-output-prefix [time-range-ms] plot_tasks_MPI.py input.dat png-output-prefix [time-range-ms]
where input.dat is a thread info file for a step of an MPI run. Use the '-y where input.dat is a thread info file for a step of an MPI run. Use the '-y
interval' flag of the swift MPI commands to create these. The output plots interval' flag of the swift MPI commands to create these. The output plots
will be called 'png-output-prefix<mpi-rank>.png', i.e. one each for all the will be called 'png-output-prefix<mpi-rank>.png', i.e. one each for all the
...@@ -40,6 +40,8 @@ matplotlib.use("Agg") ...@@ -40,6 +40,8 @@ matplotlib.use("Agg")