## touched files to track the dependencies of java examples
examples/java/async/java_async_compiled
examples/java/bittorrent/java_bittorrent_compiled
-examples/java/chord/java_chord_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/commTime/java_commTime_compiled
examples/java/energy/java_energy_compiled
examples/java/io/java_io_compiled
-examples/java/kademlia/java_kademlia_compiled
examples/java/process/kill/java_process_kill_compiled
examples/java/process/migration/java_process_migration_compiled
-examples/java/process_suspend/java_process_suspend_compiled
+examples/java/process/suspend/java_process_suspend_compiled
examples/java/masterworker/java_masterworker_compiled
examples/java/mutualExclusion/java_mutualExclusion_compiled
examples/java/pingPong/java_pingPong_compiled
+set(dht_chord_sources ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/Main.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/ChordTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/Common.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/FindSuccessorAnswerTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/FindSuccessorTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/GetPredecessorAnswerTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/GetPredecessorTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/Node.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/NotifyTask.java)
+set(dht_kademlia_sources ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Main.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Answer.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Bucket.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Common.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Contact.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/FindNodeAnswerTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/FindNodeTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/KademliaTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/Node.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/PingAnswerTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/PingTask.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/RoutingTable.java)
set(process_kill_sources ${CMAKE_CURRENT_SOURCE_DIR}/process/kill/Main.java
${CMAKE_CURRENT_SOURCE_DIR}/process/kill/Killer.java
${CMAKE_CURRENT_SOURCE_DIR}/process/kill/Victim.java)
${CMAKE_CURRENT_SOURCE_DIR}/process/suspend/DreamMaster.java
${CMAKE_CURRENT_SOURCE_DIR}/process/suspend/LazyGuy.java)
-foreach (example process_kill process_migration process_suspend)
+foreach (example dht_chord dht_kademlia process_kill process_migration process_suspend)
string (REPLACE "_" "/" example_dir ${example})
if(enable_java)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
endforeach()
-set(examples_src ${examples_src} PARENT_SCOPE)
-set(tesh_files ${tesh_files} PARENT_SCOPE)
+set(examples_src ${examples_src} PARENT_SCOPE)
+set(tesh_files ${tesh_files} PARENT_SCOPE)
+set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml PARENT_SCOPE)
if(enable_java)
- foreach (example process_kill process_migration process_suspend)
+ foreach (example dht_chord dht_kademlia process_kill process_migration 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_chord)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Chord.java ${CMAKE_CURRENT_SOURCE_DIR}/ChordTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Common.java ${CMAKE_CURRENT_SOURCE_DIR}/FindSuccessorAnswerTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/FindSuccessorTask.java ${CMAKE_CURRENT_SOURCE_DIR}/GetPredecessorAnswerTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/GetPredecessorTask.java ${CMAKE_CURRENT_SOURCE_DIR}/Node.java
- ${CMAKE_CURRENT_SOURCE_DIR}/NotifyTask.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-chord --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)
-endif()
-
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/chord.tesh PARENT_SCOPE)
-set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/chord.xml PARENT_SCOPE)
-set(examples_src ${examples_src} ${sources} PARENT_SCOPE)
+++ /dev/null
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} chord/Chord ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/chord/chord.xml
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [652.540924] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
-> [Boivin:chord.Node:(7) 0.000000] [jmsg/INFO] Joining the ring with id 8 knowing node 1
-> [Gatien:chord.Node:(1) 0.000000] [jmsg/INFO] Joining the ring with id 48 knowing node 1
-> [Geoff:chord.Node:(4) 0.000000] [jmsg/INFO] Joining the ring with id 32 knowing node 1
-> [Jean_Yves:chord.Node:(6) 0.000000] [jmsg/INFO] Joining the ring with id 14 knowing node 1
-> [McGee:chord.Node:(2) 0.000000] [jmsg/INFO] Joining the ring with id 42 knowing node 1
-> [TeX:chord.Node:(5) 0.000000] [jmsg/INFO] Joining the ring with id 21 knowing node 1
-> [iRMX:chord.Node:(3) 0.000000] [jmsg/INFO] Joining the ring with id 38 knowing node 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 chord;
+package dht.chord;
-import chord.Common;
+import dht.chord.Common;
import org.simgrid.msg.Task;
public class ChordTask extends Task {
/* 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 chord;
+package dht.chord;
public class Common {
public final static int COMM_SIZE = 10;
/* 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 chord;
+package dht.chord;
public class FindSuccessorAnswerTask extends ChordTask {
public int answerId;
/* 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 chord;
+package dht.chord;
public class FindSuccessorTask extends ChordTask {
public int requestId;
-
+
public FindSuccessorTask(String issuerHostname, String answerTo, int requestId) {
super(issuerHostname, answerTo);
this.requestId = requestId;
/* 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 chord;
+package dht.chord;
public class GetPredecessorAnswerTask extends ChordTask {
public int answerId;
/* 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 chord;
+package dht.chord;
public class GetPredecessorTask extends ChordTask {
public GetPredecessorTask(String issuerHostName, String answerTo) {
/* 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 chord;
+package dht.chord;
import org.simgrid.msg.Msg;
-public class Chord {
+public class Main {
public static void main(String[] args) {
Msg.init(args);
if(args.length < 2) {
/* 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 chord;
+package dht.chord;
import org.simgrid.msg.Msg;
import org.simgrid.msg.Comm;
/* 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 chord;
+package dht.chord;
public class NotifyTask extends ChordTask {
public int requestId;
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4">
- <process host="Gatien" function="chord.Node">
+ <process host="Gatien" function="dht.chord.Node">
<argument value="48"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="400"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="McGee" function="chord.Node">
+ <process host="McGee" function="dht.chord.Node">
<argument value="42"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="300"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="iRMX" function="chord.Node">
+ <process host="iRMX" function="dht.chord.Node">
<argument value="38"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="200"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="Geoff" function="chord.Node">
+ <process host="Geoff" function="dht.chord.Node">
<argument value="32"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="100"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="TeX" function="chord.Node">
+ <process host="TeX" function="dht.chord.Node">
<argument value="21"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="40"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="Jean_Yves" function="chord.Node">
+ <process host="Jean_Yves" function="dht.chord.Node">
<argument value="14"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="16"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="Boivin" function="chord.Node">
+ <process host="Boivin" function="dht.chord.Node">
<argument value="8"/> <!-- my id -->
<argument value="1"/> <!-- known id -->
<argument value="1"/> <!-- time to sleep before it starts-->
<argument value ="600"/> <!-- deadline -->
</process>
- <process host="Jacquelin" function="chord.Node">
+ <process host="Jacquelin" function="dht.chord.Node">
<argument value="1"/> <!-- my id -->
<argument value ="600"/> <!-- deadline -->
</process>
--- /dev/null
+#! tesh
+
+! output sort 19
+
+$ java -classpath ${classpath:=.} dht/chord/Main ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/dht/chord/chord.xml
+> [0.000000] [jmsg/INFO] Using regular java threads.
+> [652.540924] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [Boivin:dht.chord.Node:(7) 0.000000] [jmsg/INFO] Joining the ring with id 8 knowing node 1
+> [Gatien:dht.chord.Node:(1) 0.000000] [jmsg/INFO] Joining the ring with id 48 knowing node 1
+> [Geoff:dht.chord.Node:(4) 0.000000] [jmsg/INFO] Joining the ring with id 32 knowing node 1
+> [Jean_Yves:dht.chord.Node:(6) 0.000000] [jmsg/INFO] Joining the ring with id 14 knowing node 1
+> [McGee:dht.chord.Node:(2) 0.000000] [jmsg/INFO] Joining the ring with id 42 knowing node 1
+> [TeX:dht.chord.Node:(5) 0.000000] [jmsg/INFO] Joining the ring with id 21 knowing node 1
+> [iRMX:dht.chord.Node:(3) 0.000000] [jmsg/INFO] Joining the ring with id 38 knowing node 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 kademlia;
+package dht.kademlia;
import java.util.ArrayList;
import java.util.Collections;
/* 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 kademlia;
+package dht.kademlia;
import java.util.ArrayList;
public class Bucket {
/* 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 kademlia;
+package dht.kademlia;
public class Common {
/* Common constants used all over the simulation */
/* 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 kademlia;
+package dht.kademlia;
public class Contact implements Comparable<Object> {
private int id;
/* 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 kademlia;
-import kademlia.Answer;
+package dht.kademlia;
+import dht.kademlia.Answer;
public class FindNodeAnswerTask extends KademliaTask {
protected int destinationId;
/* 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 kademlia;
+package dht.kademlia;
/**
* @brief Find node tasks sent by a node to another "Find Node" task sent by a node to another. Ask him for its closest
/* 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 kademlia;
-import kademlia.Common;
+package dht.kademlia;
+import dht.kademlia.Common;
import org.simgrid.msg.Task;
/* 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 kademlia;
+package dht.kademlia;
import org.simgrid.msg.Msg;
import org.simgrid.msg.MsgException;
-public class Kademlia {
+public class Main {
public static void main(String[] args) throws MsgException {
Msg.init(args);
if(args.length < 2) {
/* 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 kademlia;
+package dht.kademlia;
import org.simgrid.msg.Host;
/* 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 kademlia;
+package dht.kademlia;
public class PingAnswerTask extends KademliaTask {
public PingAnswerTask(int senderId) {
/* 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 kademlia;
+package dht.kademlia;
public class PingTask extends KademliaTask {
public PingTask(int senderId) {
/* 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 kademlia;
+package dht.kademlia;
import java.util.Collections;
import java.util.Vector;
--- /dev/null
+#! tesh
+
+! output sort 19
+
+$ java -classpath ${classpath:=.} dht/kademlia/Main ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/dht/kademlia/kademlia.xml
+> [0.000000] [jmsg/INFO] Using regular java threads.
+> [900.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [Boivin:dht.kademlia.Node:(2) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 1!
+> [Boivin:dht.kademlia.Node:(2) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+> [Jacquelin:dht.kademlia.Node:(1) 0.000000] [jmsg/INFO] Hi, I'm going to create the network with the id 0!
+> [Jacquelin:dht.kademlia.Node:(1) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+> [Jean_Yves:dht.kademlia.Node:(3) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 2!
+> [Jean_Yves:dht.kademlia.Node:(3) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+> [TeX:dht.kademlia.Node:(4) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 4!
+> [TeX:dht.kademlia.Node:(4) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
+
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4">
- <process host="Jacquelin" function="kademlia.Node">
+ <process host="Jacquelin" function="dht.kademlia.Node">
<argument value="0"/> <!-- my id -->
<argument value ="900"/> <!-- deadline -->
</process>
- <process host="Boivin" function="kademlia.Node">
+ <process host="Boivin" function="dht.kademlia.Node">
<argument value="1"/> <!-- my id -->
<argument value="0"/> <!-- known id -->
<argument value ="900"/> <!-- deadline -->
</process>
- <process host="Jean_Yves" function="kademlia.Node">
+ <process host="Jean_Yves" function="dht.kademlia.Node">
<argument value="2"/> <!-- my id -->
<argument value="0"/> <!-- known id -->
<argument value ="900"/> <!-- deadline -->
</process>
- <process host="TeX" function="kademlia.Node">
+ <process host="TeX" function="dht.kademlia.Node">
<argument value="4"/> <!-- my id -->
<argument value="0"/> <!-- known id -->
<argument value ="900"/> <!-- deadline -->
+++ /dev/null
-set(example java_kademlia)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Kademlia.java ${CMAKE_CURRENT_SOURCE_DIR}/Answer.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Bucket.java ${CMAKE_CURRENT_SOURCE_DIR}/Common.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Contact.java ${CMAKE_CURRENT_SOURCE_DIR}/FindNodeAnswerTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/FindNodeTask.java ${CMAKE_CURRENT_SOURCE_DIR}/KademliaTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Node.java ${CMAKE_CURRENT_SOURCE_DIR}/PingAnswerTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/PingTask.java ${CMAKE_CURRENT_SOURCE_DIR}/RoutingTable.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-kademlia --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)
-endif()
-
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/kademlia.tesh PARENT_SCOPE)
-set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/kademlia.xml PARENT_SCOPE)
-set(examples_src ${examples_src} ${sources} PARENT_SCOPE)
+++ /dev/null
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} kademlia/Kademlia ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/kademlia/kademlia.xml
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [900.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
-> [Boivin:kademlia.Node:(2) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 1!
-> [Boivin:kademlia.Node:(2) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-> [Jacquelin:kademlia.Node:(1) 0.000000] [jmsg/INFO] Hi, I'm going to create the network with the id 0!
-> [Jacquelin:kademlia.Node:(1) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-> [Jean_Yves:kademlia.Node:(3) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 2!
-> [Jean_Yves:kademlia.Node:(3) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-> [TeX:kademlia.Node:(4) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 4!
-> [TeX:kademlia.Node:(4) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
-
examples/java/CMakeLists.txt
examples/java/async/CMakeLists.txt
examples/java/bittorrent/CMakeLists.txt
- examples/java/chord/CMakeLists.txt
examples/java/cloud/CMakeLists.txt
examples/java/cloud/energy/CMakeLists.txt
examples/java/cloud/migration/CMakeLists.txt
examples/java/commTime/CMakeLists.txt
examples/java/energy/CMakeLists.txt
examples/java/io/CMakeLists.txt
- examples/java/kademlia/CMakeLists.txt
examples/java/masterworker/CMakeLists.txt
examples/java/mutualExclusion/CMakeLists.txt
examples/java/pingPong/CMakeLists.txt