+++ /dev/null
-set(example java_master_slave_bypass)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/MsBypass.java ${CMAKE_CURRENT_SOURCE_DIR}/FinalizeTask.java
- ${CMAKE_CURRENT_SOURCE_DIR}/Master.java ${CMAKE_CURRENT_SOURCE_DIR}/Slave.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-bypass --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)
-endif()
-
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/bypass.tesh PARENT_SCOPE)
-set(examples_src ${examples_src} ${sources} PARENT_SCOPE)
+++ /dev/null
-/* Copyright (c) 2006-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 master_slave_bypass;
-import org.simgrid.msg.Task;
-
-public class FinalizeTask extends Task {
- public FinalizeTask() {
- super("finalize",0,0);
- }
-}
-
\ No newline at end of file
+++ /dev/null
-/* Master of a basic master/slave example in Java */
-
-/* Copyright (c) 2006-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 master_slave_bypass;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.Msg;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.Task;
-
-import master_slave_bypass.FinalizeTask;
-
-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!");
-
- //Create a slave on host "alice"
- try {
- Msg.info("Create process on host 'Jacquelin'");
- new Slave("Jacquelin","process2").start();
- }
- catch (MsgException e){
- System.out.println("Process2!");
- }
-
- //Wait for slave "alice"
- while(true)
- {
- Task task = Task.receive("Jacquelin");
- if (task instanceof FinalizeTask) {
- Msg.info("Received Finalize. I'm done. See you!");
- break;
- }
- }
- }
-}
+++ /dev/null
-/* Copyright (c) 2006-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 master_slave_bypass;
-
-import org.simgrid.msg.HostNotFoundException;
-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,HostNotFoundException {
-
- /* initialize the MSG simulation. Must be done before anything else (even logging). */
- Msg.init(args);
- Msg.createEnvironment(args[0]);
-
- /* bypass deployment */
- new Master("Boivin","process1").start();
-
- /* execute the simulation. */
- Msg.run();
- }
-}
+++ /dev/null
-/* Copyright (c) 2006-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 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.NativeException;
-import org.simgrid.msg.Process;
-
-import master_slave_bypass.FinalizeTask;
-
-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, NativeException {
- Msg.info("Slave Hello!");
- FinalizeTask task = new FinalizeTask();
- Msg.info("Send finalize!");
- task.send("Jacquelin");
- }
-}
+++ /dev/null
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} master_slave_bypass/MsBypass ${srcdir:=.}/../platforms/platform.xml
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [Boivin:process1:(1) 0.000000] [jmsg/INFO] Master Hello!
-> [Boivin:process1:(1) 0.000000] [jmsg/INFO] Create process on host 'Jacquelin'
-> [Jacquelin:process2:(2) 0.000000] [jmsg/INFO] Slave Hello!
-> [Jacquelin:process2:(2) 0.000000] [jmsg/INFO] Send finalize!
-> [Boivin:process1:(1) 1.048881] [jmsg/INFO] Received Finalize. I'm done. See you!
-> [1.048881] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
examples/java/energy/CMakeLists.txt
examples/java/io/CMakeLists.txt
examples/java/kademlia/CMakeLists.txt
- examples/java/master_slave_bypass/CMakeLists.txt
examples/java/master_slave_kill/CMakeLists.txt
examples/java/masterslave/CMakeLists.txt
examples/java/migration/CMakeLists.txt