From: Paul Bédaride Date: Thu, 23 May 2013 09:09:28 +0000 (+0200) Subject: Add a scala masterslave example X-Git-Tag: v3_9_90~372 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a2fc9093202ad92a65d242d6e5fe824106dc857a Add a scala masterslave example --- diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index ce6acf7691..a9f938e9c8 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -442,6 +442,12 @@ if(NOT enable_memcheck) endif() endif() + # Scala examples + if(enable_scala) + set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/:${SIMGRID_JAR}:${SCALA_JARS}") + ADD_TEST(scala-masterslave ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/masterslave/masterslave.tesh) + endif() + # examples/msg/mc if(HAVE_MC) ADD_TEST(mc-bugged1-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 2a4e36a9c2..a7d43ff103 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -84,6 +84,11 @@ if(enable_java) message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}") set(HAVE_Java 1) endif() +if(enable_scala) + find_package(Scala REQUIRED) + message("-- [Scala] scalac found: ${SCALA_COMPILE}") + set(HAVE_Scala 1) +endif() if(enable_lua) include(FindLua51Simgrid) endif() diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 126a018f60..9e426e0914 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -832,6 +832,8 @@ set(EXAMPLES_CMAKEFILES_TXT examples/java/startKillTime/CMakeLists.txt examples/java/suspend/CMakeLists.txt examples/java/tracing/CMakeLists.txt + examples/scala/CMakeLists.txt + examples/scala/masterslave/CMakeLists.txt examples/lua/CMakeLists.txt examples/msg/CMakeLists.txt examples/msg/actions/CMakeLists.txt @@ -925,6 +927,7 @@ set(CMAKE_SOURCE_FILES buildtools/Cmake/Modules/FindNS3.cmake buildtools/Cmake/Modules/FindRngStream.cmake buildtools/Cmake/Modules/FindRubySimgrid.cmake + buildtools/Cmake/Modules/FindScala.cmake buildtools/Cmake/Modules/FindSimGrid.cmake buildtools/Cmake/Modules/FindValgrind.cmake buildtools/Cmake/Option.cmake diff --git a/buildtools/Cmake/MakeExe.cmake b/buildtools/Cmake/MakeExe.cmake index 9cf775f5ea..7a6d9f463c 100644 --- a/buildtools/Cmake/MakeExe.cmake +++ b/buildtools/Cmake/MakeExe.cmake @@ -52,6 +52,9 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/suspend) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/tracing) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/scala) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/scala/masterslave) + add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/properties) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/actions) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/migration) diff --git a/buildtools/Cmake/Option.cmake b/buildtools/Cmake/Option.cmake index 2df5821be0..76622f5a76 100644 --- a/buildtools/Cmake/Option.cmake +++ b/buildtools/Cmake/Option.cmake @@ -21,6 +21,7 @@ option(enable_debug "Set NDEBUG flag" on) option(enable_gtnets "Whether gtnets model is activated." off) option(enable_ns3 "Whether ns3 model is activated." off) option(enable_java "Whether the Java bindings are activated." off) +option(enable_scala "Whether the Scala bindings are activated." off) option(enable_lua "Whether the lua bindings are activated." off) option(enable_compile_warnings "Whether compilation warnings should be turned into errors." off) option(enable_maintainer_mode "Whether flex and flexml files should be rebuilt." off) @@ -46,6 +47,10 @@ else() option(enable_smpi "Whether SMPI in included in library." on) endif() +if(enable_scala AND NOT enable_java) + message(WARNING "For using scala you must turn java on with command:\ncmake -Denable_java=on .") +endif() + mark_as_advanced(HAVE_SSH) mark_as_advanced(HAVE_RSYNC) mark_as_advanced(BIBTEX2HTML_PATH) diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index c1393b9538..fa0fa1f309 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -106,6 +106,7 @@ if(NOT APPLE AND NOT WIN32) message(" NS-3 path ...........: ${ns3_path}") endif() message(" Compile Java ........: ${HAVE_Java}") +message(" Compile Scala........: ${HAVE_Scala}") message(" Compile Lua .........: ${HAVE_LUA}") message(" Compile Smpi ........: ${HAVE_SMPI}") message(" Compile Smpi f77 ....: ${SMPI_F2C}") diff --git a/examples/scala/CMakeLists.txt b/examples/scala/CMakeLists.txt new file mode 100644 index 0000000000..90617f925e --- /dev/null +++ b/examples/scala/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.6) + +set(tesh_files + ${tesh_files} + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) + diff --git a/examples/scala/masterslave/CMakeLists.txt b/examples/scala/masterslave/CMakeLists.txt new file mode 100644 index 0000000000..54b10294bf --- /dev/null +++ b/examples/scala/masterslave/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 2.6) + +set(example scala_masterslave) +set(sources + ${CMAKE_CURRENT_SOURCE_DIR}/FinalizeTask.scala + ${CMAKE_CURRENT_SOURCE_DIR}/Forwarder.scala + ${CMAKE_CURRENT_SOURCE_DIR}/Master.scala + ${CMAKE_CURRENT_SOURCE_DIR}/Masterslave.scala + ${CMAKE_CURRENT_SOURCE_DIR}/Slave.scala + ) + +if(enable_scala) + add_custom_command( + COMMENT "Building ${example}..." + OUTPUT ${example}_compiled + DEPENDS ${sources} SG_java_jar ${SIMGRID_JAR} + COMMAND ${SCALA_COMPILE} -cp ${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}/masterslave.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/deploy.xml + ${CMAKE_CURRENT_SOURCE_DIR}/masterslaveDeployment.xml + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${sources} + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + ${CMAKE_CURRENT_SOURCE_DIR}/README + PARENT_SCOPE + ) diff --git a/examples/scala/masterslave/FinalizeTask.scala b/examples/scala/masterslave/FinalizeTask.scala new file mode 100644 index 0000000000..82027adc18 --- /dev/null +++ b/examples/scala/masterslave/FinalizeTask.scala @@ -0,0 +1,12 @@ +/* + * Copyright 2006-2012. 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 masterslave +import org.simgrid.msg.Task + +class FinalizeTask extends Task("finalize",0,0) {} + diff --git a/examples/scala/masterslave/Forwarder.scala b/examples/scala/masterslave/Forwarder.scala new file mode 100644 index 0000000000..3b9da5342a --- /dev/null +++ b/examples/scala/masterslave/Forwarder.scala @@ -0,0 +1,52 @@ +/* + * Copyright 2006-2012. 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 masterslave + +import Stream._ +import org.simgrid.msg.Host +import org.simgrid.msg.Msg +import org.simgrid.msg.MsgException +import org.simgrid.msg.Task +import org.simgrid.msg.Process + +class Forwarder(host:Host, name:String, args:Array[String]) extends Process(host,name,args) { + + def main(args: Array[String]){ + if (args.length < 3) { + Msg.info("Forwarder needs 3 arguments (input mailbox, first output mailbox, last one)") + Msg.info("Got "+args.length+" instead") + System.exit(1) + } + val input = args(0).toInt + val firstOutput = args(1).toInt + val lastOutput = args(2).toInt + + var taskCount = 0 + val slavesCount = lastOutput - firstOutput + 1 + Msg.info("Receiving on 'slave_"+input+"'") + var cont = true + + continually({Task.receive("slave_"+input)}) + .takeWhile(!_.isInstanceOf[FinalizeTask]) + .foreach(task => { + val dest = firstOutput + (taskCount % slavesCount) + Msg.info("Sending \"" + task.getName() + "\" to \"slave_" + dest + "\"") + task.send("slave_"+dest) + taskCount += 1 + }) + + Msg.info("Got a finalize task. Let's forward that we're done.") + for (cpt <- firstOutput to lastOutput) { + val tf = new FinalizeTask() + tf.send("slave_"+cpt) + } + + Msg.info("I'm done. See you!") + } +} + diff --git a/examples/scala/masterslave/Master.scala b/examples/scala/masterslave/Master.scala new file mode 100644 index 0000000000..aba2c71d69 --- /dev/null +++ b/examples/scala/masterslave/Master.scala @@ -0,0 +1,45 @@ +/* + * Master of a basic master/slave example in Java + * + * Copyright 2006-2012 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 masterslave; + +import org.simgrid.msg.Host; +import org.simgrid.msg.Msg; +import org.simgrid.msg.MsgException; +import org.simgrid.msg.Task; +import org.simgrid.msg.Process;; + +class Master(host:Host, name:String, args:Array[String]) extends Process(host,name,args) { + def main(args:Array[String]) { + if (args.length < 4) { + Msg.info("Master needs 4 arguments") + System.exit(1) + } + + val tasksCount = args(0).toInt + val taskComputeSize = args(1).toDouble + val taskCommunicateSize = args(2).toDouble + val slavesCount = args(3).toInt + + Msg.info("Hello! Got " + slavesCount + " slaves and " + tasksCount + " tasks to process") + + for (i <- 0 until tasksCount) { + val task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize) + task.send("slave_"+(i%slavesCount)) + } + + Msg.info("All tasks have been dispatched. Let's tell everybody the computation is over.") + + for (i <- 0 until slavesCount) { + val task = new FinalizeTask() + task.send("slave_"+(i%slavesCount)) + } + + Msg.info("Goodbye now!") + } +} diff --git a/examples/scala/masterslave/Masterslave.scala b/examples/scala/masterslave/Masterslave.scala new file mode 100644 index 0000000000..473c21a13e --- /dev/null +++ b/examples/scala/masterslave/Masterslave.scala @@ -0,0 +1,36 @@ +/* + * Copyright 2006-2012. 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 masterslave + +import org.simgrid.msg.Msg +import org.simgrid.msg.NativeException +import org.simgrid.msg.Task + +object Masterslave extends App { + val TASK_COMP_SIZE = 10000000 + val TASK_COMM_SIZE = 10000000 + /* This only contains the launcher. If you do nothing more than than you can run + * scala simgrid.msg.Msg + * which also contains such a launcher + */ + + /* initialize the MSG simulation. Must be done before anything else (even logging). */ + Msg.init(args) + + if (args.length < 2) { + Msg.info("Usage : Masterslave platform_file deployment_file") + Msg.info("example : Masterslave basic_platform.xml basic_deployment.xml") + System.exit(1) + } + + /* construct the platform and deploy the application */ + Msg.createEnvironment(args(0)) + Msg.deployApplication(args(1)) + /* execute the simulation. */ + Msg.run() +} diff --git a/examples/scala/masterslave/README b/examples/scala/masterslave/README new file mode 100644 index 0000000000..9207911abc --- /dev/null +++ b/examples/scala/masterslave/README @@ -0,0 +1,11 @@ +This is a somehow basic master/slaves example. + +There is 3 kind of processes: + * Master: creates some tasks, and dispatches them to its slaves + * Forwarder: get tasks from master, and dispatch them further + * Slave: get tasks from either master or forwarder, and run them + +At the end of the execution: + - the master sends FinalizeTask to every known slave to stop them + - On reception of FT, forwarders send FT to every slave, and stop. + - On reception of FinalizeTask, slaves stop. \ No newline at end of file diff --git a/examples/scala/masterslave/Slave.scala b/examples/scala/masterslave/Slave.scala new file mode 100644 index 0000000000..07994576ac --- /dev/null +++ b/examples/scala/masterslave/Slave.scala @@ -0,0 +1,41 @@ +/* + * Copyright 2006-2012. 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 masterslave; + +import Stream._ +import org.simgrid.msg.Host +import org.simgrid.msg.HostFailureException +import org.simgrid.msg.Msg +import org.simgrid.msg.Task +import org.simgrid.msg.TaskCancelledException +import org.simgrid.msg.TimeoutException +import org.simgrid.msg.TransferFailureException +import org.simgrid.msg.Process + +class Slave(host:Host, name:String, args:Array[String]) extends Process(host,name,args) { + def main(args:Array[String]){ + if (args.length < 1) { + Msg.info("Slave needs 1 argument (its number)") + System.exit(1) + } + + val num = args(0).toInt + + continually({Task.receive("slave_"+num)}) + .takeWhile(!_.isInstanceOf[FinalizeTask]) + .foreach(task => { + Msg.info("Received \"" + task.getName() + "\". Processing it."); + try { + task.execute(); + } catch { + case e:TaskCancelledException => {} + } + }) + + Msg.info("Received Finalize. I'm done. See you!") + } +} diff --git a/examples/scala/masterslave/deploy.xml b/examples/scala/masterslave/deploy.xml new file mode 100644 index 0000000000..70f120be0c --- /dev/null +++ b/examples/scala/masterslave/deploy.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + diff --git a/examples/scala/masterslave/masterslave.tesh b/examples/scala/masterslave/masterslave.tesh new file mode 100644 index 0000000000..77a09b54fe --- /dev/null +++ b/examples/scala/masterslave/masterslave.tesh @@ -0,0 +1,32 @@ +#! tesh + +! output sort + +$ java -cp ${classpath:=.} masterslave/Masterslave ${srcdir:=.}/platform.xml ${srcdir:=.}/masterslave/masterslaveDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (1:masterslave.Master@Jacquelin) Hello! Got 7 slaves and 5 tasks to process +> [ 0.000000] (2:masterslave.Forwarder@Jackson) Receiving on 'slave_0' +> [ 0.000000] (3:masterslave.Forwarder@Casavant) Receiving on 'slave_1' +> [ 0.851467] (2:masterslave.Forwarder@Jackson) Sending "Task_0" to "slave_7" +> [ 2.208482] (3:masterslave.Forwarder@Casavant) Sending "Task_1" to "slave_9" +> [ 2.720407] (11:masterslave.Slave@Sirois) Received "Task_1". Processing it. +> [ 3.553979] (9:masterslave.Slave@Stephen) Received "Task_0". Processing it. +> [ 5.252157] (4:masterslave.Slave@iRMX) Received "Task_2". Processing it. +> [ 6.266855] (5:masterslave.Slave@Bousquet) Received "Task_3". Processing it. +> [ 7.710549] (1:masterslave.Master@Jacquelin) All tasks have been dispatched. Let's tell everybody the computation is over. +> [ 7.710549] (6:masterslave.Slave@Soucy) Received "Task_4". Processing it. +> [ 8.562012] (2:masterslave.Forwarder@Jackson) Got a finalize task. Let's forward that we're done. +> [ 9.919019] (3:masterslave.Forwarder@Casavant) Got a finalize task. Let's forward that we're done. +> [ 10.430937] (11:masterslave.Slave@Sirois) Received Finalize. I'm done. See you! +> [ 11.264486] (9:masterslave.Slave@Stephen) Received Finalize. I'm done. See you! +> [ 11.318423] (12:masterslave.Slave@Monique) Received Finalize. I'm done. See you! +> [ 11.318423] (3:masterslave.Forwarder@Casavant) I'm done. See you! +> [ 12.962677] (4:masterslave.Slave@iRMX) Received Finalize. I'm done. See you! +> [ 13.907575] (10:masterslave.Slave@Robert) Received Finalize. I'm done. See you! +> [ 13.907575] (2:masterslave.Forwarder@Jackson) I'm done. See you! +> [ 13.977355] (5:masterslave.Slave@Bousquet) Received Finalize. I'm done. See you! +> [ 15.421041] (6:masterslave.Slave@Soucy) Received Finalize. I'm done. See you! +> [ 16.278350] (7:masterslave.Slave@Kuenning) Received Finalize. I'm done. See you! +> [ 17.251680] (0:@) MSG_main finished; Cleaning up the simulation... +> [ 17.251680] (1:masterslave.Master@Jacquelin) Goodbye now! +> [ 17.251680] (8:masterslave.Slave@Browne) Received Finalize. I'm done. See you! +> [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up. diff --git a/examples/scala/masterslave/masterslaveDeployment.xml b/examples/scala/masterslave/masterslaveDeployment.xml new file mode 100644 index 0000000000..6c01ac0120 --- /dev/null +++ b/examples/scala/masterslave/masterslaveDeployment.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/scala/platform.xml b/examples/scala/platform.xml new file mode 100644 index 0000000000..84db0e240f --- /dev/null +++ b/examples/scala/platform.xml @@ -0,0 +1,8298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bindings/java/jmsg.c b/src/bindings/java/jmsg.c index 8a6a626e11..29428b3d1c 100644 --- a/src/bindings/java/jmsg.c +++ b/src/bindings/java/jmsg.c @@ -235,7 +235,7 @@ static int create_jprocess(int argc, char *argv[]) { jclass class_Process = (*env)->FindClass(env, argv[0]); xbt_str_subst(argv[0],'/','.',0); //Retrieve the methodID for the constructor - xbt_assert((class_Process != NULL), "Class not found."); + xbt_assert((class_Process != NULL), "Class not found (%s).", argv[0]); jmethodID constructor_Process = (*env)->GetMethodID(env, class_Process, "", "(Lorg/simgrid/msg/Host;Ljava/lang/String;[Ljava/lang/String;)V"); xbt_assert((constructor_Process != NULL), "Constructor not found for class %s. Is there a (Host, String ,String[]) constructor in your class ?", argv[0]);