From: Martin Quinson Date: Tue, 21 Mar 2017 12:33:24 +0000 (+0100) Subject: jtask: remove the ability to receive from a given host X-Git-Tag: v3_15~32 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/68422deb1639b1ce574393779ae259579be53fb5 jtask: remove the ability to receive from a given host This is disabled in the underlying code since a long time --- diff --git a/src/bindings/java/jmsg_task.cpp b/src/bindings/java/jmsg_task.cpp index 9c1ad7418a..f3df89157a 100644 --- a/src/bindings/java/jmsg_task.cpp +++ b/src/bindings/java/jmsg_task.cpp @@ -274,23 +274,12 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobjec jmsg_throw_status(env, res); } -JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv * env, jclass cls, jstring jalias, jdouble jtimeout, - jobject jhost) +JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv* env, jclass cls, jstring jalias, jdouble jtimeout) { msg_task_t task = nullptr; - msg_host_t host = nullptr; - - if (jhost) { - host = jhost_get_native(env, jhost); - - if (!host) { - jxbt_throw_notbound(env, "host", jhost); - return nullptr; - } - } const char *alias = env->GetStringUTFChars(jalias, 0); - msg_error_t rv = MSG_task_receive_ext(&task, alias, (double) jtimeout, host); + msg_error_t rv = MSG_task_receive_ext(&task, alias, (double)jtimeout, /*host*/ nullptr); env->ReleaseStringUTFChars(jalias, alias); if (env->ExceptionOccurred()) return nullptr; @@ -305,7 +294,6 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv * env, jclass env->DeleteGlobalRef(jtask_global); MSG_task_set_data(task, nullptr); - return (jobject) jtask_local; } @@ -336,30 +324,19 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass c return jcomm; } -JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls, jstring jalias, - jdouble jtimeout, jobject jhost, jdouble rate) +JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv* env, jclass cls, jstring jalias, + jdouble jtimeout, jdouble rate) { - msg_error_t rv; msg_task_t *task = xbt_new(msg_task_t,1); *task = nullptr; - msg_host_t host = nullptr; - - if (jhost) { - host = jhost_get_native(env, jhost); - - if (!host) { - jxbt_throw_notbound(env, "host", jhost); - return nullptr; - } - } - const char *alias = env->GetStringUTFChars(jalias, 0); - rv = MSG_task_receive_ext_bounded(task, alias, static_cast(jtimeout), host, static_cast(rate)); + msg_error_t res = MSG_task_receive_ext_bounded(task, alias, static_cast(jtimeout), /*host*/ nullptr, + static_cast(rate)); if (env->ExceptionOccurred()) return nullptr; - if (rv != MSG_OK) { - jmsg_throw_status(env,rv); + if (res != MSG_OK) { + jmsg_throw_status(env, res); return nullptr; } jobject jtask_global = (jobject) MSG_task_get_data(*task); diff --git a/src/bindings/java/jmsg_task.h b/src/bindings/java/jmsg_task.h index 5c44476468..d25c41cbf6 100644 --- a/src/bindings/java/jmsg_task.h +++ b/src/bindings/java/jmsg_task.h @@ -44,11 +44,10 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount(JNIEnv* env, job JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv* env, jobject jtask, jstring jalias, jdouble jtimeout, jdouble maxrate); -JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv* env, jclass cls, jstring jalias, jdouble jtimeout, - jobject jhost); +JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv* env, jclass cls, jstring jalias, jdouble jtimeout); JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv* env, jclass cls, jstring jmailbox); JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv* env, jclass cls, jstring jalias, - jdouble jtimeout, jobject jhost, jdouble rate); + jdouble jtimeout, jdouble rate); JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv* env, jclass cls, jstring jmailbox, jdouble rate); JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_isend(JNIEnv* env, jobject jtask, jstring jmailbox); diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index e66993d6cb..0dec155c5b 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -271,49 +271,26 @@ public class Task { * @return a Comm handler */ public static native Comm irecv(String mailbox); - /** - * Retrieves next task from the mailbox identified by the specified name - * - * @param mailbox - * @return a Task - */ - - public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException { - return receive(mailbox, -1.0, null); - } /** - * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds) + * Retrieves next task on the mailbox identified by the specified alias * * @param mailbox - * @param timeout - * @return a Task - */ - public static Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException { - return receive(mailbox, timeout, null); - } - - /** - * Retrieves next task sent by a given host on the mailbox identified by the specified alias - * - * @param mailbox - * @param host * @return a Task */ - public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException { - return receive(mailbox, -1.0, host); + public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException { + return receive(mailbox, -1.0); } /** - * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds) + * Retrieves next task on the mailbox identified by the specified alias (wait at most \a timeout seconds) * * @param mailbox * @param timeout - * @param host * @return a Task */ - public static native Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException; + public static native Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException; /** * Starts listening for receiving a task from an asynchronous communication with a capped rate @@ -329,7 +306,7 @@ public class Task { */ public static Task receiveBounded(String mailbox, double rate) throws TransferFailureException, HostFailureException, TimeoutException { - return receiveBounded(mailbox, -1.0, null, rate); + return receiveBounded(mailbox, -1.0, rate); } /** @@ -339,32 +316,7 @@ public class Task { * @param timeout * @return a Task */ - public static Task receiveBounded(String mailbox, double timeout, double rate) throws TransferFailureException, HostFailureException, TimeoutException { - return receiveBounded(mailbox, timeout, null, rate); - } - - /** - * Retrieves next task sent by a given host on the mailbox identified by the specified alias with a capped rate - * - * @param mailbox - * @param host - * @return a Task - */ - - public static Task receiveBounded(String mailbox, Host host, double rate) throws TransferFailureException, HostFailureException, TimeoutException { - return receiveBounded(mailbox, -1.0, host, rate); - } - - /** - * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds) - * with a capped rate - * - * @param mailbox - * @param timeout - * @param host - * @return a Task - */ - public static native Task receiveBounded(String mailbox, double timeout, Host host, double rate) throws TransferFailureException, HostFailureException, TimeoutException; + public static native Task receiveBounded(String mailbox, double timeout, double rate) throws TransferFailureException, HostFailureException, TimeoutException;