summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2025-06-18 09:20:20 +0200
committerYour Name <you@example.com>2025-06-18 09:20:20 +0200
commit2dbcce88ab7a73304f770006bcae53461c6daddc (patch)
tree553292e44edc971892341788b49b7eaf695ac200
parent1445f8e759a0409f561e2c811960fd65b1b64611 (diff)
threaded the loadbalancing componentHEADmaster
-rw-r--r--daemon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/daemon.c b/daemon.c
index ea1ffaa..5c50f94 100644
--- a/daemon.c
+++ b/daemon.c
@@ -35,6 +35,10 @@ void *load_balance_thread(void *arg) {
if ((max - min) > (avg / 2)) {
printf("[daemon] Triggering migration: max load node %d -> min load node %d\n", max_id, min_id);
// Call external script/function to checkpoint, scp, and restart
+ char cmd[512];
+ snprintf(cmd, sizeof(cmd), "mpirun -np 1 -host node%d checkpointandbalance.sh %d &", min_id, max_id);
+ printf("[daemon] Running on node%d: %s\n", node_id, cmd);
+ system(cmd);
char cmd[512];
snprintf(cmd, sizeof(cmd), "ssh node%d \"./migrate_heavy_job.sh %d %d\"", max_id, max_id, min_id);
system(cmd);