From: Martin Quinson Date: Tue, 24 Apr 2012 08:17:11 +0000 (+0200) Subject: Add dsend and simulatedSleep to the binding, and add an example X-Git-Tag: v3_9_90~569^2~19^2~129 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8462a1a27d5d9595a90f6c4f6dc65e70d279e6e3 Add dsend and simulatedSleep to the binding, and add an example --- diff --git a/.gitignore b/.gitignore index 4c969750a7..7cae982e58 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ build/ .project .cproject .classpath +*~ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 99095e67cb..32bfee1375 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,6 +135,11 @@ set(JAVA_EXAMPLES examples/master_slave_kill/MsKill.java examples/master_slave_kill/Slave.java examples/master_slave_kill/FinalizeTask.java + examples/async/AsyncTest.java + examples/async/FinalizeTask.java + examples/async/Forwarder.java + examples/async/Master.java + examples/async/Slave.java ) set(CMAKE_SRC @@ -154,6 +159,7 @@ set(XML_FILES examples/basic/deploy.xml examples/master_slave_bypass/platform.xml examples/master_slave_kill/platform.xml + examples/async/asyncDeployment.xml ) set(source_to_pack @@ -225,6 +231,7 @@ add_custom_command( 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/async/*.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 @@ -255,6 +262,9 @@ ENABLE_TESTING() ADD_TEST(basic java -cp .:${CMAKE_HOME_DIRECTORY}/examples:${CMAKE_HOME_DIRECTORY}/simgrid.jar basic/BasicTest ${CMAKE_HOME_DIRECTORY}/examples/platform.xml ${CMAKE_HOME_DIRECTORY}/examples/basic/basicDeployment.xml ) +ADD_TEST(async +java -cp .:${CMAKE_HOME_DIRECTORY}/examples:${CMAKE_HOME_DIRECTORY}/simgrid.jar async/AsyncTest ${CMAKE_HOME_DIRECTORY}/examples/platform.xml ${CMAKE_HOME_DIRECTORY}/examples/async/asyncDeployment.xml +) ADD_TEST(pingPong java -cp .:${CMAKE_HOME_DIRECTORY}/examples:${CMAKE_HOME_DIRECTORY}/simgrid.jar pingPong/PingPongTest ${CMAKE_HOME_DIRECTORY}/examples/platform.xml ${CMAKE_HOME_DIRECTORY}/examples/pingPong/pingPongDeployment.xml ) @@ -271,7 +281,7 @@ ADD_TEST(kill java -cp .:${CMAKE_HOME_DIRECTORY}/examples:${CMAKE_HOME_DIRECTORY}/simgrid.jar master_slave_kill/MsKill ${CMAKE_HOME_DIRECTORY}/examples/master_slave_kill/platform.xml ) #Don't forget to put new test in this list!!! -set(test_list basic pingPong CommTime mutualExclusion bypass kill) +set(test_list basic async pingPong CommTime mutualExclusion bypass kill) ########################################## # Set the DYLD_LIBRARY_PATH for mac # diff --git a/examples/async/AsyncTest.java b/examples/async/AsyncTest.java new file mode 100644 index 0000000000..1e14632da9 --- /dev/null +++ b/examples/async/AsyncTest.java @@ -0,0 +1,45 @@ +/* + * 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 async; + +import org.simgrid.msg.Msg; +import org.simgrid.msg.NativeException; + +public class AsyncTest { + + /* 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); + + if(args.length == 0) { + Msg.createEnvironment("async_platform.xml"); + Msg.deployApplication("async_deployment.xml"); + + } else if (args.length < 2) { + + + Msg.info("Usage : Async platform_file deployment_file"); + Msg.info("example : Async async_platform.xml async_deployment.xml"); + System.exit(1); + } else { + + /* construct the platform and deploy the application */ + Msg.createEnvironment(args[0]); + Msg.deployApplication(args[1]); + } + + /* execute the simulation. */ + Msg.run(); + } +} diff --git a/examples/async/FinalizeTask.java b/examples/async/FinalizeTask.java new file mode 100644 index 0000000000..c93dc7f759 --- /dev/null +++ b/examples/async/FinalizeTask.java @@ -0,0 +1,16 @@ +/* + * 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 async; +import org.simgrid.msg.Task; + +public class FinalizeTask extends Task { + public FinalizeTask() { + super("finalize",0,0); + } +} + \ No newline at end of file diff --git a/examples/async/Forwarder.java b/examples/async/Forwarder.java new file mode 100644 index 0000000000..d17bb9343e --- /dev/null +++ b/examples/async/Forwarder.java @@ -0,0 +1,55 @@ +/* + * 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 async; +import org.simgrid.msg.Msg; +import org.simgrid.msg.MsgException; +import org.simgrid.msg.Task; +import org.simgrid.msg.Process; + + +public class Forwarder extends Process { + + public void main(String[] args) throws MsgException { + 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); + } + int input = Integer.valueOf(args[0]).intValue(); + int firstOutput = Integer.valueOf(args[1]).intValue(); + int lastOutput = Integer.valueOf(args[2]).intValue(); + + int taskCount = 0; + int slavesCount = lastOutput - firstOutput + 1; + Msg.info("Receiving on 'slave_"+input+"'"); + while(true) { + Task task = Task.receive("slave_"+input); + + if (task instanceof FinalizeTask) { + Msg.info("Got a finalize task. Let's forward (asynchronously) that we're done, and then sleep 20 seconds so that nobody gets a message from a terminated process."); + + for (int cpt = firstOutput; cpt<=lastOutput; cpt++) { + Task tf = new FinalizeTask(); + tf.dsend("slave_"+cpt); + } + simulatedSleep(20); + break; + } + int dest = firstOutput + (taskCount % slavesCount); + + Msg.info("Sending \"" + task.getName() + "\" to \"slave_" + dest + "\""); + task.send("slave_"+dest); + + taskCount++; + } + + + Msg.info("I'm done. See you!"); + } +} + diff --git a/examples/async/Master.java b/examples/async/Master.java new file mode 100644 index 0000000000..88d6d1249e --- /dev/null +++ b/examples/async/Master.java @@ -0,0 +1,47 @@ +/* + * 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 async; +import org.simgrid.msg.Msg; +import org.simgrid.msg.MsgException; +import org.simgrid.msg.Task; +import org.simgrid.msg.Process;; + +public class Master extends Process { + public void main(String[] args) throws MsgException { + if (args.length < 4) { + Msg.info("Master needs 4 arguments"); + System.exit(1); + } + + int tasksCount = Integer.valueOf(args[0]).intValue(); + double taskComputeSize = Double.valueOf(args[1]).doubleValue(); + double taskCommunicateSize = Double.valueOf(args[2]).doubleValue(); + + int slavesCount = Integer.valueOf(args[3]).intValue(); + + Msg.info("Hello! Got "+ slavesCount + " slaves and "+tasksCount+" tasks to process"); + + for (int i = 0; i < tasksCount; i++) { + Task task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize); + //Msg.info("Sending \"" + task.getName()+ "\" to \"slave_" + i % slavesCount + "\""); + task.send("slave_"+(i%slavesCount)); + } + + Msg.info("All tasks have been dispatched. Let's tell (asynchronously) everybody the computation is over, and sleep 20s so that nobody gets a message from a terminated process."); + + for (int i = 0; i < slavesCount; i++) { + FinalizeTask task = new FinalizeTask(); + task.dsend("slave_"+(i%slavesCount)); + } + simulatedSleep(20); + + Msg.info("Goodbye now!"); + } +} diff --git a/examples/async/README b/examples/async/README new file mode 100644 index 0000000000..0d6dcc2dcb --- /dev/null +++ b/examples/async/README @@ -0,0 +1,24 @@ +This is another version of the master/slaves example, using asynchronous communications. + +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, + using dsend instead of send. That's non-blocking with no way to + know if/when the communication succeeds. It is intended for + communications where you don't care to know whether your message got + received or not. The process then sleeps 20 seconds because we have + a strange bug for now when the receiver gets a message from a + terminated process. This should not be the case, actually, that's a + JAVA specific bug, but I don't really have the time to dig in right + now. + + - On reception of FT, forwarders dsend FT to every slave, and stop + after a little while. + - On reception of FinalizeTask, slaves stop. + +Other non-blocking primitives will get used here as soon as they are +added to the bindings. \ No newline at end of file diff --git a/examples/async/Slave.java b/examples/async/Slave.java new file mode 100644 index 0000000000..3d2270b0d4 --- /dev/null +++ b/examples/async/Slave.java @@ -0,0 +1,43 @@ +/* + * 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 async; +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; + +public class Slave extends Process { + public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException { + if (args.length < 1) { + Msg.info("Slave needs 1 argument (its number)"); + System.exit(1); + } + + int num = Integer.valueOf(args[0]).intValue(); + //Msg.info("Receiving on 'slave_"+num+"'"); + + while(true) { + Task task = Task.receive("slave_"+num); + + if (task instanceof FinalizeTask) { + break; + } + Msg.info("Received \"" + task.getName() + "\". Processing it."); + try { + task.execute(); + } catch (TaskCancelledException e) { + + } + // Msg.info("\"" + task.getName() + "\" done "); + } + + Msg.info("Received Finalize. I'm done. See you!"); + } +} \ No newline at end of file diff --git a/examples/async/async.tesh b/examples/async/async.tesh new file mode 100644 index 0000000000..8bbea2bb62 --- /dev/null +++ b/examples/async/async.tesh @@ -0,0 +1,75 @@ +# compile the example +$ javac -classpath $MSG4JAVA_CLASSPATH$ENV_SEPARATOR. *.java + +# run the basic sample +$ java -classpath $MSG4JAVA_CLASSPATH$ENV_SEPARATOR BasicTest basic_platform.xml basic_deployment.xml +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] hello! +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argc=8 +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:5 +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:50000 +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:10 +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:iRMX +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:Casavant +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:Bousquet +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:Soucy +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] argv:Jackson +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Got 5 slave(s) : +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] iRMX +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Casavant +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Bousquet +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Soucy +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Jackson +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Got 5 task to process. +> [Jacquelin:Master:(1) 0.000000] [jmsg/INFO] Sending "Task_0" to "iRMX" +> [Jackson:Forwarder:(2) 0.000000] [jmsg/INFO] hello! +> [Casavant:Forwarder:(3) 0.000000] [jmsg/INFO] hello! +> [iRMX:Slave:(4) 0.000000] [jmsg/INFO] Hello ! +> [Bousquet:Slave:(5) 0.000000] [jmsg/INFO] Hello ! +> [Soucy:Slave:(6) 0.000000] [jmsg/INFO] Hello ! +> [Kuenning:Slave:(7) 0.000000] [jmsg/INFO] Hello ! +> [Browne:Slave:(8) 0.000000] [jmsg/INFO] Hello ! +> [Stephen:Slave:(9) 0.000000] [jmsg/INFO] Hello ! +> [Robert:Slave:(10) 0.000000] [jmsg/INFO] Hello ! +> [Sirois:Slave:(11) 0.000000] [jmsg/INFO] Hello ! +> [Monique:Slave:(12) 0.000000] [jmsg/INFO] Hello ! +> [Jacquelin:Master:(1) 0.234181] [jmsg/INFO] Sending "Task_1" to "Casavant" +> [iRMX:Slave:(4) 0.234181] [jmsg/INFO] Received "Task_0" +> [iRMX:Slave:(4) 0.234181] [jmsg/INFO] Processing "Task_0" +> [iRMX:Slave:(4) 0.234910] [jmsg/INFO] "Task_0" done +> [Jacquelin:Master:(1) 0.338591] [jmsg/INFO] Sending "Task_2" to "Bousquet" +> [Casavant:Forwarder:(3) 0.338591] [jmsg/INFO] Received "Task_1" +> [Casavant:Forwarder:(3) 0.338591] [jmsg/INFO] Sending "Task_1" to "Robert" +> [Jacquelin:Master:(1) 0.416661] [jmsg/INFO] Sending "Task_3" to "Soucy" +> [Bousquet:Slave:(5) 0.416661] [jmsg/INFO] Received "Task_2" +> [Bousquet:Slave:(5) 0.416661] [jmsg/INFO] Processing "Task_2" +> [Bousquet:Slave:(5) 0.417826] [jmsg/INFO] "Task_2" done +> [Robert:Slave:(10) 0.454402] [jmsg/INFO] Received "Task_1" +> [Robert:Slave:(10) 0.454402] [jmsg/INFO] Processing "Task_1" +> [Robert:Slave:(10) 0.454766] [jmsg/INFO] "Task_1" done +> [Jacquelin:Master:(1) 0.527739] [jmsg/INFO] Sending "Task_4" to "Jackson" +> [Soucy:Slave:(6) 0.527739] [jmsg/INFO] Received "Task_3" +> [Soucy:Slave:(6) 0.527739] [jmsg/INFO] Processing "Task_3" +> [Soucy:Slave:(6) 0.528103] [jmsg/INFO] "Task_3" done +> [Jacquelin:Master:(1) 0.593252] [jmsg/INFO] Send completed +> [Jacquelin:Master:(1) 0.593252] [jmsg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. +> [Jackson:Forwarder:(2) 0.593252] [jmsg/INFO] Received "Task_4" +> [Jackson:Forwarder:(2) 0.593252] [jmsg/INFO] Sending "Task_4" to "Kuenning" +> [Kuenning:Slave:(7) 0.593708] [jmsg/INFO] Received "Task_4" +> [Kuenning:Slave:(7) 0.593708] [jmsg/INFO] Processing "Task_4" +> [Kuenning:Slave:(7) 0.594291] [jmsg/INFO] "Task_4" done +> [iRMX:Slave:(4) 0.827199] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Casavant:Forwarder:(3) 0.931504] [jmsg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. +> [Bousquet:Slave:(5) 1.009496] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Robert:Slave:(10) 1.047200] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Sirois:Slave:(11) 1.086548] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Soucy:Slave:(6) 1.120464] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Casavant:Forwarder:(3) 1.154764] [jmsg/INFO] I'm done. See you! +> [Monique:Slave:(12) 1.154764] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Jacquelin:Master:(1) 1.185911] [jmsg/INFO] Goodbye now! +> [Jackson:Forwarder:(2) 1.185911] [jmsg/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. +> [Kuenning:Slave:(7) 1.186360] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Browne:Slave:(8) 1.325058] [jmsg/INFO] Received Finalize. I'm done. See you! +> [Jackson:Forwarder:(2) 1.532781] [jmsg/INFO] I'm done. See you! +> [Stephen:Slave:(9) 1.532781] [jmsg/INFO] Received Finalize. I'm done. See you! + + diff --git a/examples/async/asyncDeployment.xml b/examples/async/asyncDeployment.xml new file mode 100644 index 0000000000..5b545d3a5c --- /dev/null +++ b/examples/async/asyncDeployment.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org/simgrid/msg/MsgNative.java b/org/simgrid/msg/MsgNative.java index b5f8765569..3f3df2128a 100644 --- a/org/simgrid/msg/MsgNative.java +++ b/org/simgrid/msg/MsgNative.java @@ -427,4 +427,6 @@ final class MsgNative { */ final static native void taskSendBounded(String alias, Task task, double maxrate) throws TransferFailureException,HostFailureException,TimeoutException; + final static native void taskDSend(String mailbox, Task task); + } diff --git a/org/simgrid/msg/Process.java b/org/simgrid/msg/Process.java index 94d6bf6ba0..d2d657e589 100644 --- a/org/simgrid/msg/Process.java +++ b/org/simgrid/msg/Process.java @@ -365,6 +365,15 @@ public abstract class Process extends Thread { Msg.info("[" + this.msgName() + "/" + this.getHost().getName() + "] args[" + i + "]=" + (String) (this.args.get(i))); } + /** + * Let the simulated process sleep for the given amount of millisecond in the simulated world. + * + * You don't want to use sleep instead, because it would freeze your simulation + * run without any impact on the simulated world. + * @param millis + */ + public native void simulatedSleep(double seconds); + /** * This method runs the process. Il calls the method function that you must overwrite. */ diff --git a/org/simgrid/msg/Task.java b/org/simgrid/msg/Task.java index c151961b34..907c26faa7 100644 --- a/org/simgrid/msg/Task.java +++ b/org/simgrid/msg/Task.java @@ -146,6 +146,14 @@ public class Task { MsgNative.taskDestroy(this); } + /** Send the task asynchronously on the mailbox identified by the specified name, + * with no way to retrieve whether the communication succeeded or not + * + */ + public void dsend(String mailbox) { + MsgNative.taskDSend(mailbox, this); + } + /** * Sends the task on the mailbox identified by the specified name * diff --git a/src/jmsg.c b/src/jmsg.c index 61d916b6db..f10f465b1c 100644 --- a/src/jmsg.c +++ b/src/jmsg.c @@ -140,6 +140,22 @@ Java_org_simgrid_msg_MsgNative_processSuspend(JNIEnv * env, jclass cls, } +JNIEXPORT void JNICALL +Java_org_simgrid_msg_Process_simulatedSleep(JNIEnv * env, jobject jprocess, + jdouble jseconds) { + m_process_t process = jprocess_to_native_process(jprocess, env); + + if (!process) { + jxbt_throw_notbound(env, "process", jprocess); + return; + } + MSG_error_t rv = MSG_process_sleep((double)jseconds); + + jxbt_check_res("MSG_process_sleep()", rv, MSG_OK, + bprintf("unexpected error , please report this bug")); +} + + JNIEXPORT void JNICALL Java_org_simgrid_msg_MsgNative_processResume(JNIEnv * env, jclass cls, jobject jprocess) @@ -967,6 +983,41 @@ Java_org_simgrid_msg_MsgNative_taskSend(JNIEnv * env, jclass cls, MSG_task_get_name(task), alias)); } +static void msg_task_cancel_on_failed_dsend(void*t) { + m_task_t task = t; + JNIEnv *env =get_current_thread_env(); + jobject jtask_global = MSG_task_get_data(task); + + /* Destroy the global ref so that the JVM can free the stuff */ + (*env)->DeleteGlobalRef(env, jtask_global); + MSG_task_set_data(task, NULL); + MSG_task_destroy(task); +} + +JNIEXPORT void JNICALL +Java_org_simgrid_msg_MsgNative_taskDSend(JNIEnv * env, jclass cls, + jstring jalias, jobject jtask) +{ + + const char *alias = (*env)->GetStringUTFChars(env, jalias, 0); + + m_task_t task = jtask_to_native_task(jtask, env); + + + if (!task) { + (*env)->ReleaseStringUTFChars(env, jalias, alias); + jxbt_throw_notbound(env, "task", jtask); + return; + } + + /* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */ + MSG_task_set_data(task, (void *) (*env)->NewGlobalRef(env, jtask)); + MSG_task_dsend(task, alias, msg_task_cancel_on_failed_dsend); + + (*env)->ReleaseStringUTFChars(env, jalias, alias); +} + + JNIEXPORT void JNICALL Java_org_simgrid_msg_MsgNative_taskSendBounded(JNIEnv * env, jclass cls, jstring jalias, jobject jtask, diff --git a/src/jmsg.h b/src/jmsg.h index bfa02c14e2..9fdbaebd36 100644 --- a/src/jmsg.h +++ b/src/jmsg.h @@ -32,7 +32,7 @@ Java_org_simgrid_msg_MsgNative_processCreate(JNIEnv * env, jclass cls, * Signature (Lsimgrid/msg/Process;)V */ JNIEXPORT void JNICALL -Java_org_simgrid_msg_MsgNative_processSuspend(JNIEnv * env, jclass cls, +Java_org_simgrid_msg_MsgNative_processSuspend(JNIEnv * env, jobject obj, jobject jprocess); /* @@ -43,6 +43,12 @@ Java_org_simgrid_msg_MsgNative_processSuspend(JNIEnv * env, jclass cls, JNIEXPORT void JNICALL Java_org_simgrid_msg_MsgNative_processResume (JNIEnv *, jclass, jobject); + +JNIEXPORT void JNICALL +Java_org_simgrid_msg_Process_simulatedSleep(JNIEnv * env, jclass cls, + jdouble jmillis); + + /* * Class simgrid_msg_Msg * Method processIsSuspended @@ -273,17 +279,14 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_MsgNative_taskReceive (JNIEnv *, jclass, jstring, jdouble, jobject); +JNIEXPORT void JNICALL +Java_org_simgrid_msg_MsgNative_taskDSend(JNIEnv * env, jclass cls, + jstring jalias, jobject jtask); + JNIEXPORT void JNICALL Java_org_simgrid_msg_MsgNative_taskSend (JNIEnv *, jclass, jstring, jobject, jdouble); -/* - * Class simgrid_msg_Msg - * Method getErrCode - * Signature ()I - */ -JNIEXPORT jint JNICALL Java_org_simgrid_msg_Msg_getErrCode(JNIEnv *, jclass); - /* * Class simgrid_msg_Msg * Method getClock