examples/msg/sendrecv/sendrecv
examples/msg/set-maestro/set-maestro
examples/msg/simulation.trace
-examples/msg/start_kill_time/start_kill_time
+examples/msg/process-startkilltime/process-startkilltime
examples/msg/process-suspend/process-suspend
examples/msg/token_ring/token_ring
examples/msg/trace/test_trace_integration
examples/java/async/java_async_compiled
examples/java/dht/chord/java_dht_chord_compiled
examples/java/dht/kademlia/java_dht_kademlia_compiled
-examples/java/cloud/java_cloud_compiled
+examples/java/cloud/masterworker/java_cloud_masterworker_compiled
examples/java/cloud/migration/java_cloud_migration_compiled
examples/java/energy/consumption/java_energy_consumption_compiled
examples/java/energy/vm/java_energy_vm_compiled
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker)
set(app_masterworker_sources ${srcdir}/Main.java ${srcdir}/Master.java ${srcdir}/Worker.java)
+set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/cloud/masterworker)
+set(cloud_masterworker_sources ${srcdir}/Main.java ${srcdir}/Master.java ${srcdir}/Worker.java)
+
+set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration)
+set(cloud_migration_sources ${srcdir}/Main.java ${srcdir}/Daemon.java ${srcdir}/Test.java
+ ${srcdir}/TestHostOnOff.java ${srcdir}/XVM.java)
+
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord)
set(dht_chord_sources ${srcdir}/Main.java ${srcdir}/ChordTask.java ${srcdir}/Common.java
${srcdir}/FindSuccessorAnswerTask.java ${srcdir}/FindSuccessorTask.java
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend)
set(process_suspend_sources ${srcdir}/Main.java ${srcdir}/DreamMaster.java ${srcdir}/LazyGuy.java)
-foreach (example app_bittorrent app_masterworker dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage
- process_kill process_migration process_startkilltime process_suspend)
+foreach (example app_bittorrent app_masterworker cloud_migration cloud_masterworker dht_chord dht_kademlia
+ energy_consumption energy_vm io_file io_storage process_kill process_migration process_startkilltime
+ process_suspend)
string (REPLACE "_" "/" example_dir ${example})
if(enable_java)
add_custom_command(
set(examples_src ${examples_src} PARENT_SCOPE)
set(tesh_files ${tesh_files} PARENT_SCOPE)
set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/generate.py PARENT_SCOPE)
-set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/README PARENT_SCOPE)
+set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/README
+ ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration/README PARENT_SCOPE)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bittorrent.xml
${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/masterworker.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml PARENT_SCOPE)
if(enable_java)
- foreach (example app_bittorrent app_masterworker dht_chord dht_kademlia energy_consumption energy_vm io_file
- io_storage process_kill process_migration process_startkilltime process_suspend)
+ foreach (example app_bittorrent app_masterworker cloud_migration cloud_masterworker dht_chord dht_kademlia
+ energy_consumption energy_vm io_file io_storage process_kill process_migration process_startkilltime
+ process_suspend)
string (REPLACE "_" "/" example_dir ${example})
ADD_TESH(java-${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
endforeach()
+++ /dev/null
-set(example java_cloud)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Cloud.java ${CMAKE_CURRENT_SOURCE_DIR}/FinalizeTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Master.java ${CMAKE_CURRENT_SOURCE_DIR}/Slave.java)
-
-if(enable_java)
- add_custom_command(
- COMMENT "Building ${example}..."
- OUTPUT ${example}_compiled
- DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
- COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}
- COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
- COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
- )
- add_custom_target(${example} ALL DEPENDS ${example}_compiled)
- ADD_TESH(java-cloud --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/cloud.tesh)
-endif()
-
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/cloud.tesh PARENT_SCOPE)
-set(examples_src ${examples_src} ${sources} PARENT_SCOPE)
+++ /dev/null
-/* Copyright (c) 2012-2014,2016. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-package cloud;
-
-import org.simgrid.msg.Task;
-
-public class FinalizeTask extends Task {
- public FinalizeTask(double compSize, double commSize) {
- super("Finalize",compSize,commSize);
- }
-}
\ No newline at end of file
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-package cloud;
+package cloud.masterworker;
import org.simgrid.msg.Msg;
import org.simgrid.msg.Host;
import org.simgrid.msg.MsgException;
-public class Cloud {
+public class Main {
public static final double task_comp_size = 10;
public static final double task_comm_size = 10;
public static final int hostNB = 2 ;
Msg.init(args);
if (args.length < 1) {
- Msg.info("Usage : Cloud platform_file");
- Msg.info("Usage : Cloud ../platforms/platform.xml");
+ Msg.info("Usage : Main platform_file");
+ Msg.info("Usage : Main ../platforms/platform.xml");
System.exit(1);
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-package cloud;
+package cloud.masterworker;
import java.util.ArrayList;
}
public void main(String[] args) throws MsgException {
- int slavesCount = Cloud.hostNB;
+ int slavesCount = Main.hostNB;
ArrayList<VM> vms = new ArrayList<VM>();
// Create one VM per host and bind a process inside each one.
VM vm = new VM(hosts[i+1],"VM0"+i);
vm.start();
vms.add(vm);
- Slave slave = new Slave(vm,i);
- Msg.info("Put Worker "+slave.getName()+ " on "+vm.getName());
- slave.start();
+ Worker worker= new Worker(vm,i);
+ Msg.info("Put Worker "+worker.getName()+ " on "+vm.getName());
+ worker.start();
}
Msg.info("Launched " + vms.size() + " VMs");
public void workBatch(int slavesCount) throws MsgException {
for (int i = 0; i < slavesCount; i++) {
- Task task = new Task("Task0" + i, Cloud.task_comp_size, Cloud.task_comm_size);
+ Task task = new Task("Task0" + i, Main.task_comp_size, Main.task_comm_size);
Msg.info("Sending to WRK0" + i);
task.send("MBOX:WRK0" + i);
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-package cloud;
+package cloud.masterworker;
import org.simgrid.msg.Msg;
import org.simgrid.msg.Host;
import org.simgrid.msg.Process;
import org.simgrid.msg.MsgException;
-public class Slave extends Process {
+public class Worker extends Process {
private int number;
- public Slave(Host host, int number) {
+ public Worker(Host host, int number) {
super(host,"WRK0" + number,null);
this.number = number;
}
Msg.debug("Received failed. I'm done. See you!");
break;
}
- if (task instanceof FinalizeTask) {
- Msg.info("Received Finalize. I'm done. See you!");
- break;
- }
Msg.info("Received \"" + task.getName() + "\". Processing it.");
try {
task.execute();
! output sort 19
-$ java -classpath ${classpath:=.} cloud/Cloud ${srcdir:=.}/../platforms/platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ java -classpath ${classpath:=.} cloud/masterworker/Main ${srcdir:=.}/../platforms/platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:maestro@) Using regular java threads.
> [ 0.000000] (0:maestro@) Start2 hosts
> [ 0.000000] (1:Master@Jacquelin) create VM00
+++ /dev/null
-set(example java_cloud_migration)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Daemon.java ${CMAKE_CURRENT_SOURCE_DIR}/Main.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Test.java ${CMAKE_CURRENT_SOURCE_DIR}/TestHostOnOff.java
- ${CMAKE_CURRENT_SOURCE_DIR}/XVM.java)
-
-if(enable_java)
- add_custom_command(
- COMMENT "Building ${example}..."
- OUTPUT ${example}_compiled
- DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
- COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/../.. ${sources}
- COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
- COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
- )
- add_custom_target(${example} ALL DEPENDS ${example}_compiled)
- ADD_TESH(java-cloud-migration --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/migration/migration.tesh)
-endif()
-
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/migration.tesh PARENT_SCOPE)
-set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deploy_simple.xml PARENT_SCOPE)
-set(examples_src ${examples_src} ${sources} PARENT_SCOPE)
-set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/README PARENT_SCOPE)
import org.simgrid.msg.Msg;
import org.simgrid.msg.Host;
import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.NativeException;
+import org.simgrid.msg.MsgException;
public class Main {
private static boolean endOfTest = false;
return endOfTest;
}
- public static void main(String[] args) throws NativeException {
+ public static void main(String[] args) throws MsgException {
Msg.init(args);
- if (args.length < 2) {
- Msg.info("Usage : Main platform_file.xml dployment_file.xml");
+ if (args.length < 1) {
+ Msg.info("Usage : Main platform_file.xml");
System.exit(1);
}
/* construct the platform and deploy the application */
Msg.createEnvironment(args[0]);
- Msg.deployApplication(args[1]);
-
+ new cloud.migration.Test("host0","Test").start();
Msg.run();
}
}
public class Test extends Process{
- Test(Host host, String name, String[] args) throws HostNotFoundException, NativeException {
- super(host, name, args);
+ Test(String hostname, String name) throws HostNotFoundException, NativeException {
+ super(hostname, name);
}
public void main(String[] strings) throws MsgException {
--- /dev/null
+#! tesh
+
+$ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/../platforms/two_hosts_platform.xml
+> [0.000000] [jmsg/INFO] Using regular java threads.
+> [host0:Test:(1) 0.000000] [jmsg/INFO] This example evaluates the migration time of a VM in presence of collocated VMs on the source and the dest nodes
+> [host0:Test:(1) 0.000000] [jmsg/INFO] The migrated VM has a memory intensity rate of 70% of the network BW and a cpu load of 90% " (see cloudcom 2013 paper "Adding a Live Migration Model Into SimGrid" for further information)
+> [host0:Test:(1) 0.000000] [jmsg/INFO] Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see whether it impacts or not the migration time
+> [host0:Test:(1) 0.000000] [jmsg/INFO] Round trip of VM1 (load 90%)
+> [host0:Test:(1) 0.000000] [jmsg/INFO] - Launch migration from host 0 to host 1
+> [host0:Test:(1) 0.000000] [jmsg/INFO] Start migration of VM vm0 to host1
+> [host0:Test:(1) 0.000000] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:8.10E+11
+> [host0:Test:(1) 35.084170] [jmsg/INFO] End of migration of VM vm0 to node host1
+> [host0:Test:(1) 35.084170] [jmsg/INFO] - End of Migration from host 0 to host 1 (duration:35.0841702956701)
+> [host0:Test:(1) 35.084170] [jmsg/INFO] - Launch migration from host 1 to host 0
+> [host0:Test:(1) 35.084170] [jmsg/INFO] Start migration of VM vm0 to host0
+> [host0:Test:(1) 35.084170] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:6.22E+11
+> [host0:Test:(1) 67.551019] [jmsg/INFO] End of migration of VM vm0 to node host0
+> [host0:Test:(1) 67.551019] [jmsg/INFO] - End of Migration from host 1 to host 0 (duration:32.46684874546391)
+> [host0:Test:(1) 67.551019] [jmsg/INFO]
+> [host0:Test:(1) 67.551019] [jmsg/INFO]
+> [host0:Test:(1) 67.551019] [jmsg/INFO] Round trip of VM1 (load 80%)
+> [host0:Test:(1) 67.551019] [jmsg/INFO] - Launch migration from host 0 to host 1
+> [host0:Test:(1) 67.551019] [jmsg/INFO] Start migration of VM vm0 to host1
+> [host0:Test:(1) 67.551019] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:4.64E+11
+> [host0:Test:(1) 102.635189] [jmsg/INFO] End of migration of VM vm0 to node host1
+> [host0:Test:(1) 102.635189] [jmsg/INFO] - End of Migration from host 0 to host 1 (duration:35.08417029567006)
+> [host0:Test:(1) 102.635189] [jmsg/INFO] - Launch migration from host 1 to host 0
+> [host0:Test:(1) 102.635189] [jmsg/INFO] Start migration of VM vm0 to host0
+> [host0:Test:(1) 102.635189] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:2.77E+11
+> [host0:Test:(1) 135.102038] [jmsg/INFO] End of migration of VM vm0 to node host0
+> [host0:Test:(1) 135.102038] [jmsg/INFO] - End of Migration from host 1 to host 0 (duration:32.46684874546395)
+> [host0:Test:(1) 135.102038] [jmsg/INFO] Forcefully destroy VMs
+> [135.102038] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4">
- <process host="host0" function="cloud/migration/Test"/>
-</platform>
+++ /dev/null
-#! tesh
-
-$ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/../platforms/two_hosts_platform.xml ${srcdir:=.}/cloud/migration/deploy_simple.xml
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] This example evaluates the migration time of a VM in presence of collocated VMs on the source and the dest nodes
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] The migrated VM has a memory intensity rate of 70% of the network BW and a cpu load of 90% " (see cloudcom 2013 paper "Adding a Live Migration Model Into SimGrid" for further information)
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see whether it impacts or not the migration time
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] Round trip of VM1 (load 90%)
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] - Launch migration from host 0 to host 1
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] Start migration of VM vm0 to host1
-> [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:8.10E+11
-> [host0:cloud/migration/Test:(1) 35.084170] [jmsg/INFO] End of migration of VM vm0 to node host1
-> [host0:cloud/migration/Test:(1) 35.084170] [jmsg/INFO] - End of Migration from host 0 to host 1 (duration:35.0841702956701)
-> [host0:cloud/migration/Test:(1) 35.084170] [jmsg/INFO] - Launch migration from host 1 to host 0
-> [host0:cloud/migration/Test:(1) 35.084170] [jmsg/INFO] Start migration of VM vm0 to host0
-> [host0:cloud/migration/Test:(1) 35.084170] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:6.22E+11
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] End of migration of VM vm0 to node host0
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] - End of Migration from host 1 to host 0 (duration:32.46684874546391)
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO]
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO]
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] Round trip of VM1 (load 80%)
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] - Launch migration from host 0 to host 1
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] Start migration of VM vm0 to host1
-> [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:4.64E+11
-> [host0:cloud/migration/Test:(1) 102.635189] [jmsg/INFO] End of migration of VM vm0 to node host1
-> [host0:cloud/migration/Test:(1) 102.635189] [jmsg/INFO] - End of Migration from host 0 to host 1 (duration:35.08417029567006)
-> [host0:cloud/migration/Test:(1) 102.635189] [jmsg/INFO] - Launch migration from host 1 to host 0
-> [host0:cloud/migration/Test:(1) 102.635189] [jmsg/INFO] Start migration of VM vm0 to host0
-> [host0:cloud/migration/Test:(1) 102.635189] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:2.77E+11
-> [host0:cloud/migration/Test:(1) 135.102038] [jmsg/INFO] End of migration of VM vm0 to node host0
-> [host0:cloud/migration/Test:(1) 135.102038] [jmsg/INFO] - End of Migration from host 1 to host 0 (duration:32.46684874546395)
-> [host0:cloud/migration/Test:(1) 135.102038] [jmsg/INFO] Forcefully destroy VMs
-> [135.102038] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
set(CMAKEFILES_TXT
examples/java/CMakeLists.txt
examples/java/async/CMakeLists.txt
- examples/java/cloud/CMakeLists.txt
- examples/java/cloud/migration/CMakeLists.txt
examples/java/mutualExclusion/CMakeLists.txt
examples/java/pingPong/CMakeLists.txt
examples/java/priority/CMakeLists.txt