From: jed56 ( Jean-Emile DARTOIS) Date: Tue, 9 Oct 2018 13:32:02 +0000 (+0200) Subject: Merge branch 'master' into v3.20-expose-simgrid-jni X-Git-Tag: v3_22~909^2^2 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/29a3b2869c0075fc75e8ccc66fc1d9c4c8bf6a85 Merge branch 'master' into v3.20-expose-simgrid-jni --- 29a3b2869c0075fc75e8ccc66fc1d9c4c8bf6a85 diff --cc ChangeLog index 5f4dcfcfbe,3fe5f937a2..2c3c853201 --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,92 +1,93 @@@ + SimGrid (3.22) NOT RELEASED (Release Target: December 21. 2018, 22:23 UTC) + + SimGrid (3.21) October 3. 2018 + + The Restarting Documentation (TRD) Release. + + Documentation: + - Convert the user manual to Sphinx for improved usability. + Unstable version now hosted on https://simgrid.frama.io/simgrid + Many glitches remain; stay tuned. + - Restrict the Doxygen reference API to the installed header files. + (documenting all internals this way is overkill + doxygen scales badly) + - New tutorial on S4U (highly inspired from the old MSG one, but with + a git repository to fork as a starting point, and a docker image) + - Started but not finished a SMPI tutorial inspired from the JLPC'14 one. + - The Developper manual is still to be converted (not compiled until then) + - Some parts are still missing in this conversion (such as the + platform and deployment sections) while others were blindly converted + and would need more love (such as the configuration flags). + Things will certainly further improve in the future releases. + + S4U new features: + - Fully reimplement auto_restart mechanism that was utterly broken + (fix #22, #131 and #281 that were all very related) + - Implement semaphores (fix #303 and #291) + - When creating an actor from a function and its parameters, + move-only parameters are not allowed anymore, as it would prevent + the actor to be restartable if its parameters are consumed on run. + - s4u::Io: IOs go asynchronous as activities. New methods in s4u::Storage: + - io_init(sg_size_t, s4u::Io::OpType) to create a READ or WRITE asynchronous + IO operations that can be started, waited for, or canceled as a regular + activity. + - read_async(sg_size_t) and write_async(sg_size_t) which are wrappers on + io_init() + start() + + Tracing: + - Rename 'power' and 'power_used' variables into 'speed' and 'speed_used' + - New host variable: 'core_count' + + XBT: + - Remove xbt_os_thread_specific features + - Remove portability wrapper to condition variables + - Remove xbt_os_thread_yield() + + SMPI: + - MPICH collective selector now mimics MPICH 3.3b + - OpenMPI collective selector now mimics OpenMPI 3.1.2 (default "tuned" setting) + - MPI_Init(NULL,NULL) is now allowed + - smpi/wtime option now injects time in gettimeofday or clock_gettime calls + - Command-line arguments should now be handled properly in Fortran simulations + - MPI Attributes and related callbacks should work in Fortran + - Apps using C + Fortran should now work + - MPI_* calls now check for non MPI_SUCCESS return values and emit warnings + - Support MPI_Error_String + + Java: + - Due to an internal bug, Msg.run() must now be your last line. + We hope to fix it in a future release, and we are sorry for the inconvenience. ++ - Expose host load plugin (i.e. loadInit, getCurrentLoad, getComputedFlops,getAvgLoad) + + Fixed bugs: + - #22: Process autorestart seem to only work with CAS01 cpus + - #56: Feature request: dynamic SMPI replay + - #93: simgrid should not eat --help + - #111: How to change the loopback link characteristics? + - #116: Platform cluster radical + - #117: Platform cluster/host order + - #129: Replay_multiple on steroid + - #131: Java : autostart does not work + - #143: Setting a breakpoint at a given time + - #235: Network energy models should be integrated + - #264: Add ptask L07 resource tracing + - #271: Dynamic and manual replay of SMPI traces + - #279: Breakpoints option uses time deltas instead of absolute time + - #281: Daemonized actor no longer daemonized after an auto-restart + - #282: TIT convertor erase traces when using absolute path in the trace list file + - #285: segfault when a s4u actor kills itself with msg process tracing activated + - #286: Pajé traces are not exposing the number of cores + - #287: Command-line parsing should stop when encountering '--' + - #288: MPI_Init(NULL, NULL) + - #289: Improve documentation of Actor::on_destruction and this_actor::on_exit() + - #290: Method to check if a mailbox has a message ready to be consumed + - #291: [s4u] semaphores do not seem available yet + - #294: Alltoall collective implementation of mpich + - #295: Starting a Host as OFF is not supported + - #296: DTD too permissive + - #299: Add a s4u barrier example + + ---------------------------------------------------------------------------- + SimGrid (3.20) Released June 24. 2018 The proxy snake_case() release. diff --cc examples/java/CMakeLists.txt index 7a29a83c55,768f22cef3..3b0ba59786 --- a/examples/java/CMakeLists.txt +++ b/examples/java/CMakeLists.txt @@@ -23,11 -23,16 +23,17 @@@ set(process-migration_files Main E set(process-startkilltime_files Main Sleeper) set(process-suspend_files Main DreamMaster LazyGuy) set(task-priority_files Main Test) +set(hostload_files Main LoadRunner) + if(enable_java) + add_custom_target(java-all + COMMENT "Building all Java examples..." + ) + endif() + foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend -- cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm io-file io-storage - process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong hostload) ++ cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload io-file io-storage + process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong) string (REPLACE "-" "/" example_dir ${example}) set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}) foreach (filename ${${example}_files} ) @@@ -65,8 -71,8 +72,8 @@@ set(xml_files ${xml_files} ${CM if(enable_java) foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend -- cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm io-file io-storage - process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong hostload) ++ cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload io-file io-storage + process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong) string (REPLACE "-" "/" example_dir ${example}) ADD_TESH(java-${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh) endforeach() diff --cc examples/java/hostload/LoadRunner.java index 24fcf931bd,0000000000..b382353d06 mode 100644,000000..100644 --- a/examples/java/hostload/LoadRunner.java +++ b/examples/java/hostload/LoadRunner.java @@@ -1,47 -1,0 +1,48 @@@ +/* Copyright (c) 2016-2018. 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 hostload; + +import org.simgrid.msg.*; +import org.simgrid.msg.Process; + + +public class LoadRunner extends Process { + + public LoadRunner(Host host, String s) { - super(host, s); - } - - public void display(){ - Msg.info("Computed Flops "+ getHost().getComputedFlops()); - Msg.info("Current Load "+ getHost().getCurrentLoad()); - Msg.info("GetLoad "+ getHost().getLoad()); - Msg.info("AvgLoad "+ getHost().getAvgLoad()); - } - @Override - public void main(String[] strings) throws MsgException { - double workload = 100E6; - Host host = getHost(); - display(); - // Run a task - Task task1 = new Task("t1", workload, 0); - task1.execute(); - display(); - double taskTime = Msg.getClock(); - Msg.info("Task1 simulation time: "+ taskTime); - - // Run a second task - new Task("t1", workload, 0).execute(); - - taskTime = Msg.getClock() - taskTime; - Msg.info("Task2 simulation time: "+ taskTime); - display(); - - } - - - } - ++ super(host, s); ++ } ++ ++ public void display(){ ++ Msg.info("Speed="+getHost().getSpeed()+" flop/s"); ++ Msg.info("Computed Flops "+ getHost().getComputedFlops()); ++ Msg.info("AvgLoad "+ getHost().getAvgLoad()); ++ } ++ @Override ++ public void main(String[] strings) throws MsgException { ++ Host host = getHost(); ++ display(); ++ Msg.info("Sleep for 10 seconds"); ++ waitFor(10); ++ display(); ++ ++ // Run a task ++ Task task1 = new Task("t1", 200E6, 0); ++ task1.execute(); ++ display(); ++ double taskTime = Msg.getClock(); ++ Msg.info("Task1 simulation time: "+ taskTime); ++ ++ // Run a second task ++ new Task("t1", 200E6, 0).execute(); ++ ++ taskTime = Msg.getClock() - taskTime; ++ Msg.info("Task2 simulation time: "+ taskTime); ++ display(); ++ ++ } ++ ++ ++} diff --cc examples/java/hostload/hostload.tesh index ba637d5d25,0000000000..19c0a22954 mode 100644,000000..100644 --- a/examples/java/hostload/hostload.tesh +++ b/examples/java/hostload/hostload.tesh @@@ -1,19 -1,0 +1,20 @@@ +#!/usr/bin/env tesh + +$ java -classpath ${classpath:=.} hostload/Main ${srcdir:=.}/../platforms/small_platform.xml +> [0.000000] [java/INFO] Using regular java threads. ++> [Boivin::(1) 0.000000] [java/INFO] Speed=9.8095E7 flop/s +> [Boivin::(1) 0.000000] [java/INFO] Computed Flops 0.0 - > [Boivin::(1) 0.000000] [java/INFO] Current Load 0.0 - > [Boivin::(1) 0.000000] [java/INFO] GetLoad 0.0 +> [Boivin::(1) 0.000000] [java/INFO] AvgLoad 0.0 - > [Boivin::(1) 1.019420] [java/INFO] Computed Flops 1.0E8 - > [Boivin::(1) 1.019420] [java/INFO] Current Load 1.0 - > [Boivin::(1) 1.019420] [java/INFO] GetLoad 0.0 - > [Boivin::(1) 1.019420] [java/INFO] AvgLoad 1.0 - > [Boivin::(1) 1.019420] [java/INFO] Task1 simulation time: 1.0194199500484225 - > [Boivin::(1) 2.038840] [java/INFO] Task2 simulation time: 1.0194199500484225 - > [Boivin::(1) 2.038840] [java/INFO] Computed Flops 2.0E8 - > [Boivin::(1) 2.038840] [java/INFO] Current Load 1.0 - > [Boivin::(1) 2.038840] [java/INFO] GetLoad 0.0 - > [Boivin::(1) 2.038840] [java/INFO] AvgLoad 1.0 - > [2.038840] [java/INFO] MSG_main finished; Cleaning up the simulation... ++> [Boivin::(1) 0.000000] [java/INFO] Sleep for 10 seconds ++> [Boivin::(1) 10.000000] [java/INFO] Speed=9.8095E7 flop/s ++> [Boivin::(1) 10.000000] [java/INFO] Computed Flops 0.0 ++> [Boivin::(1) 10.000000] [java/INFO] AvgLoad 0.0 ++> [Boivin::(1) 12.038840] [java/INFO] Speed=9.8095E7 flop/s ++> [Boivin::(1) 12.038840] [java/INFO] Computed Flops 2.0E8 ++> [Boivin::(1) 12.038840] [java/INFO] AvgLoad 0.1693551801515729 ++> [Boivin::(1) 12.038840] [java/INFO] Task1 simulation time: 12.038839900096844 ++> [Boivin::(1) 14.077680] [java/INFO] Task2 simulation time: 2.0388399000968445 ++> [Boivin::(1) 14.077680] [java/INFO] Speed=9.8095E7 flop/s ++> [Boivin::(1) 14.077680] [java/INFO] Computed Flops 4.0E8 ++> [Boivin::(1) 14.077680] [java/INFO] AvgLoad 0.2896556718201238 ++> [14.077680] [java/INFO] MSG_main finished; Terminating the simulation... diff --cc include/simgrid/host.h index 5d2f2f40da,4a72056e6e..e75e509845 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@@ -93,14 -93,9 +93,15 @@@ XBT_PUBLIC double sg_host_get_available XBT_PUBLIC int sg_host_core_count(sg_host_t host); - /** \ingroup m_host_management - * \brief Returns the current computation load (in flops per second). ++/** @ingroup m_host_management ++ * @brief Returns the current computation load (in flops per second). ++ * @param host a host + */ +XBT_PUBLIC double sg_host_load(sg_host_t host); + - /** \ingroup m_process_management - * \brief Return the location on which a process is running. - * \return the sg_host_t corresponding to the location on which \a process is running. + /** @ingroup m_process_management + * @brief Return the location on which a process is running. + * @return the sg_host_t corresponding to the location on which @a process is running. */ XBT_PUBLIC sg_host_t sg_host_self(); diff --cc include/simgrid/msg.h index c859352b76,2abf905374..9f103aecdc --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@@ -81,8 -113,8 +113,9 @@@ XBT_PUBLIC const char* MSG_host_get_pro XBT_PUBLIC void MSG_host_set_property_value(sg_host_t host, const char* name, const char* value); XBT_PUBLIC void MSG_host_get_process_list(sg_host_t host, xbt_dynar_t whereto); + /** @brief Return the location on which the current process is executed */ XBT_PUBLIC sg_host_t MSG_host_self(); +XBT_PUBLIC double MSG_host_get_load(sg_host_t host); /* ******************************** VMs ************************************* */ typedef sg_vm_t msg_vm_t; diff --cc src/bindings/java/jmsg.cpp index 86e69d9350,143a28bfa0..5ff074acd6 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@@ -239,10 -241,6 +242,9 @@@ JNIEXPORT void JNICALL Java_org_simgrid sg_storage_file_system_init(); } +JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_loadInit() { + sg_host_load_plugin_init(); +} - /** Run a Java org.simgrid.msg.Process * * If needed, this waits for the process starting time. diff --cc src/bindings/java/jmsg_host.cpp index d6cc242989,32c513fa12..d889f513b9 --- a/src/bindings/java/jmsg_host.cpp +++ b/src/bindings/java/jmsg_host.cpp @@@ -373,50 -372,3 +373,45 @@@ JNIEXPORT jdouble JNICALL Java_org_simg msg_host_t host = jhost_get_native(env, jhost); return MSG_host_get_power_peak_at(host, pstate); } + +JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getLoad(JNIEnv* env, jobject jhost) +{ + msg_host_t host = jhost_get_native(env, jhost); + 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); + + if (not host) { + jxbt_throw_notbound(env, "host", jhost); + return 0; + } + + 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); + + if (not host) { + jxbt_throw_notbound(env, "host", jhost); + return 0; + } + + 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); + + if (not host) { + jxbt_throw_notbound(env, "host", jhost); + return 0; + } + + return MSG_host_get_avg_load(host); +} diff --cc src/bindings/java/org/simgrid/msg/Host.java index c61d9c7dc5,0476da4d8e..b40704c5c6 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@@ -143,13 -143,7 +143,13 @@@ public class Host * the value will be updated in kernel mode before returning the control to the requesting actor. */ public native double getConsumedEnergy(); - + ++ /** Returns the current load of the host */ + public native double getCurrentLoad(); - ++ /** Returns the number of flops computed of the host */ + public native double getComputedFlops(); - ++ /** Returns the average load of the host */ + public native double getAvgLoad(); - /** Returns the current pstate */ public native int getPstate(); /** Changes the current pstate */ diff --cc src/bindings/java/org/simgrid/msg/Msg.java index 953b1df6d1,b103d2f259..b4becc9a7f --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@@ -40,9 -40,8 +40,16 @@@ public final class Msg /** Tell the kernel that you want to use the energy plugin */ public static final native void energyInit(); ++ ++ /** Tell the kernel that you want to use the filesystem plugin. */ public static final native void fileSystemInit(); + ++ /** Initializes the HostLoad plugin. ++ * ++ * The HostLoad plugin provides an API to get the current load of each host. ++ */ + public static final native void loadInit(); + /** Run the MSG simulation. * * After the simulation, you can freely retrieve the information that you want.. diff --cc src/s4u/s4u_Host.cpp index 3ccf0410fa,27d5e96402..adde454108 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@@ -643,10 -624,5 +624,10 @@@ void sg_host_get_actor_list(sg_host_t h sg_host_t sg_host_self() { smx_actor_t process = SIMIX_process_self(); - return (process == nullptr) ? nullptr : process->host; + return (process == nullptr) ? nullptr : process->host_; } + +double sg_host_load(sg_host_t host) +{ + return host->get_load(); +}