Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make example java/cloud/migration build, and add dummy tesh file.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 30 Jan 2014 12:56:41 +0000 (13:56 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 30 Jan 2014 14:26:51 +0000 (15:26 +0100)
12 files changed:
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/MakeExe.cmake
examples/java/cloud/migration-test/CONFIG/cluster_platform.xml [deleted file]
examples/java/cloud/migration/CMakeLists.txt [new file with mode: 0644]
examples/java/cloud/migration/Daemon.java [moved from examples/java/cloud/migration-test/src/Daemon.java with 77% similarity]
examples/java/cloud/migration/Main.java [moved from examples/java/cloud/migration-test/src/Main.java with 52% similarity]
examples/java/cloud/migration/Test.java [moved from examples/java/cloud/migration-test/src/Test.java with 92% similarity]
examples/java/cloud/migration/XVM.java [moved from examples/java/cloud/migration-test/src/XVM.java with 87% similarity]
examples/java/cloud/migration/deploy_simple.xml [moved from examples/java/cloud/migration-test/CONFIG/deploy_simple.xml with 70% similarity]
examples/java/cloud/migration/migration.tesh [new file with mode: 0644]
examples/java/cloud/migration/platform_simple.xml [moved from examples/java/cloud/migration-test/CONFIG/platform_simple.xml with 100% similarity]

index 5f18e9a..8036e0b 100644 (file)
@@ -561,15 +561,16 @@ if(NOT enable_memcheck)
   # 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)
index 63ed844..b4b6295 100644 (file)
@@ -873,6 +873,7 @@ set(EXAMPLES_CMAKEFILES_TXT
   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
index 59794d0..c854fb5 100644 (file)
@@ -7,6 +7,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/async)
 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)
diff --git a/examples/java/cloud/migration-test/CONFIG/cluster_platform.xml b/examples/java/cloud/migration-test/CONFIG/cluster_platform.xml
deleted file mode 100644 (file)
index e0811a0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?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
diff --git a/examples/java/cloud/migration/CMakeLists.txt b/examples/java/cloud/migration/CMakeLists.txt
new file mode 100644 (file)
index 0000000..210dc00
--- /dev/null
@@ -0,0 +1,47 @@
+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
+  )
@@ -1,3 +1,10 @@
+/* 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;
 
similarity index 52%
rename from examples/java/cloud/migration-test/src/Main.java
rename to examples/java/cloud/migration/Main.java
index d088468..68b19ac 100644 (file)
@@ -1,3 +1,10 @@
+/* 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;
@@ -18,9 +25,14 @@ public class Main {
        /* 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();
 
similarity index 92%
rename from examples/java/cloud/migration-test/src/Test.java
rename to examples/java/cloud/migration/Test.java
index d1e28b8..50e9271 100644 (file)
@@ -1,3 +1,10 @@
+/* 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;
 
similarity index 87%
rename from examples/java/cloud/migration-test/src/XVM.java
rename to examples/java/cloud/migration/XVM.java
index 5cc70f5..03dd601 100644 (file)
@@ -1,3 +1,10 @@
+/* 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;
@@ -1,6 +1,6 @@
 <?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>
diff --git a/examples/java/cloud/migration/migration.tesh b/examples/java/cloud/migration/migration.tesh
new file mode 100644 (file)
index 0000000..4c53f8d
--- /dev/null
@@ -0,0 +1,6 @@
+#! tesh
+
+$ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/cloud/migration/platform_simple.xml ${srcdir:=.}/cloud/migration/deploy_simple.xml 
+>
+> FIXME: add expected output here!
+>