Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv example from cloud to energy
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 30 Mar 2016 10:33:56 +0000 (12:33 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 30 Mar 2016 10:33:56 +0000 (12:33 +0200)
  + to match C organization

.gitignore
examples/java/CMakeLists.txt
examples/java/cloud/energy/CMakeLists.txt [deleted file]
examples/java/energy/vm/EnergyVMRunner.java [moved from examples/java/cloud/energy/EnergyVMRunner.java with 99% similarity]
examples/java/energy/vm/Main.java [moved from examples/java/cloud/energy/Main.java with 97% similarity]
examples/java/energy/vm/energy_vm.tesh [moved from examples/java/cloud/energy/energy.tesh with 91% similarity]
tools/cmake/DefinePackages.cmake

index e901bbe..792d54a 100644 (file)
@@ -976,9 +976,9 @@ 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/dht/chord/java_dht_chord_compiled
 examples/java/dht/kademlia/java_dht_kademlia_compiled
 examples/java/cloud/java_cloud_compiled
-examples/java/cloud/energy/java_cloud_energy_compiled
 examples/java/cloud/migration/java_cloud_migration_compiled
 examples/java/energy/consumption/java_energy_consumption_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
 examples/java/io/file/java_io_file_compiled
 examples/java/io/storage/java_io_storage_compiled
 examples/java/process/kill/java_process_kill_compiled
 examples/java/io/file/java_io_file_compiled
 examples/java/io/storage/java_io_storage_compiled
 examples/java/process/kill/java_process_kill_compiled
index 31ebb6d..7427c11 100644 (file)
@@ -21,11 +21,14 @@ set(dht_kademlia_sources       ${srcdir}/Main.java  ${srcdir}/Answer.java  ${src
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/consumption)
 set(energy_consumption_sources ${srcdir}/Main.java  ${srcdir}/EnergyConsumer.java)
 
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/consumption)
 set(energy_consumption_sources ${srcdir}/Main.java  ${srcdir}/EnergyConsumer.java)
 
+set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/vm)
+set(energy_vm_sources          ${srcdir}/Main.java  ${srcdir}/EnergyVMRunner.java)
+
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/file)
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/file)
-set(io_file_sources ${srcdir}/Main.java  ${srcdir}/Node.java)
+set(io_file_sources            ${srcdir}/Main.java  ${srcdir}/Node.java)
 
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/storage)
 
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/storage)
-set(io_storage_sources ${srcdir}/Main.java  ${srcdir}/Client.java)
+set(io_storage_sources         ${srcdir}/Main.java  ${srcdir}/Client.java)
 
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/kill)
 set(process_kill_sources       ${srcdir}/Main.java  ${srcdir}/Killer.java  ${srcdir}/Victim.java)
 
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/kill)
 set(process_kill_sources       ${srcdir}/Main.java  ${srcdir}/Killer.java  ${srcdir}/Victim.java)
@@ -39,7 +42,7 @@ set(process_startkilltime_sources ${srcdir}/Main.java ${srcdir}/Sleeper.java)
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend)
 set(process_suspend_sources    ${srcdir}/Main.java  ${srcdir}/DreamMaster.java  ${srcdir}/LazyGuy.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 io_file io_storage 
+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)
   string (REPLACE "_" "/" example_dir ${example})
   if(enable_java)
          process_kill process_migration process_startkilltime process_suspend)
   string (REPLACE "_" "/" example_dir ${example})
   if(enable_java)
@@ -68,8 +71,8 @@ set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bi
                                    ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml   PARENT_SCOPE)
 
 if(enable_java)
                                    ${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 io_file io_storag
-           process_kill process_migration process_startkilltime process_suspend)
+  foreach (example app_bittorrent app_masterworker dht_chord dht_kademlia energy_consumption energy_vm io_fil
+           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()
     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()
diff --git a/examples/java/cloud/energy/CMakeLists.txt b/examples/java/cloud/energy/CMakeLists.txt
deleted file mode 100644 (file)
index 0f32ce7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-set(example java_cloud_energy)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Main.java ${CMAKE_CURRENT_SOURCE_DIR}/EnergyVMRunner.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-energy --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/energy/energy.tesh)
-endif()
-
-set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh  PARENT_SCOPE)
-set(examples_src  ${examples_src}  ${sources}                               PARENT_SCOPE)
similarity index 99%
rename from examples/java/cloud/energy/EnergyVMRunner.java
rename to examples/java/energy/vm/EnergyVMRunner.java
index 34d2cf5..32ac1fb 100644 (file)
@@ -3,7 +3,7 @@
 /* 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. */
 
 /* 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.energy;
+package energy.vm;
 
 import org.simgrid.msg.*;
 import org.simgrid.msg.Process;
 
 import org.simgrid.msg.*;
 import org.simgrid.msg.Process;
similarity index 97%
rename from examples/java/cloud/energy/Main.java
rename to examples/java/energy/vm/Main.java
index d450b20..e4efa3e 100644 (file)
@@ -3,7 +3,7 @@
 /* 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. */
 
 /* 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.energy;
+package energy.vm;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
similarity index 91%
rename from examples/java/cloud/energy/energy.tesh
rename to examples/java/energy/vm/energy_vm.tesh
index df7999a..da07646 100644 (file)
@@ -1,6 +1,6 @@
 #! tesh
 
 #! tesh
 
-$ java -classpath ${classpath:=.} cloud/energy/Main ${srcdir:=.}/../platforms/energy_platform.xml
+$ java -classpath ${classpath:=.} energy/vm/Main ${srcdir:=.}/../platforms/energy_platform.xml
 > [0.000000] [jmsg/INFO] Using regular java threads.
 > [MyHost1:energy VM runner:(1) 0.000000] [jmsg/INFO] Creating and starting two VMs
 > [MyHost1:energy VM runner:(1) 0.000000] [jmsg/INFO] Create two tasks on Host1: one inside a VM, the other directly on the host
 > [0.000000] [jmsg/INFO] Using regular java threads.
 > [MyHost1:energy VM runner:(1) 0.000000] [jmsg/INFO] Creating and starting two VMs
 > [MyHost1:energy VM runner:(1) 0.000000] [jmsg/INFO] Create two tasks on Host1: one inside a VM, the other directly on the host
index b11a9df..6a32436 100644 (file)
@@ -926,7 +926,6 @@ set(CMAKEFILES_TXT
   examples/java/CMakeLists.txt
     examples/java/async/CMakeLists.txt
     examples/java/cloud/CMakeLists.txt
   examples/java/CMakeLists.txt
     examples/java/async/CMakeLists.txt
     examples/java/cloud/CMakeLists.txt
-    examples/java/cloud/energy/CMakeLists.txt
     examples/java/cloud/migration/CMakeLists.txt
     examples/java/mutualExclusion/CMakeLists.txt
     examples/java/pingPong/CMakeLists.txt
     examples/java/cloud/migration/CMakeLists.txt
     examples/java/mutualExclusion/CMakeLists.txt
     examples/java/pingPong/CMakeLists.txt