foreach(x actions-comm actions-storage app-masterworker async-wait async-waitall async-waitany cloud-capping
- cloud-masterworker cloud-migration cloud-multicore cloud-scale cloud-simple cloud-two-tasks dht-chord
+ cloud-masterworker cloud-migration cloud-multicore cloud-simple cloud-two-tasks 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 pmm task-priority process-kill process-migration process-suspend
properties sendrecv set-maestro process-startkilltime synchro token_ring trace-categories
${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_kill_d.xml PARENT_SCOPE)
foreach(x actions-comm actions-storage app-bittorrent app-chainsend app-masterworker async-wait async-waitall
- async-waitany cloud-capping cloud-masterworker cloud-migration cloud-scale cloud-simple cloud-two-tasks
+ async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple cloud-two-tasks
dht-chord dht-kademlia failures io-file io-file-unlink io-remote io-storage 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)
+++ /dev/null
-/* Copyright (c) 2007-2015. 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. */
-
-#include <sys/time.h>
-#include "simgrid/msg.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
-static int task_count=0;
-static int computation_fun(int argc, char *argv[]) {
- msg_task_t task = MSG_task_create("Task", 2210000, 0, NULL);
- MSG_task_execute(task);
- task_count++;
- MSG_task_destroy(task);
- return 0;
-}
-
-static void launch_computation_worker(msg_host_t host) {
- MSG_process_create("compute", computation_fun, NULL, host);
-}
-
-static int master_main(int argc, char *argv[])
-{
- xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
-
- int npm = 10;
- int nvm = 1000;
-
- msg_host_t *pm = xbt_new(msg_host_t, npm);
- msg_vm_t *vm = xbt_new(msg_vm_t, nvm);
-
- int i = 0;
- for (i = 0; i < npm; i++) {
- pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t);
- }
-
- XBT_INFO("## Test (start)");
- for (i = 0; i < nvm; i++) {
- int pm_index = i % npm;
- char *vm_name = bprintf("vm%d", i);
- vm[i] = MSG_vm_create_core(pm[pm_index], vm_name);
- MSG_vm_start(vm[i]);
-
- launch_computation_worker(vm[i]);
-
- xbt_free(vm_name);
- }
-
- for (i = 0; i < 10; i++) {
- MSG_process_sleep(1);
- XBT_INFO("Completed tasks: %d", task_count);
- }
-
- for (i = 0; i < nvm; i++) {
- MSG_vm_destroy(vm[i]);
- }
-
- XBT_INFO("## Test (ended)");
- return 0;
-}
-
-static void launch_master(msg_host_t host)
-{
- const char *pr_name = "master_";
- char **argv = xbt_new(char *, 2);
- argv[0] = xbt_strdup(pr_name);
- argv[1] = NULL;
-
- MSG_process_create_with_arguments(pr_name, master_main, NULL, host, 1, argv);
-}
-
-
-int main(int argc, char *argv[])
-{
- /* Get the arguments */
- MSG_init(&argc, argv);
-
- /* load the platform file */
- xbt_assert(argc == 2);
- MSG_create_environment(argv[1]);
-
- xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
- msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
- launch_master(pm0);
-
- int res = MSG_main();
- XBT_INFO("Bye (simulation time %g)", MSG_get_clock());
-
- return !(res == MSG_OK);
-}
+++ /dev/null
-#! ./tesh
-
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-scale$EXEEXT ${srcdir:=.}/platform.xml --cfg=contexts/stack_size:1000
-> [Jacquelin:master_:(1) 0.000000] [msg_test/INFO] ## Test (start)
-> [Jacquelin:master_:(1) 1.000000] [msg_test/INFO] Completed tasks: 0
-> [Jacquelin:master_:(1) 2.000000] [msg_test/INFO] Completed tasks: 600
-> [Jacquelin:master_:(1) 3.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 4.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 5.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 6.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 7.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 8.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 9.000000] [msg_test/INFO] Completed tasks: 900
-> [Jacquelin:master_:(1) 10.000000] [msg_test/INFO] Completed tasks: 1000
-> [Jacquelin:master_:(1) 10.000000] [msg_test/INFO] ## Test (ended)
-> [10.000000] [msg_test/INFO] Bye (simulation time 10)