From f9c27ed0fa9cb0250d78352adbed23c60d7f7a77 Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Thu, 28 Sep 2017 10:34:01 +0100
Subject: [PATCH] Add costs to MPI tasks

These are meant to be larger than other tasks, keep recv at a slighly lower cost as that is a speculative call (to MPI_Test), whereas sends are expecting a result

(cherry picked from commit bfcebf24834c63434407f6565a0e0cd7731ee3c9)
---
 src/scheduler.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/scheduler.c b/src/scheduler.c
index b2466d5510..5f379a8bac 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -1038,6 +1038,12 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
       case task_type_timestep:
         cost = wscale * t->ci->count;
         break;
+      case task_type_send:
+        cost = 10 * wscale * t->ci->count * t->ci->count;
+        break;
+      case task_type_recv:
+        cost = 5 * wscale * t->ci->count * t->ci->count;
+        break;
       default:
         cost = 0;
         break;
-- 
GitLab