Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix silly bug in msg process sleep bindings - Adrien
[simgrid.git] / src / bindings / java / jmsg_host.c
index 230ad16..21cfc8a 100644 (file)
@@ -174,6 +174,20 @@ Java_org_simgrid_msg_Host_getSpeed(JNIEnv * env,
 
   return (jdouble) MSG_get_host_speed(host);
 }
+
+JNIEXPORT jdouble JNICALL
+Java_org_simgrid_msg_Host_getCoreNumber(JNIEnv * env,
+                                        jobject jhost) {
+  msg_host_t host = jhost_get_native(env, jhost);
+
+  if (!host) {
+    jxbt_throw_notbound(env, "host", jhost);
+    return -1;
+  }
+
+  return (jdouble) MSG_host_get_core_number(host);
+}
+
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_Host_getLoad(JNIEnv * env, jobject jhost) {
   msg_host_t host = jhost_get_native(env, jhost);