A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change exception raised if a StopRequest is catched in Host.off()
[simgrid.git]
/
src
/
bindings
/
java
/
jmsg_host.cpp
diff --git
a/src/bindings/java/jmsg_host.cpp
b/src/bindings/java/jmsg_host.cpp
index
d6cc242
..
e25ad9d
100644
(file)
--- a/
src/bindings/java/jmsg_host.cpp
+++ b/
src/bindings/java/jmsg_host.cpp
@@
-1,6
+1,6
@@
/* Functions related to the java host instances. */
/* Functions related to the java host instances. */
-/* Copyright (c) 2007-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-201
9
. 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. */
/* 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. */
@@
-10,6
+10,7
@@
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
+#include "JavaContext.hpp"
#include "jmsg.hpp"
#include "jmsg_host.h"
#include "jmsg_storage.h"
#include "jmsg.hpp"
#include "jmsg_host.h"
#include "jmsg_storage.h"
@@
-141,7
+142,8
@@
JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost)
JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost) {
msg_host_t host = jhost_get_native(env, jhost);
JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost) {
msg_host_t host = jhost_get_native(env, jhost);
- MSG_host_off(host);
+ if (not simgrid::kernel::context::StopRequest::try_n_catch([host]() { MSG_host_off(host); }))
+ jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
}
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount(JNIEnv * env, jclass cls) {
}
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount(JNIEnv * env, jclass cls) {
@@
-380,8
+382,6
@@
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getLoad(JNIEnv* env, jobject
return MSG_host_get_load(host);
}
return MSG_host_get_load(host);
}
-
-
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentLoad (JNIEnv *env, jobject jhost)
{
msg_host_t host = jhost_get_native(env, jhost);
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentLoad (JNIEnv *env, jobject jhost)
{
msg_host_t host = jhost_get_native(env, jhost);
@@
-394,7
+394,6
@@
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentLoad (JNIEnv *env,
return MSG_host_get_current_load(host);
}
return MSG_host_get_current_load(host);
}
-
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getComputedFlops (JNIEnv *env, jobject jhost)
{
msg_host_t host = jhost_get_native(env, jhost);
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getComputedFlops (JNIEnv *env, jobject jhost)
{
msg_host_t host = jhost_get_native(env, jhost);
@@
-407,8
+406,6
@@
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getComputedFlops (JNIEnv *en
return MSG_host_get_computed_flops(host);
}
return MSG_host_get_computed_flops(host);
}
-
-
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getAvgLoad (JNIEnv *env, jobject jhost)
{
msg_host_t host = jhost_get_native(env, jhost);
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getAvgLoad (JNIEnv *env, jobject jhost)
{
msg_host_t host = jhost_get_native(env, jhost);
@@
-419,4
+416,4
@@
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getAvgLoad (JNIEnv *env, job
}
return MSG_host_get_avg_load(host);
}
return MSG_host_get_avg_load(host);
-}
\ No newline at end of file
+}