# Java examples
if(enable_java)
if(WIN32)
- set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/\;${SIMGRID_JAR}")
+ set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/\;${SIMGRID_JAR}")
else()
- set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/:${SIMGRID_JAR}")
+ set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/:${SIMGRID_JAR}")
endif()
ADD_TEST(java-async ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/async/async.tesh)
ADD_TEST(java-bittorrent ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/bittorrent/bittorrent.tesh)
ADD_TEST(java-bypass ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_bypass/bypass.tesh)
ADD_TEST(java-chord ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/chord/chord.tesh)
ADD_TEST(java-cloud ${TESH_COMMAND} ${TESH_OPTION} --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)
+ ADD_TEST(java-cloud-migration ${TESH_COMMAND} ${TESH_OPTION} --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)
ADD_TEST(java-commTime ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/commTime/commtime.tesh)
ADD_TEST(java-kademlia ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/kademlia/kademlia.tesh)
ADD_TEST(java-kill ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_kill/kill.tesh)
examples/java/bittorrent/CMakeLists.txt
examples/java/chord/CMakeLists.txt
examples/java/cloud/CMakeLists.txt
+ examples/java/cloud/migration/CMakeLists.txt
examples/java/commTime/CMakeLists.txt
examples/java/io/CMakeLists.txt
examples/java/kademlia/CMakeLists.txt
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/bittorrent)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/chord)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/cloud)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/cloud/migration)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/commTime)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/io)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/kademlia)
+++ /dev/null
-<?xml version='1.0'?>
- <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
- <platform version="3">
-<AS id="AS0" routing="Full">
- <cluster id="my_cluster_1" prefix="node" suffix=""
- radical="0-1001" power="1000000000" bw="125000000" lat="5E-5"
- bb_bw="2250000000" bb_lat="5E-4"/>
-</AS>
-</platform>
\ No newline at end of file
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+
+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}/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)
+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
+ ${CMAKE_CURRENT_SOURCE_DIR}/platform_simple.xml
+ PARENT_SCOPE
+ )
+set(examples_src
+ ${examples_src}
+ ${sources}
+ PARENT_SCOPE
+ )
+set(bin_files
+ ${bin_files}
+ PARENT_SCOPE
+ )
+set(txt_files
+ ${txt_files}
+ PARENT_SCOPE
+ )
+/* Copyright (c) 2014. 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.migration;
+
import org.simgrid.msg.*;
import org.simgrid.msg.Process;
+/* Copyright (c) 2014. 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.migration;
+
import org.simgrid.msg.Host;
import org.simgrid.msg.HostNotFoundException;
import org.simgrid.msg.Msg;
/* Init. internal values */
Msg.init(args);
+ if (args.length < 2) {
+ Msg.info("Usage : Main platform_file.xml dployment_file.xml");
+ System.exit(1);
+ }
+
/* construct the platform and deploy the application */
- Msg.createEnvironment("./CONFIG/platform_simple.xml");
- Msg.deployApplication("./CONFIG/deploy_simple.xml");
+ Msg.createEnvironment(args[0]);
+ Msg.deployApplication(args[1]);
Msg.run();
+/* Copyright (c) 2014. 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.migration;
+
import org.simgrid.msg.*;
import org.simgrid.msg.Process;
+/* Copyright (c) 2014. 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.migration;
+
import org.simgrid.msg.Host;
import org.simgrid.msg.HostNotFoundException;
import org.simgrid.msg.Msg;
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
- <process host="host0" function="Test">
+ <process host="host0" function="cloud/migration/Test">
</process>
</platform>
--- /dev/null
+#! tesh
+
+$ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/cloud/migration/platform_simple.xml ${srcdir:=.}/cloud/migration/deploy_simple.xml
+>
+> FIXME: add expected output here!
+>