Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 6 Feb 2016 09:22:20 +0000 (10:22 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 6 Feb 2016 09:22:20 +0000 (10:22 +0100)
167 files changed:
doc/msg-tuto-src/masterworker1.c
doc/msg-tuto-src/masterworker2.c
doc/msg-tuto-src/masterworker3.c
doc/msg-tuto-src/masterworker4.c
examples/msg/actions/actions.c
examples/msg/actions/storage_actions.c
examples/msg/chord/chord.c
examples/msg/cloud/migrate_vm.c
examples/msg/cloud/multicore.c
examples/msg/cloud/scale.c
examples/msg/cloud/two_tasks_vm.c
examples/msg/energy/consumption/energy_consumption.c
examples/msg/energy/onoff/onoff.c
examples/msg/energy/pstate/pstate.c
examples/msg/energy/vm/energy_vm.c
examples/msg/exception/exception.c
examples/msg/gtnets/gtnets.c
examples/msg/icomms/peer.c
examples/msg/icomms/peer2.c
examples/msg/kademlia/kademlia.c
examples/msg/masterslave/masterslave_arg.c
examples/msg/masterslave/masterslave_failure.c
examples/msg/masterslave/masterslave_forwarder.c
examples/msg/masterslave/masterslave_kill.c
examples/msg/masterslave/masterslave_mailbox.c
examples/msg/migration/migration.c
examples/msg/ns3/ns3.c
examples/msg/parallel_task/parallel_task.c
examples/msg/parallel_task/test_ptask.c
examples/msg/pastry/pastry.c
examples/msg/priority/priority.c
examples/msg/properties/msg_prop.c
examples/msg/semaphores/synchro.c
examples/msg/sendrecv/sendrecv.c
examples/msg/start_kill_time/sk_time.c
examples/msg/suspend/suspend.c
examples/s4u/basic/s4u_basic.cpp
examples/s4u/io/s4u_io_test.cpp
examples/simdag/dax/dax_test.c
examples/simdag/properties/sd_prop.c
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_comm_throttling.c
examples/simdag/sd_test.c
examples/simdag/sd_test2.c
examples/simdag/sd_typed_tasks_test.c
examples/smpi/MM/MM_mpi.c
examples/smpi/mc/non_termination4.c
examples/smpi/replay_multiple/replay_multiple.c
include/simgrid/msg.h
include/simgrid/s4u/actor.hpp
include/simgrid/s4u/async.hpp
include/simgrid/s4u/comm.hpp
include/simgrid/s4u/engine.hpp
include/simgrid/s4u/file.hpp
include/simgrid/s4u/host.hpp
include/simgrid/s4u/mailbox.hpp
include/simgrid/s4u/storage.hpp
include/xbt/base.h
include/xbt/log.h
src/bindings/java/jmsg.h
src/bindings/java/jmsg_file.h
src/bindings/java/jmsg_host.cpp
src/bindings/java/jmsg_host.h
src/bindings/java/jmsg_process.cpp
src/bindings/java/jmsg_process.h
src/bindings/java/jmsg_storage.cpp
src/bindings/java/jmsg_storage.h
src/bindings/java/jmsg_task.cpp
src/bindings/java/jmsg_task.h
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jmsg_vm.h
src/include/mc/mc.h
src/include/surf/maxmin.h
src/include/surf/surf.h
src/msg/instr_msg_vm.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/msg/msg_task.cpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_async.cpp
src/s4u/s4u_comm.cpp
src/s4u/s4u_engine.cpp
src/s4u/s4u_file.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_mailbox.cpp
src/s4u/s4u_storage.cpp
src/simdag/dax_dtd.c
src/simdag/sd_daxloader.cpp
src/simgrid/host.cpp
src/simix/libsmx.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp
src/simix/smx_vm.cpp
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_coll.c
src/smpi/smpi_mpi_dt.c
src/smpi/smpi_pmpi.c
src/smpi/smpi_replay.c
src/surf/PropertyHolder.cpp
src/surf/PropertyHolder.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/fair_bottleneck.cpp
src/surf/host_interface.cpp
src/surf/host_interface.hpp
src/surf/host_ptask_L07.cpp
src/surf/host_ptask_L07.hpp
src/surf/lagrange.cpp
src/surf/maxmin.cpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_ib.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/network_smpi.cpp
src/surf/plugins/energy.cpp
src/surf/sg_platf.cpp
src/surf/simgrid_dtd.c
src/surf/storage_interface.cpp
src/surf/storage_interface.hpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/surf_routing.cpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_dijkstra.hpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_generic.cpp
src/surf/surf_routing_none.cpp
src/surf/surf_routing_vivaldi.cpp
src/surf/surfxml_parse.cpp
src/surf/surfxml_parseplatf.cpp
src/surf/virtual_machine.hpp
src/surf/vm_hl13.cpp
src/xbt/automaton/automaton_lexer.yy.c
src/xbt/backtrace_linux.c
src/xbt/config.c
src/xbt/ex.c
src/xbt/graphxml.c
src/xbt/heap.c
src/xbt/lib.c
src/xbt/log.c
src/xbt/xbt_os_file.c
src/xbt/xbt_replay.c
teshsuite/mc/mutex_handling.c
teshsuite/msg/host_on_off/host_on_off.c
teshsuite/msg/host_on_off/host_on_off_recv.c
teshsuite/msg/host_on_off/host_on_off_wait.c
teshsuite/msg/process/process.c
teshsuite/msg/storage/concurrent_rw.c
teshsuite/msg/storage/storage_basic.c
teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c
teshsuite/simdag/platforms/basic_link_test.c
teshsuite/smpi/reduce/reduce_scatter_coll.c
tools/cmake/test_prog/prog_gnu_dynlinker.c

index 2d44af8..c5d7877 100644 (file)
@@ -70,13 +70,13 @@ int master(int argc, char *argv[])
     
     for (i = 0; i < workers_count; i++)
       if(host_self == workers[i]) {
-       workers[i] = workers[workers_count-1];
-       workers_count--;
-       break;
+  workers[i] = workers[workers_count-1];
+  workers_count--;
+  break;
       }
 
     for (i = 0; i < workers_count; i++)
-       MSG_process_create("worker", worker, master_name, workers[i]);
+  MSG_process_create("worker", worker, master_name, workers[i]);
   }
 
   XBT_INFO("Got %d workers and %d tasks to process", workers_count,
@@ -84,7 +84,7 @@ int master(int argc, char *argv[])
 
   for (i = 0; i < number_of_tasks; i++) {
     build_channel_name(channel,master_name,
-                      MSG_host_get_name(workers[i % workers_count]));
+           MSG_host_get_name(workers[i % workers_count]));
 
     XBT_INFO("Sending \"%s\" to channel \"%s\"", todo[i]->name, channel);
 
@@ -97,7 +97,7 @@ int master(int argc, char *argv[])
   for (i = 0; i < workers_count; i++) {
     msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
     MSG_task_send(finalize, build_channel_name(channel,master_name,
-                   MSG_host_get_name(workers[i % workers_count])));
+        MSG_host_get_name(workers[i % workers_count])));
   }
 
   XBT_INFO("Goodbye now!");
@@ -114,7 +114,7 @@ int worker(int argc, char *argv[])
   char channel[1024];
 
   build_channel_name(channel,MSG_process_get_data(MSG_process_self()),
-                    MSG_host_get_name(MSG_host_self()));
+         MSG_host_get_name(MSG_host_self()));
 
   XBT_INFO("Receiving on channel \"%s\"", channel);
 
index 4ac7469..e3c2826 100644 (file)
@@ -57,17 +57,17 @@ int master(int argc, char *argv[])
     
     for (i = 0; i < workers_count; i++)
       if(host_self == workers[i]) {
-       workers[i] = workers[workers_count-1];
-       workers_count--;
-       break;
+  workers[i] = workers[workers_count-1];
+  workers_count--;
+  break;
       }
 
     for (i = 0; i < workers_count; i++)
-       MSG_process_create("worker", worker, master_name, workers[i]);
+  MSG_process_create("worker", worker, master_name, workers[i]);
   }
 
   XBT_INFO("Got %d workers and will send tasks for %g seconds!", 
-          workers_count, timeout);
+     workers_count, timeout);
 
   for (i = 0; 1; i++) {
     char sprintf_buffer[64];
@@ -77,10 +77,10 @@ int master(int argc, char *argv[])
 
     sprintf(sprintf_buffer, "Task_%d", i);
     task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
-                          NULL);
+         NULL);
 
     build_channel_name(channel,master_name,
-                      MSG_host_get_name(workers[i % workers_count]));
+           MSG_host_get_name(workers[i % workers_count]));
     
     XBT_DEBUG("Sending \"%s\" to channel \"%s\"", task->name, channel);
     MSG_task_send(task, channel);
@@ -94,7 +94,7 @@ int master(int argc, char *argv[])
   for (i = 0; i < workers_count; i++) {
     msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
     MSG_task_send(finalize, build_channel_name(channel,master_name,
-                   MSG_host_get_name(workers[i % workers_count])));
+        MSG_host_get_name(workers[i % workers_count])));
   }
 
   XBT_INFO("Sent %d tasks in total!", task_num);
@@ -111,7 +111,7 @@ int worker(int argc, char *argv[])
   char channel[1024];
 
   build_channel_name(channel,MSG_process_get_data(MSG_process_self()),
-                    MSG_host_get_name(MSG_host_self()));
+         MSG_host_get_name(MSG_host_self()));
 
   XBT_DEBUG("Receiving on channel \"%s\"", channel);
 
index 75f351d..e5e9726 100644 (file)
@@ -59,17 +59,17 @@ int master(int argc, char *argv[])
     
     for (i = 0; i < workers_count; i++)
       if(host_self == workers[i]) {
-       workers[i] = workers[workers_count-1];
-       workers_count--;
-       break;
+  workers[i] = workers[workers_count-1];
+  workers_count--;
+  break;
       }
 
     for (i = 0; i < workers_count; i++)
-       MSG_process_create("worker", worker, master_name, workers[i]);
+  MSG_process_create("worker", worker, master_name, workers[i]);
   }
 
   XBT_INFO("Got %d workers and will send tasks for %g seconds!", 
-          workers_count, timeout);
+     workers_count, timeout);
 
   for (i = 0; 1; i++) {
     char sprintf_buffer[64];
@@ -79,11 +79,11 @@ int master(int argc, char *argv[])
 
     sprintf(sprintf_buffer, "Task_%d", i);
     task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
-                          NULL);
+         NULL);
     MSG_task_set_category(task, master_name);
 
     build_channel_name(channel,master_name,
-                      MSG_host_get_name(workers[i % workers_count]));
+           MSG_host_get_name(workers[i % workers_count]));
     
     XBT_DEBUG("Sending \"%s\" to channel \"%s\"", task->name, channel);
     MSG_task_send(task, channel);
@@ -97,7 +97,7 @@ int master(int argc, char *argv[])
   for (i = 0; i < workers_count; i++) {
     msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
     MSG_task_send(finalize, build_channel_name(channel,master_name,
-                   MSG_host_get_name(workers[i % workers_count])));
+        MSG_host_get_name(workers[i % workers_count])));
   }
 
   XBT_INFO("Sent %d tasks in total!", task_num);
@@ -114,7 +114,7 @@ int worker(int argc, char *argv[])
   char channel[1024];
 
   build_channel_name(channel,MSG_process_get_data(MSG_process_self()),
-                    MSG_host_get_name(MSG_host_self()));
+         MSG_host_get_name(MSG_host_self()));
 
   XBT_DEBUG("Receiving on channel \"%s\"", channel);
 
index c50a067..029ceb9 100644 (file)
@@ -59,17 +59,17 @@ int master(int argc, char *argv[])
     
     for (i = 0; i < workers_count; i++)
       if(host_self == workers[i]) {
-       workers[i] = workers[workers_count-1];
-       workers_count--;
-       break;
+  workers[i] = workers[workers_count-1];
+  workers_count--;
+  break;
       }
 
     for (i = 0; i < workers_count; i++)
-       MSG_process_create("worker", worker, master_name, workers[i]);
+  MSG_process_create("worker", worker, master_name, workers[i]);
   }
 
   XBT_INFO("Got %d workers and will send tasks for %g seconds!", 
-          workers_count, timeout);
+     workers_count, timeout);
   xbt_dynar_t idle_hosts = xbt_dynar_new(sizeof(msg_host_t), NULL);
   msg_host_t request_host = NULL;
 
@@ -90,8 +90,8 @@ int master(int argc, char *argv[])
     if(MSG_get_clock()>timeout) {
       if(xbt_dynar_length(idle_hosts) == workers_count) break;
       else {
-       MSG_process_sleep(.1);
-       continue;
+  MSG_process_sleep(.1);
+  continue;
       }
     }
     
@@ -103,7 +103,7 @@ int master(int argc, char *argv[])
 
     sprintf(sprintf_buffer, "Task_%d", i);
     task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
-                          NULL);
+         NULL);
     MSG_task_set_category(task, master_name);
 
     xbt_dynar_shift(idle_hosts, &request_host);
@@ -123,7 +123,7 @@ int master(int argc, char *argv[])
   for (i = 0; i < workers_count; i++) {
     msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
     MSG_task_send(finalize, build_channel_name(channel,master_name,
-                   MSG_host_get_name(workers[i % workers_count])));
+        MSG_host_get_name(workers[i % workers_count])));
   }
 
   XBT_INFO("Sent %d tasks in total!", task_num);
index e43c1d4..81ef04e 100644 (file)
@@ -482,17 +482,17 @@ int main(int argc, char *argv[])
   MSG_action_init();
 
   xbt_assert(argc > 2,
-            "Usage: %s platform_file deployment_file [action_files]\n"
-            "\t# if all actions are in the same file\n"
-            "\tExample: %s msg_platform.xml msg_deployment.xml actions\n"
-            "\t# if actions are in separate files, specified in deployment\n"
-            "\tExample: %s msg_platform.xml msg_deployment.xml ",
-            argv[0],argv[0],argv[0]);
+       "Usage: %s platform_file deployment_file [action_files]\n"
+       "\t# if all actions are in the same file\n"
+       "\tExample: %s msg_platform.xml msg_deployment.xml actions\n"
+       "\t# if actions are in separate files, specified in deployment\n"
+       "\tExample: %s msg_platform.xml msg_deployment.xml ",
+       argv[0],argv[0],argv[0]);
 
   printf("WARNING: THIS BINARY IS KINDA DEPRECATED\n"
-        "This example is still relevant if you want to learn about MSG-based trace replay, "
-        "but if you want to simulate MPI-like traces, you should use the newer version "
-        "that is in the examples/smpi/replay directory instead.\n");
+   "This example is still relevant if you want to learn about MSG-based trace replay, "
+   "but if you want to simulate MPI-like traces, you should use the newer version "
+   "that is in the examples/smpi/replay directory instead.\n");
    
   /*  Simulation setting */
   MSG_create_environment(argv[1]);
index 17758e4..aa1ef5b 100644 (file)
@@ -58,7 +58,7 @@ static void action_open(const char *const *action) {
   double clock = MSG_get_clock();       /* this "call" is free thanks to inlining */
 
   sprintf(full_name, "%s:%s", MSG_process_get_name(MSG_process_self()), 
-         file_name);
+    file_name);
 
   ACT_DEBUG("Entering Open: %s (filename: %s)", NAME, file_name);
   file = MSG_file_open(file_name, NULL);
index 21c6a8c..8de01ef 100644 (file)
@@ -714,19 +714,19 @@ static int remote_find_successor(node_t node, int ask_to, int id)
         XBT_DEBUG("Received a task (%p)", task_received);
         task_data_t ans_data = MSG_task_get_data(task_received);
 
-       // Once upon a time, our code assumed that here, task_received != task_sent all the time
-       //
-       // This assumption is wrong (as messages from differing round can interleave), leading to a bug in our code.
-       // We failed to find this bug directly, as it only occured on large platforms, leading to hardly usable traces.
-       // Instead, we used the model-checker to track down the issue by adding the following test here in the code:
-       //   if (MC_is_active()) {
-       //      MC_assert(task_received == task_sent);
+  // Once upon a time, our code assumed that here, task_received != task_sent all the time
+  //
+  // This assumption is wrong (as messages from differing round can interleave), leading to a bug in our code.
+  // We failed to find this bug directly, as it only occured on large platforms, leading to hardly usable traces.
+  // Instead, we used the model-checker to track down the issue by adding the following test here in the code:
+  //   if (MC_is_active()) {
+  //      MC_assert(task_received == task_sent);
         //   }
-       // That explained the bug in a snap, with a very cool example and everything.
-       //
-       // This MC_assert is now desactivated as the case is now properly handled in our code and we don't want the
-       //   MC to fail any further under that condition, but this comment is here to as a memorial for this first
-       //   brillant victory of the model-checking in the SimGrid community :)
+  // That explained the bug in a snap, with a very cool example and everything.
+  //
+  // This MC_assert is now desactivated as the case is now properly handled in our code and we don't want the
+  //   MC to fail any further under that condition, but this comment is here to as a memorial for this first
+  //   brillant victory of the model-checking in the SimGrid community :)
 
         if (task_received != task_sent ||
             ans_data->type != TASK_FIND_SUCCESSOR_ANSWER) {
@@ -1027,9 +1027,9 @@ int main(int argc, char *argv[])
 {
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, 
-            "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
-            "\tExample: %s ../msg_platform.xml chord.xml\n", 
-            argv[0], argv[0]);
+       "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
+       "\tExample: %s ../msg_platform.xml chord.xml\n", 
+       argv[0], argv[0]);
 
   char **options = &argv[1];
   while (!strncmp(options[0], "-", 1)) {
index 853400b..3eaed07 100644 (file)
@@ -23,8 +23,8 @@ static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
   double mig_end = MSG_get_clock();
 
   XBT_INFO("%s migrated: %s->%s in %g s", MSG_vm_get_name(vm),
-                 MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
-                 mig_end - mig_sta);
+      MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
+      mig_end - mig_sta);
 }
 
 static int migration_worker_main(int argc, char *argv[])
index ea56aba..c6bd09f 100644 (file)
@@ -29,9 +29,9 @@ static int worker_main(int argc, char *argv[])
 
 
 struct task_data {
-       msg_task_t task;
-       double prev_computation_amount;
-       double prev_clock;
+  msg_task_t task;
+  double prev_computation_amount;
+  double prev_clock;
 };
 
 
index 338b75f..1c45b8c 100644 (file)
@@ -24,14 +24,14 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
  **/
 
 static double time_precise(void) {
-       struct timeval tv;
-       int ret = gettimeofday(&tv, NULL);
+  struct timeval tv;
+  int ret = gettimeofday(&tv, NULL);
   if (ret < 0)
     xbt_die("gettimeofday");
 
-       double now = (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001;
+  double now = (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001;
 
-       return now;
+  return now;
 }
 
 static int computation_fun(int argc, char *argv[]) {
@@ -67,33 +67,33 @@ static int master_main(int argc, char *argv[])
 
   int i = 0;
   for (i = 0; i < npm; i++) {
-         pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t);
+    pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t);
   }
 
   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]);
+    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);
+    xbt_free(vm_name);
   }
 
 
   XBT_INFO("## Test (start)");
 
   for (i = 0; i < 10; i++) {
-         double clock_sta = time_precise();
-         MSG_process_sleep(1);
-         double clock_end = time_precise();
-         XBT_INFO("duration %f", clock_end - clock_sta);
+    double clock_sta = time_precise();
+    MSG_process_sleep(1);
+    double clock_end = time_precise();
+    XBT_INFO("duration %f", clock_end - clock_sta);
   }
 
 
   for (i = 0; i < nvm; i++) {
-         MSG_vm_destroy(vm[i]);
+    MSG_vm_destroy(vm[i]);
   }
 
   XBT_INFO("## Test (ended)");
index 6a0dd2c..d2e8263 100644 (file)
@@ -70,9 +70,9 @@ static int master_main(int argc, char *argv[])
   launch_computation_worker(vm0);
 
   while(MSG_get_clock()<100) {
-       if (atask != NULL)
-         XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask));
-       MSG_process_sleep(1);
+  if (atask != NULL)
+    XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask));
+  MSG_process_sleep(1);
   }
 
   MSG_process_sleep(10000);
index f919a12..092515d 100644 (file)
@@ -28,16 +28,16 @@ int dvfs(int argc, char *argv[])
 
 
   XBT_INFO("Energetic profile: %s",
-                 MSG_host_get_property_value(host,"watt_per_state"));
+      MSG_host_get_property_value(host,"watt_per_state"));
   XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
-                 MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+      MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
 
   double start = MSG_get_clock();
   XBT_INFO("Sleep for 10 seconds");
   MSG_process_sleep(10);
   XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J",
-                 MSG_get_clock()-start,
-                 MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+      MSG_get_clock()-start,
+      MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
 
   // Run a task
   start = MSG_get_clock();
@@ -46,18 +46,18 @@ int dvfs(int argc, char *argv[])
   MSG_task_execute (task1);
   MSG_task_destroy(task1);
   XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW depending on load; Energy dissipated=%.0f J",
-                 MSG_get_clock()-start,
-                 MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)),
-                 sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)),
-                 sg_host_get_consumed_energy(host));
+      MSG_get_clock()-start,
+      MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)),
+      sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)),
+      sg_host_get_consumed_energy(host));
 
   // ========= Change power peak =========
   int pstate=2;
   MSG_host_set_pstate(host, pstate);
   XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)",
-                 pstate,
-                 MSG_host_get_power_peak_at(host, pstate),
-                 MSG_host_get_current_power_peak(host));
+      pstate,
+      MSG_host_get_power_peak_at(host, pstate),
+      MSG_host_get_current_power_peak(host));
 
   // Run a second task
   start = MSG_get_clock();
@@ -66,25 +66,25 @@ int dvfs(int argc, char *argv[])
   MSG_task_execute (task1);
   MSG_task_destroy(task1);
   XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-                 MSG_get_clock()-start,
-                 MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+      MSG_get_clock()-start,
+      MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
 
   start = MSG_get_clock();
   XBT_INFO("Sleep for 4 seconds");
   MSG_process_sleep(4);
   XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-                 MSG_get_clock()-start,
-                 MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+      MSG_get_clock()-start,
+      MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
 
   // =========== Turn the other host off ==========
   XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
-                 sg_host_get_consumed_energy(MSG_host_by_name("MyHost2")) );
+      sg_host_get_consumed_energy(MSG_host_by_name("MyHost2")) );
   MSG_host_off(MSG_host_by_name("MyHost2"));
   start = MSG_get_clock();
   MSG_process_sleep(10);
   XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-                 MSG_get_clock()-start,
-                 MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+      MSG_get_clock()-start,
+      MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
   return 0;
 }
 
@@ -95,8 +95,8 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+            argv[0], argv[0]);
  
   MSG_create_environment(argv[1]);
 
index f06d512..4f0b927 100644 (file)
@@ -15,7 +15,7 @@
 #include "xbt/asserts.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
-                            "Messages specific for this msg example");
+           "Messages specific for this msg example");
 
 static void simulate_bootup(msg_host_t host) {
 
@@ -68,27 +68,27 @@ static int onoff(int argc, char *argv[]) {
   msg_host_t host1 = MSG_host_by_name("MyHost1");
 
   XBT_INFO("Energetic profile: %s",
-          MSG_host_get_property_value(host1,"watt_per_state"));
+     MSG_host_get_property_value(host1,"watt_per_state"));
   XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
-          MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+     MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
   XBT_INFO("Sleep for 10 seconds");
   MSG_process_sleep(10);
   XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
-          MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+     MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
   simulate_shutdown(host1);
   XBT_INFO("Host1 is now OFF. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-          MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+     MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
   XBT_INFO("Sleep for 10 seconds");
   MSG_process_sleep(10);
   XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
-          MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+     MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
   simulate_bootup(host1);
   XBT_INFO("Host1 is now ON again. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-          MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+     MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
 
   return 0;
@@ -101,8 +101,8 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-            argv[0], argv[0]);
+       "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+       argv[0], argv[0]);
 
   MSG_create_environment(argv[1]);
 
index 3e07790..cd37f4d 100644 (file)
 /** @addtogroup MSG_examples
  *
  * - <b>energy/e1/e1.c</b> Shows how a set of pstates can be defined
- *             for a host and how the current pstate can be accessed/changed
- *             with @ref MSG_get_host_current_power_peak and @ref
- *             MSG_set_host_pstate.
- *             Make sure to read the platform XML file for details on how
- *             to declare the CPU capacity for each pstate.
+ *     for a host and how the current pstate can be accessed/changed
+ *     with @ref MSG_get_host_current_power_peak and @ref
+ *     MSG_set_host_pstate.
+ *     Make sure to read the platform XML file for details on how
+ *     to declare the CPU capacity for each pstate.
  *
  */
 
@@ -54,10 +54,10 @@ int dvfs(int argc, char *argv[])
 
   // Change power peak
   if ((new_peak_index >= nb) || (new_peak_index < 0))
-         {
-         XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb);
-         return 0;
-         }
+    {
+    XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb);
+    return 0;
+    }
 
   double peak_at = MSG_host_get_power_peak_at(host, new_peak_index);
   XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_peak_index);
@@ -93,8 +93,8 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+            argv[0], argv[0]);
   
   MSG_create_environment(argv[1]);
 
index 943cc6c..14a41d6 100644 (file)
@@ -68,8 +68,8 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   xbt_assert(argc > 1, "Usage: %s platform_file\n"
-            "\tExample: %s msg_platform.xml\n", 
-            argv[0], argv[0]);
+       "\tExample: %s msg_platform.xml\n", 
+       argv[0], argv[0]);
 
   MSG_create_environment(argv[1]);
 
index 7d8af4a..18d5c10 100644 (file)
@@ -22,7 +22,7 @@ static int victim(int argc, char *argv[]) {
   msg_error_t res = MSG_OK;
   
   XBT_INFO("Let's work.");
-  TRY {        
+  TRY {  
     res = MSG_task_execute(MSG_task_create("Task", 1e14, 0, NULL));
     if (res != MSG_OK) {
       XBT_INFO("The MSG_task_execute caught the exception for me and returned %d)",res);
@@ -115,8 +115,8 @@ int main(int argc, char *argv[]) {
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                argv[0], argv[0]);
+           "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+           argv[0], argv[0]);
 
   MSG_function_register("terrorist", terrorist);
   MSG_create_environment(argv[1]);
index 839d4a7..a2bed8d 100644 (file)
@@ -194,8 +194,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s platform.xml deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s platform.xml deployment.xml\n", 
+            argv[0], argv[0]);
    
   res = test_all(argv[1], argv[2]);
 
index d36b412..a94c91e 100644 (file)
@@ -172,8 +172,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                argv[0], argv[0]);
+           "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+           argv[0], argv[0]);
 
   res = test_all(argv[1], argv[2]);
 
index ddd51ca..b5b4b5b 100644 (file)
@@ -128,8 +128,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                argv[0], argv[0]);
+           "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+           argv[0], argv[0]);
 
   res = test_all(argv[1], argv[2]);
 
index 9952786..5ba1285 100644 (file)
@@ -474,8 +474,8 @@ int main(int argc, char *argv[])
 
   /* Check the arguments */
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-            argv[0], argv[0]);
+       "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+       argv[0], argv[0]);
 
   const char *platform_file = argv[1];
   const char *deployment_file = argv[2];
index 5e1be97..ecaafac 100644 (file)
@@ -90,8 +90,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 3, "Usage: %s platform_file number_of_jobs number_of_slaves\n"
-                 "\tExample: %s msg_platform.xml 10 5\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml 10 5\n", 
+            argv[0], argv[0]);
 
   MSG_function_register("master", master);
   MSG_function_register("slave", slave);
index 8acbc13..2b1b372 100644 (file)
@@ -205,8 +205,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+            argv[0], argv[0]);
   
   res = test_all(argv[1], argv[2]);
 
index 6e01b3b..8628584 100644 (file)
@@ -208,8 +208,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+            argv[0], argv[0]);
   
   res = test_all(argv[1], argv[2]);
 
index 316516e..91e9914 100644 (file)
@@ -67,8 +67,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", 
+            argv[0], argv[0]);
 
   test_all(argv[1], argv[2]);
 
index ed1a0a7..7737722 100644 (file)
@@ -103,8 +103,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+            argv[0], argv[0]);
   
   platform_file = argv[1];
   application_file = argv[2];
index 8a6bd75..9a6bd21 100644 (file)
@@ -77,8 +77,8 @@ int main(int argc, char *argv[])
   /* Argument checking */
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", 
+            argv[0], argv[0]);
 
   /* Simulation setting */
   MSG_create_environment(argv[1]);
index 2338f16..fecc41c 100644 (file)
@@ -210,8 +210,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s platform.xml deployment.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s platform.xml deployment.xml\n", 
+            argv[0], argv[0]);
    
 
   res = test_all(argv[1], argv[2]);
index 51a5b23..7035cba 100644 (file)
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 1, "Usage: %s platform_file\n"
-            "\tExample: %s msg_platform.xml", argv[0], argv[0]);
+       "\tExample: %s msg_platform.xml", argv[0], argv[0]);
   res = test_all(argv[1]);
 
   return res != MSG_OK;
index 245990e..7bf64aa 100644 (file)
@@ -159,8 +159,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-            "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-            argv[0], argv[0]);
+       "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+       argv[0], argv[0]);
 
   res = test_all(argv[1], argv[2]);
 
index 131e8e7..bc85c04 100644 (file)
@@ -141,11 +141,11 @@ static int closest_in_namespace_set(node_t node, int dest) {
     int i, dist;
     for (i=0; i<NAMESPACE_SIZE; i++) {
       if (node->namespace_set[i]!=-1) {
-       dist = abs(node->namespace_set[i] - dest);
-       if (dist<best_dist) {
-         best_dist = dist;
-          res = node->namespace_set[i];          
-       }
+  dist = abs(node->namespace_set[i] - dest);
+  if (dist<best_dist) {
+    best_dist = dist;
+          res = node->namespace_set[i];    
+  }
       }
     }
   }
@@ -226,7 +226,7 @@ static void handle_task(node_t node, msg_task_t task) {
       if (next!=node->id) {
         get_mailbox(next, mailbox);
         task_data->sender_id = node->id;
-       task_data->steps++;
+  task_data->steps++;
         task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, task_data);
         MSG_task_send_with_timeout(task_sent, mailbox, timeout);
         type = TASK_JOIN_REPLY;
@@ -259,7 +259,7 @@ static void handle_task(node_t node, msg_task_t task) {
 
       // if first node touched reply, copy its neighborood set
       if (task_data->sender_id == node->known_id) {
-       node->neighborhood_set[0] = task_data->sender_id;
+  node->neighborhood_set[0] = task_data->sender_id;
         for (i=1; i<NEIGHBORHOOD_SIZE; i++)
             node->neighborhood_set[i] = task_data->state->neighborhood_set[i-1]; 
       }
@@ -270,7 +270,7 @@ static void handle_task(node_t node, msg_task_t task) {
       for (i=min;i<max;i++) {
         d = domain(node->id, i); 
         for (j=0; j<LEVEL_SIZE; j++)
-         if (d!=j)
+    if (d!=j)
             node->routing_table[i][j] =  task_data->state->routing_table[i][j];
       }
 
@@ -280,15 +280,15 @@ static void handle_task(node_t node, msg_task_t task) {
         XBT_DEBUG("Node %i is ready!!!", node->id);
 
         while(xbt_fifo_size(node->pending_tasks))
-         handle_task(node, xbt_fifo_pop(node->pending_tasks));
+    handle_task(node, xbt_fifo_pop(node->pending_tasks));
 
-       for (i=0; i<NAMESPACE_SIZE; i++) {
+  for (i=0; i<NAMESPACE_SIZE; i++) {
           j = node->namespace_set[i];
           if (j!=-1) {
             XBT_DEBUG("Send update to %i", j);
             get_mailbox(j, mailbox);
-           
-           req_data = xbt_new0(s_task_data_t,1);
+      
+      req_data = xbt_new0(s_task_data_t,1);
             req_data->answer_id = node->id;
             req_data->steps = 0;
             req_data->type = TASK_UPDATE;
@@ -320,65 +320,65 @@ static void handle_task(node_t node, msg_task_t task) {
       i=0;
       for (; i<NAMESPACE_SIZE/2; i++){
         curr_namespace_set[i] = node->namespace_set[i];
-       task_namespace_set[i] = task_data->state->namespace_set[i];
+  task_namespace_set[i] = task_data->state->namespace_set[i];
       }
       task_namespace_set[i] = task_data->state->id;
       for (; i<NAMESPACE_SIZE; i++){
-        curr_namespace_set[i] = node->namespace_set[i];        
-       task_namespace_set[i+1] = task_data->state->namespace_set[i];   
+        curr_namespace_set[i] = node->namespace_set[i];  
+  task_namespace_set[i+1] = task_data->state->namespace_set[i];  
       }
 
       // get the index of values before and after node->id in task_namespace
       min = -1;
       max = -1;
       for (i=0; i<=NAMESPACE_SIZE; i++) {
-       j = task_namespace_set[i];
+  j = task_namespace_set[i];
         if (i<NAMESPACE_SIZE)
-         printf("%08x %08x | ", j, curr_namespace_set[i]);
-       if (j != -1 && j < node->id) min = i;
-       if (j != -1 && max == -1 && j > node->id) max = i;
+    printf("%08x %08x | ", j, curr_namespace_set[i]);
+  if (j != -1 && j < node->id) min = i;
+  if (j != -1 && max == -1 && j > node->id) max = i;
       }
       printf("\n");
 
       // add lower elements
       j = NAMESPACE_SIZE/2-1;
       for (i=NAMESPACE_SIZE/2-1; i>=0; i--) {
-       printf("i:%i, j:%i, min:%i, currj:%08x, taskmin:%08x\n", i, j, min, curr_namespace_set[j], task_namespace_set[min]);
+  printf("i:%i, j:%i, min:%i, currj:%08x, taskmin:%08x\n", i, j, min, curr_namespace_set[j], task_namespace_set[min]);
         if (min<0) {
-         node->namespace_set[i] = curr_namespace_set[j];
-         j--; 
-       } else if (curr_namespace_set[j] == task_namespace_set[min]) {
-         node->namespace_set[i] = curr_namespace_set[j];
-         j--; min--;
-       } else if (curr_namespace_set[j] > task_namespace_set[min]) {
+    node->namespace_set[i] = curr_namespace_set[j];
+    j--; 
+  } else if (curr_namespace_set[j] == task_namespace_set[min]) {
+    node->namespace_set[i] = curr_namespace_set[j];
+    j--; min--;
+  } else if (curr_namespace_set[j] > task_namespace_set[min]) {
           node->namespace_set[i] = curr_namespace_set[j];
-         j--;
-       } else {
+    j--;
+  } else {
           node->namespace_set[i] = task_namespace_set[min];
-         min--;
-       }
+    min--;
+  }
       }
 
       // add greater elements
       j = NAMESPACE_SIZE/2;
       for (i=NAMESPACE_SIZE/2; i<NAMESPACE_SIZE; i++) {
-       printf("i:%i, j:%i, max:%i, currj:%08x, taskmax:%08x\n", i, j, max, curr_namespace_set[j], task_namespace_set[max]);          
+  printf("i:%i, j:%i, max:%i, currj:%08x, taskmax:%08x\n", i, j, max, curr_namespace_set[j], task_namespace_set[max]);        
         if (min<0 || max>=NAMESPACE_SIZE) {
-         node->namespace_set[i] = curr_namespace_set[j];
-         j++;
-       } else if (curr_namespace_set[j] == -1) {
-         node->namespace_set[i] = task_namespace_set[max];
-         max++;
-       } else if (curr_namespace_set[j] == task_namespace_set[max]) {
-         node->namespace_set[i] = curr_namespace_set[j];
-         j++; max++;
-       } else if (curr_namespace_set[j] < task_namespace_set[max]) {
+    node->namespace_set[i] = curr_namespace_set[j];
+    j++;
+  } else if (curr_namespace_set[j] == -1) {
+    node->namespace_set[i] = task_namespace_set[max];
+    max++;
+  } else if (curr_namespace_set[j] == task_namespace_set[max]) {
+    node->namespace_set[i] = curr_namespace_set[j];
+    j++; max++;
+  } else if (curr_namespace_set[j] < task_namespace_set[max]) {
           node->namespace_set[i] = curr_namespace_set[j];
-         j++;
-       } else {
+    j++;
+  } else {
           node->namespace_set[i] = task_namespace_set[max];
-         max++;
-       }
+    max++;
+  }
       }
       print_node_namespace_set(node);
 
@@ -389,7 +389,7 @@ static void handle_task(node_t node, msg_task_t task) {
             node->routing_table[i][j] = task_data->state->routing_table[i][j];
         }
       }
-  }               
+  }         
 }
 
 /**
@@ -437,7 +437,7 @@ static void print_node(node_t node) {
  * Print the node id
  */
 static void print_node_id(node_t node) {
-  int i;       
+  int i;  
   printf(" id: %i '%08x' ", node->id, node->id);
   for (i=0;i<LEVELS_COUNT;i++)
     printf(" %x", domain(node->id, i));
@@ -448,7 +448,7 @@ static void print_node_id(node_t node) {
  * Print the node neighborood set
  */
 static void print_node_neighborood_set(node_t node) {
-  int i;       
+  int i;  
   printf(" neighborood:\n");
   for (i=0; i<NEIGHBORHOOD_SIZE; i++)
     printf("  %08x\n", node->neighborhood_set[i]);
@@ -458,7 +458,7 @@ static void print_node_neighborood_set(node_t node) {
  * Print the routing table
  */
 static void print_node_routing_table(node_t node) {
-  int i,j;     
+  int i,j;  
   printf(" routing table:\n");
   for (i=0; i<LEVELS_COUNT; i++){
     printf("  ");
@@ -484,7 +484,7 @@ static void print_node_namespace_set(node_t node) {
  * Get the corresponding state of a node
  */
 static state_t node_get_state(node_t node) {
-  int i,j;     
+  int i,j;  
   state_t state = xbt_new0(s_state_t,1);
   state->id = node->id;
   for (i=0; i<NEIGHBORHOOD_SIZE; i++)
@@ -614,9 +614,9 @@ int main(int argc, char *argv[])
 {
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, 
-            "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
-            "\tExample: %s ../msg_platform.xml pastry10.xml\n", 
-            argv[0], argv[0]);
+       "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
+       "\tExample: %s ../msg_platform.xml pastry10.xml\n", 
+       argv[0], argv[0]);
   
   char **options = &argv[1];
   while (!strncmp(options[0], "-", 1)) {
index 6cc0b81..b184bf5 100644 (file)
@@ -75,8 +75,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                argv[0], argv[0]);
+           "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+           argv[0], argv[0]);
   
   res = test_all(argv[1], argv[2]);
 
index 9417692..15d2ee0 100644 (file)
@@ -157,8 +157,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                argv[0], argv[0]);
+           "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+           argv[0], argv[0]);
  
    res = test_all(argv[1], argv[2]);
 
index aed1405..f64e726 100644 (file)
@@ -72,9 +72,9 @@ int main(int argc, char* argv[]) {
  
 
   MSG_process_create_with_arguments(xbt_strdup("Alice"), peer, NULL, 
-                                   h, 8, aliceTimes);
+            h, 8, aliceTimes);
   MSG_process_create_with_arguments(xbt_strdup("Bob"), peer, NULL, 
-                                   h, 8, bobTimes);
+            h, 8, bobTimes);
 
   msg_error_t res = MSG_main();
   printf("Finished\n");
index ca12844..fbff386 100644 (file)
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-            "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+       "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
 
   res = test_all(argv[1], argv[2]);
 
index 014059b..00dfcbb 100644 (file)
@@ -51,8 +51,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
    xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
-                argv[0], argv[0]);
+           "\tExample: %s msg_platform.xml msg_deployment.xml\n", 
+           argv[0], argv[0]);
   
   test_all(argv[1], argv[2]);
 
index 19e5b84..a36254a 100644 (file)
@@ -102,8 +102,8 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-                 "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", 
-                 argv[0], argv[0]);
+            "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", 
+            argv[0], argv[0]);
 
   test_all(argv[1], argv[2]);
 
index c1e3ca5..0a7c018 100644 (file)
@@ -11,41 +11,41 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
 
 class Worker : simgrid::s4u::Actor {
 public:
-       Worker(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
-                       : simgrid::s4u::Actor(procname,host,argc,argv){}
+  Worker(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
+      : simgrid::s4u::Actor(procname,host,argc,argv){}
 
-       int main(int argc, char **argv) {
-               XBT_INFO("Hello s4u, I'm ready to serve");
+  int main(int argc, char **argv) {
+    XBT_INFO("Hello s4u, I'm ready to serve");
 
-               char *msg = (char*)recv(*simgrid::s4u::Mailbox::byName("worker"));
-               XBT_INFO("I received '%s'",msg);
-               XBT_INFO("I'm done. See you.");
-               return 1;
-       }
+    char *msg = (char*)recv(*simgrid::s4u::Mailbox::byName("worker"));
+    XBT_INFO("I received '%s'",msg);
+    XBT_INFO("I'm done. See you.");
+    return 1;
+  }
 };
 
 class Master : simgrid::s4u::Actor {
 public:
-       Master(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
-                       : Actor(procname,host,argc,argv){}
+  Master(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
+      : Actor(procname,host,argc,argv){}
 
-       int main(int argc, char **argv) {
-               const char *msg = "GaBuZoMeu";
-               XBT_INFO("Hello s4u, I have something to send");
-               send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg));
+  int main(int argc, char **argv) {
+    const char *msg = "GaBuZoMeu";
+    XBT_INFO("Hello s4u, I have something to send");
+    send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg));
 
-               XBT_INFO("I'm done. See you.");
-               return 1;
-       }
+    XBT_INFO("I'm done. See you.");
+    return 1;
+  }
 };
 
 
 int main(int argc, char **argv) {
-       simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
-       e->loadPlatform("../../platforms/two_hosts_platform.xml");
+  simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
+  e->loadPlatform("../../platforms/two_hosts_platform.xml");
 
-       new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL);
-       new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL);
-       e->run();
-       return 0;
+  new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL);
+  new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL);
+  e->run();
+  return 0;
 }
index c2e9757..789a8f4 100644 (file)
@@ -13,103 +13,103 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
 
 class myHost : simgrid::s4u::Actor {
 public:
-       myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
+  myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
 : simgrid::s4u::Actor(procname,host,argc,argv){}
 
-       void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage*> const&mounts) {
-               XBT_INFO("Storage info on %s:",
-                       simgrid::s4u::Host::current()->name().c_str());
-
-               for (const auto&kv : mounts) {
-                       const char* mountpoint = kv.first.c_str();
-                       simgrid::s4u::Storage &storage = *kv.second;
-
-                       // Retrieve disk's information
-                       sg_size_t free_size = storage.size_free();
-                       sg_size_t used_size = storage.size_used();
-                       sg_size_t size = storage.size();
-
-                       XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.",
-                                       storage.name(), mountpoint, used_size, free_size, size);
-               }
-       }
-
-       int main(int argc, char **argv) {
-               boost::unordered_map <std::string, simgrid::s4u::Storage *> const& mounts =
-                       simgrid::s4u::Host::current()->mounted_storages();
-
-               show_info(mounts);
-
-               // Open an non-existing file to create it
-               const char *filename = "/home/tmp/data.txt";
-               simgrid::s4u::File *file = new simgrid::s4u::File(filename, NULL);
-               sg_size_t write, read, file_size;
-
-               write = file->write(200000);  // Write 200,000 bytes
-               XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename);
-
-               // check that sizes have changed
-               show_info(mounts);
-
-               // Now retrieve the size of created file and read it completely
-               file_size = file->size();
-               file->seek(0);
-               read = file->read(file_size);
-               XBT_INFO("Read %llu bytes on %s", read, filename);
-
-               // Now write 100,000 bytes in tmp/data.txt
-               write = file->write(100000);  // Write 100,000 bytes
-               XBT_INFO("Write %llu bytes on %s", write, filename);
-
-               simgrid::s4u::Storage &storage = simgrid::s4u::Storage::byName("Disk4");
-
-               // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
-               const char *newpath = "/home/tmp/simgrid.readme";
-               XBT_INFO("Move '%s' to '%s'", file->path(), newpath);
-               file->move(newpath);
-
-               // Test attaching some user data to the file
-               file->set_userdata(xbt_strdup("777"));
-               XBT_INFO("User data attached to the file: %s", (char*)file->userdata());
-
-               // Close the file
-               delete file;
-
-               // Now attach some user data to disk1
-               XBT_INFO("Get/set data for storage element: %s",storage.name());
-               XBT_INFO("    Uninitialized storage data: '%s'", (char*)storage.userdata());
-
-               storage.set_userdata(xbt_strdup("Some user data"));
-               XBT_INFO("    Set and get data: '%s'", (char*)storage.userdata());
-
-               /*
-                 // Dump disks contents
-                 XBT_INFO("*** Dump content of %s ***",Host::current()->name());
-                 xbt_dict_t contents = NULL;
-                 contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts
-                 xbt_dict_cursor_t curs, curs2 = NULL;
-                 char* mountname;
-                 xbt_dict_t content;
-                 char* path;
-                 sg_size_t *size;
-                 xbt_dict_foreach(contents, curs, mountname, content){
-                   XBT_INFO("Print the content of mount point: %s",mountname);
-                   xbt_dict_foreach(content,curs2,path,size){
-                      XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size));
-                   }
-                 xbt_dict_free(&content);
-                 }
-                 xbt_dict_free(&contents);
-                */
-               return 0;
-       }
+  void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage*> const&mounts) {
+    XBT_INFO("Storage info on %s:",
+      simgrid::s4u::Host::current()->name().c_str());
+
+    for (const auto&kv : mounts) {
+      const char* mountpoint = kv.first.c_str();
+      simgrid::s4u::Storage &storage = *kv.second;
+
+      // Retrieve disk's information
+      sg_size_t free_size = storage.size_free();
+      sg_size_t used_size = storage.size_used();
+      sg_size_t size = storage.size();
+
+      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.",
+          storage.name(), mountpoint, used_size, free_size, size);
+    }
+  }
+
+  int main(int argc, char **argv) {
+    boost::unordered_map <std::string, simgrid::s4u::Storage *> const& mounts =
+      simgrid::s4u::Host::current()->mounted_storages();
+
+    show_info(mounts);
+
+    // Open an non-existing file to create it
+    const char *filename = "/home/tmp/data.txt";
+    simgrid::s4u::File *file = new simgrid::s4u::File(filename, NULL);
+    sg_size_t write, read, file_size;
+
+    write = file->write(200000);  // Write 200,000 bytes
+    XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename);
+
+    // check that sizes have changed
+    show_info(mounts);
+
+    // Now retrieve the size of created file and read it completely
+    file_size = file->size();
+    file->seek(0);
+    read = file->read(file_size);
+    XBT_INFO("Read %llu bytes on %s", read, filename);
+
+    // Now write 100,000 bytes in tmp/data.txt
+    write = file->write(100000);  // Write 100,000 bytes
+    XBT_INFO("Write %llu bytes on %s", write, filename);
+
+    simgrid::s4u::Storage &storage = simgrid::s4u::Storage::byName("Disk4");
+
+    // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
+    const char *newpath = "/home/tmp/simgrid.readme";
+    XBT_INFO("Move '%s' to '%s'", file->path(), newpath);
+    file->move(newpath);
+
+    // Test attaching some user data to the file
+    file->set_userdata(xbt_strdup("777"));
+    XBT_INFO("User data attached to the file: %s", (char*)file->userdata());
+
+    // Close the file
+    delete file;
+
+    // Now attach some user data to disk1
+    XBT_INFO("Get/set data for storage element: %s",storage.name());
+    XBT_INFO("    Uninitialized storage data: '%s'", (char*)storage.userdata());
+
+    storage.set_userdata(xbt_strdup("Some user data"));
+    XBT_INFO("    Set and get data: '%s'", (char*)storage.userdata());
+
+    /*
+      // Dump disks contents
+      XBT_INFO("*** Dump content of %s ***",Host::current()->name());
+      xbt_dict_t contents = NULL;
+      contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts
+      xbt_dict_cursor_t curs, curs2 = NULL;
+      char* mountname;
+      xbt_dict_t content;
+      char* path;
+      sg_size_t *size;
+      xbt_dict_foreach(contents, curs, mountname, content){
+        XBT_INFO("Print the content of mount point: %s",mountname);
+        xbt_dict_foreach(content,curs2,path,size){
+           XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size));
+        }
+      xbt_dict_free(&content);
+      }
+      xbt_dict_free(&contents);
+     */
+    return 0;
+  }
 };
 
 int main(int argc, char **argv) {
-       simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
-       e->loadPlatform("../../platforms/storage/storage.xml");
+  simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
+  e->loadPlatform("../../platforms/storage/storage.xml");
 
-       new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL);
-       e->run();
-       return 0;
+  new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL);
+  e->run();
+  return 0;
 }
index 024c00d..3d68e1b 100644 (file)
@@ -35,13 +35,13 @@ int main(int argc, char **argv)
 
   /* Check our arguments */
   xbt_assert(argc > 2, "Usage: %s platform_file dax_file [jedule_file]\n"
-            "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed", 
-            argv[0], argv[0]);
+       "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed", 
+       argv[0], argv[0]);
 
   char *last = strrchr(argv[2], '.');
   char * tracefilename = bprintf("%.*s.trace",(int) (last == NULL ? 
-                                                  strlen(argv[2]) : 
-                                                  last - argv[2]), argv[2]);  
+               strlen(argv[2]) : 
+               last - argv[2]), argv[2]);  
   if (argc == 4)
     tracefilename = xbt_strdup(argv[3]);
  
index ad340f4..c03f7d0 100644 (file)
@@ -30,8 +30,8 @@ int main(int argc, char **argv)
   /* SD initialization */
   SD_init(&argc, argv);
   xbt_assert(argc > 1,
-            "Usage: %s platform_file\n\tExample: %s ../two_hosts.xml", 
-            argv[0], argv[0]);
+       "Usage: %s platform_file\n\tExample: %s ../two_hosts.xml", 
+       argv[0], argv[0]);
 
   SD_create_environment(argv[1]);
 
index 8ecf2d5..8e672a9 100644 (file)
@@ -112,8 +112,8 @@ static double finish_on_at(SD_task_t task, sg_host_t workstation)
         grand_parents = SD_task_get_parents(parent);
 
         xbt_assert(xbt_dynar_length(grand_parents) <2, 
-                  "Error: transfer %s has 2 parents", 
-                  SD_task_get_name(parent));
+       "Error: transfer %s has 2 parents", 
+       SD_task_get_name(parent));
         
         xbt_dynar_get_cpy(grand_parents, 0, &grand_parent);
 
index 1265710..8bbcf95 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   xbt_assert(argc > 1, "Usage: %s platform_file\n"
-            "\nExample: %s two_clusters.xml", argv[0], argv[0]);
+       "\nExample: %s two_clusters.xml", argv[0], argv[0]);
 
   /* creation of the environment */
   platform_file = argv[1];
index 2f236a6..5acc969 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   xbt_assert(argc > 1, "Usage: %s platform_file\n"
-            "\nExample: %s two_clusters.xml", argv[0], argv[0]);
+       "\nExample: %s two_clusters.xml", argv[0], argv[0]);
 
   /* creation of the environment */
   platform_file = argv[1];
index d589e33..ce4f739 100644 (file)
@@ -61,8 +61,8 @@ int main(int argc, char **argv)
 
   /* creation of the environment */
   xbt_assert(strstr(argv[1],".xml"), 
-            "Unsupported platform description style (not XML): %s",
-            argv[1]);
+       "Unsupported platform description style (not XML): %s",
+       argv[1]);
   SD_create_environment(argv[1]);
 
   /* getting platform infos */
index 4e29f2c..632ca94 100644 (file)
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   xbt_assert(argc > 1, "Usage: %s platform_file\n"
-            "\nExample: %s two_clusters.xml", argv[0], argv[0]);
+       "\nExample: %s two_clusters.xml", argv[0], argv[0]);
 
   /* creation of the environment */
   platform_file = argv[1];
index 871f83e..6767ba4 100644 (file)
@@ -81,16 +81,16 @@ int main(int argc, char ** argv)
       case 'h':
         XBT_INFO(
                     "Usage: mxm_cblas_test [options]\n"
-                    "  -M I    M size (default: %zu)\n"
-                    "  -N I    N size (default: %zu)\n"
-                    "  -K I    K size (default: %zu)\n"
-                    "  -B I    Block size on the k dimension(default: %zu)\n"
-                    "  -G I    Number of processor groups(default: %zu)\n"
-                    "  -g I    group index(default: %zu)\n"
-                    "  -k I    group rank(default: %zu)\n"
-                    "  -r I    processor row size (default: %zu)\n"
-                    "  -c I    processor col size (default: %zu)\n"
-                    "  -h      help\n",
+                    "  -M I  M size (default: %zu)\n"
+                    "  -N I  N size (default: %zu)\n"
+                    "  -K I  K size (default: %zu)\n"
+                    "  -B I  Block size on the k dimension(default: %zu)\n"
+                    "  -G I  Number of processor groups(default: %zu)\n"
+                    "  -g I  group index(default: %zu)\n"
+                    "  -k I  group rank(default: %zu)\n"
+                    "  -r I  processor row size (default: %zu)\n"
+                    "  -c I  processor col size (default: %zu)\n"
+                    "  -h  help\n",
                     m, n, k, Block_size, NB_groups, group, key, row, col);
         return 0;
       case 'M':
index c992b24..5d6a829 100644 (file)
@@ -6,7 +6,7 @@ int x = 20;
 
 int main(int argc, char **argv) {
   
-       int recv_x = 1, size, rank;
+  int recv_x = 1, size, rank;
   MPI_Status status;
 
   MPI_Init(&argc, &argv);
@@ -35,5 +35,5 @@ int main(int argc, char **argv) {
 
   MPI_Finalize();
   
-       return 0;
+  return 0;
 }
index bb06949..03ec4b4 100644 (file)
 #include "xbt/asserts.h"
 #include "smpi/smpi.h"
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
-               "Messages specific for this msg example");
+    "Messages specific for this msg example");
 
 static int smpi_replay(int argc, char *argv[]) {
-       smpi_replay_run(&argc, &argv);
-       return 0;
+  smpi_replay_run(&argc, &argv);
+  return 0;
 }
 
 int main(int argc, char *argv[]){
-       msg_error_t res;
-       const char *platform_file;
-       const char *application_file;
-       const char *description_file;
-
-       MSG_init(&argc, argv);
-
-       if (argc < 4) {
-               printf("Usage: %s description_file platform_file deployment_file\n", argv[0]);
-               printf("example: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0]);
-               exit(1);
-       }
-       description_file = argv[1];
-       platform_file = argv[2];
-       application_file = argv[3];
-
-
-       /*  Simulation setting */
-       MSG_create_environment(platform_file);
-
-       /*   Application deployment: read the description file in order to identify instances to launch */
-       FILE* fp = fopen(description_file, "r");
-       if (fp == NULL)
-               xbt_die("Cannot open %s", description_file);
-       ssize_t read;
-       char     *line = NULL;
-       size_t n         = 0;
-       int instance_size = 0;
-       const char* instance_id = NULL;
-       while ((read = xbt_getline(&line, &n, fp)) != -1 ){
-               xbt_dynar_t elems = xbt_str_split_quoted_in_place(line);
-               if(xbt_dynar_length(elems)<3){
-                       xbt_die ("Not enough elements in the line");
-               }
-
-               const char** line_char= xbt_dynar_to_array(elems);
-               instance_id = line_char[0];
-               instance_size = atoi(line_char[2]);
-
-               XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size);
-               SMPI_app_instance_register(instance_id, smpi_replay,instance_size);
-
-               xbt_free(line_char);
-       }
-
-       MSG_launch_application(application_file);
-       SMPI_init();
-
-       res = MSG_main();
-
-       XBT_INFO("Simulation time %g", MSG_get_clock());
-
-       SMPI_finalize();
-       if (res == MSG_OK)
-               return 0;
-       else
-               return 1;
+  msg_error_t res;
+  const char *platform_file;
+  const char *application_file;
+  const char *description_file;
+
+  MSG_init(&argc, argv);
+
+  if (argc < 4) {
+    printf("Usage: %s description_file platform_file deployment_file\n", argv[0]);
+    printf("example: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0]);
+    exit(1);
+  }
+  description_file = argv[1];
+  platform_file = argv[2];
+  application_file = argv[3];
+
+
+  /*  Simulation setting */
+  MSG_create_environment(platform_file);
+
+  /*   Application deployment: read the description file in order to identify instances to launch */
+  FILE* fp = fopen(description_file, "r");
+  if (fp == NULL)
+    xbt_die("Cannot open %s", description_file);
+  ssize_t read;
+  char   *line = NULL;
+  size_t n   = 0;
+  int instance_size = 0;
+  const char* instance_id = NULL;
+  while ((read = xbt_getline(&line, &n, fp)) != -1 ){
+    xbt_dynar_t elems = xbt_str_split_quoted_in_place(line);
+    if(xbt_dynar_length(elems)<3){
+      xbt_die ("Not enough elements in the line");
+    }
+
+    const char** line_char= xbt_dynar_to_array(elems);
+    instance_id = line_char[0];
+    instance_size = atoi(line_char[2]);
+
+    XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size);
+    SMPI_app_instance_register(instance_id, smpi_replay,instance_size);
+
+    xbt_free(line_char);
+  }
+
+  MSG_launch_application(application_file);
+  SMPI_init();
+
+  res = MSG_main();
+
+  XBT_INFO("Simulation time %g", MSG_get_clock());
+
+  SMPI_finalize();
+  if (res == MSG_OK)
+    return 0;
+  else
+    return 1;
 
 }
index 0e03906..93b9539 100644 (file)
@@ -208,7 +208,7 @@ XBT_PUBLIC(void) MSG_config(const char *key, const char *value);
  *  We allow to link against compiled versions that differ in the patch level.
  */
 #define MSG_init(argc,argv)  do {                                                          \
-       sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\
+  sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\
     MSG_init_nocheck(argc,argv);                                                        \
   } while (0)
 
index f807407..696da86 100644 (file)
@@ -30,74 +30,74 @@ namespace s4u {
  *
  * class Worker : simgrid::s4u::Actor {
  *
- *       int main(int argc, char **argv) {
- *             printf("Hello s4u");
- *       }
+ *     int main(int argc, char **argv) {
+ *    printf("Hello s4u");
+ *    }
  * };
  * \endverbatim
  *
  */
 XBT_PUBLIC_CLASS Actor {
-       friend Comm;
-       Actor(smx_process_t smx_proc);
+  friend Comm;
+  Actor(smx_process_t smx_proc);
 public:
-       Actor(const char*name, s4u::Host *host, int argc, char **argv);
-       Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime);
-       virtual ~Actor() {}
-
-       /** The main method of your agent */
-       virtual int main(int argc, char **argv);
-
-       /** The Actor that is currently running */
-       static Actor *current();
-       /** Retrieves the actor that have the given PID (or NULL if not existing) */
-       static Actor *byPid(int pid);
-
-       /** Retrieves the name of that actor */
-       const char*getName();
-       /** Retrieves the host on which that actor is running */
-       s4u::Host *getHost();
-       /** Retrieves the PID of that actor */
-       int getPid();
-
-       /** If set to true, the actor will automatically restart when its host reboots */
-       void setAutoRestart(bool autorestart);
-       /** Sets the time at which that actor should be killed */
-       void setKillTime(double time);
-       /** Retrieves the time at which that actor will be killed (or -1 if not set) */
-       double getKillTime();
-
-       /** Ask kindly to all actors to die. Only the issuer will survive. */
-       static void killAll();
-       /** Ask the actor to die.
-        *
-        * It will only notice your request when doing a simcall next time (a communication or similar).
-        * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues.
-        */
-       void kill();
-
-       /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */
-       void sleep(double duration);
-
-       /** Block the actor, computing the given amount of flops */
-       e_smx_state_t execute(double flop);
-
-       /** Block the actor until it gets a message from the given mailbox.
-        *
-        * See \ref Comm for the full communication API (including non blocking communications).
-        */
-       void *recv(Mailbox &chan);
-
-       /** Block the actor until it delivers a message of the given simulated size to the given mailbox
-        *
-        * See \ref Comm for the full communication API (including non blocking communications).
-       */
-       void send(Mailbox &chan, void*payload, size_t simulatedSize);
+  Actor(const char*name, s4u::Host *host, int argc, char **argv);
+  Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime);
+  virtual ~Actor() {}
+
+  /** The main method of your agent */
+  virtual int main(int argc, char **argv);
+
+  /** The Actor that is currently running */
+  static Actor *current();
+  /** Retrieves the actor that have the given PID (or NULL if not existing) */
+  static Actor *byPid(int pid);
+
+  /** Retrieves the name of that actor */
+  const char*getName();
+  /** Retrieves the host on which that actor is running */
+  s4u::Host *getHost();
+  /** Retrieves the PID of that actor */
+  int getPid();
+
+  /** If set to true, the actor will automatically restart when its host reboots */
+  void setAutoRestart(bool autorestart);
+  /** Sets the time at which that actor should be killed */
+  void setKillTime(double time);
+  /** Retrieves the time at which that actor will be killed (or -1 if not set) */
+  double getKillTime();
+
+  /** Ask kindly to all actors to die. Only the issuer will survive. */
+  static void killAll();
+  /** Ask the actor to die.
+   *
+   * It will only notice your request when doing a simcall next time (a communication or similar).
+   * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues.
+   */
+  void kill();
+
+  /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */
+  void sleep(double duration);
+
+  /** Block the actor, computing the given amount of flops */
+  e_smx_state_t execute(double flop);
+
+  /** Block the actor until it gets a message from the given mailbox.
+   *
+   * See \ref Comm for the full communication API (including non blocking communications).
+   */
+  void *recv(Mailbox &chan);
+
+  /** Block the actor until it delivers a message of the given simulated size to the given mailbox
+   *
+   * See \ref Comm for the full communication API (including non blocking communications).
+  */
+  void send(Mailbox &chan, void*payload, size_t simulatedSize);
 
 protected:
-       smx_process_t getInferior() {return p_smx_process;}
+  smx_process_t getInferior() {return p_smx_process;}
 private:
-       smx_process_t p_smx_process;
+  smx_process_t p_smx_process;
 };
 }} // namespace simgrid::s4u
 
@@ -106,34 +106,34 @@ private:
 #if 0
 
 public abstract class Actor implements Runnable {
-       /** Suspends the process. See {@link #resume()} to resume it afterward */
-       public native void suspend();
-       /** Resume a process that was suspended by {@link #suspend()}. */
-       public native void resume();    
-       /** Tests if a process is suspended. */
-       public native boolean isSuspended();
-       
-       /**
-        * Returns the value of a given process property. 
-        */
-       public native String getProperty(String name);
-
-
-       /**
-        * Migrates a process to another host.
-        *
-        * @param host                  The host where to migrate the process.
-        *
-        */
-       public native void migrate(Host host);  
-
-       public native void exit();    
-       /**
-        * This static method returns the current amount of processes running
-        *
-        * @return                      The count of the running processes
-        */ 
-       public native static int getCount();
+  /** Suspends the process. See {@link #resume()} to resume it afterward */
+  public native void suspend();
+  /** Resume a process that was suspended by {@link #suspend()}. */
+  public native void resume();  
+  /** Tests if a process is suspended. */
+  public native boolean isSuspended();
+  
+  /**
+   * Returns the value of a given process property. 
+   */
+  public native String getProperty(String name);
+
+
+  /**
+   * Migrates a process to another host.
+   *
+   * @param host      The host where to migrate the process.
+   *
+   */
+  public native void migrate(Host host);  
+
+  public native void exit();    
+  /**
+   * This static method returns the current amount of processes running
+   *
+   * @return      The count of the running processes
+   */ 
+  public native static int getCount();
 
 }
 #endif
index 37bd4e1..6500b79 100644 (file)
@@ -15,7 +15,7 @@
 
 SG_BEGIN_DECL();
 typedef enum {
-       inited, started, finished
+  inited, started, finished
 } e_s4u_async_state_t;
 SG_END_DECL();
 
@@ -27,51 +27,51 @@ namespace s4u {
  * This class is the ancestor of every asynchronous actions, that is, of actions that do take time in the simulated world.
  */
 XBT_PUBLIC_CLASS Async {
-       friend Comm;
+  friend Comm;
 protected:
-       Async();
-       virtual ~Async();
-       
+  Async();
+  virtual ~Async();
+  
 private:
-       struct s_smx_synchro *p_inferior = NULL;
+  struct s_smx_synchro *p_inferior = NULL;
 
 private:
-       e_s4u_async_state_t p_state = inited;
+  e_s4u_async_state_t p_state = inited;
 public:
-       /** Starts a previously created async.
-        *
-        * This function is optional: you can call wait() even if you didn't call start()
-        */
-       virtual void start()=0;
-       /** Tests whether the given async is terminated yet */
-       //virtual bool test()=0;
-       /** Blocks until the async is terminated */
-       virtual void wait()=0;
-       /** Blocks until the async is terminated, or until the timeout is elapsed
-        *  Raises: timeout exception.*/
-       virtual void wait(double timeout)=0;
-       /** Cancel that async */
-       //virtual void cancel();
-       /** Retrieve the current state of the async */
-       e_s4u_async_state_t getState() {return p_state;}
+  /** Starts a previously created async.
+   *
+   * This function is optional: you can call wait() even if you didn't call start()
+   */
+  virtual void start()=0;
+  /** Tests whether the given async is terminated yet */
+  //virtual bool test()=0;
+  /** Blocks until the async is terminated */
+  virtual void wait()=0;
+  /** Blocks until the async is terminated, or until the timeout is elapsed
+   *  Raises: timeout exception.*/
+  virtual void wait(double timeout)=0;
+  /** Cancel that async */
+  //virtual void cancel();
+  /** Retrieve the current state of the async */
+  e_s4u_async_state_t getState() {return p_state;}
 
 private:
-       double p_remains = 0;
+  double p_remains = 0;
 public:
-       /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */
-       double getRemains();
-       /** Set the [remaining] amount of work that this Async will entail
-        *
-        * It is forbidden to change the amount of work once the Async is started */
-       void setRemains(double remains);
+  /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */
+  double getRemains();
+  /** Set the [remaining] amount of work that this Async will entail
+   *
+   * It is forbidden to change the amount of work once the Async is started */
+  void setRemains(double remains);
 
 private:
-       void *p_userData = NULL;
+  void *p_userData = NULL;
 public:
-       /** Put some user data onto the Async */
-       void setUserData(void *data) {p_userData=data;}
-       /** Retrieve the user data of the Async */
-       void *getUserData() { return p_userData; }
+  /** Put some user data onto the Async */
+  void setUserData(void *data) {p_userData=data;}
+  /** Retrieve the user data of the Async */
+  void *getUserData() { return p_userData; }
 }; // class
 
 }}; // Namespace simgrid::s4u
index fa6b064..ded1496 100644 (file)
@@ -20,61 +20,61 @@ namespace s4u {
  * Represents all asynchronous communications, that you can test or wait onto.
  */
 XBT_PUBLIC_CLASS Comm : public Async {
-       Comm() : Async() {}
+  Comm() : Async() {}
 public:
-       virtual ~Comm();
+  virtual ~Comm();
 
 public:
-       /** Creates (but don't start) an async send to the mailbox #dest */
-       static Comm &send_init(Actor *sender, Mailbox &dest);
-       /** Creates and start an async send to the mailbox #dest */
-       static Comm &send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedByteAmount);
+  /** Creates (but don't start) an async send to the mailbox #dest */
+  static Comm &send_init(Actor *sender, Mailbox &dest);
+  /** Creates and start an async send to the mailbox #dest */
+  static Comm &send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedByteAmount);
     /** Creates (but don't start) an async recv onto the mailbox #from */
-       static Comm &recv_init(s4u::Actor *receiver, Mailbox &from);
-       /** Creates and start an async recv to the mailbox #from */
-       static Comm &recv_async(s4u::Actor *receiver, Mailbox &from, void **data);
+  static Comm &recv_init(s4u::Actor *receiver, Mailbox &from);
+  /** Creates and start an async recv to the mailbox #from */
+  static Comm &recv_async(s4u::Actor *receiver, Mailbox &from, void **data);
 
-       void start() override;
-       void wait() override;
-       void wait(double timeout) override;
+  void start() override;
+  void wait() override;
+  void wait(double timeout) override;
 
 private:
-       double p_rate=-1;
+  double p_rate=-1;
 public:
-       /** Sets the maximal communication rate (in byte/sec). Must be done before start */
-       void setRate(double rate);
+  /** Sets the maximal communication rate (in byte/sec). Must be done before start */
+  void setRate(double rate);
 
 private:
-       void *p_dstBuff = NULL;
-       size_t p_dstBuffSize = 0;
-       void *p_srcBuff = NULL;
-       size_t p_srcBuffSize = sizeof(void*);
+  void *p_dstBuff = NULL;
+  size_t p_dstBuffSize = 0;
+  void *p_srcBuff = NULL;
+  size_t p_srcBuffSize = sizeof(void*);
 public:
-       /** Specify the data to send */
-       void setSrcData(void * buff);
-       /** Specify the size of the data to send */
-       void setSrcDataSize(size_t size);
-       /** Specify the data to send and its size */
-       void setSrcData(void * buff, size_t size);
+  /** Specify the data to send */
+  void setSrcData(void * buff);
+  /** Specify the size of the data to send */
+  void setSrcDataSize(size_t size);
+  /** Specify the data to send and its size */
+  void setSrcData(void * buff, size_t size);
 
-       /** Specify where to receive the data */
-       void setDstData(void ** buff);
-       /** Specify the buffer in which the data should be received */
-       void setDstData(void ** buff, size_t size);
-       /** Retrieve the size of the received data */
-       size_t getDstDataSize();
+  /** Specify where to receive the data */
+  void setDstData(void ** buff);
+  /** Specify the buffer in which the data should be received */
+  void setDstData(void ** buff, size_t size);
+  /** Retrieve the size of the received data */
+  size_t getDstDataSize();
 
 
 private: /* FIXME: expose these elements in the API */
-       int p_detached = 0;
+  int p_detached = 0;
     int (*p_matchFunction)(void *, void *, smx_synchro_t) = NULL;
     void (*p_cleanFunction)(void *) = NULL;
     void (*p_copyDataFunction)(smx_synchro_t, void*, size_t) = NULL;
 
 private:
-       Actor *p_sender = NULL;
-       Actor *p_receiver = NULL;
-       Mailbox *p_mailbox = NULL;
+  Actor *p_sender = NULL;
+  Actor *p_receiver = NULL;
+  Mailbox *p_mailbox = NULL;
 };
 
 }} // namespace simgrid::s4u
index da1d33a..e5bc4d2 100644 (file)
@@ -18,35 +18,35 @@ namespace s4u {
  */
 XBT_PUBLIC_CLASS Engine {
 public:
-       /** Constructor, taking the command line parameters of your main function */
-       Engine(int *argc, char **argv);
-
-       /** @brief Load a platform file describing the environment
-        *
-        * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
-        * Some examples can be found in the directory examples/platforms.
-        */
-       void loadPlatform(const char *platf);
-
-       /** Registers the main function of an actor that will be launched from the deployment file */
-       void register_function(const char*name, int (*code)(int,char**));
-
-       /** Registers a function as the default main function of actors
-        *
-        * It will be used as fallback when the function requested from the deployment file was not registered.
-        * It is used for trace-based simulations (see examples/msg/actions).
-        */
-       void register_default(int (*code)(int,char**));
-
-       /** @brief Load a deployment file and launch the actors that it contains */
-       void loadDeployment(const char *deploy);
-
-       /** @brief Run the simulation */
-       void run();
-
-       /** @brief Retrieve the simulation time */
-       static double getClock();
-       
+  /** Constructor, taking the command line parameters of your main function */
+  Engine(int *argc, char **argv);
+
+  /** @brief Load a platform file describing the environment
+   *
+   * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
+   * Some examples can be found in the directory examples/platforms.
+   */
+  void loadPlatform(const char *platf);
+
+  /** Registers the main function of an actor that will be launched from the deployment file */
+  void register_function(const char*name, int (*code)(int,char**));
+
+  /** Registers a function as the default main function of actors
+   *
+   * It will be used as fallback when the function requested from the deployment file was not registered.
+   * It is used for trace-based simulations (see examples/msg/actions).
+   */
+  void register_default(int (*code)(int,char**));
+
+  /** @brief Load a deployment file and launch the actors that it contains */
+  void loadDeployment(const char *deploy);
+
+  /** @brief Run the simulation */
+  void run();
+
+  /** @brief Retrieve the simulation time */
+  static double getClock();
+  
 };
 }} // namespace simgrid::sgo
 
index 6c4ccd0..f2182a3 100644 (file)
@@ -27,56 +27,56 @@ class Storage;
  */
 XBT_PUBLIC_CLASS File {
 public:
-       File(const char *fullpath, void* userdata);
-       ~File();
+  File(const char *fullpath, void* userdata);
+  ~File();
 private:
-       smx_file_t p_inferior;
-       const char *p_path;
+  smx_file_t p_inferior;
+  const char *p_path;
 
 public:
-       /** Retrieves the path to the file */
-       const char *path() { return p_path;}
+  /** Retrieves the path to the file */
+  const char *path() { return p_path;}
 public:
-       /** Simulates a read action. Returns the size of data actually read
-        *
-        *  FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
-        */
-       sg_size_t read(sg_size_t size);
-       /** Simulates a write action. Returns the size of data actually written.
-        *
-        *  FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
-        */
-       sg_size_t write(sg_size_t size);
-
-       /** Allows to store user data on that host */
-       void set_userdata(void *data) {p_userdata = data;}
-       /** Retrieves the previously stored data */
-       void* userdata() {return p_userdata;}
+  /** Simulates a read action. Returns the size of data actually read
+   *
+   *  FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
+   */
+  sg_size_t read(sg_size_t size);
+  /** Simulates a write action. Returns the size of data actually written.
+   *
+   *  FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
+   */
+  sg_size_t write(sg_size_t size);
+
+  /** Allows to store user data on that host */
+  void set_userdata(void *data) {p_userdata = data;}
+  /** Retrieves the previously stored data */
+  void* userdata() {return p_userdata;}
 private:
-       void *p_userdata=NULL;
+  void *p_userdata=NULL;
 
 public:
-       /** Retrieve the datasize */
-       sg_size_t size();
-
-       /** Sets the file head to the given position. */
-       void seek(sg_size_t pos);
-       /** Retrieves the current file position */
-       sg_size_t tell();
-
-       /** Rename a file
-        *
-        * WARNING: It is forbidden to move the file to another mount point */
-       void move(const char*fullpath);
-
-       /** Remove a file from disk */
-       void unlink();
-
-       /* FIXME: add these to the S4U API:
-       XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file);
-       XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath);
-       XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath);
-       */
+  /** Retrieve the datasize */
+  sg_size_t size();
+
+  /** Sets the file head to the given position. */
+  void seek(sg_size_t pos);
+  /** Retrieves the current file position */
+  sg_size_t tell();
+
+  /** Rename a file
+   *
+   * WARNING: It is forbidden to move the file to another mount point */
+  void move(const char*fullpath);
+
+  /** Remove a file from disk */
+  void unlink();
+
+  /* FIXME: add these to the S4U API:
+  XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file);
+  XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath);
+  XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath);
+  */
 
 };
 
index 65960a8..20e5e7d 100644 (file)
@@ -41,70 +41,70 @@ XBT_PUBLIC_CLASS Host :
   public simgrid::xbt::Extendable<Host> {
 
 private:
-       Host(const char *name);
+  Host(const char *name);
 public: // TODO, make me private
-       ~Host();
+  ~Host();
 public:
 
   static Host* by_name_or_null(const char* name);
   static Host* by_name_or_create(const char* name);
-       /** Retrieves an host from its name. */
-       static s4u::Host *by_name(std::string name);
-       /** Retrieves the host on which the current actor is running */
-       static s4u::Host *current();
-
-       simgrid::xbt::string const& name() const { return name_; }
-
-       /** Turns that host on if it was previously off
-        *
-        * All actors on that host which were marked autorestart will be restarted automatically.
-        * This call does nothing if the host is already on.
-        */
-       void turn_on();
-       /** Turns that host off. All actors are forcefully stopped. */
-       void turn_off();
-       /** Returns if that host is currently up and running */
-       bool is_on();
-       bool is_off() { return !is_on(); }
-
-       double speed();
-       int core_count();
-       xbt_dict_t properties();
-       xbt_swag_t processes();
-       double current_power_peak();
-       double power_peak_at(int pstate_index);
-       void set_pstate(int pstate_index);
-       int pstates_count() const;
-       int pstate();
-       void get_parameters(vm_params_t params);
-       void set_parameters(vm_params_t params);
-       xbt_dict_t mounted_storages_as_dict(); // HACK
-       xbt_dynar_t attached_storages();
-
-       /** Get an associative list [mount point]->[Storage] off all local mount points.
-        *
-        *      This is defined in the platform file, and cannot be modified programatically (yet).
-        */
-       boost::unordered_map<std::string, Storage*> const &mounted_storages();
+  /** Retrieves an host from its name. */
+  static s4u::Host *by_name(std::string name);
+  /** Retrieves the host on which the current actor is running */
+  static s4u::Host *current();
+
+  simgrid::xbt::string const& name() const { return name_; }
+
+  /** Turns that host on if it was previously off
+   *
+   * All actors on that host which were marked autorestart will be restarted automatically.
+   * This call does nothing if the host is already on.
+   */
+  void turn_on();
+  /** Turns that host off. All actors are forcefully stopped. */
+  void turn_off();
+  /** Returns if that host is currently up and running */
+  bool is_on();
+  bool is_off() { return !is_on(); }
+
+  double speed();
+  int core_count();
+  xbt_dict_t properties();
+  xbt_swag_t processes();
+  double current_power_peak();
+  double power_peak_at(int pstate_index);
+  void set_pstate(int pstate_index);
+  int pstates_count() const;
+  int pstate();
+  void get_parameters(vm_params_t params);
+  void set_parameters(vm_params_t params);
+  xbt_dict_t mounted_storages_as_dict(); // HACK
+  xbt_dynar_t attached_storages();
+
+  /** Get an associative list [mount point]->[Storage] off all local mount points.
+   *
+   *  This is defined in the platform file, and cannot be modified programatically (yet).
+   */
+  boost::unordered_map<std::string, Storage*> const &mounted_storages();
 
 private:
-       simgrid::xbt::string name_ = "noname";
-       boost::unordered_map<std::string, Storage*> *mounts = NULL; // caching
+  simgrid::xbt::string name_ = "noname";
+  boost::unordered_map<std::string, Storage*> *mounts = NULL; // caching
 
 public:
-       // FIXME: these should be protected, but it leads to many errors
-       // Use the extensions stuff for this? Go through simgrid::surf::Host?
+  // FIXME: these should be protected, but it leads to many errors
+  // Use the extensions stuff for this? Go through simgrid::surf::Host?
   // TODO, this could be a unique_ptr
-       surf::Cpu     *pimpl_cpu = nullptr;
-       surf::NetCard *pimpl_netcard = nullptr;
+  surf::Cpu     *pimpl_cpu = nullptr;
+  surf::NetCard *pimpl_netcard = nullptr;
 
 public:
-       /*** Called on each newly created object */
-       static simgrid::xbt::signal<void(Host&)> onCreation;
-       /*** Called just before destructing an object */
-       static simgrid::xbt::signal<void(Host&)> onDestruction;
-       /*** Called when the machine is turned on or off */
-       static simgrid::xbt::signal<void(Host&)> onStateChange;
+  /*** Called on each newly created object */
+  static simgrid::xbt::signal<void(Host&)> onCreation;
+  /*** Called just before destructing an object */
+  static simgrid::xbt::signal<void(Host&)> onDestruction;
+  /*** Called when the machine is turned on or off */
+  static simgrid::xbt::signal<void(Host&)> onStateChange;
 };
 
 }} // namespace simgrid::s4u
@@ -134,75 +134,75 @@ import org.simgrid.msg.Storage;
 Host jacquelin;
 
 try { 
-       jacquelin = Host.getByName("Jacquelin");
+  jacquelin = Host.getByName("Jacquelin");
 } catch(HostNotFoundException e) {
-       System.err.println(e.toString());
+  System.err.println(e.toString());
 }
 ...
 \endverbatim
  *
  */ 
 public class Host {
-       /**
-        * This static method returns all of the hosts of the installed platform.
-        *
-        * @return                      An array containing all the hosts installed.
-        *
-        */ 
-       public native static Host[] all();
-
-       /** 
-        * This static method sets a mailbox to receive in asynchronous mode.
-        
-        * All messages sent to this mailbox will be transferred to 
-        * the receiver without waiting for the receive call. 
-        * The receive call will still be necessary to use the received data.
-        * If there is a need to receive some messages asynchronously, and some not, 
-        * two different mailboxes should be used.
-        *
-        * @param mailboxName The name of the mailbox
-        */
-       public static native void setAsyncMailbox(String mailboxName);
-
-       /**
-        * This method returns the number of tasks currently running on a host.
-        * The external load (comming from an availability trace) is not taken in account.
-        *
-        * @return                      The number of tasks currently running on a host.
-        */ 
-       public native int getLoad();
-
-       /**
-        * This method returns the speed of the processor of a host,
-        * regardless of the current load of the machine.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
-        */ 
-       public native double getSpeed();
-
-       /**
-        * This method returns the number of core of a host.
-        *
-        * @return                      The speed of the processor of the host in flops.
-        *
-        */ 
-       public native double getCoreNumber();
-
-       /**
-        * Returns the value of a given host property (set from the platform file).
-        */
-       public native String getProperty(String name);
-
-       /**
-        * Change the value of a given host property. 
-        */
-       public native void setProperty(String name, String value);
-
-       /** This methods returns the list of storages attached to an host
-        * @return An array containing all storages (name) attached to the host
-        */
-       public native String[] getAttachedStorage();
+  /**
+   * This static method returns all of the hosts of the installed platform.
+   *
+   * @return      An array containing all the hosts installed.
+   *
+   */ 
+  public native static Host[] all();
+
+  /** 
+   * This static method sets a mailbox to receive in asynchronous mode.
+   * 
+   * All messages sent to this mailbox will be transferred to 
+   * the receiver without waiting for the receive call. 
+   * The receive call will still be necessary to use the received data.
+   * If there is a need to receive some messages asynchronously, and some not, 
+   * two different mailboxes should be used.
+   *
+   * @param mailboxName The name of the mailbox
+   */
+  public static native void setAsyncMailbox(String mailboxName);
+
+  /**
+   * This method returns the number of tasks currently running on a host.
+   * The external load (comming from an availability trace) is not taken in account.
+   *
+   * @return      The number of tasks currently running on a host.
+   */ 
+  public native int getLoad();
+
+  /**
+   * This method returns the speed of the processor of a host,
+   * regardless of the current load of the machine.
+   *
+   * @return      The speed of the processor of the host in flops.
+   *
+   */ 
+  public native double getSpeed();
+
+  /**
+   * This method returns the number of core of a host.
+   *
+   * @return      The speed of the processor of the host in flops.
+   *
+   */ 
+  public native double getCoreNumber();
+
+  /**
+   * Returns the value of a given host property (set from the platform file).
+   */
+  public native String getProperty(String name);
+
+  /**
+   * Change the value of a given host property. 
+   */
+  public native void setProperty(String name, String value);
+
+  /** This methods returns the list of storages attached to an host
+   * @return An array containing all storages (name) attached to the host
+   */
+  public native String[] getAttachedStorage();
 
 
 } 
index 1962201..a2311c7 100644 (file)
@@ -23,26 +23,26 @@ namespace s4u {
  * sender and receiver.
  */
 XBT_PUBLIC_CLASS Mailbox {
-       friend Comm;
+  friend Comm;
 
 private:
-       Mailbox(const char*name, smx_rdv_t inferior);
+  Mailbox(const char*name, smx_rdv_t inferior);
 public:
-       ~Mailbox();
-       
+  ~Mailbox();
+  
 protected:
-       smx_rdv_t getInferior() { return p_inferior; }
+  smx_rdv_t getInferior() { return p_inferior; }
 
 public:
-       /** Get the name of that mailbox */
-       const char *getName();
-       /** Retrieve the mailbox associated to the given string */
-       static Mailbox *byName(const char *name);
+  /** Get the name of that mailbox */
+  const char *getName();
+  /** Retrieve the mailbox associated to the given string */
+  static Mailbox *byName(const char *name);
 
 private:
-       std::string p_name;
-       smx_rdv_t p_inferior;
-       static boost::unordered_map<std::string, Mailbox *> *mailboxes;
+  std::string p_name;
+  smx_rdv_t p_inferior;
+  static boost::unordered_map<std::string, Mailbox *> *mailboxes;
 };
 }} // namespace simgrid::s4u
 
index 66547b8..193a6d2 100644 (file)
@@ -17,18 +17,18 @@ namespace s4u {
 
 XBT_PUBLIC_CLASS Storage {
 private:
-       Storage(std::string name, smx_storage_t inferior);
-       virtual ~Storage();
+  Storage(std::string name, smx_storage_t inferior);
+  virtual ~Storage();
 public:
-       /** Retrieve a Storage by its name. It must exist in the platform file */
-       static Storage &byName(const char* name);
-       const char *name();
-       sg_size_t size_free();
-       sg_size_t size_used();
-       /** Retrieve the total amount of space of this storage element */
-       sg_size_t size();
-
-       /* TODO: missing API:
+  /** Retrieve a Storage by its name. It must exist in the platform file */
+  static Storage &byName(const char* name);
+  const char *name();
+  sg_size_t size_free();
+  sg_size_t size_used();
+  /** Retrieve the total amount of space of this storage element */
+  sg_size_t size();
+
+  /* TODO: missing API:
 XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage);
 XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn);
 XBT_PUBLIC(const char *)MSG_storage_get_property_value(msg_storage_t storage, const char *name);
@@ -36,20 +36,20 @@ XBT_PUBLIC(xbt_dynar_t) MSG_storages_as_dynar(void);
 XBT_PUBLIC(xbt_dict_t) MSG_storage_get_content(msg_storage_t storage);
 XBT_PUBLIC(msg_error_t) MSG_storage_file_move(msg_file_t fd, msg_host_t dest, char* mount, char* fullname);
 XBT_PUBLIC(const char *) MSG_storage_get_host(msg_storage_t storage);
-        */
+   */
 protected:
-       smx_storage_t inferior();
+  smx_storage_t inferior();
 private:
-       static boost::unordered_map<std::string, Storage *> *storages;
-       std::string p_name;
-       smx_storage_t p_inferior;
+  static boost::unordered_map<std::string, Storage *> *storages;
+  std::string p_name;
+  smx_storage_t p_inferior;
 
 
 public:
-       void set_userdata(void *data) {p_userdata = data;}
-       void *userdata() {return p_userdata;}
+  void set_userdata(void *data) {p_userdata = data;}
+  void *userdata() {return p_userdata;}
 private:
-       void *p_userdata = NULL;
+  void *p_userdata = NULL;
 
 };
 
index a1fa369..1180007 100644 (file)
@@ -13,7 +13,7 @@
 
 /* Define _GNU_SOURCE for getline, isfinite, etc. */
 #ifndef _GNU_SOURCE
-       #define _GNU_SOURCE
+  #define _GNU_SOURCE
 #endif
 
 /* Attributes are only in recent versions of GCC */
 #endif
 
 #ifdef _MSC_VER /* MSVC has no ssize_t, and I fail to use the SSIZE_T declared in BaseTsd.h */
-       #if defined(_WIN64)
-               typedef __int64 ssize_t;
-       #else
-               typedef long ssize_t;
-       #endif
+  #if defined(_WIN64)
+    typedef __int64 ssize_t;
+  #else
+    typedef long ssize_t;
+  #endif
 
 /* Microsoft wants to improve the code quality blah blah blah */
 /* See: https://msdn.microsoft.com/en-us/library/8ef0s5kh.aspx */
-       /* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */
-       #define _CRT_NONSTDC_NO_WARNINGS
-       /* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */
-       #define _CRT_SECURE_NO_WARNINGS
+  /* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */
+  #define _CRT_NONSTDC_NO_WARNINGS
+  /* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */
+  #define _CRT_SECURE_NO_WARNINGS
 #endif
 
 #if !defined (max) && !defined(__cplusplus)
index 78a4815..fbde8e2 100644 (file)
@@ -460,51 +460,51 @@ extern xbt_log_layout_t xbt_log_default_layout;
  *  @brief Log an event at the DEBUG priority on the specified category with these args.
  */
 #define XBT_CDEBUG(categ, ...) \
-                 do {                                                                  \
-                   if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) {            \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = &(_XBT_LOGV(categ));                                \
-                     _log_ev.priority = xbt_log_priority_debug;                        \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) {            \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = &(_XBT_LOGV(categ));                                \
+          _log_ev.priority = xbt_log_priority_debug;                        \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the VERB priority on the specified category with these args.
  */
 #define XBT_CVERB(categ, ...)  \
-                 do {                                                                  \
-                   if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) {          \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = &(_XBT_LOGV(categ));                                \
-                     _log_ev.priority = xbt_log_priority_verbose;                      \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) {          \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = &(_XBT_LOGV(categ));                                \
+          _log_ev.priority = xbt_log_priority_verbose;                      \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the INFO priority on the specified category with these args.
  */
 #define XBT_CINFO(categ, ...) \
-                 do {                                                                  \
-                   if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) {             \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = &(_XBT_LOGV(categ));                                \
-                     _log_ev.priority = xbt_log_priority_info;                         \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) {             \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = &(_XBT_LOGV(categ));                                \
+          _log_ev.priority = xbt_log_priority_info;                         \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 
 /** @ingroup XBT_log
@@ -512,17 +512,17 @@ extern xbt_log_layout_t xbt_log_default_layout;
  *  @brief Log an event at the WARN priority on the specified category with these args.
  */
 #define XBT_CWARN(categ, ...) \
-                 do {                                                                  \
-                   if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) {          \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = &(_XBT_LOGV(categ));                                \
-                     _log_ev.priority = xbt_log_priority_warning;                      \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) {          \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = &(_XBT_LOGV(categ));                                \
+          _log_ev.priority = xbt_log_priority_warning;                      \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 
 /** @ingroup XBT_log
@@ -530,34 +530,34 @@ extern xbt_log_layout_t xbt_log_default_layout;
  *  @brief Log an event at the ERROR priority on the specified category with these args.
  */
 #define XBT_CERROR(categ, ...) \
-                 do {                                                                  \
-                   if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) {            \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = &(_XBT_LOGV(categ));                                \
-                     _log_ev.priority = xbt_log_priority_error;                        \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) {            \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = &(_XBT_LOGV(categ));                                \
+          _log_ev.priority = xbt_log_priority_error;                        \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10).
  */
 #define XBT_CCRITICAL(categ, ...) \
-                 do {                                                                  \
-                   if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) {         \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = &(_XBT_LOGV(categ));                                \
-                     _log_ev.priority = xbt_log_priority_critical;                     \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) {         \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = &(_XBT_LOGV(categ));                                \
+          _log_ev.priority = xbt_log_priority_critical;                     \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
@@ -565,108 +565,108 @@ extern xbt_log_layout_t xbt_log_default_layout;
  *  @brief Log an event at the DEBUG priority on the default category with these args.
  */
 #define XBT_DEBUG(...) \
-                 do {                                                                  \
-                   if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                                               xbt_log_priority_debug)) {                  \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = _simgrid_log_category__default;                     \
-                     _log_ev.priority = xbt_log_priority_debug;                        \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
+                            xbt_log_priority_debug)) {                  \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = _simgrid_log_category__default;                     \
+          _log_ev.priority = xbt_log_priority_debug;                        \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the VERB priority on the default category with these args.
  */
 #define XBT_VERB(...) \
-                 do {                                                                  \
-                   if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                                               xbt_log_priority_verbose)) {                \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = _simgrid_log_category__default;                     \
-                     _log_ev.priority = xbt_log_priority_verbose;                      \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
+                            xbt_log_priority_verbose)) {                \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = _simgrid_log_category__default;                     \
+          _log_ev.priority = xbt_log_priority_verbose;                      \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the INFO priority on the default category with these args.
  */
 #define XBT_INFO(...) \
-                 do {                                                                  \
-                   if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                                               xbt_log_priority_info)) {                   \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = _simgrid_log_category__default;                     \
-                     _log_ev.priority = xbt_log_priority_info;                         \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
+                            xbt_log_priority_info)) {                   \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = _simgrid_log_category__default;                     \
+          _log_ev.priority = xbt_log_priority_info;                         \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the WARN priority on the default category with these args.
  */
 #define XBT_WARN(...) \
-                 do {                                                                  \
-                   if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                                               xbt_log_priority_warning)) {                \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = _simgrid_log_category__default;                     \
-                     _log_ev.priority = xbt_log_priority_warning;                      \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
+                            xbt_log_priority_warning)) {                \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = _simgrid_log_category__default;                     \
+          _log_ev.priority = xbt_log_priority_warning;                      \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the ERROR priority on the default category with these args.
  */
 #define XBT_ERROR(...) \
-                 do {                                                                  \
-                   if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                                               xbt_log_priority_error)) {                  \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = _simgrid_log_category__default;                     \
-                     _log_ev.priority = xbt_log_priority_error;                        \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
+                            xbt_log_priority_error)) {                  \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = _simgrid_log_category__default;                     \
+          _log_ev.priority = xbt_log_priority_error;                        \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the CRITICAL priority on the default category with these args.
  */
 #define XBT_CRITICAL(...) \
-                 do {                                                                  \
-                   if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                                               xbt_log_priority_critical)) {               \
-                     s_xbt_log_event_t _log_ev;                                        \
-                     _log_ev.cat = _simgrid_log_category__default;                     \
-                     _log_ev.priority = xbt_log_priority_critical;                     \
-                     _log_ev.fileName = __FILE__;                                      \
-                     _log_ev.functionName = _XBT_FUNCTION;                             \
-                     _log_ev.lineNum = __LINE__;                                       \
-                     _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-                   }                                                                   \
-                 }  while (0)
+      do {                                                                  \
+        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
+                            xbt_log_priority_critical)) {               \
+          s_xbt_log_event_t _log_ev;                                        \
+          _log_ev.cat = _simgrid_log_category__default;                     \
+          _log_ev.priority = xbt_log_priority_critical;                     \
+          _log_ev.fileName = __FILE__;                                      \
+          _log_ev.functionName = _XBT_FUNCTION;                             \
+          _log_ev.lineNum = __LINE__;                                       \
+          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
+        }                                                                   \
+      }  while (0)
 
 #define _XBT_IN_OUT(...) \
   _XBT_IF_ONE_ARG(_XBT_IN_OUT_ARG1, _XBT_IN_OUT_ARGN, __VA_ARGS__)(__VA_ARGS__)
index 75ad3db..06c8f2b 100644 (file)
@@ -25,14 +25,14 @@ JNIEnv *get_current_thread_env(void);
 void jmsg_throw_status(JNIEnv *env, msg_error_t status);
 
 /*
- * Class               org_simgrid_msg_Msg
- * Method              getClock
- * Signature   ()D
+ * Class    org_simgrid_msg_Msg
+ * Method    getClock
+ * Signature  ()D
  */
 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv *, jclass);
 /**
- * Class               org_simgrid_msg_Msg
- * Method              run
+ * Class    org_simgrid_msg_Msg
+ * Method    run
  */
 JNIEXPORT void JNICALL
     JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv * env, jclass cls);
index ea88343..2d92f7a 100644 (file)
@@ -18,34 +18,34 @@ jfieldID jfile_field_bind;
 void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd);
 msg_file_t jfile_get_native(JNIEnv *env, jobject jfile);
 /**
- * Class                       org_simgrid_msg_File
- * Method                      nativeInit
- * Signature   ()V
+ * Class      org_simgrid_msg_File
+ * Method      nativeInit
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_File_nativeInit(JNIEnv*, jclass);
 /**
- * Class                       org_simgrid_msg_File
- * Method                      open
- * Signature   (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ * Class      org_simgrid_msg_File
+ * Method      open
+ * Signature  (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_File_open(JNIEnv*, jobject, jobject);
 /**
- * Class                       org_simgrid_msg_File
- * Method                      read
+ * Class       org_simgrid_msg_File
+ * Method      read
  */
 JNIEXPORT jlong JNICALL
 Java_org_simgrid_msg_File_read(JNIEnv*, jobject, jlong);
 /**
- * Class                       org_simgrid_msg_File
- * Method                      write
+ * Class      org_simgrid_msg_File
+ * Method      write
  */
 JNIEXPORT jlong JNICALL
 Java_org_simgrid_msg_File_write(JNIEnv*, jobject, jlong);
 /**
- * Class                       org_simgrid_msg_File
- * Method                      close
+ * Class      org_simgrid_msg_File
+ * Method      close
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_File_close(JNIEnv*, jobject);
index 55cc4a1..1d6e240 100644 (file)
@@ -72,8 +72,8 @@ Java_org_simgrid_msg_Host_getByName(JNIEnv * env, jclass cls,
 
   /* get the C string from the java string */
   if (jname == NULL) {
-       jxbt_throw_null(env,bprintf("No host can have a null name"));
-       return NULL;
+    jxbt_throw_null(env,bprintf("No host can have a null name"));
+    return NULL;
   }
   const char *name = env->GetStringUTFChars(jname, 0);
   /* get the host by name       (the hosts are created during the grid resolution) */
@@ -267,29 +267,29 @@ Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost){
   }
 
   int index = 0;
-       jobjectArray jtable;
-       xbt_dict_t dict =  MSG_host_get_mounted_storage_list(host);
-       int count = xbt_dict_length(dict);
-       jclass cls = env->FindClass("org/simgrid/msg/Storage");
+  jobjectArray jtable;
+  xbt_dict_t dict =  MSG_host_get_mounted_storage_list(host);
+  int count = xbt_dict_length(dict);
+  jclass cls = env->FindClass("org/simgrid/msg/Storage");
 
-       jtable = env->NewObjectArray((jsize) count, cls, NULL);
+  jtable = env->NewObjectArray((jsize) count, cls, NULL);
 
-       if (!jtable) {
-        jxbt_throw_jni(env, "Storages table allocation failed");
-        return NULL;
-       }
+  if (!jtable) {
+   jxbt_throw_jni(env, "Storages table allocation failed");
+   return NULL;
+  }
 
-       xbt_dict_cursor_t cursor=NULL;
-       const char *mount_name, *storage_name;
+  xbt_dict_cursor_t cursor=NULL;
+  const char *mount_name, *storage_name;
 
-       xbt_dict_foreach(dict,cursor,mount_name,storage_name) {
-               jname = env->NewStringUTF(storage_name);
-         jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
-         env->SetObjectArrayElement(jtable, index, jstorage);
+  xbt_dict_foreach(dict,cursor,mount_name,storage_name) {
+    jname = env->NewStringUTF(storage_name);
+    jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
+    env->SetObjectArrayElement(jtable, index, jstorage);
     index++;
-       }
-       xbt_dict_free(&dict);
-       return jtable;
+  }
+  xbt_dict_free(&dict);
+  return jtable;
 }
 
 JNIEXPORT jobjectArray JNICALL
@@ -363,7 +363,7 @@ Java_org_simgrid_msg_Host_all(JNIEnv * env, jclass cls_arg)
       jname = env->NewStringUTF(MSG_host_get_name(host));
 
       jhost =
-               Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
+          Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
       /* FIXME: leak of jname ? */
     }
 
index 5a342f2..327940c 100644 (file)
@@ -17,14 +17,14 @@ SG_BEGIN_DECL()
 /**
  * This function returns a new java host instance.
  *
- * @param env                  The environment of the current thread
+ * @param env      The environment of the current thread
  *
- * @return                             A new java host object.
+ * @return        A new java host object.
  *
- * @exception                  If the class Host is not found the function throws 
- *                                             the ClassNotFoundException. If the constructor of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchMethodException.
+ * @exception      If the class Host is not found the function throws 
+ *            the ClassNotFoundException. If the constructor of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchMethodException.
  */
 jobject jhost_new_instance(JNIEnv * env);
 
@@ -32,58 +32,58 @@ jobject jhost_new_instance(JNIEnv * env);
  * This function returns a global reference to the  java host instance 
  * specified by the parameter jhost.
  *
- * @param jhost                        The original java host instance.
- * @param env                  The environment of the current thread
+ * @param jhost      The original java host instance.
+ * @param env      The environment of the current thread
  *
- * @return                             The global reference to the original java host 
- *                                             instance.
+ * @return        The global reference to the original java host 
+ *            instance.
  */
 jobject jhost_ref(JNIEnv * env, jobject jhost);
 /**
  * This function delete a global reference to a java host instance.
  *
- * @param                              The global refernce to delete.
- * @param env                  The environment of the current thread
+ * @param        The global refernce to delete.
+ * @param env      The environment of the current thread
  */
 void jhost_unref(JNIEnv * env, jobject jhost);
 
 /**
  * This function associated a native host to a java host instance.
  *
- * @param jhost                        The java host instance.
- * @param host                 The native host to bind.
- * @param env                  The environment of the current thread
+ * @param jhost      The java host instance.
+ * @param host      The native host to bind.
+ * @param env      The environment of the current thread
  *
- * @exception                  If the class Host is not found the function throws 
- *                                             the ClassNotFoundException. If the field bind of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Host is not found the function throws 
+ *            the ClassNotFoundException. If the field bind of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  */
 void jhost_bind(jobject jhost, msg_host_t host, JNIEnv * env);
 
 /**
  * This function returns a native host from a java host instance.
  *
- * @param jhost                        The java host object from which get the native host.
- * @param env                  The environment of the current thread
+ * @param jhost      The java host object from which get the native host.
+ * @param env      The environment of the current thread
  *
- * @return                             The function returns the native host associated to the
- *                                             java host object.
+ * @return        The function returns the native host associated to the
+ *            java host object.
  *
- * @exception                  If the class Host is not found the function throws 
- *                                             the ClassNotFoundException. If the field bind of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Host is not found the function throws 
+ *            the ClassNotFoundException. If the field bind of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  */
 msg_host_t jhost_get_native(JNIEnv * env, jobject jhost);
 
 /**
  * This function returns the name of a MSG host.
  *
- * @param jhost                        A java host object.
- * @param env                  The environment of the current thread
+ * @param jhost      A java host object.
+ * @param env      The environment of the current thread
  *
- * @return                             The name of the host.
+ * @return        The name of the host.
  */
 const char *jhost_get_name(jobject jhost, JNIEnv * env);
 
@@ -91,25 +91,25 @@ const char *jhost_get_name(jobject jhost, JNIEnv * env);
  * This function tests if a java host instance is valid.
  * A java host object is valid if it is bind to a native host.
  *
- * @param jhost                        The host to test the validity.
- * @param env                  The environment of the current thread
+ * @param jhost      The host to test the validity.
+ * @param env      The environment of the current thread
  *
- * @return                             If the java host is valid the function returns true.
- *                                             Otherwise the function returns false.
+ * @return        If the java host is valid the function returns true.
+ *            Otherwise the function returns false.
  */
 jboolean jhost_is_valid(jobject jhost, JNIEnv * env);
 /*
- * Class               org_simgrid_msg_Host
- * Method              nativeInit
- * Signature   ();
+ * Class    org_simgrid_msg_Host
+ * Method    nativeInit
+ * Signature  ();
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls);
 
 /*
- * Class               org_simgrid_msg_Host
- * Method              getByName
- * Signature   (Ljava/lang/String;)Lsimgrid/msg/Host;
+ * Class    org_simgrid_msg_Host
+ * Method    getByName
+ * Signature  (Ljava/lang/String;)Lsimgrid/msg/Host;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName
     (JNIEnv *, jclass, jstring);
@@ -117,8 +117,8 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName
 /**
  * This function start the host if it is off
  *
- * @param jhost                        The host to test the validity.
- * @param env                  The environment of the current thread
+ * @param jhost      The host to test the validity.
+ * @param env      The environment of the current thread
  *
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost);
@@ -126,38 +126,38 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost);
 /**
  * This function stop the host if it is on
  *
- * @param jhost                        The host to test the validity.
- * @param env                  The environment of the current thread
+ * @param jhost      The host to test the validity.
+ * @param env      The environment of the current thread
  *
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost);
 
 /*
- * Class               org_simgrid_msg_Host
- * Method              currentHost
- * Signature   ()Lsimgrid/msg/Host;
+ * Class    org_simgrid_msg_Host
+ * Method    currentHost
+ * Signature  ()Lsimgrid/msg/Host;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost
     (JNIEnv *, jclass);
 /*
- * Class               org_simgrid_msg_Host
- * Method              getCount
- * Signature   ()I
+ * Class    org_simgrid_msg_Host
+ * Method    getCount
+ * Signature  ()I
  */
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount
     (JNIEnv *, jclass);
 
 /*
- * Class               org_simgrid_msg_Host
- * Method              getSpeed
- * Signature   ()D
+ * Class    org_simgrid_msg_Host
+ * Method    getSpeed
+ * Signature  ()D
  */
 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed
     (JNIEnv *, jobject);
 /*
- * Class               org_simgrid_msg_Host
- * Method              getCoreNumber
- * Signature   ()D
+ * Class    org_simgrid_msg_Host
+ * Method    getCoreNumber
+ * Signature  ()D
  */
 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber
     (JNIEnv *, jobject);
@@ -176,30 +176,30 @@ Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname)
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
 /*
- * Class               org_simgrid_msg_Host
- * Method              isOn
- * Signature   ()Z
+ * Class    org_simgrid_msg_Host
+ * Method    isOn
+ * Signature  ()Z
  */
 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn
     (JNIEnv *, jobject);
 
 
 /*
- * Class               org_simgrid_msg_Host
- * Method              getMountedStorage
+ * Class    org_simgrid_msg_Host
+ * Method    getMountedStorage
  * Signature: ()[Lorg/simgrid/msg/Storage;
  */
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost);
 
 /*
- * Class               org_simgrid_msg_Host
- * Method              getAttachedStorageList
+ * Class    org_simgrid_msg_Host
+ * Method    getAttachedStorageList
  */
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost);
 
 /*
- * Class               org_simgrid_msg_Host
- * Method              getStorageContent
+ * Class    org_simgrid_msg_Host
+ * Method    getStorageContent
  */
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost);
 
index 601733f..05491e3 100644 (file)
@@ -49,10 +49,10 @@ void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env)
 
 void jprocess_join(jobject jprocess, JNIEnv * env)
 {
-       msg_process_t process = jprocess_to_native_process(jprocess,env);
-       simgrid::java::JavaContext* context =
+  msg_process_t process = jprocess_to_native_process(jprocess,env);
+  simgrid::java::JavaContext* context =
     (simgrid::java::JavaContext*) MSG_process_get_smx_ctx(process);
-       xbt_os_thread_join(context->thread,NULL);
+  xbt_os_thread_join(context->thread,NULL);
 }
 
 msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env)
@@ -161,9 +161,9 @@ Java_org_simgrid_msg_Process_create(JNIEnv * env,
               simgrid::java::java_main_jprocess(jprocess);
               return 0;
             }, jprocess,
-                                               host,
-                                               /*argc, argv, properties*/
-                                               0, NULL, NULL);
+            host,
+            /*argc, argv, properties*/
+            0, NULL, NULL);
   MSG_process_set_kill_time(process, (double)jkill);
   /* bind the java process instance to the native process */
   jprocess_bind(jprocess, process, env);
@@ -376,14 +376,14 @@ JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_kill(JNIEnv * env,
                                   jobject jprocess)
 {
-       /* get the native instances from the java ones */
+  /* get the native instances from the java ones */
   msg_process_t process = jprocess_to_native_process(jprocess, env);
   if (!process) {
     jxbt_throw_notbound(env, "process", jprocess);
     return;
   }
 
-       MSG_process_kill(process);
+  MSG_process_kill(process);
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_migrate(JNIEnv * env,
@@ -414,8 +414,8 @@ Java_org_simgrid_msg_Process_migrate(JNIEnv * env,
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdouble jkilltime) {
-       msg_process_t process = jprocess_to_native_process(jprocess, env);
-       MSG_process_set_kill_time(process, (double)jkilltime);
+  msg_process_t process = jprocess_to_native_process(jprocess, env);
+  MSG_process_set_kill_time(process, (double)jkilltime);
 }
 
 JNIEXPORT jint JNICALL
index 7cd3c65..145f830 100644 (file)
@@ -34,11 +34,11 @@ jobject native_to_java_process(msg_process_t process);
  * This function returns a global reference to the  java process instance 
  * specified by the parameter jprocess.
  *
- * @param jprocess             The original java process instance.
- * @param env                  The env of the current thread
+ * @param jprocess    The original java process instance.
+ * @param env      The env of the current thread
  *
- * @return                             The global reference to the original java process 
- *                                             instance.
+ * @return        The global reference to the original java process 
+ *            instance.
  */
 jobject jprocess_new_global_ref(jobject jprocess, JNIEnv * env);
 
@@ -46,11 +46,11 @@ jobject jprocess_new_global_ref(jobject jprocess, JNIEnv * env);
  * This function delete a global reference to a java process instance.
  * If the java process is alive the function joins it and stops it before.
  *
- * @param                              The global refernce to delete.
- * @param env                  The env of the current thread
+ * @param        The global refernce to delete.
+ * @param env      The env of the current thread
  *
- * @see                                        jprocess_join()
- * @see                                        jprocess_exit()
+ * @see          jprocess_join()
+ * @see          jprocess_exit()
  */
 void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env);
 
@@ -58,58 +58,58 @@ void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env);
 /**
  * This function waits for a java process to terminate.
  *
- * @param jprocess             The java process ot wait for.
- * @param env                  The env of the current thread
+ * @param jprocess    The java process ot wait for.
+ * @param env      The env of the current thread
  *
- * @exception                  If the class Process is not found the function throws 
- *                                             the ClassNotFoundException. If the methos join() of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchMethodException. 
+ * @exception      If the class Process is not found the function throws 
+ *            the ClassNotFoundException. If the methos join() of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchMethodException.  
  *
  */
 void jprocess_join(jobject jprocess, JNIEnv * env);
 /**
  * This function associated a native process to a java process instance.
  *
- * @param jprocess             The java process instance.
- * @param process              The native process to bind.
- * @param env                  The env of the current thread
+ * @param jprocess    The java process instance.
+ * @param process    The native process to bind.
+ * @param env      The env of the current thread
  *
- * @exception                  If the class Process is not found the function throws 
- *                                             the ClassNotFoundException. If the field bind of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Process is not found the function throws 
+ *            the ClassNotFoundException. If the field bind of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  */
 void jprocess_bind(jobject jprocess, msg_process_t process, JNIEnv * env);
 
 /**
  * This function returns a native process from a java process instance.
  *
- * @param jprocess             The java process object from which get the native process.
- * @param env                  The env of the current thread
+ * @param jprocess    The java process object from which get the native process.
+ * @param env      The env of the current thread
  *
- * @return                             The function returns the native process associated to the
- *                                             java process object.
+ * @return        The function returns the native process associated to the
+ *            java process object.
  *
- * @exception                  If the class Process is not found the function throws 
- *                                             the ClassNotFoundException. If the field bind of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Process is not found the function throws 
+ *            the ClassNotFoundException. If the field bind of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  */
 msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env);
 
 /**
  * This function gets the id of the specified java process.
  *
- * @param jprocess             The java process to get the id.
- * @param env                  The env of the current thread
+ * @param jprocess    The java process to get the id.
+ * @param env      The env of the current thread
  *
- * @exception                  If the class Process is not found the function throws 
- *                                             the ClassNotFoundException. If the field id of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Process is not found the function throws 
+ *            the ClassNotFoundException. If the field id of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  *
- * @return                             The id of the specified java process.
+ * @return        The id of the specified java process.
  */
 jlong jprocess_get_id(jobject jprocess, JNIEnv * env);
 
@@ -118,41 +118,41 @@ jlong jprocess_get_id(jobject jprocess, JNIEnv * env);
  * A java process object is valid if it is bind to a native 
  * process.
  *
- * @param jprocess             The java process to test the validity.
- * @param env                  The env of the current thread
+ * @param jprocess    The java process to test the validity.
+ * @param env      The env of the current thread
  *
- * @return                             If the java process is valid the function returns true.
- *                                             Otherwise the function returns false.
+ * @return        If the java process is valid the function returns true.
+ *            Otherwise the function returns false.
  */
 jboolean jprocess_is_valid(jobject jprocess, JNIEnv * env);
 
 /**
  * This function gets the name of the specified java process.
  *
- * @param jprocess             The java process to get the name.
- * @param env                  The env of the current thread
+ * @param jprocess    The java process to get the name.
+ * @param env      The env of the current thread
  *
- * @exception                  If the class Process is not found the function throws 
- *                                             the ClassNotFoundException. If the field name of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Process is not found the function throws 
+ *            the ClassNotFoundException. If the field name of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  *
- * @return                             The name of the specified java process.
+ * @return        The name of the specified java process.
  */
 jstring jprocess_get_name(jobject jprocess, JNIEnv * env);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              nativeInit
- * Signature   ();
+ * Class    org_simgrid_msg_Process
+ * Method    nativeInit
+ * Signature  ();
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jclass cls);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              create
- * Signature   (Lorg/simgrid/msg/Host;)V
+ * Class    org_simgrid_msg_Process
+ * Method    create
+ * Signature  (Lorg/simgrid/msg/Host;)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_create(JNIEnv * env,
@@ -160,17 +160,17 @@ Java_org_simgrid_msg_Process_create(JNIEnv * env,
                                     jobject jhostname);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              killAll
- * Signature   (I)I
+ * Class    org_simgrid_msg_Process
+ * Method    killAll
+ * Signature  (I)I
  */
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll
     (JNIEnv *, jclass, jint);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              fromPID
- * Signature   (I)Lorg/simgrid/msg/Process;
+ * Class    org_simgrid_msg_Process
+ * Method    fromPID
+ * Signature  (I)Lorg/simgrid/msg/Process;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID
     (JNIEnv *, jclass, jint);
@@ -182,24 +182,24 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname);
 /*
- * Class               org_simgrid_msg_Process
- * Method              currentProcess
- * Signature   ()Lorg/simgrid/msg/Process;
+ * Class    org_simgrid_msg_Process
+ * Method    currentProcess
+ * Signature  ()Lorg/simgrid/msg/Process;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getCurrentProcess
     (JNIEnv *, jclass);
 /*
- * Class               org_simgrid_msg_Process
- * Method              suspend
- * Signature   (Lorg/simgrid/msg/Process;)V
+ * Class    org_simgrid_msg_Process
+ * Method    suspend
+ * Signature  (Lorg/simgrid/msg/Process;)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_suspend(JNIEnv * env,
                                           jobject jprocess);
 /*
- * Class               org_simgrid_msg_Process
- * Method              resume
- * Signature   (Lorg/simgrid/msg/Process;)V
+ * Class    org_simgrid_msg_Process
+ * Method    resume
+ * Signature  (Lorg/simgrid/msg/Process;)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume
     (JNIEnv *, jobject);
@@ -219,46 +219,46 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart
     (JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              isSuspended
- * Signature   (Lorg/simgrid/msg/Process;)Z
+ * Class    org_simgrid_msg_Process
+ * Method    isSuspended
+ * Signature  (Lorg/simgrid/msg/Process;)Z
  */
 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended
     (JNIEnv *, jobject);
 /*
- * Class               org_simgrid_msg_Process
- * Method              sleep
- * Signature   (DI)V
+ * Class    org_simgrid_msg_Process
+ * Method    sleep
+ * Signature  (DI)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep
     (JNIEnv *, jclass, jlong, jint);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              waitFor
- * Signature   (D)V
+ * Class    org_simgrid_msg_Process
+ * Method    waitFor
+ * Signature  (D)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor
     (JNIEnv *, jobject, jdouble);
 /*
- * Class               org_simgrid_msg_Process
- * Method              kill
- * Signature   (Lorg/simgrid/msg/Process;)V
+ * Class    org_simgrid_msg_Process
+ * Method    kill
+ * Signature  (Lorg/simgrid/msg/Process;)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill
     (JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Process
- * Method              migrate
- * Signature   (Lorg/simgrid/msg/Host;)V
+ * Class    org_simgrid_msg_Process
+ * Method    migrate
+ * Signature  (Lorg/simgrid/msg/Host;)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate
     (JNIEnv *, jobject, jobject);
 /*
- * Class               org_simgrid_msg_Process
- * Method              setKillTime
- * Signature   (D)V
+ * Class    org_simgrid_msg_Process
+ * Method    setKillTime
+ * Signature  (D)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime
     (JNIEnv *, jobject, jdouble);
index 299b34a..cc3b39b 100644 (file)
@@ -65,8 +65,8 @@ Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, jclass cls,
 
   /* get the C string from the java string */
   if (jname == NULL) {
-       jxbt_throw_null(env,bprintf("No host can have a null name"));
-       return NULL;
+    jxbt_throw_null(env,bprintf("No host can have a null name"));
+    return NULL;
   }
   const char *name = env->GetStringUTFChars(jname, 0);
   storage = MSG_storage_get_by_name(name);
@@ -170,7 +170,7 @@ Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject
 
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject jname, jobject jvalue) {
-       msg_storage_t storage = jstorage_get_native(env, jstorage);
+  msg_storage_t storage = jstorage_get_native(env, jstorage);
 
   if (!storage) {
     jxbt_throw_notbound(env, "storage", jstorage);
index 739a930..ac617ca 100644 (file)
@@ -16,28 +16,28 @@ SG_BEGIN_DECL()
 /**
  * This function returns a new java storage instance.
  *
- * @param env                  The environment of the current thread
+ * @param env      The environment of the current thread
  *
- * @return                             A new java storage object.
+ * @return        A new java storage object.
  *
- * @exception                  If the class Storage is not found the function throws
- *                                             the ClassNotFoundException. If the constructor of
- *                                             this class is not found the function throws the exception
- *                                             NotSuchMethodException.
+ * @exception      If the class Storage is not found the function throws
+ *            the ClassNotFoundException. If the constructor of
+ *            this class is not found the function throws the exception
+ *            NotSuchMethodException.
  */
 jobject jstorage_new_instance(JNIEnv * env);
 
 /**
  * This function associated a native storage to a java storage instance.
  *
- * @param jstorage                     The java storage instance.
- * @param storage                      The native storage to bind.
- * @param env                  The environment of the current thread
+ * @param jstorage      The java storage instance.
+ * @param storage      The native storage to bind.
+ * @param env      The environment of the current thread
  *
- * @exception                  If the class Storage is not found the function throws
- *                                             the ClassNotFoundException. If the field bind of
- *                                             this class is not found the function throws the exception
- *                                             NotSuchFieldException.
+ * @exception      If the class Storage is not found the function throws
+ *            the ClassNotFoundException. If the field bind of
+ *            this class is not found the function throws the exception
+ *            NotSuchFieldException.
  */
 void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
 
@@ -45,24 +45,24 @@ void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
 /**
  * This function returns a native storage from a java storage instance.
  *
- * @param jstorage                     The java storage object from which get the native storage.
- * @param env                  The environment of the current thread
+ * @param jstorage      The java storage object from which get the native storage.
+ * @param env      The environment of the current thread
  *
- * @return                             The function returns the native storage associated to the
- *                                             java storage object.
+ * @return        The function returns the native storage associated to the
+ *            java storage object.
  *
- * @exception                  If the class Storage is not found the function throws
- *                                             the ClassNotFoundException. If the field bind of
- *                                             this class is not found the function throws the exception
- *                                             NotSuchFieldException.
+ * @exception      If the class Storage is not found the function throws
+ *            the ClassNotFoundException. If the field bind of
+ *            this class is not found the function throws the exception
+ *            NotSuchFieldException.
  */
 msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage);
 
 
 /**
- * Class                       org_simgrid_msg_Storage
- * Method                      nativeInit
- * Signature   ()V
+ * Class      org_simgrid_msg_Storage
+ * Method      nativeInit
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Storage_nativeInit(JNIEnv*, jclass);
@@ -72,56 +72,56 @@ Java_org_simgrid_msg_Storage_nativeInit(JNIEnv*, jclass);
  * This function returns a global reference to the  java storage instance
  * specified by the parameter jstorage.
  *
- * @param jstorage                     The original java storage instance.
- * @param env                  The environment of the current thread
+ * @param jstorage      The original java storage instance.
+ * @param env      The environment of the current thread
  *
- * @return                             The global reference to the original java storage
- *                                             instance.
+ * @return        The global reference to the original java storage
+ *            instance.
  */
 jobject jstorage_ref(JNIEnv * env, jobject jstorage);
 /**
  * This function delete a global reference to a java storage instance.
  *
- * @param                              The global reference to delete.
- * @param env                  The environment of the current thread
+ * @param        The global reference to delete.
+ * @param env      The environment of the current thread
  */
 void jstorage_unref(JNIEnv * env, jobject jstorage);
 
 /**
  * This function returns the name of a MSG storage.
  *
- * @param jstorage                     A java storage object.
- * @param env                  The environment of the current thread
+ * @param jstorage      A java storage object.
+ * @param env      The environment of the current thread
  *
- * @return                             The name of the storage.
+ * @return        The name of the storage.
  */
 const char *jstorage_get_name(jobject jstorage, JNIEnv * env);
 
 /*
- * Class               org_simgrid_msg_Storage
- * Method              getByName
- * Signature   (Ljava/lang/String;)Lsimgrid/msg/Storage;
+ * Class    org_simgrid_msg_Storage
+ * Method    getByName
+ * Signature  (Ljava/lang/String;)Lsimgrid/msg/Storage;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv *, jclass, jstring);
 
 /*
- * Class               org_simgrid_msg_Storage
- * Method              getSize
- * Signature   ()D
+ * Class    org_simgrid_msg_Storage
+ * Method    getSize
+ * Signature  ()D
  */
 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Storage
- * Method              getFreeSize
- * Signature   ()D
+ * Class    org_simgrid_msg_Storage
+ * Method    getFreeSize
+ * Signature  ()D
  */
 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Storage
- * Method              getUsedSize
- * Signature   ()D
+ * Class    org_simgrid_msg_Storage
+ * Method    getUsedSize
+ * Signature  ()D
  */
 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *, jobject);
 
index fb1a948..7c6cb4a 100644 (file)
@@ -261,7 +261,7 @@ Java_org_simgrid_msg_Task_getSender(JNIEnv * env,
 
   process = MSG_task_get_sender(task);
   if (process == NULL) {
-       return NULL;
+    return NULL;
   }
   return (jobject) native_to_java_process(process);
 }
@@ -280,7 +280,7 @@ Java_org_simgrid_msg_Task_getSource(JNIEnv * env,
 
   host = MSG_task_get_source(task);
   if (host == NULL) {
-       return NULL;
+    return NULL;
   }
   if (!host->extension(JAVA_HOST_LEVEL)) {
     jxbt_throw_jni(env, "MSG_task_get_source() failed");
@@ -304,18 +304,18 @@ Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv * env, jobject jtask)
 
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname) {
-       msg_task_t task = jtask_to_native_task(jtask, env);
+  msg_task_t task = jtask_to_native_task(jtask, env);
 
-       if (!task) {
-               jxbt_throw_notbound(env, "task", jtask);
-               return;
-       }
-       const char *name = env->GetStringUTFChars((jstring) jname, 0);
+  if (!task) {
+    jxbt_throw_notbound(env, "task", jtask);
+    return;
+  }
+  const char *name = env->GetStringUTFChars((jstring) jname, 0);
 
-       env->SetObjectField(jtask, jtask_field_Task_name, jname);
-       MSG_task_set_name(task, name);
+  env->SetObjectField(jtask, jtask_field_Task_name, jname);
+  MSG_task_set_name(task, name);
 
-       env->ReleaseStringUTFChars((jstring) jname, name);
+  env->ReleaseStringUTFChars((jstring) jname, name);
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setPriority(JNIEnv * env,
@@ -331,26 +331,26 @@ Java_org_simgrid_msg_Task_setPriority(JNIEnv * env,
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setFlopsAmount
-               (JNIEnv *env, jobject jtask, jdouble computationAmount) {
-       msg_task_t task = jtask_to_native_task(jtask, env);
+    (JNIEnv *env, jobject jtask, jdouble computationAmount) {
+  msg_task_t task = jtask_to_native_task(jtask, env);
 
-       if (!task) {
+  if (!task) {
     jxbt_throw_notbound(env, "task", jtask);
     return;
-       }
-       MSG_task_set_flops_amount(task, (double) computationAmount);
+  }
+  MSG_task_set_flops_amount(task, (double) computationAmount);
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setBytesAmount
-               (JNIEnv *env, jobject jtask, jdouble dataSize) {
-       msg_task_t task = jtask_to_native_task(jtask, env);
+    (JNIEnv *env, jobject jtask, jdouble dataSize) {
+  msg_task_t task = jtask_to_native_task(jtask, env);
 
-       if (!task) {
+  if (!task) {
     jxbt_throw_notbound(env, "task", jtask);
     return;
-       }
+  }
   env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize);
-       MSG_task_set_bytes_amount(task, (double) dataSize);
+  MSG_task_set_bytes_amount(task, (double) dataSize);
 }
 
 JNIEXPORT void JNICALL
@@ -455,37 +455,37 @@ Java_org_simgrid_msg_Task_receive(JNIEnv * env, jclass cls,
 
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox) {
-       msg_comm_t comm;
-       const char *mailbox;
-       jclass comm_class;
-       //pointer to store the task object pointer.
-       msg_task_t *task = xbt_new(msg_task_t,1);
-       *task = NULL;
-       /* There should be a cache here */
-       comm_class = env->FindClass("org/simgrid/msg/Comm");
+  msg_comm_t comm;
+  const char *mailbox;
+  jclass comm_class;
+  //pointer to store the task object pointer.
+  msg_task_t *task = xbt_new(msg_task_t,1);
+  *task = NULL;
+  /* There should be a cache here */
+  comm_class = env->FindClass("org/simgrid/msg/Comm");
 
-       if (!comm_class) {
-               jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
-               return NULL;
-       }
+  if (!comm_class) {
+    jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
+    return NULL;
+  }
 
-       jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
-       if (!jcomm) {
-               jxbt_throw_native(env,bprintf("Can't create a Comm object."));
-               return NULL;
-       }
+  jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
+  if (!jcomm) {
+    jxbt_throw_native(env,bprintf("Can't create a Comm object."));
+    return NULL;
+  }
 
-       mailbox = env->GetStringUTFChars(jmailbox, 0);
+  mailbox = env->GetStringUTFChars(jmailbox, 0);
 
-       comm = MSG_task_irecv(task,mailbox);
+  comm = MSG_task_irecv(task,mailbox);
 
-       env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
-       env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
-       env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
+  env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
+  env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
+  env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
 
-       env->ReleaseStringUTFChars(jmailbox, mailbox);
+  env->ReleaseStringUTFChars(jmailbox, mailbox);
 
-       return jcomm;
+  return jcomm;
 }
 
 
@@ -536,38 +536,38 @@ Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls,
 
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls,
-               jstring jmailbox, jdouble rate) {
-       msg_comm_t comm;
-       const char *mailbox;
-       jclass comm_class;
-       //pointer to store the task object pointer.
-       msg_task_t *task = xbt_new(msg_task_t,1);
-       *task = NULL;
-       /* There should be a cac hee */
-       comm_class = env->FindClass("org/simgrid/msg/Comm");
+    jstring jmailbox, jdouble rate) {
+  msg_comm_t comm;
+  const char *mailbox;
+  jclass comm_class;
+  //pointer to store the task object pointer.
+  msg_task_t *task = xbt_new(msg_task_t,1);
+  *task = NULL;
+  /* There should be a cac hee */
+  comm_class = env->FindClass("org/simgrid/msg/Comm");
 
-       if (!comm_class) {
-               jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
-               return NULL;
-       }
+  if (!comm_class) {
+    jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
+    return NULL;
+  }
 
-       jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
-       if (!jcomm) {
-               jxbt_throw_native(env,bprintf("Can't create a Comm object."));
-               return NULL;
-       }
+  jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
+  if (!jcomm) {
+    jxbt_throw_native(env,bprintf("Can't create a Comm object."));
+    return NULL;
+  }
 
-       mailbox = env->GetStringUTFChars(jmailbox, 0);
+  mailbox = env->GetStringUTFChars(jmailbox, 0);
 
-       comm = MSG_task_irecv_bounded(task,mailbox, (double) rate);
+  comm = MSG_task_irecv_bounded(task,mailbox, (double) rate);
 
-       env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
-       env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
-       env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
+  env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
+  env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
+  env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
 
-       env->ReleaseStringUTFChars(jmailbox, mailbox);
+  env->ReleaseStringUTFChars(jmailbox, mailbox);
 
-       return jcomm;
+  return jcomm;
 }
 
 JNIEXPORT jobject JNICALL
@@ -650,14 +650,14 @@ Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmail
 
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask) {
-         msg_task_t task = jtask_to_native_task(jtask, env);
+    msg_task_t task = jtask_to_native_task(jtask, env);
 
-         if (!task) {
-           jxbt_throw_notbound(env, "task", jtask);
-           return;
-         }
+    if (!task) {
+      jxbt_throw_notbound(env, "task", jtask);
+      return;
+    }
 
-         MSG_task_destroy(task);
+    MSG_task_destroy(task);
 }
 
 static void msg_task_cancel_on_failed_dsend(void*t) {
index 6509dc0..2a89b6e 100644 (file)
@@ -17,30 +17,30 @@ SG_BEGIN_DECL()
 /**
  * This function associated a native task to a java task instance.
  *
- * @param jtask                        The java task instance.
- * @param task                 The native task to bind.
- * @param env                  The environment of the current thread.
+ * @param jtask      The java task instance.
+ * @param task      The native task to bind.
+ * @param env      The environment of the current thread.
  *
- * @exception                  If the class Task is not found the function throws 
- *                                             the ClassNotFoundException. If the field bind of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Task is not found the function throws 
+ *            the ClassNotFoundException. If the field bind of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  */
 void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
 
 /**
  * This function returns a native task from a java task instance.
  *
- * @param jtask                        The java task object from which get the native task.
- * @param env                  The environment of the current thread.
+ * @param jtask      The java task object from which get the native task.
+ * @param env      The environment of the current thread.
  *
- * @return                             The function returns the native task associated to the
- *                                             java task object.
+ * @return        The function returns the native task associated to the
+ *            java task object.
  *
- * @exception                  If the class Task is not found the function throws 
- *                                             the ClassNotFoundException. If the field bind of 
- *                                             this class is not found the function throws the exception 
- *                                             NotSuchFieldException.  
+ * @exception      If the class Task is not found the function throws 
+ *            the ClassNotFoundException. If the field bind of 
+ *            this class is not found the function throws the exception 
+ *            NotSuchFieldException.  
  */
 msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
 
@@ -49,146 +49,146 @@ msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
  * A java task object is valid if it is bind to a native 
  * task.
  *
- * @param jtask                        The java task to test the validity.
- * @param env                  The environment of the current thread.
+ * @param jtask      The java task to test the validity.
+ * @param env      The environment of the current thread.
  *
- * @return                             If the java task is valid the function returns true.
- *                                             Otherwise the function returns false.
+ * @return        If the java task is valid the function returns true.
+ *            Otherwise the function returns false.
  */
 jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              nativeInit
- * Signature   ();
+ * Class    org_simgrid_msg_Task
+ * Method    nativeInit
+ * Signature  ();
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls);
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              create
+ * Class    org_simgrid_msg_Task
+ * Method    create
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_create
-               (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
+    (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask);
 /*
- * Class               org_simgrid_msg_Task
- * Method              parallelCreate
+ * Class    org_simgrid_msg_Task
+ * Method    parallelCreate
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_parallelCreate
-               (JNIEnv *, jobject,
+    (JNIEnv *, jobject,
      jstring, jobjectArray,
      jdoubleArray,
      jdoubleArray);
 /*
- * Class               org_simgrid_msg_Task
- * Method              destroy
- * Signature   (Lsimgrid/msg/Task;)V
+ * Class    org_simgrid_msg_Task
+ * Method    destroy
+ * Signature  (Lsimgrid/msg/Task;)V
  */
 /* JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy */
 /*     (JNIEnv *, jobject); */
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              cancel
- * Signature   ()V
+ * Class    org_simgrid_msg_Task
+ * Method    cancel
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel
     (JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              execute
- * Signature   ()V
+ * Class    org_simgrid_msg_Task
+ * Method    execute
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute
     (JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              setBound
- * Signature   ()V
+ * Class    org_simgrid_msg_Task
+ * Method    setBound
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound
     (JNIEnv *, jobject, jdouble);
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              getName
- * Signature   ()Ljava/lang/String;
+ * Class    org_simgrid_msg_Task
+ * Method    getName
+ * Signature  ()Ljava/lang/String;
  */
 JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName
     (JNIEnv *, jobject);
 
 /*
- * Class               org_simgrid_msg_Task
- * Method              getSender
- * Signature   ()Lsimgrid/msg/Process;
+ * Class    org_simgrid_msg_Task
+ * Method    getSender
+ * Signature  ()Lsimgrid/msg/Process;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender
     (JNIEnv *, jobject);
 /*
- * Class               org_simgrid_msg_Task
- * Method              getSource
- * Signature   ()Lsimgrid/msg/Host;
+ * Class    org_simgrid_msg_Task
+ * Method    getSource
+ * Signature  ()Lsimgrid/msg/Host;
  */
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource
     (JNIEnv *, jobject);
 /*
- * Class               org_simgrid_msg_Task
- * Method              getFlopsAmount
- * Signature   ()D
+ * Class    org_simgrid_msg_Task
+ * Method    getFlopsAmount
+ * Signature  ()D
  */
 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount
     (JNIEnv *, jobject);
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              setName
- * Signature   (Ljava/lang/string;)V
+ * Class    org_simgrid_msg_Task
+ * Method    setName
+ * Signature  (Ljava/lang/string;)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname);
 /*
- * Class               org_simgrid_msg_Task
- * Method              setPriority
- * Signature   (D)V
+ * Class    org_simgrid_msg_Task
+ * Method    setPriority
+ * Signature  (D)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
     (JNIEnv *, jobject, jdouble);
 /**
- * Class               org_simgrid_msg_Task
- * Method              setComputeDuration
- * Signature   (D)V
+ * Class    org_simgrid_msg_Task
+ * Method    setComputeDuration
+ * Signature  (D)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setFlopsAmount
-               (JNIEnv *env, jobject jtask, jdouble computationAmount);
-               
-               /**
- * Class               org_simgrid_msg_Task
- * Method              setDataSize
- * Signature   (D)V
+    (JNIEnv *env, jobject jtask, jdouble computationAmount);
+    
+    /**
+ * Class    org_simgrid_msg_Task
+ * Method    setDataSize
+ * Signature  (D)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setBytesAmount
-               (JNIEnv *env, jobject jtask, jdouble dataSize);
-               
+    (JNIEnv *env, jobject jtask, jdouble dataSize);
+    
 /**
- * Class               org_simgrid_msg_Task
- * Method              send
+ * Class    org_simgrid_msg_Task
+ * Method    send
  */
 JNIEXPORT void JNICALL
     Java_org_simgrid_msg_Task_send
     (JNIEnv *, jobject, jstring, jdouble);
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              sendBounded
+ * Class    org_simgrid_msg_Task
+ * Method    sendBounded
  */
 JNIEXPORT void JNICALL
     Java_org_simgrid_msg_Task_sendBounded
@@ -196,81 +196,81 @@ JNIEXPORT void JNICALL
 
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              receive
+ * Class    org_simgrid_msg_Task
+ * Method    receive
  */
 JNIEXPORT jobject JNICALL
     Java_org_simgrid_msg_Task_receive
     (JNIEnv *, jclass, jstring, jdouble, jobject);
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              irecv
- * Signature   (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
+ * Class     org_simgrid_msg_Task
+ * Method    irecv
+ * Signature  (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
  */
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox);
 /**
- * Class               org_simgrid_msg_Task
- * Method              receiveBounded
+ * Class     org_simgrid_msg_Task
+ * Method    receiveBounded
  */
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls,
                                          jstring jalias, jdouble jtimeout,
                                          jobject jhost, jdouble rate);
 /**
- * Class               org_simgrid_msg_Task
- * Method              irecvBounded
+ * Class     org_simgrid_msg_Task
+ * Method    irecvBounded
  */
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls,
                                        jstring jmailbox, jdouble rate);
 /**
- * Class               org_simgrid_msg_Task
- * Method              isend
- * Signature   (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
+ * Class     org_simgrid_msg_Task
+ * Method    isend
+ * Signature  (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
  */
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox);
 /**
- * Class               org_simgrid_msg_Task
- * Method              isendBounded
+ * Class     org_simgrid_msg_Task
+ * Method    isendBounded
  */
 JNIEXPORT jobject JNICALL
 Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox, jdouble maxrate);
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              dsend
+ * Class     org_simgrid_msg_Task
+ * Method    dsend
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask,
                                 jstring jalias);
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              dsendBounded
+ * Class     org_simgrid_msg_Task
+ * Method    dsendBounded
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask,
                                 jstring jalias, jdouble maxrate);
 
 /**
- * Class               org_simgrid_msg_Task
- * Method              listen
+ * Class     org_simgrid_msg_Task
+ * Method    listen
  */
 JNIEXPORT jboolean JNICALL
 Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring);
 /**
- * Class               org_simgrid_msg_Task
- * Method              listenFromHost
+ * Class     org_simgrid_msg_Task
+ * Method    listenFromHost
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring,
                                               jobject);
 /**
- * Class               org_simgrid_msg_Task
- * Method              listenFrom
+ * Class     org_simgrid_msg_Task
+ * Method    listenFrom
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring);
index 2d2b382..81da0b2 100644 (file)
@@ -29,7 +29,7 @@ JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass cls) {
   jclass jprocess_class_VM = env->FindClass("org/simgrid/msg/VM");
   jvm_field_bind = jxbt_get_jfield(env, jprocess_class_VM, "bind", "J");
-  if (!jvm_field_bind  ) {
+  if (!jvm_field_bind  ) {
     jxbt_throw_native(env,bprintf("Can't find some fields in Java class. You should report this bug."));
   }
 }
@@ -79,14 +79,14 @@ Java_org_simgrid_msg_VM_isRestoring(JNIEnv * env, jobject jvm) {
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load) { 
 
-       msg_vm_t vm = jvm_get_native(env,jvm);
-       double bound = MSG_get_host_speed(vm) * load / 100;
-       MSG_vm_set_bound(vm, bound); 
+  msg_vm_t vm = jvm_get_native(env,jvm);
+  double bound = MSG_get_host_speed(vm) * load / 100;
+  MSG_vm_set_bound(vm, bound); 
 }
 
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
-                              jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) {
+                   jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) {
 
   msg_host_t host = jhost_get_native(env, jhost);
 
@@ -100,7 +100,7 @@ Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring
   // disk_path = xbt_strdup(disk_path);
 
   msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize,
-                 (int) jnetcap, NULL, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity);
+      (int) jnetcap, NULL, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity);
 
   jvm_bind(env,jvm,vm);
 }
index 6168766..1ed5e3b 100644 (file)
@@ -18,73 +18,73 @@ void jvm_bind(JNIEnv *env, jobject jvm, msg_vm_t vm);
 msg_vm_t jvm_get_native(JNIEnv *env, jobject jvm);
 
 /*
- * Class                       org_simgrid_msg_VM
- * Method                      nativeInit
- * Signature   ()V
+ * Class      org_simgrid_msg_VM
+ * Method      nativeInit
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass);
 
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isCreated
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isCreated
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isCreated(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isRunning
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isRunning
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isRunning(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isMigrating
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isMigrating
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isMigrating(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isSuspended
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isSuspended
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isSuspended(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isResuming
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isResuming
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isResuming(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isSuspended
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isSuspended
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isSaving(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isSave
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isSave
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isSaved(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      isResuming
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      isResuming
+ * Signature  ()B
  */
 JNIEXPORT jint JNICALL
 Java_org_simgrid_msg_VM_isRestoring(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      setBound
- * Signature   ()B
+ * Class      org_simgrid_msg_VM
+ * Method      setBound
+ * Signature  ()B
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load); 
@@ -96,7 +96,7 @@ Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load);
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
-                              jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint dprate, jint mig_netspeed);
+                   jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint dprate, jint mig_netspeed);
 
 /**
  * Class            org_simgrid_msg_VM
@@ -106,37 +106,37 @@ Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      start
- * Signature   (I)V
+ * Class      org_simgrid_msg_VM
+ * Method      start
+ * Signature  (I)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_start(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      nativeMigrate
- * Signature   (Lorg/simgrid/msg/Host;)V
+ * Class      org_simgrid_msg_VM
+ * Method      nativeMigrate
+ * Signature  (Lorg/simgrid/msg/Host;)V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject jvm, jobject jhost);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      suspend
- * Signature   ()V
+ * Class      org_simgrid_msg_VM
+ * Method      suspend
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_suspend(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      resume
- * Signature   ()V
+ * Class      org_simgrid_msg_VM
+ * Method      resume
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_resume(JNIEnv *env, jobject jvm);
 /**
- * Class                       org_simgrid_msg_VM
- * Method                      shutdown
- * Signature   ()V
+ * Class      org_simgrid_msg_VM
+ * Method      shutdown
+ * Signature  ()V
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm);
index f227bae..eaeb396 100644 (file)
@@ -36,7 +36,7 @@
 
 SG_BEGIN_DECL()
 
-/********************************** Configuration of MC **************************************/        
+/********************************** Configuration of MC **************************************/  
 
 extern XBT_PUBLIC(int) _sg_do_model_check;
 extern XBT_PRIVATE int _sg_do_model_check_record;
index 6fbb863..b7a0a72 100644 (file)
@@ -235,7 +235,7 @@ XBT_PUBLIC(void) lmm_constraint_concurrency_maximum_reset(lmm_constraint_t cnst)
  */
 XBT_PUBLIC(int) lmm_constraint_concurrency_maximum_get(lmm_constraint_t cnst);
 
-                            
+           
 /**
  * @brief Create a new Linear MaxMin variable
  * 
index 52a2e56..4e800a8 100644 (file)
@@ -257,7 +257,7 @@ XBT_PUBLIC(surf_action_t) surf_network_model_communicate(surf_network_model_t mo
  */
 XBT_PUBLIC(const char * ) surf_resource_name(surf_cpp_resource_t resource);
 static inline const char * surf_cpu_name(surf_cpu_t cpu) {
-       return surf_resource_name((surf_cpp_resource_t)cpu);
+  return surf_resource_name((surf_cpp_resource_t)cpu);
 }
 
 /** @brief Get the available speed of cpu associated to a host */
index c002413..995a22d 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_vm, instr, "MSG VM");
 
 char *instr_vm_id (msg_vm_t vm, char *str, int len)
 {
-       return instr_vm_id_2 (MSG_vm_get_name(vm), str, len);
+  return instr_vm_id_2 (MSG_vm_get_name(vm), str, len);
 }
 
 char *instr_vm_id_2 (const char *vm_name, char *str, int len)
index 87582b1..15a78c1 100644 (file)
@@ -121,7 +121,7 @@ void __MSG_host_priv_free(msg_host_priv_t priv)
 {
 
   if (priv == NULL)
-         return;
+    return;
   unsigned int size = xbt_dict_size(priv->dp_objs);
   if (size > 0)
     XBT_WARN("dp_objs: %u pending task?", size);
@@ -274,8 +274,8 @@ void MSG_host_get_params(msg_host_t host, vm_params_t params)
  * \return Returns the processor speed associated with pstate_index
  */
 double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) {
-         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
-         return host->power_peak_at(pstate_index);
+    xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+    return host->power_peak_at(pstate_index);
 }
 
 /** \ingroup m_host_management
@@ -285,8 +285,8 @@ double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) {
  * \return Returns the current processor speed
  */
 double MSG_host_get_current_power_peak(msg_host_t host) {
-         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
-         return host->current_power_peak();
+    xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+    return host->current_power_peak();
 }
 
 /** \ingroup m_host_management
@@ -295,7 +295,7 @@ double MSG_host_get_current_power_peak(msg_host_t host) {
  * \param  host host to test
  */
 int MSG_host_get_nb_pstates(msg_host_t host) {
-         return sg_host_get_nb_pstates(host);
+    return sg_host_get_nb_pstates(host);
 }
 
 /** \ingroup m_host_management
index 959fb1f..227031e 100644 (file)
@@ -536,7 +536,7 @@ xbt_dynar_t MSG_storages_as_dynar(void) {
   xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),NULL);
 
   xbt_lib_foreach(storage_lib, cursor, key, data) {
-         if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) {
+    if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) {
       xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor);
       xbt_dynar_push(res, &elm);
     }
index 22de933..2455645 100644 (file)
@@ -318,11 +318,11 @@ msg_error_t MSG_task_cancel(msg_task_t task)
  */
 double MSG_task_get_flops_amount(msg_task_t task) {
 
-       if (task->simdata->compute) {
-               return simcall_execution_get_remains(task->simdata->compute);
-       } else {
-               return task->simdata->flops_amount;
-       }
+  if (task->simdata->compute) {
+    return simcall_execution_get_remains(task->simdata->compute);
+  } else {
+    return task->simdata->flops_amount;
+  }
 }
 
 
index 010aff4..8344b43 100644 (file)
@@ -18,10 +18,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor,"S4U actors");
 /* C main function of a actor, running this->main */
 static int s4u_actor_runner(int argc, char **argv) {
 
-       smx_process_t smx_proc = SIMIX_process_self();
-       simgrid::s4u::Actor *actor = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
-       int res = actor->main(argc,argv);
-       return res;
+  smx_process_t smx_proc = SIMIX_process_self();
+  simgrid::s4u::Actor *actor = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
+  int res = actor->main(argc,argv);
+  return res;
 }
 
 
@@ -29,83 +29,83 @@ static int s4u_actor_runner(int argc, char **argv) {
 using namespace simgrid;
 
 s4u::Actor::Actor(smx_process_t smx_proc) {
-       p_smx_process = smx_proc;
+  p_smx_process = smx_proc;
 }
 s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv)
     : s4u::Actor::Actor(name,host, argc,argv, -1) {
 }
 s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv, double killTime) {
-       p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
+  p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
 
-       xbt_assert(p_smx_process,"Cannot create the actor");
-//     TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
-//     simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process);
+  xbt_assert(p_smx_process,"Cannot create the actor");
+//  TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
+//  simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process);
 }
 
 int s4u::Actor::main(int argc, char **argv) {
-       fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName());
-       return 0;
+  fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName());
+  return 0;
 }
 s4u::Actor *s4u::Actor::current() {
-       smx_process_t smx_proc = SIMIX_process_self();
-       simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
-       if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object
-               res = new Actor(smx_proc);
-       return res;
+  smx_process_t smx_proc = SIMIX_process_self();
+  simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
+  if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object
+    res = new Actor(smx_proc);
+  return res;
 }
 s4u::Actor *s4u::Actor::byPid(int pid) {
-       return (simgrid::s4u::Actor*) SIMIX_process_self_get_data(SIMIX_process_from_PID(pid));
+  return (simgrid::s4u::Actor*) SIMIX_process_self_get_data(SIMIX_process_from_PID(pid));
 }
 
 void s4u::Actor::setAutoRestart(bool autorestart) {
-       simcall_process_auto_restart_set(p_smx_process,autorestart);
+  simcall_process_auto_restart_set(p_smx_process,autorestart);
 }
 
 s4u::Host *s4u::Actor::getHost() {
-       return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process)));
+  return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process)));
 }
 const char* s4u::Actor::getName() {
-       return simcall_process_get_name(p_smx_process);
+  return simcall_process_get_name(p_smx_process);
 }
 int s4u::Actor::getPid(){
-       return simcall_process_get_PID(p_smx_process);
+  return simcall_process_get_PID(p_smx_process);
 }
 
 void s4u::Actor::setKillTime(double time) {
-       simcall_process_set_kill_time(p_smx_process,time);
+  simcall_process_set_kill_time(p_smx_process,time);
 }
 double s4u::Actor::getKillTime() {
-       return simcall_process_get_kill_time(p_smx_process);
+  return simcall_process_get_kill_time(p_smx_process);
 }
 void s4u::Actor::killAll() {
-       simcall_process_killall(1);
+  simcall_process_killall(1);
 }
 void s4u::Actor::kill() {
-       simcall_process_kill(p_smx_process);
+  simcall_process_kill(p_smx_process);
 }
 
 void s4u::Actor::sleep(double duration) {
-       simcall_process_sleep(duration);
+  simcall_process_sleep(duration);
 }
 
 e_smx_state_t s4u::Actor::execute(double flops) {
-       smx_synchro_t s = simcall_execution_start(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
-       return simcall_execution_wait(s);
+  smx_synchro_t s = simcall_execution_start(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
+  return simcall_execution_wait(s);
 }
 
 void *s4u::Actor::recv(Mailbox &chan) {
-       void *res=NULL;
+  void *res=NULL;
 
-       Comm c = Comm::recv_init(this, chan);
-       c.setDstData(&res,sizeof(res));
-       c.wait();
+  Comm c = Comm::recv_init(this, chan);
+  c.setDstData(&res,sizeof(res));
+  c.wait();
 
     return res;
 }
 void s4u::Actor::send(Mailbox &chan, void *payload, size_t simulatedSize) {
-       Comm c = Comm::send_init(this,chan);
-       c.setRemains(simulatedSize);
-       c.setSrcData(payload);
-       // c.start() is optional.
-       c.wait();
+  Comm c = Comm::send_init(this,chan);
+  c.setRemains(simulatedSize);
+  c.setSrcData(payload);
+  // c.start() is optional.
+  c.wait();
 }
index 5bbce9a..331ef22 100644 (file)
@@ -22,7 +22,7 @@ s4u::Async::~Async() {
 }
 
 void s4u::Async::setRemains(double remains) {
-       xbt_assert(p_state == inited, "Cannot change the remaining amount of work once the Async is started");
-       p_remains = remains;
+  xbt_assert(p_state == inited, "Cannot change the remaining amount of work once the Async is started");
+  p_remains = remains;
 }
 
index d26c4d6..564ae9c 100644 (file)
@@ -18,135 +18,135 @@ s4u::Comm::~Comm() {
 }
 
 s4u::Comm &s4u::Comm::send_init(s4u::Actor *sender, s4u::Mailbox &chan) {
-       s4u::Comm *res = new s4u::Comm();
-       res->p_sender = sender;
-       res->p_mailbox = &chan;
+  s4u::Comm *res = new s4u::Comm();
+  res->p_sender = sender;
+  res->p_mailbox = &chan;
 
-       return *res;
+  return *res;
 }
 s4u::Comm &s4u::Comm::recv_init(s4u::Actor *receiver, s4u::Mailbox &chan) {
-       s4u::Comm *res = new s4u::Comm();
-       res->p_receiver = receiver;
-       res->p_mailbox = &chan;
+  s4u::Comm *res = new s4u::Comm();
+  res->p_receiver = receiver;
+  res->p_mailbox = &chan;
 
-       return *res;
+  return *res;
 }
 
 void s4u::Comm::setRate(double rate) {
-       xbt_assert(p_state==inited);
-       p_rate = rate;
+  xbt_assert(p_state==inited);
+  p_rate = rate;
 }
 
 void s4u::Comm::setSrcData(void * buff) {
-       xbt_assert(p_state==inited);
-       xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
-       p_srcBuff = buff;
+  xbt_assert(p_state==inited);
+  xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
+  p_srcBuff = buff;
 }
 void s4u::Comm::setSrcDataSize(size_t size){
-       xbt_assert(p_state==inited);
-       p_srcBuffSize = size;
+  xbt_assert(p_state==inited);
+  p_srcBuffSize = size;
 }
 void s4u::Comm::setSrcData(void * buff, size_t size) {
-       xbt_assert(p_state==inited);
+  xbt_assert(p_state==inited);
 
-       xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
-       p_srcBuff = buff;
-       p_srcBuffSize = size;
+  xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
+  p_srcBuff = buff;
+  p_srcBuffSize = size;
 }
 void s4u::Comm::setDstData(void ** buff) {
-       xbt_assert(p_state==inited);
-       xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
-       p_dstBuff = buff;
+  xbt_assert(p_state==inited);
+  xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
+  p_dstBuff = buff;
 }
 size_t s4u::Comm::getDstDataSize(){
-       xbt_assert(p_state==finished);
-       return p_dstBuffSize;
+  xbt_assert(p_state==finished);
+  return p_dstBuffSize;
 }
 void s4u::Comm::setDstData(void ** buff, size_t size) {
-       xbt_assert(p_state==inited);
+  xbt_assert(p_state==inited);
 
-       xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
-       p_dstBuff = buff;
-       p_dstBuffSize = size;
+  xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
+  p_dstBuff = buff;
+  p_dstBuffSize = size;
 }
 
 void s4u::Comm::start() {
-       xbt_assert(p_state == inited);
-
-       if (p_srcBuff != NULL) { // Sender side
-               p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
-                               p_srcBuff, p_srcBuffSize,
-                               p_matchFunction, p_cleanFunction, p_copyDataFunction,
-                               p_userData, p_detached);
-       } else if (p_dstBuff != NULL) { // Receiver side
-               p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
-                               p_matchFunction, p_copyDataFunction,
-                               p_userData, p_rate);
-
-       } else {
-               xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
-       }
-       p_state = started;
+  xbt_assert(p_state == inited);
+
+  if (p_srcBuff != NULL) { // Sender side
+    p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
+        p_srcBuff, p_srcBuffSize,
+        p_matchFunction, p_cleanFunction, p_copyDataFunction,
+        p_userData, p_detached);
+  } else if (p_dstBuff != NULL) { // Receiver side
+    p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
+        p_matchFunction, p_copyDataFunction,
+        p_userData, p_rate);
+
+  } else {
+    xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
+  }
+  p_state = started;
 }
 void s4u::Comm::wait() {
-       xbt_assert(p_state == started || p_state == inited);
-
-       if (p_state == started)
-               simcall_comm_wait(p_inferior, -1/*timeout*/);
-       else {// p_state == inited. Save a simcall and do directly a blocking send/recv
-               if (p_srcBuff != NULL) {
-                       simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
-                                       p_srcBuff, p_srcBuffSize,
-                                       p_matchFunction, p_copyDataFunction,
-                                       p_userData, -1 /*timeout*/);
-               } else {
-                       simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
-                                       p_matchFunction, p_copyDataFunction,
-                                       p_userData, -1/*timeout*/, p_rate);
-               }
-       }
-       p_state = finished;
+  xbt_assert(p_state == started || p_state == inited);
+
+  if (p_state == started)
+    simcall_comm_wait(p_inferior, -1/*timeout*/);
+  else {// p_state == inited. Save a simcall and do directly a blocking send/recv
+    if (p_srcBuff != NULL) {
+      simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
+          p_srcBuff, p_srcBuffSize,
+          p_matchFunction, p_copyDataFunction,
+          p_userData, -1 /*timeout*/);
+    } else {
+      simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
+          p_matchFunction, p_copyDataFunction,
+          p_userData, -1/*timeout*/, p_rate);
+    }
+  }
+  p_state = finished;
 }
 void s4u::Comm::wait(double timeout) {
-       xbt_assert(p_state == started || p_state == inited);
-
-       if (p_state == started) {
-               simcall_comm_wait(p_inferior, timeout);
-               p_state = finished;
-               return;
-       }
-
-       // It's not started yet. Do it in one simcall
-       if (p_srcBuff != NULL) {
-               simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
-                               p_srcBuff, p_srcBuffSize,
-                               p_matchFunction, p_copyDataFunction,
-                               p_userData, timeout);
-       } else { // Receiver
-               simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
-                               p_matchFunction, p_copyDataFunction,
-                               p_userData, timeout, p_rate);
-       }
-       p_state = finished;
+  xbt_assert(p_state == started || p_state == inited);
+
+  if (p_state == started) {
+    simcall_comm_wait(p_inferior, timeout);
+    p_state = finished;
+    return;
+  }
+
+  // It's not started yet. Do it in one simcall
+  if (p_srcBuff != NULL) {
+    simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
+        p_srcBuff, p_srcBuffSize,
+        p_matchFunction, p_copyDataFunction,
+        p_userData, timeout);
+  } else { // Receiver
+    simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
+        p_matchFunction, p_copyDataFunction,
+        p_userData, timeout, p_rate);
+  }
+  p_state = finished;
 }
 
 s4u::Comm &s4u::Comm::send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedSize) {
-       s4u::Comm &res = s4u::Comm::send_init(sender, dest);
+  s4u::Comm &res = s4u::Comm::send_init(sender, dest);
 
-       res.setRemains(simulatedSize);
-       res.p_srcBuff = data;
-       res.p_srcBuffSize = sizeof(void*);
+  res.setRemains(simulatedSize);
+  res.p_srcBuff = data;
+  res.p_srcBuffSize = sizeof(void*);
 
-       res.start();
-       return res;
+  res.start();
+  return res;
 }
 
 s4u::Comm &s4u::Comm::recv_async(s4u::Actor *receiver, Mailbox &dest, void **data) {
-       s4u::Comm &res = s4u::Comm::recv_init(receiver, dest);
+  s4u::Comm &res = s4u::Comm::recv_init(receiver, dest);
 
-       res.setDstData(data);
+  res.setDstData(data);
 
-       res.start();
-       return res;
+  res.start();
+  return res;
 }
 
index dc22416..3e2e284 100644 (file)
@@ -13,31 +13,31 @@ XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
 using namespace simgrid;
 
 double s4u::Engine::getClock() {
-       return SIMIX_get_clock();
+  return SIMIX_get_clock();
 }
 
 s4u::Engine::Engine(int *argc, char **argv) {
-       SIMIX_global_init(argc, argv);
+  SIMIX_global_init(argc, argv);
 }
 
 void s4u::Engine::loadPlatform(const char *platf) {
-       SIMIX_create_environment(platf);
+  SIMIX_create_environment(platf);
 }
 
 void s4u::Engine::register_function(const char*name, int (*code)(int,char**)) {
-       SIMIX_function_register(name,code);
+  SIMIX_function_register(name,code);
 }
 void s4u::Engine::register_default(int (*code)(int,char**)) {
-       SIMIX_function_register_default(code);
+  SIMIX_function_register_default(code);
 }
 void s4u::Engine::loadDeployment(const char *deploy) {
-       SIMIX_launch_application(deploy);
+  SIMIX_launch_application(deploy);
 }
 
 void s4u::Engine::run() {
-       if (MC_is_active()) {
-               MC_run();
-       } else {
-               SIMIX_run();
-       }
+  if (MC_is_active()) {
+    MC_run();
+  } else {
+    SIMIX_run();
+  }
 }
index e68d191..23a6360 100644 (file)
@@ -22,37 +22,37 @@ namespace simgrid {
 namespace s4u {
 
 File::File(const char*fullpath, void *userdata) {
-       // this cannot fail because we get a xbt_die if the mountpoint does not exist
-       p_inferior = simcall_file_open(fullpath, Host::current());
-       p_path = fullpath;
+  // this cannot fail because we get a xbt_die if the mountpoint does not exist
+  p_inferior = simcall_file_open(fullpath, Host::current());
+  p_path = fullpath;
 }
 
 File::~File() {
-       simcall_file_close(p_inferior, Host::current());
+  simcall_file_close(p_inferior, Host::current());
 }
 
 sg_size_t File::read(sg_size_t size) {
-       return simcall_file_read(p_inferior, size, Host::current());
+  return simcall_file_read(p_inferior, size, Host::current());
 }
 sg_size_t File::write(sg_size_t size) {
-       return simcall_file_write(p_inferior,size, Host::current());
+  return simcall_file_write(p_inferior,size, Host::current());
 }
 sg_size_t File::size() {
-       return simcall_file_get_size(p_inferior);
+  return simcall_file_get_size(p_inferior);
 }
 
 void File::seek(sg_size_t pos) {
-       simcall_file_seek(p_inferior,pos,SEEK_SET);
+  simcall_file_seek(p_inferior,pos,SEEK_SET);
 }
 sg_size_t File::tell() {
-       return simcall_file_tell(p_inferior);
+  return simcall_file_tell(p_inferior);
 }
 void File::move(const char*fullpath) {
-       simcall_file_move(p_inferior,fullpath);
+  simcall_file_move(p_inferior,fullpath);
 }
 void File::unlink() {
-       sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
-       simcall_file_unlink(p_inferior,attached);
+  sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
+  simcall_file_unlink(p_inferior,attached);
 }
 
 }} // namespace simgrid::s4u
index b997195..7aaf021 100644 (file)
@@ -46,16 +46,16 @@ Host::Host(const char* name)
 }
 
 Host::~Host() {
-       delete pimpl_cpu;
-       delete mounts;
+  delete pimpl_cpu;
+  delete mounts;
 }
 
 Host *Host::by_name(std::string name) {
-       Host* host = Host::by_name_or_null(name.c_str());
-       // TODO, raise an exception instead?
-       if (host == nullptr)
-               xbt_die("No such host: %s", name.c_str());
-       return host;
+  Host* host = Host::by_name_or_null(name.c_str());
+  // TODO, raise an exception instead?
+  if (host == nullptr)
+    xbt_die("No such host: %s", name.c_str());
+  return host;
 }
 Host* Host::by_name_or_null(const char* name)
 {
@@ -72,14 +72,14 @@ Host* Host::by_name_or_create(const char* name)
 }
 
 Host *Host::current(){
-       smx_process_t smx_proc = SIMIX_process_self();
-       if (smx_proc == NULL)
-               xbt_die("Cannot call Host::current() from the maestro context");
-       return SIMIX_process_get_host(smx_proc);
+  smx_process_t smx_proc = SIMIX_process_self();
+  if (smx_proc == NULL)
+    xbt_die("Cannot call Host::current() from the maestro context");
+  return SIMIX_process_get_host(smx_proc);
 }
 
 void Host::turn_on() {
-       simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
+  simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
 }
 
 void Host::turn_off() {
@@ -87,37 +87,37 @@ void Host::turn_off() {
 }
 
 bool Host::is_on() {
-       return this->pimpl_cpu->isOn();
+  return this->pimpl_cpu->isOn();
 }
 
 int Host::pstates_count() const {
-       return this->pimpl_cpu->getNbPStates();
+  return this->pimpl_cpu->getNbPStates();
 }
 
 boost::unordered_map<std::string, Storage*> const& Host::mounted_storages() {
-       if (mounts == NULL) {
-               mounts = new boost::unordered_map<std::string, Storage*> ();
-
-               xbt_dict_t dict = this->mounted_storages_as_dict();
-
-               xbt_dict_cursor_t cursor;
-               char *mountname;
-               char *storagename;
-               xbt_dict_foreach(dict, cursor, mountname, storagename) {
-                       mounts->insert({mountname, &Storage::byName(storagename)});
-               }
-               xbt_dict_free(&dict);
-       }
+  if (mounts == NULL) {
+    mounts = new boost::unordered_map<std::string, Storage*> ();
+
+    xbt_dict_t dict = this->mounted_storages_as_dict();
+
+    xbt_dict_cursor_t cursor;
+    char *mountname;
+    char *storagename;
+    xbt_dict_foreach(dict, cursor, mountname, storagename) {
+      mounts->insert({mountname, &Storage::byName(storagename)});
+    }
+    xbt_dict_free(&dict);
+  }
 
-       return *mounts;
+  return *mounts;
 }
 
 /** Get the properties assigned to a host */
 xbt_dict_t Host::properties() {
   return simgrid::simix::kernel([&] {
-               simgrid::surf::Host* surf_host = this->extension<simgrid::surf::Host>();
-               return surf_host->getProperties();
-       });
+    simgrid::surf::Host* surf_host = this->extension<simgrid::surf::Host>();
+    return surf_host->getProperties();
+  });
 }
 
 /** Get the processes attached to the host */
@@ -146,11 +146,11 @@ double Host::power_peak_at(int pstate_index)
 
 /** @brief Get the speed of the cpu associated to a host */
 double Host::speed() {
-       return pimpl_cpu->getSpeed(1.0);
+  return pimpl_cpu->getSpeed(1.0);
 }
 /** @brief Returns the number of core of the processor. */
 int Host::core_count() {
-       return pimpl_cpu->getCore();
+  return pimpl_cpu->getCore();
 }
 
 /** @brief Set the pstate at which the host should run */
index a2a6a42..587a72a 100644 (file)
@@ -20,24 +20,24 @@ boost::unordered_map <std::string, s4u::Mailbox *> *s4u::Mailbox::mailboxes = ne
 
 
 s4u::Mailbox::Mailbox(const char*name, smx_rdv_t inferior) {
-       p_inferior = inferior;
-       p_name = name;
-       mailboxes->insert({name, this});
+  p_inferior = inferior;
+  p_name = name;
+  mailboxes->insert({name, this});
 }
 const char *s4u::Mailbox::getName() {
-       return p_name.c_str();
+  return p_name.c_str();
 }
 s4u::Mailbox *s4u::Mailbox::byName(const char*name) {
-       s4u::Mailbox *res;
-       try {
-               res = mailboxes->at(name);
-       } catch (std::out_of_range& e) {
-               // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox
-               // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv.
-               // Only one simix object will be created, but two S4U objects will be created.
-               // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked.
-               new Mailbox(name,simcall_rdv_create(name));
-               res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself.
-       }
-       return res;
+  s4u::Mailbox *res;
+  try {
+    res = mailboxes->at(name);
+  } catch (std::out_of_range& e) {
+    // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox
+    // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv.
+    // Only one simix object will be created, but two S4U objects will be created.
+    // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked.
+    new Mailbox(name,simcall_rdv_create(name));
+    res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself.
+  }
+  return res;
 }
index 3c5bb11..3b0841b 100644 (file)
@@ -14,45 +14,45 @@ namespace s4u {
 
 boost::unordered_map <std::string, Storage *> *Storage::storages = new boost::unordered_map<std::string, Storage*> ();
 Storage::Storage(std::string name, smx_storage_t inferior) {
-       p_name = name;
-       p_inferior = inferior;
+  p_name = name;
+  p_inferior = inferior;
 
-       storages->insert({name, this});
+  storages->insert({name, this});
 }
 
 Storage::~Storage() {
-       // TODO Auto-generated destructor stub
+  // TODO Auto-generated destructor stub
 }
 
 smx_storage_t Storage::inferior() {
-       return p_inferior;
+  return p_inferior;
 }
 Storage &Storage::byName(const char*name) {
-       s4u::Storage *res = NULL;
-       try {
-               res = storages->at(name);
-       } catch (std::out_of_range& e) {
-               smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name);
-               if (inferior == NULL)
-                       xbt_die("Storage %s does not exist. Please only use the storages that are defined in your platform.", name);
+  s4u::Storage *res = NULL;
+  try {
+    res = storages->at(name);
+  } catch (std::out_of_range& e) {
+    smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name);
+    if (inferior == NULL)
+      xbt_die("Storage %s does not exist. Please only use the storages that are defined in your platform.", name);
 
-               res = new Storage(name,inferior);
-       }
-       return *res;
+    res = new Storage(name,inferior);
+  }
+  return *res;
 }
 
 const char*Storage::name() {
-       return p_name.c_str();
+  return p_name.c_str();
 }
 
 sg_size_t Storage::size_free() {
-       return simcall_storage_get_free_size(p_inferior);
+  return simcall_storage_get_free_size(p_inferior);
 }
 sg_size_t Storage::size_used() {
-       return simcall_storage_get_used_size(p_inferior);
+  return simcall_storage_get_used_size(p_inferior);
 }
 sg_size_t Storage::size() {
-       return SIMIX_storage_get_size(p_inferior);
+  return SIMIX_storage_get_size(p_inferior);
 }
 
 } /* namespace s4u */
index 7566f87..03ad3d0 100644 (file)
@@ -111,15 +111,15 @@ typedef unsigned int flex_uint32_t;
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
-#else  /* ! __cplusplus */
+#else  /* ! __cplusplus */
 
 /* C99 requires __STDC__ to be defined as 1. */
 #if defined (__STDC__)
 
 #define YY_USE_CONST
 
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif  /* defined (__STDC__) */
+#endif  /* ! __cplusplus */
 
 #ifdef YY_USE_CONST
 #define yyconst const
@@ -217,83 +217,83 @@ extern FILE *dax_in, *dax_out;
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up dax_text. */ \
+  do \
+    { \
+    /* Undo effects of setting up dax_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-               *yy_cp = (yy_hold_char); \
-               YY_RESTORE_YY_MORE_OFFSET \
-               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-               YY_DO_BEFORE_ACTION; /* set up dax_text again */ \
-               } \
-       while ( 0 )
+    *yy_cp = (yy_hold_char); \
+    YY_RESTORE_YY_MORE_OFFSET \
+    (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+    YY_DO_BEFORE_ACTION; /* set up dax_text again */ \
+    } \
+  while ( 0 )
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-       {
-       FILE *yy_input_file;
-
-       char *yy_ch_buf;                /* input buffer */
-       char *yy_buf_pos;               /* current position in input buffer */
-
-       /* Size of input buffer in bytes, not including room for EOB
-        * characters.
-        */
-       yy_size_t yy_buf_size;
-
-       /* Number of characters read into yy_ch_buf, not including EOB
-        * characters.
-        */
-       yy_size_t yy_n_chars;
-
-       /* Whether we "own" the buffer - i.e., we know we created it,
-        * and can realloc() it to grow it, and should free() it to
-        * delete it.
-        */
-       int yy_is_our_buffer;
-
-       /* Whether this is an "interactive" input source; if so, and
-        * if we're using stdio for input, then we want to use getc()
-        * instead of fread(), to make sure we stop fetching input after
-        * each newline.
-        */
-       int yy_is_interactive;
-
-       /* Whether we're considered to be at the beginning of a line.
-        * If so, '^' rules will be active on the next match, otherwise
-        * not.
-        */
-       int yy_at_bol;
+  {
+  FILE *yy_input_file;
+
+  char *yy_ch_buf;    /* input buffer */
+  char *yy_buf_pos;    /* current position in input buffer */
+
+  /* Size of input buffer in bytes, not including room for EOB
+   * characters.
+   */
+  yy_size_t yy_buf_size;
+
+  /* Number of characters read into yy_ch_buf, not including EOB
+   * characters.
+   */
+  yy_size_t yy_n_chars;
+
+  /* Whether we "own" the buffer - i.e., we know we created it,
+   * and can realloc() it to grow it, and should free() it to
+   * delete it.
+   */
+  int yy_is_our_buffer;
+
+  /* Whether this is an "interactive" input source; if so, and
+   * if we're using stdio for input, then we want to use getc()
+   * instead of fread(), to make sure we stop fetching input after
+   * each newline.
+   */
+  int yy_is_interactive;
+
+  /* Whether we're considered to be at the beginning of a line.
+   * If so, '^' rules will be active on the next match, otherwise
+   * not.
+   */
+  int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
 
-       /* Whether to try to fill the input buffer when we reach the
-        * end of it.
-        */
-       int yy_fill_buffer;
+  /* Whether to try to fill the input buffer when we reach the
+   * end of it.
+   */
+  int yy_fill_buffer;
 
-       int yy_buffer_status;
+  int yy_buffer_status;
 
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
-       /* When an EOF's been seen but there's still some text to process
-        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-        * shouldn't try reading from the input source any more.  We might
-        * still have a bunch of tokens to match, though, because of
-        * possible backing-up.
-        *
-        * When we actually see the EOF, we change the status to "new"
-        * (via dax_restart()), so that the user can continue scanning by
-        * just pointing dax_in at a new input file.
-        */
+  /* When an EOF's been seen but there's still some text to process
+   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+   * shouldn't try reading from the input source any more.  We might
+   * still have a bunch of tokens to match, though, because of
+   * possible backing-up.
+   *
+   * When we actually see the EOF, we change the status to "new"
+   * (via dax_restart()), so that the user can continue scanning by
+   * just pointing dax_in at a new input file.
+   */
 #define YY_BUFFER_EOF_PENDING 2
 
-       };
+  };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* Stack of input buffers. */
@@ -318,13 +318,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when dax_text is formed. */
 static char yy_hold_char;
-static yy_size_t yy_n_chars;           /* number of characters read into yy_ch_buf */
+static yy_size_t yy_n_chars;    /* number of characters read into yy_ch_buf */
 yy_size_t dax_leng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;                /* whether we need to initialize */
-static int yy_start = 0;       /* start state number */
+static int yy_init = 0;    /* whether we need to initialize */
+static int yy_start = 0;  /* start state number */
 
 /* Flag which is used to allow dax_wrap()'s to do buffer switches
  * instead of setting up a fresh dax_in.  A bit of a hack ...
@@ -356,24 +356,24 @@ void dax_free (void *  );
 #define yy_new_buffer dax__create_buffer
 
 #define yy_set_interactive(is_interactive) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){ \
+  { \
+  if ( ! YY_CURRENT_BUFFER ){ \
         dax_ensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
+    YY_CURRENT_BUFFER_LVALUE =    \
             dax__create_buffer(dax_in,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-       }
+  } \
+  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+  }
 
 #define yy_set_bol(at_bol) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){\
+  { \
+  if ( ! YY_CURRENT_BUFFER ){\
         dax_ensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
+    YY_CURRENT_BUFFER_LVALUE =    \
             dax__create_buffer(dax_in,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-       }
+  } \
+  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+  }
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
@@ -404,21 +404,21 @@ static void yy_fatal_error (yyconst char msg[]  );
  * corresponding action - sets up dax_text.
  */
 #define YY_DO_BEFORE_ACTION \
-       (yytext_ptr) = yy_bp; \
-       dax_leng = (size_t) (yy_cp - yy_bp); \
-       (yy_hold_char) = *yy_cp; \
-       *yy_cp = '\0'; \
-       (yy_c_buf_p) = yy_cp;
+  (yytext_ptr) = yy_bp; \
+  dax_leng = (size_t) (yy_cp - yy_bp); \
+  (yy_hold_char) = *yy_cp; \
+  *yy_cp = '\0'; \
+  (yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 140
 #define YY_END_OF_BUFFER 141
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
-       {
-       flex_int32_t yy_verify;
-       flex_int32_t yy_nxt;
-       };
+  {
+  flex_int32_t yy_verify;
+  flex_int32_t yy_nxt;
+  };
 static yyconst flex_int16_t yy_accept[775] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -1422,23 +1422,23 @@ short int dax__uses_optional_isset;
 
 /* XML state. */
 #ifdef FLEX_DEBUG
-# define ENTER(state)  debug_enter(state,#state)
-# define LEAVE         debug_leave()
-# define SET(state)    debug_set(state,#state)
+# define ENTER(state)  debug_enter(state,#state)
+# define LEAVE    debug_leave()
+# define SET(state)  debug_set(state,#state)
   static void debug_enter(int, const char*);
   static void debug_leave(void);
   static void debug_set(int, const char*);
 #else
-# define ENTER(state)  (yy_push_state(state))
-# define LEAVE         (yy_pop_state())
-# define SET(state)    BEGIN(state)
+# define ENTER(state)  (yy_push_state(state))
+# define LEAVE    (yy_pop_state())
+# define SET(state)  BEGIN(state)
 #endif
 
 /* Generic actions. */
-#define SKIP   /*skip*/
+#define SKIP  /*skip*/
 #define SUCCEED        CLEANUP; return 0
 
-#define FAIL   return fail
+#define FAIL  return fail
 static int fail(const char*, ...);
 
 enum {flexml_max_err_msg_size = 512};
@@ -1475,12 +1475,12 @@ static int inext = 1;
 static int ck_blimit()
 {
      if (bnext >= blimit) {
-        blimit += FLEXML_BUFFERSTACKSIZE + 2;
-        {
-            char *temp = (char *) realloc(dax__bufferstack, blimit);
-            assert(temp);
-            dax__bufferstack = temp;
-        }
+   blimit += FLEXML_BUFFERSTACKSIZE + 2;
+   {
+       char *temp = (char *) realloc(dax__bufferstack, blimit);
+       assert(temp);
+       dax__bufferstack = temp;
+   }
      }
      return 0;
 }
@@ -1489,12 +1489,12 @@ static int ck_blimit()
 static int ck_ilimit()
 {
      if (inext >= ilimit) {
-        ilimit += FLEXML_INDEXSTACKSIZE + 2;
-        {
-            int *temp = (int *) realloc(indexstack, ilimit);
-            assert(temp);
-            indexstack = temp;
-        }
+   ilimit += FLEXML_INDEXSTACKSIZE + 2;
+   {
+       int *temp = (int *) realloc(indexstack, ilimit);
+       assert(temp);
+       indexstack = temp;
+   }
      }
      return 0;
 }
@@ -1508,16 +1508,16 @@ static void dax__bufferliteral(char c, int* pp, const char* text)
       assert(s && e && s <= e);
       ++s;
       while (s < e) {
-        if (isspace(*s)) {
-           BUFFERPUTC(' ');
-           do ++s; while (s < e && isspace(*s));
-        } else
-          BUFFERPUTC(*s++);
+   if (isspace(*s)) {
+      BUFFERPUTC(' ');
+      do ++s; while (s < e && isspace(*s));
+   } else
+     BUFFERPUTC(*s++);
       }
    } else {
       const char *s = text;
       while (*s)
-       BUFFERPUTC(*s++);
+  BUFFERPUTC(*s++);
    }
    BUFFERDONE;
 }
@@ -1551,18 +1551,18 @@ static int popbuffer(void)
 /* Miscellaneous. */
 /* Parser states (flex `exclusive start conditions'):
  *
- * PROLOG      the XML prolog of the document before <?xml...>
- * DOCTYPE     the XML prolog of the document after <?xml...>
- * EPILOG      after the root element
- * INCOMMENT   inside an XML comment <!--....-->
- * INPI                inside an XML PI <?...?>
- * VALUE1      inside a '...'-delimited literal
- * VALUE2      inside a "..."-delimited literal
- * CDATA       inside a <![CDATA[...] ]> section.
- * ROOT_<tag>  expect root element <tag>
- * AL_<tag>    inside the attribute list for <tag>
- * IN_<tag>    inside a <tag> with element contents (ready for end tag)
- * IMPOSSIBLE  dummy to permit disabling rules; must be last
+ * PROLOG  the XML prolog of the document before <?xml...>
+ * DOCTYPE  the XML prolog of the document after <?xml...>
+ * EPILOG  after the root element
+ * INCOMMENT  inside an XML comment <!--....-->
+ * INPI    inside an XML PI <?...?>
+ * VALUE1  inside a '...'-delimited literal
+ * VALUE2  inside a "..."-delimited literal
+ * CDATA  inside a <![CDATA[...] ]> section.
+ * ROOT_<tag>  expect root element <tag>
+ * AL_<tag>  inside the attribute list for <tag>
+ * IN_<tag>  inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE  dummy to permit disabling rules; must be last
  */
 
 /* State names. */
@@ -1713,33 +1713,33 @@ static int input (void );
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-               { \
-               int c = '*'; \
-               size_t n; \
-               for ( n = 0; n < max_size && \
-                            (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \
-                       buf[n] = (char) c; \
-               if ( c == '\n' ) \
-                       buf[n++] = (char) c; \
-               if ( c == EOF && ferror( dax_in ) ) \
-                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
-               result = n; \
-               } \
-       else \
-               { \
-               errno=0; \
-               while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \
-                       { \
-                       if( errno != EINTR) \
-                               { \
-                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                               break; \
-                               } \
-                       errno=0; \
-                       clearerr(dax_in); \
-                       } \
-               }\
+  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+    { \
+    int c = '*'; \
+    size_t n; \
+    for ( n = 0; n < max_size && \
+           (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \
+      buf[n] = (char) c; \
+    if ( c == '\n' ) \
+      buf[n++] = (char) c; \
+    if ( c == EOF && ferror( dax_in ) ) \
+      YY_FATAL_ERROR( "input in flex scanner failed" ); \
+    result = n; \
+    } \
+  else \
+    { \
+    errno=0; \
+    while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \
+      { \
+      if( errno != EINTR) \
+        { \
+        YY_FATAL_ERROR( "input in flex scanner failed" ); \
+        break; \
+        } \
+      errno=0; \
+      clearerr(dax_in); \
+      } \
+    }\
 \
 
 #endif
@@ -1788,43 +1788,43 @@ extern int dax_lex (void);
 #endif
 
 #define YY_RULE_SETUP \
-       YY_USER_ACTION
+  YY_USER_ACTION
 
 /** The main scanner function which does all the work.
  */
 YY_DECL
 {
-       yy_state_type yy_current_state;
-       char *yy_cp, *yy_bp;
-       int yy_act;
+  yy_state_type yy_current_state;
+  char *yy_cp, *yy_bp;
+  int yy_act;
 
-       if ( !(yy_init) )
-               {
-               (yy_init) = 1;
+  if ( !(yy_init) )
+    {
+    (yy_init) = 1;
 
 #ifdef YY_USER_INIT
-               YY_USER_INIT;
+    YY_USER_INIT;
 #endif
 
-               if ( ! (yy_start) )
-                       (yy_start) = 1; /* first start state */
+    if ( ! (yy_start) )
+      (yy_start) = 1;  /* first start state */
 
-               if ( ! dax_in )
-                       dax_in = stdin;
+    if ( ! dax_in )
+      dax_in = stdin;
 
-               if ( ! dax_out )
-                       dax_out = stdout;
+    if ( ! dax_out )
+      dax_out = stdout;
 
-               if ( ! YY_CURRENT_BUFFER ) {
-                       dax_ensure_buffer_stack ();
-                       YY_CURRENT_BUFFER_LVALUE =
-                               dax__create_buffer(dax_in,YY_BUF_SIZE );
-               }
+    if ( ! YY_CURRENT_BUFFER ) {
+      dax_ensure_buffer_stack ();
+      YY_CURRENT_BUFFER_LVALUE =
+        dax__create_buffer(dax_in,YY_BUF_SIZE );
+    }
 
-               dax__load_buffer_state( );
-               }
+    dax__load_buffer_state( );
+    }
 
-       {
+  {
 
  /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
  SET(PROLOG);
@@ -1888,146 +1888,146 @@ YY_DECL
 
  /* COMMENTS and PIs: handled uniformly for efficiency. */
 
-       while ( 1 )             /* loops until end-of-file is reached */
-               {
-               yy_cp = (yy_c_buf_p);
+  while ( 1 )    /* loops until end-of-file is reached */
+    {
+    yy_cp = (yy_c_buf_p);
 
-               /* Support of dax_text. */
-               *yy_cp = (yy_hold_char);
+    /* Support of dax_text. */
+    *yy_cp = (yy_hold_char);
 
-               /* yy_bp points to the position in yy_ch_buf of the start of
-                * the current run.
-                */
-               yy_bp = yy_cp;
+    /* yy_bp points to the position in yy_ch_buf of the start of
+     * the current run.
+     */
+    yy_bp = yy_cp;
 
-               yy_current_state = (yy_start);
+    yy_current_state = (yy_start);
 yy_match:
-               do
-                       {
-                       YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
-                       if ( yy_accept[yy_current_state] )
-                               {
-                               (yy_last_accepting_state) = yy_current_state;
-                               (yy_last_accepting_cpos) = yy_cp;
-                               }
-                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                               {
-                               yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 775 )
-                                       yy_c = yy_meta[(unsigned int) yy_c];
-                               }
-                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-                       ++yy_cp;
-                       }
-               while ( yy_base[yy_current_state] != 2164 );
+    do
+      {
+      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+      if ( yy_accept[yy_current_state] )
+        {
+        (yy_last_accepting_state) = yy_current_state;
+        (yy_last_accepting_cpos) = yy_cp;
+        }
+      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+        {
+        yy_current_state = (int) yy_def[yy_current_state];
+        if ( yy_current_state >= 775 )
+          yy_c = yy_meta[(unsigned int) yy_c];
+        }
+      yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+      ++yy_cp;
+      }
+    while ( yy_base[yy_current_state] != 2164 );
 
 yy_find_action:
-               yy_act = yy_accept[yy_current_state];
-               if ( yy_act == 0 )
-                       { /* have to back up */
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       yy_act = yy_accept[yy_current_state];
-                       }
-
-               YY_DO_BEFORE_ACTION;
-
-               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-                       {
-                       yy_size_t yyl;
-                       for ( yyl = 0; yyl < dax_leng; ++yyl )
-                               if ( dax_text[yyl] == '\n' )
+    yy_act = yy_accept[yy_current_state];
+    if ( yy_act == 0 )
+      { /* have to back up */
+      yy_cp = (yy_last_accepting_cpos);
+      yy_current_state = (yy_last_accepting_state);
+      yy_act = yy_accept[yy_current_state];
+      }
+
+    YY_DO_BEFORE_ACTION;
+
+    if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+      {
+      yy_size_t yyl;
+      for ( yyl = 0; yyl < dax_leng; ++yyl )
+        if ( dax_text[yyl] == '\n' )
 
     dax_lineno++;
 ;
-                       }
+      }
 
-do_action:     /* This label is used only to access EOF actions. */
+do_action:  /* This label is used only to access EOF actions. */
 
-               switch ( yy_act )
-       { /* beginning of action switch */
-                       case 0: /* must back up */
-                       /* undo the effects of YY_DO_BEFORE_ACTION */
-                       *yy_cp = (yy_hold_char);
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       goto yy_find_action;
+    switch ( yy_act )
+  { /* beginning of action switch */
+      case 0: /* must back up */
+      /* undo the effects of YY_DO_BEFORE_ACTION */
+      *yy_cp = (yy_hold_char);
+      yy_cp = (yy_last_accepting_cpos);
+      yy_current_state = (yy_last_accepting_state);
+      goto yy_find_action;
 
 case 1:
 YY_RULE_SETUP
 ENTER(INCOMMENT);
-       YY_BREAK
+  YY_BREAK
 case 2:
 YY_RULE_SETUP
 ENTER(INPI);
-       YY_BREAK
+  YY_BREAK
 
 case 3:
 YY_RULE_SETUP
 LEAVE;
-       YY_BREAK
+  YY_BREAK
 case 4:
 case 5:
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
 SKIP;
-       YY_BREAK
+  YY_BREAK
 case YY_STATE_EOF(INCOMMENT):
 FAIL("EOF in comment.");
-       YY_BREAK
+  YY_BREAK
 
 case 7:
 YY_RULE_SETUP
 LEAVE;
-       YY_BREAK
+  YY_BREAK
 case 8:
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
 SKIP;
-       YY_BREAK
+  YY_BREAK
 case YY_STATE_EOF(INPI):
 FAIL("EOF in PI (processing instruction).");
-       YY_BREAK
+  YY_BREAK
 
 /* SPACES: skipped uniformly */
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
 SKIP;
-       YY_BREAK
+  YY_BREAK
 /* PROLOG: determine root element and process it. */
 
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
 SET(ROOT_dax__adag);
-       YY_BREAK
+  YY_BREAK
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
 FAIL("Bad declaration %s.",dax_text);
-       YY_BREAK
+  YY_BREAK
 
 case 13:
 /* rule 13 can match eol */
 YY_RULE_SETUP
 SET(ROOT_dax__adag);
-       YY_BREAK
+  YY_BREAK
 case 14:
 /* rule 14 can match eol */
 YY_RULE_SETUP
 FAIL("Bad declaration %s.",dax_text);
-       YY_BREAK
+  YY_BREAK
 case 15:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in prolog.", dax_text[0]);
-       YY_BREAK
+  YY_BREAK
 case YY_STATE_EOF(PROLOG):
 case YY_STATE_EOF(DOCTYPE):
 FAIL("EOF in prolog.");
-       YY_BREAK
+  YY_BREAK
 
 /* RULES DERIVED FROM DTD. */
 /* <!-- Small DTD for DAX files. -->  */
@@ -2035,7 +2035,7 @@ case 16:
 /* rule 16 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <adag> is not allowed here.");
-       YY_BREAK
+  YY_BREAK
 case 17:
 /* rule 17 can match eol */
 YY_RULE_SETUP
@@ -2062,114 +2062,114 @@ YY_RULE_SETUP
   dax__adag_childCount_isset = 0;
   ENTER(AL_dax__adag); pushbuffer(0);
   }
-       YY_BREAK
+  YY_BREAK
 
 case 18:
 /* rule 18 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in <dax__adag>");} dax__adag_xmlns_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns);
-       YY_BREAK
+  YY_BREAK
 case 19:
 /* rule 19 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in <dax__adag>");}  dax__adag_xmlns_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns);
-       YY_BREAK
+  YY_BREAK
 case 20:
 /* rule 20 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in <dax__adag>");} dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns_c_xsi);
-       YY_BREAK
+  YY_BREAK
 case 21:
 /* rule 21 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in <dax__adag>");}  dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns_c_xsi);
-       YY_BREAK
+  YY_BREAK
 case 22:
 /* rule 22 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in <dax__adag>");} dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation);
-       YY_BREAK
+  YY_BREAK
 case 23:
 /* rule 23 can match eol */
 YY_RULE_SETUP
 if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in <dax__adag>");}  dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation);
-       YY_BREAK
+  YY_BREAK
 case 24:
 /* rule 24 can match eol */
 YY_RULE_SETUP
 if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__adag>");} dax__adag_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_version);
-      &n