*.class
simgrid.jar
libSG_java.so
-
+build/
+*.dylib
+.project
+.cproject
+.classpath
examples/pingPong/Sender.java
examples/pingPong/Receiver.java
examples/pingPong/PingPongTest.java
+ examples/master_slave_bypass/Master.java
+ examples/master_slave_bypass/MsBypass.java
+ examples/master_slave_bypass/Slave.java
)
set(CMAKE_SRC
examples/pingPong/pingPongDeployment.xml
examples/basic/basicDeployment.xml
examples/basic/deploy.xml
+ examples/master_slave_bypass/platform.xml
)
set(source_to_pack
add_custom_command(
COMMENT "Build examples for java"
OUTPUT ${JAVA_EXAMPLES_CLASS}
-
+ DEPENDS ${JAVA_EXAMPLES}
COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/basic/*.java
COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/pingPong/*.java
COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/commTime/*.java
COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/mutualExclusion/centralized/*.java
+ COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/master_slave_bypass/*.java
)
add_custom_target(simgrid_java_examples ALL
DEPENDS ${JAVA_EXAMPLES_CLASS}
ADD_TEST(mutualExclusion
java -cp .:${CMAKE_HOME_DIRECTORY}/examples:${CMAKE_HOME_DIRECTORY}/simgrid.jar mutualExclusion/centralized/MutexCentral ${CMAKE_HOME_DIRECTORY}/examples/mutualExclusion/ring3.xml ${CMAKE_HOME_DIRECTORY}/examples/mutualExclusion/centralized/mutex_centralized_deployment.xml
)
+ADD_TEST(bypass
+java -cp .:${CMAKE_HOME_DIRECTORY}/examples:${CMAKE_HOME_DIRECTORY}/simgrid.jar master_slave_bypass/MsBypass ${CMAKE_HOME_DIRECTORY}/examples/master_slave_bypass/platform.xml
+)
+
##########################################
# Set the DYLD_LIBRARY_PATH for mac #
--- /dev/null
+/*
+ * Master of a basic master/slave example in Java
+ *
+ * Copyright 2006,2007,2010 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 master_slave_bypass;
+import org.simgrid.msg.HostNotFoundException;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
+import org.simgrid.msg.Process;
+
+public class Master extends Process {
+ public Master(String hostname, String name) throws HostNotFoundException {
+ super(hostname, name);
+ }
+ public void main(String[] args) throws MsgException {
+ Msg.info("Master Hello!");
+/* try {
+ Slave process2 = new Slave("alice","process2");
+ }
+ catch (MsgException e){
+ System.out.println("Mes couilles!!!!!");
+ } */
+ }
+}
--- /dev/null
+/*
+ * Copyright 2006,2007,2010. 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 master_slave_bypass;
+
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
+import org.simgrid.msg.NativeException;
+
+public class MsBypass {
+
+ /* This only contains the launcher. If you do nothing more than than you can run
+ * java simgrid.msg.Msg
+ * which also contains such a launcher
+ */
+
+ public static void main(String[] args) throws NativeException {
+
+ /* initialize the MSG simulation. Must be done before anything else (even logging). */
+ Msg.init(args);
+ Msg.createEnvironment(args[0]);
+
+ /* bypass deploymemt */
+ try {
+ Master process1 = new Master("bob","process1");
+ Slave process2 = new Slave("alice","process2");
+ }
+ catch (MsgException e){
+ System.out.println("Mes couilles!!!!!");
+ }
+
+ /* execute the simulation. */
+ Msg.run();
+ }
+}
--- /dev/null
+/*
+ * Copyright 2006,2007,2010. 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 master_slave_bypass;
+import org.simgrid.msg.HostFailureException;
+import org.simgrid.msg.HostNotFoundException;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.TimeoutException;
+import org.simgrid.msg.TransferFailureException;
+import org.simgrid.msg.Process;
+
+public class Slave extends Process {
+ public Slave(String hostname, String name) throws HostNotFoundException {
+ super(hostname, name);
+ }
+ public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
+ Msg.info("Slave Hello!");
+ }
+}
\ No newline at end of file
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+<AS id="AS0" routing="Full">
+ <host id="bob" power="137333000"/>
+ <host id="alice" power="98095000"/>
+
+ <link id="1" bandwidth="100000000" latency="0.001"/>
+
+ <route src="bob"
+ dst="alice"
+ symmetrical="YES">
+ <link_ctn id="1"/>
+ </route>
+</AS>
+</platform>
\ No newline at end of file