examples/msg/ms.trace
examples/msg/ns3/ns3
examples/msg/pmm/pmm
-examples/msg/priority/priority
+examples/msg/task-priority/task-priority
examples/msg/procmig.trace
examples/msg/properties/properties
examples/msg/synchro/synchro
examples/java/process/migration/java_process_migration_compiled
examples/java/process/suspend/java_process_suspend_compiled
examples/java/pingPong/java_pingPong_compiled
-examples/java/priority/java_priority_compiled
examples/java/process/startkilltime/java_process_startkilltime_compiled
+examples/java/task/priority/java_task_priority_compiled
examples/java/tracing/java_tracing_compiled
/CMakeCache.txt
examples/smpi/mc/smpi_bugged1
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend)
set(process_suspend_sources ${srcdir}/Main.java ${srcdir}/DreamMaster.java ${srcdir}/LazyGuy.java)
+set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/task/priority)
+set(task_priority_sources ${srcdir}/Main.java ${srcdir}/Test.java)
+
foreach (example app_bittorrent app_centralizedmutex app_masterworker cloud_migration cloud_masterworker
dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage process_kill process_migration
- process_startkilltime process_suspend)
+ process_startkilltime process_suspend task_priority)
string (REPLACE "_" "/" example_dir ${example})
if(enable_java)
add_custom_command(
${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/masterworker.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml PARENT_SCOPE)
+ ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml PARENT_SCOPE)
if(enable_java)
foreach (example app_bittorrent app_centralizedmutex app_masterworker cloud_migration cloud_masterworker
dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage process_kill process_migration
- process_startkilltime process_suspend)
+ process_startkilltime process_suspend task_priority)
string (REPLACE "_" "/" example_dir ${example})
ADD_TESH(java-${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
endforeach()
+++ /dev/null
-set(example java_priority)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Priority.java ${CMAKE_CURRENT_SOURCE_DIR}/Test.java)
-
-if(enable_java)
- add_custom_command(
- COMMENT "Building ${example}..."
- OUTPUT ${example}_compiled
- DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
- COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}
- COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
- COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
- )
- add_custom_target(${example} ALL DEPENDS ${example}_compiled)
- ADD_TESH(java-priority --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/priority/priority.tesh)
-endif()
-
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/priority.tesh PARENT_SCOPE)
-set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/priorityDeployment.xml PARENT_SCOPE)
-set(examples_src ${examples_src} ${sources} PARENT_SCOPE)
+++ /dev/null
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} priority/Priority ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/priority/priorityDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (0:maestro@) Using regular java threads.
-> [ 0.000000] (1:priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 1.0
-> [ 0.000000] (2:priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 2.0
-> [ 0.833332] (2:priority.Test@Fafard) Goodbye now!
-> [ 1.111109] (0:maestro@) MSG_main finished; Cleaning up the simulation...
-> [ 1.111109] (1:priority.Test@Fafard) Goodbye now!
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4">
- <process host="Fafard" function="priority.Test">
- <argument value="76296000"/>
- <argument value="1.0"/>
- </process>
- <process host="Fafard" function="priority.Test">
- <argument value="76296000"/>
- <argument value="2.0"/>
- </process>
-</platform>
/* 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 priority;
+package task.priority;
import org.simgrid.msg.Msg;
import org.simgrid.msg.NativeException;
/* Demonstrates the use of Task.setPriority to change the computation priority of a task */
-public class Priority {
+public class Main {
public static void main(String[] args) throws NativeException {
Msg.init(args);
if(args.length < 2) {
/* 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 priority;
+package task.priority;
import org.simgrid.msg.Msg;
import org.simgrid.msg.Host;
import org.simgrid.msg.Task;
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4">
+ <process host="Fafard" function="task.priority.Test"> <argument value="76296000"/> <argument value="1.0"/> </process>
+ <process host="Fafard" function="task.priority.Test"> <argument value="76296000"/> <argument value="2.0"/> </process>
+</platform>
--- /dev/null
+#! tesh
+
+! output sort 19
+
+$ java -classpath ${classpath:=.} task/priority/Main ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/task/priority/priority.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [ 0.000000] (0:maestro@) Using regular java threads.
+> [ 0.000000] (1:task.priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 1.0
+> [ 0.000000] (2:task.priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 2.0
+> [ 1.500000] (2:task.priority.Test@Fafard) Goodbye now!
+> [ 2.000000] (0:maestro@) MSG_main finished; Cleaning up the simulation...
+> [ 2.000000] (1:task.priority.Test@Fafard) Goodbye now!
foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany dht-chord dht-pastry exception
energy-consumption energy-onoff energy-pstate energy-ptask energy-vm failures io-file io-file-unlink io-remote
- io-storage masterslave masterslave-mailbox pmm priority process-kill process-migration process-suspend
+ io-storage masterslave masterslave-mailbox pmm task-priority process-kill process-migration process-suspend
properties sendrecv set-maestro process-startkilltime synchro token_ring trace-categories
trace-link-srcdst-user-variables trace-link-user-variables trace-masterslave trace-platform
trace-process-migration trace-simple trace-user-variables)
endforeach()
foreach (file actions-mpi actions-storage async-wait async-waitall async-waitany bittorrent chainsend dht-chord
- dht-kademlia dht-pastry io-remote masterslave masterslave-mailbox priority properties sendrecv set-maestro)
+ dht-kademlia dht-pastry io-remote masterslave masterslave-mailbox properties sendrecv set-maestro
+ task-priority)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
endforeach()
${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_kill_d.xml PARENT_SCOPE)
foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany bittorrent chainsend dht-chord dht-kademlia
- failures io-file io-file-unlink io-remote io-storage masterslave masterslave-mailbox priority process-kill
+ failures io-file io-file-unlink io-remote io-storage masterslave masterslave-mailbox task-priority process-kill
process-migration process-suspend properties sendrecv synchro process-startkilltime token_ring)
ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
endforeach()
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4">
-<!-- For using with ping_pong, platform_sendrecv.xml -->
-
- <process host="Fafard" function="test">
- <argument value="76296000"/>
- <argument value="1.0"/>
- </process>
- <process host="Fafard" function="test">
- <argument value="76296000"/>
- <argument value="2.0"/>
- </process>
-</platform>
static int test(int argc, char *argv[])
{
- double computation_amount = 0.0;
- double priority = 1.0;
- msg_task_t task = NULL;
-
- XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%lg", &computation_amount);
- xbt_assert(res, "Invalid argument %s\n", argv[1]);
- res = sscanf(argv[2], "%lg", &priority);
- xbt_assert(res, "Invalid argument %s\n", argv[2]);
+ double computation_amount = xbt_str_parse_double(argv[1], "Invalid argument: %s");
+ double priority = xbt_str_parse_double(argv[2], "Invalid argument: %s");
XBT_INFO("Hello! Running a task of size %g with priority %g", computation_amount, priority);
- task = MSG_task_create("Task", computation_amount, 0.0, NULL);
+ msg_task_t task = MSG_task_create("Task", computation_amount, 0.0, NULL);
MSG_task_set_priority(task, priority);
MSG_task_execute(task);
p Testing a simple master/slave example application
! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/priority$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/priority/priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/task-priority$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/task-priority/task-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 1
> [ 0.000000] (2:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 2
> [ 1.500000] (2:test@Fafard) Goodbye now!
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4">
+ <process host="Fafard" function="test"> <argument value="76296000"/> <argument value="1.0"/> </process>
+ <process host="Fafard" function="test"> <argument value="76296000"/> <argument value="2.0"/> </process>
+</platform>
examples/java/CMakeLists.txt
examples/java/async/CMakeLists.txt
examples/java/pingPong/CMakeLists.txt
- examples/java/priority/CMakeLists.txt
examples/java/tracing/CMakeLists.txt
examples/msg/CMakeLists.txt
examples/msg/cloud/CMakeLists.txt