From f898d54deebc8fffc087ccd0b281819a4f13f2b1 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Wed, 1 May 2019 10:04:10 +0200 Subject: [PATCH] Updated the plotting python scripts to include the new BH-related tasks. --- src/task.c | 6 ++++++ tools/plot_task_dependencies.py | 18 +++++++++++++++++- tools/task_plots/analyse_tasks.py | 6 ++++++ tools/task_plots/plot_tasks.py | 14 ++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/task.c b/src/task.c index 8bad4550af..7d79fb68a4 100644 --- a/src/task.c +++ b/src/task.c @@ -709,6 +709,12 @@ void task_get_group_name(int type, int subtype, char *cluster) { case task_subtype_stars_feedback: strcpy(cluster, "StarsFeedback"); break; + case task_subtype_bh_density: + strcpy(cluster, "BHDensity"); + break; + case task_subtype_bh_feedback: + strcpy(cluster, "BHFeedback"); + break; default: strcpy(cluster, "None"); break; diff --git a/tools/plot_task_dependencies.py b/tools/plot_task_dependencies.py index 14ba7c99f6..bb4c2780f8 100644 --- a/tools/plot_task_dependencies.py +++ b/tools/plot_task_dependencies.py @@ -136,6 +136,20 @@ def appendData(data): return data[0] +def taskIsBlackHoles(name): + """ + Does the task concern black holes? + + Parameters + ---------- + + name: str + Task name + """ + if "bh" in name or "bpart" in name: + return True + return False + def taskIsStars(name): """ Does the task concern stars? @@ -150,7 +164,6 @@ def taskIsStars(name): return True return False - def taskIsHydro(name): """ Does the task concern the hydro? @@ -291,6 +304,9 @@ def writeTask(f, name, implicit, mpi, with_calls): if mpi: txt += "shape=diamond," + if taskIsBlackHoles(name): + txt += "color=forestgreen," + if taskIsStars(name): txt += "color=darkorange1," diff --git a/tools/task_plots/analyse_tasks.py b/tools/task_plots/analyse_tasks.py index e938d0610a..baa85c338c 100755 --- a/tools/task_plots/analyse_tasks.py +++ b/tools/task_plots/analyse_tasks.py @@ -77,6 +77,7 @@ TASKTYPES = [ "extra_ghost", "drift_part", "drift_spart", + "drift_bpart", "drift_gpart", "drift_gpart_out", "hydro_end_force", @@ -103,6 +104,9 @@ TASKTYPES = [ "stars_ghost", "stars_ghost_out", "stars_sort", + "bh_in", + "bh_out", + "bh_ghost", "count", ] @@ -124,6 +128,8 @@ SUBTYPES = [ "spart", "stars_density", "stars_feedback", + "bh_density", + "bh_feedback", "count", ] diff --git a/tools/task_plots/plot_tasks.py b/tools/task_plots/plot_tasks.py index b692ee9637..5ad4eafb63 100755 --- a/tools/task_plots/plot_tasks.py +++ b/tools/task_plots/plot_tasks.py @@ -162,6 +162,7 @@ TASKTYPES = [ "extra_ghost", "drift_part", "drift_spart", + "drift_bpart", "drift_gpart", "drift_gpart_out", "hydro_end_force", @@ -188,6 +189,9 @@ TASKTYPES = [ "stars_ghost", "stars_ghost_out", "stars_sort", + "bh_in", + "bh_out", + "bh_ghost", "count", ] @@ -209,6 +213,8 @@ SUBTYPES = [ "spart", "stars_density", "stars_feedback", + "bh_density", + "bh_feedback", "count", ] @@ -254,6 +260,14 @@ FULLTYPES = [ "pair/stars_feedback", "sub_self/stars_feedback", "sub_pair/stars_feedback", + "self/bh_density", + "pair/bh_density", + "sub_self/bh_density", + "sub_pair/bh_density", + "self/bh_feedback", + "pair/bh_feedback", + "sub_self/bh_feedback", + "sub_pair/bh_feedback", ] # A number of colours for the various types. Recycled when there are -- GitLab