From 197498fa99a843982f25cf430090c7acb86c0bb0 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Tue, 19 Dec 2017 01:35:19 +0100 Subject: [PATCH] add live migration plugin in java. One test fails, well be checked later update changelog --- ChangeLog | 10 ++++++++++ examples/java/cloud/masterworker/Main.java | 1 + examples/java/cloud/migration/Main.java | 2 +- src/bindings/java/jmsg.cpp | 6 ++++++ src/bindings/java/jmsg.hpp | 1 + src/bindings/java/org/simgrid/msg/Msg.java | 1 + 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 83c32a949b..b271e22318 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,16 @@ SimGrid (3.18) NOT RELEASED YET (target: December 24 2017) - LMM stuff moved to its own namespace: simgrid::kernel::lmm. - Renamed LMM classes (e.g. s_lmm_system_t -> System). + Virtual Machines + - Live migration is getting moved to a plugin. Dirty page tracking is + the first part of this plugin. This imply that VM migration is now + only possible if one this function is called : + - C/MSG: MSG_vm_live_migration_plugin_init() + - C/C++: sg_vm_live_migration_plugin_init() + - Java: Msg.liveMigrationInit() + For C and C++, "simgrid/plugins/live_migration.h" also has to be + included. + XBT - Define class simgrid::xbt::Path to manage file names. - Removed unused functions: diff --git a/examples/java/cloud/masterworker/Main.java b/examples/java/cloud/masterworker/Main.java index 5623ffa5e2..8406958c28 100644 --- a/examples/java/cloud/masterworker/Main.java +++ b/examples/java/cloud/masterworker/Main.java @@ -22,6 +22,7 @@ class Main { public static void main(String[] args) { Msg.init(args); + Msg.liveMigrationInit(); String platfFile = "../../examples/platforms/small_platform.xml"; if (args.length >= 1) diff --git a/examples/java/cloud/migration/Main.java b/examples/java/cloud/migration/Main.java index b03c4b465a..191b2a170b 100644 --- a/examples/java/cloud/migration/Main.java +++ b/examples/java/cloud/migration/Main.java @@ -26,7 +26,7 @@ public class Main { public static void main(String[] args) throws MsgException { Msg.init(args); - + Msg.liveMigrationInit(); if (args.length < 1) { Msg.info("Usage : Main platform_file.xml"); System.exit(1); diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index 44f5f5fbcb..b821c474b1 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -12,6 +12,7 @@ #include "simgrid/msg.h" #include "simgrid/plugins/energy.h" #include "simgrid/plugins/file_system.h" +#include "simgrid/plugins/live_migration.h" #include "simgrid/simix.h" #include "simgrid/s4u/Host.hpp" @@ -241,6 +242,11 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() { sg_host_energy_plugin_init(); } +JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_liveMigrationInit() +{ + sg_vm_live_migration_plugin_init(); +} + JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_fileSystemInit() { sg_storage_file_system_init(); diff --git a/src/bindings/java/jmsg.hpp b/src/bindings/java/jmsg.hpp index e7d0919c0f..e6107351e5 100644 --- a/src/bindings/java/jmsg.hpp +++ b/src/bindings/java/jmsg.hpp @@ -37,6 +37,7 @@ JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs); JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit(); +JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_liveMigrationInit(); JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_fileSystemInit(); JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass cls, jstring jargs); diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java index cc1cb7d0ba..86a14b4846 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -41,6 +41,7 @@ public final class Msg { /** Tell the kernel that you want to use the energy plugin */ public static final native void energyInit(); public static final native void fileSystemInit(); + public static final native void liveMigrationInit(); /** Run the MSG simulation. * -- 2.20.1