Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sed -i -e 's/\t/ /g' *.[ch] Please people, stop using tabs in your source
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 20 Jun 2012 09:30:00 +0000 (11:30 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 20 Jun 2012 09:30:00 +0000 (11:30 +0200)
149 files changed:
buildtools/Cmake/test_prog/prog_sem_open.c
doc/HelloWorld/HelloWorld.c
examples/msg/actions/actions.c
examples/msg/masterslave/masterslave_bypass.c
examples/msg/masterslave/masterslave_cluster.c
examples/msg/masterslave/masterslave_forwarder.c
examples/msg/mc/bugged1_for_liveness.c
examples/msg/mc/bugged1_while_liveness.c
examples/msg/mc/bugged2_liveness.c
examples/msg/mc/centralized_liveness.c
examples/msg/mc/centralized_liveness_deadlock.c
examples/msg/mc/lex.yy.c
examples/msg/ns3/ns3.c
examples/msg/pmm/msg_pmm.c
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_comm_throttling.c
examples/simdag/sd_seq_access.c
examples/simdag/sd_typed_tasks_test.c
examples/smpi/NAS/DT-folding/DGraph.c
examples/smpi/NAS/DT-folding/dt.c
examples/smpi/NAS/DT-trace/DGraph.c
examples/smpi/NAS/DT-trace/dt.c
examples/smpi/NAS/DT/DGraph.c
examples/smpi/NAS/DT/dt.c
examples/smpi/NAS/EP-sampling/ep.c
examples/smpi/NAS/EP-sampling/randlc.c
examples/smpi/NAS/EP-trace/ep-trace.c
examples/smpi/NAS/EP-trace/randlc.c
examples/smpi/NAS/EP/ep.c
examples/smpi/NAS/EP/randlc.c
examples/smpi/NAS/IS-trace/is-trace.c
examples/smpi/NAS/IS/is.c
examples/smpi/NAS/common/c_print_results.c
examples/smpi/NAS/common/randdp.c
examples/smpi/NAS/sys/setparams.c
examples/smpi/dsend.c
examples/xbt/sem_basic.c
examples/xbt/sem_sched.c
include/instr/jedule/jedule_events.h
include/instr/jedule/jedule_output.h
include/instr/jedule/jedule_platform.h
include/simdag/datatypes.h
include/simdag/simdag.h
include/simgrid/simix.h
include/surf/surf_routing.h
include/xbt/asserts.h
include/xbt/automatonparse_promela.h
include/xbt/datadesc.h
include/xbt/dynar.h
include/xbt/ex.h
include/xbt/log.h
include/xbt/misc.h
include/xbt/parmap.h
include/xbt/swag.h
include/xbt/time.h
src/gras/Msg/gras_msg_listener.c
src/gras/Msg/sg_msg.c
src/gras/Transport/sg_transport.c
src/include/surf/surf.h
src/include/surf/surfxml_parse_values.h
src/include/surf/trace_mgr.h
src/instr/instr_paje_trace.c
src/instr/jedule/jedule_events.c
src/instr/jedule/jedule_output.c
src/instr/jedule/jedule_platform.c
src/instr/jedule/jedule_sd_binding.c
src/mc/mc_checkpoint.c
src/mc/mc_dpor.c
src/mc/mc_global.c
src/mc/mc_liveness.c
src/mc/mc_request.c
src/msg/msg_actions.c
src/msg/msg_host.c
src/msg/msg_mailbox.h
src/msg/msg_private.h
src/msg/msg_process.c
src/msg/msg_vm.c
src/simdag/dax_dtd.c
src/simdag/private.h
src/simdag/sd_global.c
src/simdag/sd_link.c
src/simdag/sd_task.c
src/simdag/sd_workstation.c
src/simix/smx_context.c
src/simix/smx_context_sysv.c
src/simix/smx_deployment.c
src/simix/smx_environment.c
src/simix/smx_global.c
src/simix/smx_host.c
src/simix/smx_network.c
src/simix/smx_process.c
src/simix/smx_process_private.h
src/simix/smx_smurf.c
src/simix/smx_synchro.c
src/simix/smx_user.c
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_global.c
src/surf/cpu_ti.c
src/surf/lagrange.c
src/surf/maxmin.c
src/surf/network_gtnets.c
src/surf/network_ns3.c
src/surf/network_ns3_private.h
src/surf/ns3/ns3_interface.h
src/surf/ns3/ns3_simulator.h
src/surf/random_mgr.c
src/surf/simgrid_dtd.c
src/surf/surf.c
src/surf/surf_config.c
src/surf/surf_private.h
src/surf/surf_routing_cluster.c
src/surf/surf_routing_private.h
src/surf/surfxml_parse.c
src/surf/workstation_ptask_L07.c
src/win32/compiler/borland.h
src/win32/compiler/select_compiler_features.h
src/win32/compiler/visualc.h
src/win32/config.h
src/win32/platform/select_platform_features.h
src/xbt/RngStream.c
src/xbt/automaton/automaton_parse.yy.c
src/xbt/automaton/y.tab.c
src/xbt/datadesc/ddt_parse.yy.c
src/xbt/dynar.c
src/xbt/graphxml.c
src/xbt/heap.c
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_diff.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmorecore.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c
src/xbt/snprintf.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_main.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_str.c
teshsuite/simdag/platforms/Evaluate_get_route_time.c
teshsuite/simdag/platforms/Evaluate_parse_time.c
teshsuite/simdag/platforms/basic_parsing_test.c
teshsuite/simdag/platforms/flatifier.c
testsuite/xbt/graphxml_usage.c
tools/tesh/tesh.c
win32_test_app/include/TBuffer.h
win32_test_app/include/TDefs.h
win32_test_app/include/TErrno.h
win32_test_app/include/TTestCaseContext.h

index e9f0445..2295b0e 100644 (file)
@@ -16,9 +16,9 @@
 
 int main(void) {   
 #ifdef WIN32
-       int s;
+  int s;
 #else
-       sem_t * s;
+  sem_t * s;
 #endif
    s = sem_open("/0", O_CREAT, 0644, 10);
    if (s == SEM_FAILED){
index 1399ea9..ae6a7fb 100644 (file)
@@ -4,5 +4,5 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(HelloWorld,
                              "Messages specific for this Hello World example");
 void main()
 {
-       XBT_INFO("Hello World !!!");
+  XBT_INFO("Hello World !!!");
 }
index 6c63e71..6d73615 100644 (file)
@@ -296,105 +296,105 @@ static void action_barrier(const char *const *action)
 
 static void action_reduce(const char *const *action)
 {
-       int i;
-       char *reduce_identifier;
-       char mailbox[80];
-       double comm_size = parse_double(action[2]);
-       double comp_size = parse_double(action[3]);
-       m_task_t comp_task = NULL;
-       const char *process_name;
-       double clock = MSG_get_clock();
-
-       process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
-
-       xbt_assert(communicator_size, "Size of Communicator is not defined, "
-                       "can't use collective operations");
-
-       process_name = MSG_process_get_name(MSG_process_self());
-
-       reduce_identifier = bprintf("reduce_%d", counters->reduce_counter++);
-
-       if (!strcmp(process_name, "p0")) {
-               XBT_DEBUG("%s: %s is the Root", reduce_identifier, process_name);
-
-               msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
-           m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
-           for (i = 1; i < communicator_size; i++) {
-             sprintf(mailbox, "%s_p%d_p0", reduce_identifier, i);
-             comms[i-1] = MSG_task_irecv(&(tasks[i-1]),mailbox);
-           }
-           MSG_comm_waitall(comms,communicator_size-1,-1);
-           for (i = 1; i < communicator_size; i++) {
-               MSG_comm_destroy(comms[i-1]);
-               MSG_task_destroy(tasks[i-1]);
-           }
-           free(tasks);
-
-           comp_task = MSG_task_create("reduce_comp", comp_size, 0, NULL);
-           XBT_DEBUG("%s: computing 'reduce_comp'", reduce_identifier);
-           MSG_task_execute(comp_task);
-           MSG_task_destroy(comp_task);
-           XBT_DEBUG("%s: computed", reduce_identifier);
-
-       } else {
-               XBT_DEBUG("%s: %s sends", reduce_identifier, process_name);
-               sprintf(mailbox, "%s_%s_p0", reduce_identifier, process_name);
-           XBT_DEBUG("put on %s", mailbox);
-           MSG_task_send(MSG_task_create(reduce_identifier, 0, comm_size, NULL),
-                         mailbox);
-       }
-
-       XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
-       free(reduce_identifier);
+  int i;
+  char *reduce_identifier;
+  char mailbox[80];
+  double comm_size = parse_double(action[2]);
+  double comp_size = parse_double(action[3]);
+  m_task_t comp_task = NULL;
+  const char *process_name;
+  double clock = MSG_get_clock();
+
+  process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
+
+  xbt_assert(communicator_size, "Size of Communicator is not defined, "
+      "can't use collective operations");
+
+  process_name = MSG_process_get_name(MSG_process_self());
+
+  reduce_identifier = bprintf("reduce_%d", counters->reduce_counter++);
+
+  if (!strcmp(process_name, "p0")) {
+    XBT_DEBUG("%s: %s is the Root", reduce_identifier, process_name);
+
+    msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
+      m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
+      for (i = 1; i < communicator_size; i++) {
+        sprintf(mailbox, "%s_p%d_p0", reduce_identifier, i);
+        comms[i-1] = MSG_task_irecv(&(tasks[i-1]),mailbox);
+      }
+      MSG_comm_waitall(comms,communicator_size-1,-1);
+      for (i = 1; i < communicator_size; i++) {
+        MSG_comm_destroy(comms[i-1]);
+        MSG_task_destroy(tasks[i-1]);
+      }
+      free(tasks);
+
+      comp_task = MSG_task_create("reduce_comp", comp_size, 0, NULL);
+      XBT_DEBUG("%s: computing 'reduce_comp'", reduce_identifier);
+      MSG_task_execute(comp_task);
+      MSG_task_destroy(comp_task);
+      XBT_DEBUG("%s: computed", reduce_identifier);
+
+  } else {
+    XBT_DEBUG("%s: %s sends", reduce_identifier, process_name);
+    sprintf(mailbox, "%s_%s_p0", reduce_identifier, process_name);
+      XBT_DEBUG("put on %s", mailbox);
+      MSG_task_send(MSG_task_create(reduce_identifier, 0, comm_size, NULL),
+                    mailbox);
+  }
+
+  XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+  free(reduce_identifier);
 }
 
 static void action_bcast(const char *const *action)
 {
-       int i;
-       char *bcast_identifier;
-       char mailbox[80];
-       double comm_size = parse_double(action[2]);
-       m_task_t task = NULL;
-       const char *process_name;
-       double clock = MSG_get_clock();
-
-       process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
-
-       xbt_assert(communicator_size, "Size of Communicator is not defined, "
-                       "can't use collective operations");
-
-       process_name = MSG_process_get_name(MSG_process_self());
-
-       bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++);
-
-       if (!strcmp(process_name, "p0")) {
-               XBT_DEBUG("%s: %s is the Root", bcast_identifier, process_name);
-
-           msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
-
-           for (i = 1; i < communicator_size; i++) {
-             sprintf(mailbox, "%s_p0_p%d", bcast_identifier, i);
-             comms[i-1] =
-                 MSG_task_isend(MSG_task_create(mailbox,0,comm_size,NULL),
-                     mailbox);
-           }
-           MSG_comm_waitall(comms,communicator_size-1,-1);
-               for (i = 1; i < communicator_size; i++)
-              MSG_comm_destroy(comms[i-1]);
-           free(comms);
-
-           XBT_DEBUG("%s: all messages sent by %s have been received",
-                  bcast_identifier, process_name);
-
-       } else {
-           sprintf(mailbox, "%s_p0_%s", bcast_identifier, process_name);
-           MSG_task_receive(&task, mailbox);
-           MSG_task_destroy(task);
-           XBT_DEBUG("%s: %s has received", bcast_identifier, process_name);
-       }
-
-       XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
-       free(bcast_identifier);
+  int i;
+  char *bcast_identifier;
+  char mailbox[80];
+  double comm_size = parse_double(action[2]);
+  m_task_t task = NULL;
+  const char *process_name;
+  double clock = MSG_get_clock();
+
+  process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
+
+  xbt_assert(communicator_size, "Size of Communicator is not defined, "
+      "can't use collective operations");
+
+  process_name = MSG_process_get_name(MSG_process_self());
+
+  bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++);
+
+  if (!strcmp(process_name, "p0")) {
+    XBT_DEBUG("%s: %s is the Root", bcast_identifier, process_name);
+
+      msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
+
+      for (i = 1; i < communicator_size; i++) {
+        sprintf(mailbox, "%s_p0_p%d", bcast_identifier, i);
+        comms[i-1] =
+            MSG_task_isend(MSG_task_create(mailbox,0,comm_size,NULL),
+                mailbox);
+      }
+      MSG_comm_waitall(comms,communicator_size-1,-1);
+    for (i = 1; i < communicator_size; i++)
+         MSG_comm_destroy(comms[i-1]);
+      free(comms);
+
+      XBT_DEBUG("%s: all messages sent by %s have been received",
+             bcast_identifier, process_name);
+
+  } else {
+      sprintf(mailbox, "%s_p0_%s", bcast_identifier, process_name);
+      MSG_task_receive(&task, mailbox);
+      MSG_task_destroy(task);
+      XBT_DEBUG("%s: %s has received", bcast_identifier, process_name);
+  }
+
+  XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+  free(bcast_identifier);
 }
 
 
index 343c92f..b600d07 100644 (file)
@@ -72,7 +72,7 @@ static int surf_parse_bypass_platform(void)
   SURFXML_BUFFER_SET(route_dst, "host B");
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
   SURFXML_START_TAG(route);
-  XBT_DEBUG("  <link:ctn id=\"LinkA\"/>");
+  XBT_DEBUG("  <link:ctn id=\"LinkA\"/>");
   SURFXML_BUFFER_SET(link_ctn_id, "LinkA");
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   SURFXML_START_TAG(link_ctn);
@@ -220,7 +220,7 @@ int master(int argc, char *argv[])
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++)
     MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
-               MSG_host_get_name(slaves[i]));
+        MSG_host_get_name(slaves[i]));
 
   XBT_INFO("Goodbye now!");
   free(slaves);
index 1e54f5e..e45876f 100644 (file)
@@ -90,7 +90,7 @@ int master(int argc, char *argv[])
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++)
     MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
-               MSG_host_get_name(slaves[i]));
+        MSG_host_get_name(slaves[i]));
 
   XBT_INFO("Goodbye now!");
   free(slaves);
@@ -119,7 +119,7 @@ int slave(int argc, char *argv[])
     } else {
       XBT_INFO("Hey ?! What's up ? ");
       xbt_die("Unexpected behavior");
-                                   }
+            }
   }
   XBT_INFO("I'm done. See you!");
   return 0;
@@ -129,101 +129,101 @@ int slave(int argc, char *argv[])
 /** Bypass deployment **/
 static int bypass_deployment(void)
 {
-       int nb_host,i;
-       static int AX_ptr;
-       static int surfxml_bufferstack_size = 2048;
-       static int surfxml_buffer_stack_stack_ptr = 0;
-       static int surfxml_buffer_stack_stack[1024];
-       xbt_dynar_t hosts = MSG_hosts_as_dynar();
-       /* allocating memory to the buffer, I think 2MB should be enough */
-       surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
-
-       nb_host = xbt_dynar_length(hosts);
-       xbt_dynar_free(&hosts);
-
-       /* <platform> */
-       SURFXML_BUFFER_SET(platform_version, "3");
-       SURFXML_START_TAG(platform);
-       XBT_DEBUG("<platform version=\"3\">");
-
-         XBT_DEBUG("   <process host=\"c-0.me\" function=\"master\">");
-         SURFXML_BUFFER_SET(process_host, "c-0.me");
-         SURFXML_BUFFER_SET(process_function, "master");
-         SURFXML_BUFFER_SET(process_start_time, "-1.0");
-         SURFXML_BUFFER_SET(process_kill_time, "-1.0");
-         SURFXML_START_TAG(process);
-
-         XBT_DEBUG("           <argument value=\"%s\"/>",bprintf("%d",nb_host-1));
-         SURFXML_BUFFER_SET(argument_value, bprintf("%d",nb_host-1));
-         SURFXML_START_TAG(argument);
-         SURFXML_END_TAG(argument);
-
-         XBT_DEBUG("           <argument value=\"5000000\"/>");
-         SURFXML_BUFFER_SET(argument_value, "5000000");
-         SURFXML_START_TAG(argument);
-         SURFXML_END_TAG(argument);
-
-         XBT_DEBUG("           <argument value=\"100000\"/>");
-         SURFXML_BUFFER_SET(argument_value, "100000");
-         SURFXML_START_TAG(argument);
-         SURFXML_END_TAG(argument);
-
-       for(i=1 ; i<nb_host ; i++)
-       {
-         XBT_DEBUG("           <argument value=\"%s.me\"/>",bprintf("c-%d",i));
-         SURFXML_BUFFER_SET(argument_value, bprintf("c-%d.me",i));
-         SURFXML_START_TAG(argument);
-         SURFXML_END_TAG(argument);
-       }
-       XBT_DEBUG("     </process>");
-       SURFXML_END_TAG(process);
-
-       for(i=1 ; i<nb_host ; i++)
-       {
-         XBT_DEBUG("   <process host=\"%s.me\" function=\"slave\"/>",bprintf("c-%d",i));
-         SURFXML_BUFFER_SET(process_host, bprintf("c-%d.me",i));
-         SURFXML_BUFFER_SET(process_function, "slave");
-         SURFXML_BUFFER_SET(process_start_time, "-1.0");
-         SURFXML_BUFFER_SET(process_kill_time, "-1.0");
-         SURFXML_START_TAG(process);
-         SURFXML_END_TAG(process);
-       }
-
-       XBT_DEBUG("</platform>");
-       SURFXML_END_TAG(platform);
-
-       free(surfxml_bufferstack);
-       return 0;
+  int nb_host,i;
+  static int AX_ptr;
+  static int surfxml_bufferstack_size = 2048;
+  static int surfxml_buffer_stack_stack_ptr = 0;
+  static int surfxml_buffer_stack_stack[1024];
+  xbt_dynar_t hosts = MSG_hosts_as_dynar();
+  /* allocating memory to the buffer, I think 2MB should be enough */
+  surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
+
+  nb_host = xbt_dynar_length(hosts);
+  xbt_dynar_free(&hosts);
+
+  /* <platform> */
+  SURFXML_BUFFER_SET(platform_version, "3");
+  SURFXML_START_TAG(platform);
+  XBT_DEBUG("<platform version=\"3\">");
+
+    XBT_DEBUG("  <process host=\"c-0.me\" function=\"master\">");
+    SURFXML_BUFFER_SET(process_host, "c-0.me");
+    SURFXML_BUFFER_SET(process_function, "master");
+    SURFXML_BUFFER_SET(process_start_time, "-1.0");
+    SURFXML_BUFFER_SET(process_kill_time, "-1.0");
+    SURFXML_START_TAG(process);
+
+    XBT_DEBUG("    <argument value=\"%s\"/>",bprintf("%d",nb_host-1));
+    SURFXML_BUFFER_SET(argument_value, bprintf("%d",nb_host-1));
+    SURFXML_START_TAG(argument);
+    SURFXML_END_TAG(argument);
+
+    XBT_DEBUG("    <argument value=\"5000000\"/>");
+    SURFXML_BUFFER_SET(argument_value, "5000000");
+    SURFXML_START_TAG(argument);
+    SURFXML_END_TAG(argument);
+
+    XBT_DEBUG("    <argument value=\"100000\"/>");
+    SURFXML_BUFFER_SET(argument_value, "100000");
+    SURFXML_START_TAG(argument);
+    SURFXML_END_TAG(argument);
+
+  for(i=1 ; i<nb_host ; i++)
+  {
+    XBT_DEBUG("    <argument value=\"%s.me\"/>",bprintf("c-%d",i));
+    SURFXML_BUFFER_SET(argument_value, bprintf("c-%d.me",i));
+    SURFXML_START_TAG(argument);
+    SURFXML_END_TAG(argument);
+  }
+  XBT_DEBUG("  </process>");
+  SURFXML_END_TAG(process);
+
+  for(i=1 ; i<nb_host ; i++)
+  {
+    XBT_DEBUG("  <process host=\"%s.me\" function=\"slave\"/>",bprintf("c-%d",i));
+    SURFXML_BUFFER_SET(process_host, bprintf("c-%d.me",i));
+    SURFXML_BUFFER_SET(process_function, "slave");
+    SURFXML_BUFFER_SET(process_start_time, "-1.0");
+    SURFXML_BUFFER_SET(process_kill_time, "-1.0");
+    SURFXML_START_TAG(process);
+    SURFXML_END_TAG(process);
+  }
+
+  XBT_DEBUG("</platform>");
+  SURFXML_END_TAG(platform);
+
+  free(surfxml_bufferstack);
+  return 0;
 }
 
 /** Test function */
 MSG_error_t test_all(const char *platform_file)
 {
-       MSG_error_t res = MSG_OK;
-       MSG_create_environment(platform_file);
-       MSG_function_register("master", master);
-       MSG_function_register("slave", slave);
-       surf_parse = bypass_deployment;
-       MSG_launch_application(NULL);
+  MSG_error_t res = MSG_OK;
+  MSG_create_environment(platform_file);
+  MSG_function_register("master", master);
+  MSG_function_register("slave", slave);
+  surf_parse = bypass_deployment;
+  MSG_launch_application(NULL);
 
-       res = MSG_main();
+  res = MSG_main();
 
-       XBT_INFO("Simulation time %g", MSG_get_clock());
-       return res;
+  XBT_INFO("Simulation time %g", MSG_get_clock());
+  return res;
 }                               /* end_of_test_all */
 
 
 /** Main function */
 int main(int argc, char *argv[])
 {
-       MSG_error_t res = MSG_OK;
+  MSG_error_t res = MSG_OK;
 
-       MSG_global_init(&argc, argv);
-       res = test_all(argv[1]);
-       MSG_clean();
+  MSG_global_init(&argc, argv);
+  res = test_all(argv[1]);
+  MSG_clean();
 
-       if (res == MSG_OK)
-               return 0;
-       else
-               return 1;
+  if (res == MSG_OK)
+    return 0;
+  else
+    return 1;
 }                               /* end_of_main */
index 4ebb580..3e3560e 100644 (file)
@@ -160,7 +160,7 @@ int forwarder(int argc, char *argv[])
             ("All tasks have been dispatched. Let's tell everybody the computation is over.");
         for (i = 0; i < slaves_count; i++)
           MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
-                         MSG_host_get_name(slaves[i]));
+              MSG_host_get_name(slaves[i]));
         MSG_task_destroy(task);
         break;
       }
index 10cda7e..0a5983d 100644 (file)
@@ -42,28 +42,28 @@ int coordinator(int argc, char *argv[])
         XBT_INFO("CS already used. Queue the request of client %d", atoi(req) +1);
         xbt_dynar_push(requests, &req);
       } else {                  // can serve it immediatly
-       if(strcmp(req, "2") == 0){
-         m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
-         MSG_task_send(answer, req);
-         CS_used = 1;
-         XBT_INFO("CS idle. Grant immediatly");
-       }
+  if(strcmp(req, "2") == 0){
+    m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
+    MSG_task_send(answer, req);
+    CS_used = 1;
+    XBT_INFO("CS idle. Grant immediatly");
+  }
       }
     } else {                    // that's a release. Check if someone was waiting for the lock
       if (xbt_dynar_length(requests) > 0) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
         char *req ;
-       xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
-       if(strcmp(req, "2") == 0){
-         xbt_dynar_pop(requests, &req);
-         MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
-         todo--;
-       }else{
-         xbt_dynar_pop(requests, &req);
-         MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
-         CS_used = 0;
-         todo--;
-       }
+  xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
+  if(strcmp(req, "2") == 0){
+    xbt_dynar_pop(requests, &req);
+    MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+    todo--;
+  }else{
+    xbt_dynar_pop(requests, &req);
+    MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
+    CS_used = 0;
+    todo--;
+  }
       } else {                  // nobody wants it
         XBT_INFO("CS release. resource now idle");
         CS_used = 0;
index 23ddc73..f26749c 100644 (file)
@@ -37,26 +37,26 @@ int coordinator(int argc, char *argv[])
         XBT_INFO("CS already used. Queue the request of client %d", atoi(req) +1);
         xbt_dynar_push(requests, &req);
       } else {                  // can serve it immediatly
-       if(strcmp(req, "2") == 0){
-         m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
-         MSG_task_send(answer, req);
-         CS_used = 1;
-         XBT_INFO("CS idle. Grant immediatly");
-       }
+  if(strcmp(req, "2") == 0){
+    m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
+    MSG_task_send(answer, req);
+    CS_used = 1;
+    XBT_INFO("CS idle. Grant immediatly");
+  }
       }
     } else {                    // that's a release. Check if someone was waiting for the lock
       if (xbt_dynar_length(requests) > 0) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
         char *req ;
-       xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
-       if(strcmp(req, "2") == 0){
-         xbt_dynar_pop(requests, &req);
-         MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
-       }else{
-         xbt_dynar_pop(requests, &req);
-         MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
-         CS_used = 0;
-       }
+  xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
+  if(strcmp(req, "2") == 0){
+    xbt_dynar_pop(requests, &req);
+    MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+  }else{
+    xbt_dynar_pop(requests, &req);
+    MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
+    CS_used = 0;
+  }
       } else {                  // nobody wants it
         XBT_INFO("CS release. resource now idle");
         CS_used = 0;
index 09ec963..5a2dd19 100644 (file)
@@ -46,23 +46,23 @@ int coordinator(int argc, char *argv[])
     if (!strcmp(kind, "request")) {
       char *req = MSG_task_get_data(task);
       if (CS_used) {
-       XBT_INFO("CS already used. Queue the request");
-       xbt_dynar_push(requests, &req);
+  XBT_INFO("CS already used. Queue the request");
+  xbt_dynar_push(requests, &req);
       } else {
-       m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
-       MSG_task_send(answer, req);
-       CS_used = 1;
-       XBT_INFO("CS idle. Grant immediatly");
+  m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
+  MSG_task_send(answer, req);
+  CS_used = 1;
+  XBT_INFO("CS idle. Grant immediatly");
       }
     } else {
       if (xbt_dynar_length(requests) > 0) {
-       XBT_INFO("CS release. Grant to queued requests");
-       char *req;
-       xbt_dynar_pop(requests, &req);
-       MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+  XBT_INFO("CS release. Grant to queued requests");
+  char *req;
+  xbt_dynar_pop(requests, &req);
+  MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
       } else {
-       XBT_INFO("CS_realase, ressource now idle");
-       CS_used = 0;
+  XBT_INFO("CS_realase, ressource now idle");
+  CS_used = 0;
       }
     }
 
index b1438e2..395d4c2 100644 (file)
@@ -1,6 +1,6 @@
 /***************** Centralized Mutual Exclusion Algorithm *********************/
 /* This example implements a centralized mutual exclusion algorithm.          */
-/* LTL property checked : !(GFcs)                                                                                                                                                      */
+/* LTL property checked : !(GFcs)                                            */
 /******************************************************************************/
 
 #include "msg/msg.h"
@@ -32,7 +32,7 @@ int coordinator(int argc, char *argv[])
       char *req = MSG_task_get_data(task);
       if (CS_used) { 
         XBT_INFO("CS already used.");
-       m_task_t answer = MSG_task_create("not grant", 0, 1000, NULL);
+  m_task_t answer = MSG_task_create("not grant", 0, 1000, NULL);
         MSG_task_send(answer, req);
       } else {                  // can serve it immediatly
         XBT_INFO("CS idle. Grant immediatly");
@@ -72,15 +72,15 @@ int client(int argc, char *argv[])
       XBT_INFO("Client (%s) got the answer (grant). Sleep a bit and release it", my_mailbox);
 
       if(!strcmp(my_mailbox, "1"))
-       cs = 1;
+  cs = 1;
 
       /*MSG_process_sleep(my_pid);
       MSG_task_send(MSG_task_create("release", 0, 1000, NULL),
-                   "coordinator");
-                   XBT_INFO("Client (%s) releases the CS", my_mailbox);
+        "coordinator");
+        XBT_INFO("Client (%s) releases the CS", my_mailbox);
       
       if(!strcmp(my_mailbox, "1"))
-       cs = 0;*/
+  cs = 0;*/
       
     }else{
       
index e58364e..d73624f 100644 (file)
@@ -1,6 +1,6 @@
 /***************** Centralized Mutual Exclusion Algorithm *********************/
 /* This example implements a centralized mutual exclusion algorithm.          */
-/* LTL property checked : !(GFcs)                                                                                                                                                      */
+/* LTL property checked : !(GFcs)                                            */
 /******************************************************************************/
 
 #include "msg/msg.h"
index 78d7703..d90a4cf 100644 (file)
@@ -92,15 +92,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
@@ -173,17 +173,17 @@ extern FILE *yyin, *yyout;
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
+  do \
+    { \
+    /* Undo effects of setting up yytext. */ \
         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 yytext 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 yytext again */ \
+    } \
+  while ( 0 )
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
@@ -195,66 +195,66 @@ typedef size_t yy_size_t;
 #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.
-        */
-       int 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.
+   */
+  int 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 yyrestart()), so that the user can continue scanning by
-        * just pointing yyin 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 yyrestart()), so that the user can continue scanning by
+   * just pointing yyin at a new input file.
+   */
 #define YY_BUFFER_EOF_PENDING 2
 
-       };
+  };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* Stack of input buffers. */
@@ -279,13 +279,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-static int yy_n_chars;         /* number of characters read into yy_ch_buf */
+static int yy_n_chars;    /* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* 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 yywrap()'s to do buffer switches
  * instead of setting up a fresh yyin.  A bit of a hack ...
@@ -317,24 +317,24 @@ void yyfree (void *  );
 #define yy_new_buffer yy_create_buffer
 
 #define yy_set_interactive(is_interactive) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){ \
+  { \
+  if ( ! YY_CURRENT_BUFFER ){ \
         yyensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
+    YY_CURRENT_BUFFER_LVALUE =    \
             yy_create_buffer(yyin,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 ){\
         yyensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
+    YY_CURRENT_BUFFER_LVALUE =    \
             yy_create_buffer(yyin,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)
 
@@ -365,21 +365,21 @@ static void yy_fatal_error (yyconst char msg[]  );
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
-       (yytext_ptr) = yy_bp; \
-       yyleng = (size_t) (yy_cp - yy_bp); \
-       (yy_hold_char) = *yy_cp; \
-       *yy_cp = '\0'; \
-       (yy_c_buf_p) = yy_cp;
+  (yytext_ptr) = yy_bp; \
+  yyleng = (size_t) (yy_cp - yy_bp); \
+  (yy_hold_char) = *yy_cp; \
+  *yy_cp = '\0'; \
+  (yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 25
 #define YY_END_OF_BUFFER 26
 /* 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[54] =
     {   0,
         0,    0,   26,   24,   18,   23,    8,   24,   24,    9,
@@ -612,33 +612,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( yyin )) != EOF && c != '\n'; ++n ) \
-                       buf[n] = (char) c; \
-               if ( c == '\n' ) \
-                       buf[n++] = (char) c; \
-               if ( c == EOF && ferror( yyin ) ) \
-                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
-               result = n; \
-               } \
-       else \
-               { \
-               errno=0; \
-               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-                       { \
-                       if( errno != EINTR) \
-                               { \
-                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                               break; \
-                               } \
-                       errno=0; \
-                       clearerr(yyin); \
-                       } \
-               }\
+  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+    { \
+    int c = '*'; \
+    size_t n; \
+    for ( n = 0; n < max_size && \
+           (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+      buf[n] = (char) c; \
+    if ( c == '\n' ) \
+      buf[n++] = (char) c; \
+    if ( c == EOF && ferror( yyin ) ) \
+      YY_FATAL_ERROR( "input in flex scanner failed" ); \
+    result = n; \
+    } \
+  else \
+    { \
+    errno=0; \
+    while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+      { \
+      if( errno != EINTR) \
+        { \
+        YY_FATAL_ERROR( "input in flex scanner failed" ); \
+        break; \
+        } \
+      errno=0; \
+      clearerr(yyin); \
+      } \
+    }\
 \
 
 #endif
@@ -687,208 +687,208 @@ extern int yylex (void);
 #endif
 
 #define YY_RULE_SETUP \
-       YY_USER_ACTION
+  YY_USER_ACTION
 
 /** The main scanner function which does all the work.
  */
 YY_DECL
 {
-       register yy_state_type yy_current_state;
-       register char *yy_cp, *yy_bp;
-       register int yy_act;
+  register yy_state_type yy_current_state;
+  register char *yy_cp, *yy_bp;
+  register int yy_act;
     
 #line 29 "parserPromela.lex"
 
 
 #line 704 "lex.yy.c"
 
-       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 ( ! yyin )
-                       yyin = stdin;
+    if ( ! yyin )
+      yyin = stdin;
 
-               if ( ! yyout )
-                       yyout = stdout;
+    if ( ! yyout )
+      yyout = stdout;
 
-               if ( ! YY_CURRENT_BUFFER ) {
-                       yyensure_buffer_stack ();
-                       YY_CURRENT_BUFFER_LVALUE =
-                               yy_create_buffer(yyin,YY_BUF_SIZE );
-               }
+    if ( ! YY_CURRENT_BUFFER ) {
+      yyensure_buffer_stack ();
+      YY_CURRENT_BUFFER_LVALUE =
+        yy_create_buffer(yyin,YY_BUF_SIZE );
+    }
 
-               yy_load_buffer_state( );
-               }
+    yy_load_buffer_state( );
+    }
 
-       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 yytext. */
-               *yy_cp = (yy_hold_char);
+    /* Support of yytext. */
+    *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
-                       {
-                       register 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 >= 54 )
-                                       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] != 90 );
+    do
+      {
+      register 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 >= 54 )
+          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] != 90 );
 
 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;
-
-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;
+    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;
+
+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;
 
 case 1:
 YY_RULE_SETUP
 #line 31 "parserPromela.lex"
 { printf("%s", yytext); return (NEVER); }
-       YY_BREAK
+  YY_BREAK
 case 2:
 YY_RULE_SETUP
 #line 32 "parserPromela.lex"
 { printf("%s", yytext); return (IF); }
-       YY_BREAK
+  YY_BREAK
 case 3:
 YY_RULE_SETUP
 #line 33 "parserPromela.lex"
 { printf("%s", yytext); 
                return (FI); }
-       YY_BREAK
+  YY_BREAK
 case 4:
 YY_RULE_SETUP
 #line 35 "parserPromela.lex"
 { printf("%s", yytext); return (IMPLIES); }
-       YY_BREAK
+  YY_BREAK
 case 5:
 YY_RULE_SETUP
 #line 36 "parserPromela.lex"
 { printf("%s", yytext); return (GOTO); }
-       YY_BREAK
+  YY_BREAK
 case 6:
 YY_RULE_SETUP
 #line 37 "parserPromela.lex"
 { printf("%s", yytext); return (AND); }
-       YY_BREAK
+  YY_BREAK
 case 7:
 YY_RULE_SETUP
 #line 38 "parserPromela.lex"
 { printf("%s", yytext); return (OR); }
-       YY_BREAK
+  YY_BREAK
 case 8:
 YY_RULE_SETUP
 #line 39 "parserPromela.lex"
 { printf("%s", yytext); return (NOT); }
-       YY_BREAK
+  YY_BREAK
 case 9:
 YY_RULE_SETUP
 #line 40 "parserPromela.lex"
 { printf("%s", yytext); return (LEFT_PAR); }
-       YY_BREAK
+  YY_BREAK
 case 10:
 YY_RULE_SETUP
 #line 41 "parserPromela.lex"
 { printf("%s", yytext); return (RIGHT_PAR); }
-       YY_BREAK
+  YY_BREAK
 case 11:
 YY_RULE_SETUP
 #line 42 "parserPromela.lex"
 { printf("%s", yytext); return (CASE); }
-       YY_BREAK
+  YY_BREAK
 case 12:
 YY_RULE_SETUP
 #line 43 "parserPromela.lex"
 { printf("%s", yytext); return (COLON); }
-       YY_BREAK
+  YY_BREAK
 case 13:
 YY_RULE_SETUP
 #line 44 "parserPromela.lex"
 { printf("%s", yytext); return (SEMI_COLON); }
-       YY_BREAK
+  YY_BREAK
 case 14:
 YY_RULE_SETUP
 #line 45 "parserPromela.lex"
 { printf("%s", yytext); return (CASE_TRUE); }
-       YY_BREAK
+  YY_BREAK
 case 15:
 YY_RULE_SETUP
 #line 46 "parserPromela.lex"
 { printf("%s", yytext); return (LEFT_BRACE); }
-       YY_BREAK
+  YY_BREAK
 case 16:
 YY_RULE_SETUP
 #line 47 "parserPromela.lex"
 { printf("%s", yytext); return (RIGHT_BRACE); }
-       YY_BREAK
+  YY_BREAK
 case 17:
 /* rule 17 can match eol */
 YY_RULE_SETUP
 #line 50 "parserPromela.lex"
 { printf(" ");}
-       YY_BREAK
+  YY_BREAK
 case 18:
 YY_RULE_SETUP
 #line 52 "parserPromela.lex"
 { printf("%s",yytext); }
-       YY_BREAK
+  YY_BREAK
 case 19:
 YY_RULE_SETUP
 #line 55 "parserPromela.lex"
 { printf("%s",yytext); 
                             sscanf(yytext,"%lf",&yylval.real); 
                             return (LITT_REEL); }
-       YY_BREAK
+  YY_BREAK
 case 20:
 YY_RULE_SETUP
 #line 59 "parserPromela.lex"
 { printf("%s",yytext); 
                             sscanf(yytext,"%d",&yylval.integer); 
                             return (LITT_ENT); }
-       YY_BREAK
+  YY_BREAK
 case 21:
 /* rule 21 can match eol */
 YY_RULE_SETUP
@@ -897,395 +897,395 @@ YY_RULE_SETUP
                             yylval.string=(char *)malloc(strlen(yytext)+1);
                             sscanf(yytext,"%s",yylval.string); 
                             return (LITT_CHAINE); }
-       YY_BREAK
+  YY_BREAK
 case 22:
 YY_RULE_SETUP
 #line 68 "parserPromela.lex"
 { printf("%s",yytext); 
-                           yylval.string=(char *)malloc(strlen(yytext)+1);
-                           sscanf(yytext,"%s",yylval.string);
-                           return (ID); }
-       YY_BREAK
+          yylval.string=(char *)malloc(strlen(yytext)+1);
+          sscanf(yytext,"%s",yylval.string);
+          return (ID); }
+  YY_BREAK
 case 23:
 /* rule 23 can match eol */
 YY_RULE_SETUP
 #line 73 "parserPromela.lex"
 { printf("\n"); }
-       YY_BREAK
+  YY_BREAK
 case 24:
 YY_RULE_SETUP
 #line 75 "parserPromela.lex"
 { printf("caractère inconnu\n"); }
-       YY_BREAK
+  YY_BREAK
 case 25:
 YY_RULE_SETUP
 #line 77 "parserPromela.lex"
 ECHO;
-       YY_BREAK
+  YY_BREAK
 #line 926 "lex.yy.c"
 case YY_STATE_EOF(INITIAL):
-       yyterminate();
-
-       case YY_END_OF_BUFFER:
-               {
-               /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-               /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = (yy_hold_char);
-               YY_RESTORE_YY_MORE_OFFSET
-
-               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-                       {
-                       /* We're scanning a new file or input source.  It's
-                        * possible that this happened because the user
-                        * just pointed yyin at a new source and called
-                        * yylex().  If so, then we have to assure
-                        * consistency between YY_CURRENT_BUFFER and our
-                        * globals.  Here is the right place to do so, because
-                        * this is the first action (other than possibly a
-                        * back-up) that will match for the new input source.
-                        */
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                       }
-
-               /* Note that here we test for yy_c_buf_p "<=" to the position
-                * of the first EOB in the buffer, since yy_c_buf_p will
-                * already have been incremented past the NUL character
-                * (since all states make transitions on EOB to the
-                * end-of-buffer state).  Contrast this with the test
-                * in input().
-                */
-               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       { /* This was really a NUL. */
-                       yy_state_type yy_next_state;
-
-                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-                       yy_current_state = yy_get_previous_state(  );
-
-                       /* Okay, we're now positioned to make the NUL
-                        * transition.  We couldn't have
-                        * yy_get_previous_state() go ahead and do it
-                        * for us because it doesn't know how to deal
-                        * with the possibility of jamming (and we don't
-                        * want to build jamming into it because then it
-                        * will run more slowly).
-                        */
-
-                       yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-                       if ( yy_next_state )
-                               {
-                               /* Consume the NUL. */
-                               yy_cp = ++(yy_c_buf_p);
-                               yy_current_state = yy_next_state;
-                               goto yy_match;
-                               }
-
-                       else
-                               {
-                               yy_cp = (yy_c_buf_p);
-                               goto yy_find_action;
-                               }
-                       }
-
-               else switch ( yy_get_next_buffer(  ) )
-                       {
-                       case EOB_ACT_END_OF_FILE:
-                               {
-                               (yy_did_buffer_switch_on_eof) = 0;
-
-                               if ( yywrap( ) )
-                                       {
-                                       /* Note: because we've taken care in
-                                        * yy_get_next_buffer() to have set up
-                                        * yytext, we can now set up
-                                        * yy_c_buf_p so that if some total
-                                        * hoser (like flex itself) wants to
-                                        * call the scanner after we return the
-                                        * YY_NULL, it'll still work - another
-                                        * YY_NULL will get returned.
-                                        */
-                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-                                       yy_act = YY_STATE_EOF(YY_START);
-                                       goto do_action;
-                                       }
-
-                               else
-                                       {
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-                                       }
-                               break;
-                               }
-
-                       case EOB_ACT_CONTINUE_SCAN:
-                               (yy_c_buf_p) =
-                                       (yytext_ptr) + yy_amount_of_matched_text;
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_match;
-
-                       case EOB_ACT_LAST_MATCH:
-                               (yy_c_buf_p) =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_find_action;
-                       }
-               break;
-               }
-
-       default:
-               YY_FATAL_ERROR(
-                       "fatal flex scanner internal error--no action found" );
-       } /* end of action switch */
-               } /* end of scanning one token */
+  yyterminate();
+
+  case YY_END_OF_BUFFER:
+    {
+    /* Amount of text matched not including the EOB char. */
+    int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+    /* Undo the effects of YY_DO_BEFORE_ACTION. */
+    *yy_cp = (yy_hold_char);
+    YY_RESTORE_YY_MORE_OFFSET
+
+    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+      {
+      /* We're scanning a new file or input source.  It's
+       * possible that this happened because the user
+       * just pointed yyin at a new source and called
+       * yylex().  If so, then we have to assure
+       * consistency between YY_CURRENT_BUFFER and our
+       * globals.  Here is the right place to do so, because
+       * this is the first action (other than possibly a
+       * back-up) that will match for the new input source.
+       */
+      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+      }
+
+    /* Note that here we test for yy_c_buf_p "<=" to the position
+     * of the first EOB in the buffer, since yy_c_buf_p will
+     * already have been incremented past the NUL character
+     * (since all states make transitions on EOB to the
+     * end-of-buffer state).  Contrast this with the test
+     * in input().
+     */
+    if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+      { /* This was really a NUL. */
+      yy_state_type yy_next_state;
+
+      (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+      yy_current_state = yy_get_previous_state(  );
+
+      /* Okay, we're now positioned to make the NUL
+       * transition.  We couldn't have
+       * yy_get_previous_state() go ahead and do it
+       * for us because it doesn't know how to deal
+       * with the possibility of jamming (and we don't
+       * want to build jamming into it because then it
+       * will run more slowly).
+       */
+
+      yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+      yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+      if ( yy_next_state )
+        {
+        /* Consume the NUL. */
+        yy_cp = ++(yy_c_buf_p);
+        yy_current_state = yy_next_state;
+        goto yy_match;
+        }
+
+      else
+        {
+        yy_cp = (yy_c_buf_p);
+        goto yy_find_action;
+        }
+      }
+
+    else switch ( yy_get_next_buffer(  ) )
+      {
+      case EOB_ACT_END_OF_FILE:
+        {
+        (yy_did_buffer_switch_on_eof) = 0;
+
+        if ( yywrap( ) )
+          {
+          /* Note: because we've taken care in
+           * yy_get_next_buffer() to have set up
+           * yytext, we can now set up
+           * yy_c_buf_p so that if some total
+           * hoser (like flex itself) wants to
+           * call the scanner after we return the
+           * YY_NULL, it'll still work - another
+           * YY_NULL will get returned.
+           */
+          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+          yy_act = YY_STATE_EOF(YY_START);
+          goto do_action;
+          }
+
+        else
+          {
+          if ( ! (yy_did_buffer_switch_on_eof) )
+            YY_NEW_FILE;
+          }
+        break;
+        }
+
+      case EOB_ACT_CONTINUE_SCAN:
+        (yy_c_buf_p) =
+          (yytext_ptr) + yy_amount_of_matched_text;
+
+        yy_current_state = yy_get_previous_state(  );
+
+        yy_cp = (yy_c_buf_p);
+        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+        goto yy_match;
+
+      case EOB_ACT_LAST_MATCH:
+        (yy_c_buf_p) =
+        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+        yy_current_state = yy_get_previous_state(  );
+
+        yy_cp = (yy_c_buf_p);
+        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+        goto yy_find_action;
+      }
+    break;
+    }
+
+  default:
+    YY_FATAL_ERROR(
+      "fatal flex scanner internal error--no action found" );
+  } /* end of action switch */
+    } /* end of scanning one token */
 } /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
  * Returns a code representing an action:
- *     EOB_ACT_LAST_MATCH -
- *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *     EOB_ACT_END_OF_FILE - end of file
+ *  EOB_ACT_LAST_MATCH -
+ *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *  EOB_ACT_END_OF_FILE - end of file
  */
 static int yy_get_next_buffer (void)
 {
-       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-       register char *source = (yytext_ptr);
-       register int number_to_move, i;
-       int ret_val;
-
-       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-               YY_FATAL_ERROR(
-               "fatal flex scanner internal error--end of buffer missed" );
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-               { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-                       {
-                       /* We matched a single character, the EOB, so
-                        * treat this as a final EOF.
-                        */
-                       return EOB_ACT_END_OF_FILE;
-                       }
-
-               else
-                       {
-                       /* We matched some text prior to the EOB, first
-                        * process it.
-                        */
-                       return EOB_ACT_LAST_MATCH;
-                       }
-               }
-
-       /* Try to read more data. */
-
-       /* First move last chars to start of buffer. */
-       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-       for ( i = 0; i < number_to_move; ++i )
-               *(dest++) = *(source++);
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-               /* don't do the read, it's not guaranteed to return an EOF,
-                * just force an EOF
-                */
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-       else
-               {
-                       int num_to_read =
-                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-               while ( num_to_read <= 0 )
-                       { /* Not enough room in the buffer - grow it. */
-
-                       /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-                       int yy_c_buf_p_offset =
-                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-                       if ( b->yy_is_our_buffer )
-                               {
-                               int new_size = b->yy_buf_size * 2;
-
-                               if ( new_size <= 0 )
-                                       b->yy_buf_size += b->yy_buf_size / 8;
-                               else
-                                       b->yy_buf_size *= 2;
-
-                               b->yy_ch_buf = (char *)
-                                       /* Include room in for 2 EOB chars. */
-                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-                               }
-                       else
-                               /* Can't grow it, we don't own it. */
-                               b->yy_ch_buf = 0;
-
-                       if ( ! b->yy_ch_buf )
-                               YY_FATAL_ERROR(
-                               "fatal error - scanner input buffer overflow" );
-
-                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-                                               number_to_move - 1;
-
-                       }
-
-               if ( num_to_read > YY_READ_BUF_SIZE )
-                       num_to_read = YY_READ_BUF_SIZE;
-
-               /* Read in more data. */
-               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       (yy_n_chars), (size_t) num_to_read );
-
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       if ( (yy_n_chars) == 0 )
-               {
-               if ( number_to_move == YY_MORE_ADJ )
-                       {
-                       ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart(yyin  );
-                       }
-
-               else
-                       {
-                       ret_val = EOB_ACT_LAST_MATCH;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-                               YY_BUFFER_EOF_PENDING;
-                       }
-               }
-
-       else
-               ret_val = EOB_ACT_CONTINUE_SCAN;
-
-       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-               /* Extend the array by 50%, plus the number we really need. */
-               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-       }
-
-       (yy_n_chars) += number_to_move;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+      register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+  register char *source = (yytext_ptr);
+  register int number_to_move, i;
+  int ret_val;
+
+  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+    YY_FATAL_ERROR(
+    "fatal flex scanner internal error--end of buffer missed" );
+
+  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+    { /* Don't try to fill the buffer, so this is an EOF. */
+    if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+      {
+      /* We matched a single character, the EOB, so
+       * treat this as a final EOF.
+       */
+      return EOB_ACT_END_OF_FILE;
+      }
+
+    else
+      {
+      /* We matched some text prior to the EOB, first
+       * process it.
+       */
+      return EOB_ACT_LAST_MATCH;
+      }
+    }
+
+  /* Try to read more data. */
+
+  /* First move last chars to start of buffer. */
+  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+  for ( i = 0; i < number_to_move; ++i )
+    *(dest++) = *(source++);
+
+  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+    /* don't do the read, it's not guaranteed to return an EOF,
+     * just force an EOF
+     */
+    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+  else
+    {
+      int num_to_read =
+      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+    while ( num_to_read <= 0 )
+      { /* Not enough room in the buffer - grow it. */
+
+      /* just a shorter name for the current buffer */
+      YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+      int yy_c_buf_p_offset =
+        (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+      if ( b->yy_is_our_buffer )
+        {
+        int new_size = b->yy_buf_size * 2;
+
+        if ( new_size <= 0 )
+          b->yy_buf_size += b->yy_buf_size / 8;
+        else
+          b->yy_buf_size *= 2;
+
+        b->yy_ch_buf = (char *)
+          /* Include room in for 2 EOB chars. */
+          yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+        }
+      else
+        /* Can't grow it, we don't own it. */
+        b->yy_ch_buf = 0;
+
+      if ( ! b->yy_ch_buf )
+        YY_FATAL_ERROR(
+        "fatal error - scanner input buffer overflow" );
+
+      (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+            number_to_move - 1;
+
+      }
+
+    if ( num_to_read > YY_READ_BUF_SIZE )
+      num_to_read = YY_READ_BUF_SIZE;
+
+    /* Read in more data. */
+    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+      (yy_n_chars), (size_t) num_to_read );
+
+    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+    }
 
-       return ret_val;
+  if ( (yy_n_chars) == 0 )
+    {
+    if ( number_to_move == YY_MORE_ADJ )
+      {
+      ret_val = EOB_ACT_END_OF_FILE;
+      yyrestart(yyin  );
+      }
+
+    else
+      {
+      ret_val = EOB_ACT_LAST_MATCH;
+      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+        YY_BUFFER_EOF_PENDING;
+      }
+    }
+
+  else
+    ret_val = EOB_ACT_CONTINUE_SCAN;
+
+  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+    /* Extend the array by 50%, plus the number we really need. */
+    yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+  }
+
+  (yy_n_chars) += number_to_move;
+  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+  return ret_val;
 }
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
     static yy_state_type yy_get_previous_state (void)
 {
-       register yy_state_type yy_current_state;
-       register char *yy_cp;
+  register yy_state_type yy_current_state;
+  register char *yy_cp;
     
-       yy_current_state = (yy_start);
-
-       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-               {
-               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-               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 >= 54 )
-                               yy_c = yy_meta[(unsigned int) yy_c];
-                       }
-               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-               }
-
-       return yy_current_state;
+  yy_current_state = (yy_start);
+
+  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+    {
+    register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+    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 >= 54 )
+        yy_c = yy_meta[(unsigned int) yy_c];
+      }
+    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+    }
+
+  return yy_current_state;
 }
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
- *     next_state = yy_try_NUL_trans( current_state );
+ *  next_state = yy_try_NUL_trans( current_state );
  */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
 {
-       register int yy_is_jam;
-       register char *yy_cp = (yy_c_buf_p);
-
-       register YY_CHAR yy_c = 1;
-       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 >= 54 )
-                       yy_c = yy_meta[(unsigned int) yy_c];
-               }
-       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 53);
-
-       return yy_is_jam ? 0 : yy_current_state;
+  register int yy_is_jam;
+      register char *yy_cp = (yy_c_buf_p);
+
+  register YY_CHAR yy_c = 1;
+  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 >= 54 )
+      yy_c = yy_meta[(unsigned int) yy_c];
+    }
+  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+  yy_is_jam = (yy_current_state == 53);
+
+  return yy_is_jam ? 0 : yy_current_state;
 }
 
     static void yyunput (int c, register char * yy_bp )
 {
-       register char *yy_cp;
+  register char *yy_cp;
     
     yy_cp = (yy_c_buf_p);
 
-       /* undo effects of setting up yytext */
-       *yy_cp = (yy_hold_char);
+  /* undo effects of setting up yytext */
+  *yy_cp = (yy_hold_char);
 
-       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-               { /* need to shift things up to make room */
-               /* +2 for EOB chars. */
-               register int number_to_move = (yy_n_chars) + 2;
-               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-               register char *source =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+    { /* need to shift things up to make room */
+    /* +2 for EOB chars. */
+    register int number_to_move = (yy_n_chars) + 2;
+    register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+          YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+    register char *source =
+        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
 
-               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       *--dest = *--source;
+    while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+      *--dest = *--source;
 
-               yy_cp += (int) (dest - source);
-               yy_bp += (int) (dest - source);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+    yy_cp += (int) (dest - source);
+    yy_bp += (int) (dest - source);
+    YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
 
-               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-                       YY_FATAL_ERROR( "flex scanner push-back overflow" );
-               }
+    if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+      YY_FATAL_ERROR( "flex scanner push-back overflow" );
+    }
 
-       *--yy_cp = (char) c;
+  *--yy_cp = (char) c;
 
-       (yytext_ptr) = yy_bp;
-       (yy_hold_char) = *yy_cp;
-       (yy_c_buf_p) = yy_cp;
+  (yytext_ptr) = yy_bp;
+  (yy_hold_char) = *yy_cp;
+  (yy_c_buf_p) = yy_cp;
 }
 
 #ifndef YY_NO_INPUT
@@ -1296,71 +1296,71 @@ static int yy_get_next_buffer (void)
 #endif
 
 {
-       int c;
+  int c;
     
-       *(yy_c_buf_p) = (yy_hold_char);
-
-       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-               {
-               /* yy_c_buf_p now points to the character we want to return.
-                * If this occurs *before* the EOB characters, then it's a
-                * valid NUL; if not, then we've hit the end of the buffer.
-                */
-               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       /* This was really a NUL. */
-                       *(yy_c_buf_p) = '\0';
-
-               else
-                       { /* need more input */
-                       int offset = (yy_c_buf_p) - (yytext_ptr);
-                       ++(yy_c_buf_p);
-
-                       switch ( yy_get_next_buffer(  ) )
-                               {
-                               case EOB_ACT_LAST_MATCH:
-                                       /* This happens because yy_g_n_b()
-                                        * sees that we've accumulated a
-                                        * token and flags that we need to
-                                        * try matching the token before
-                                        * proceeding.  But for input(),
-                                        * there's no matching to consider.
-                                        * So convert the EOB_ACT_LAST_MATCH
-                                        * to EOB_ACT_END_OF_FILE.
-                                        */
-
-                                       /* Reset buffer status. */
-                                       yyrestart(yyin );
-
-                                       /*FALLTHROUGH*/
-
-                               case EOB_ACT_END_OF_FILE:
-                                       {
-                                       if ( yywrap( ) )
-                                               return EOF;
-
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
+  *(yy_c_buf_p) = (yy_hold_char);
+
+  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+    {
+    /* yy_c_buf_p now points to the character we want to return.
+     * If this occurs *before* the EOB characters, then it's a
+     * valid NUL; if not, then we've hit the end of the buffer.
+     */
+    if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+      /* This was really a NUL. */
+      *(yy_c_buf_p) = '\0';
+
+    else
+      { /* need more input */
+      int offset = (yy_c_buf_p) - (yytext_ptr);
+      ++(yy_c_buf_p);
+
+      switch ( yy_get_next_buffer(  ) )
+        {
+        case EOB_ACT_LAST_MATCH:
+          /* This happens because yy_g_n_b()
+           * sees that we've accumulated a
+           * token and flags that we need to
+           * try matching the token before
+           * proceeding.  But for input(),
+           * there's no matching to consider.
+           * So convert the EOB_ACT_LAST_MATCH
+           * to EOB_ACT_END_OF_FILE.
+           */
+
+          /* Reset buffer status. */
+          yyrestart(yyin );
+
+          /*FALLTHROUGH*/
+
+        case EOB_ACT_END_OF_FILE:
+          {
+          if ( yywrap( ) )
+            return EOF;
+
+          if ( ! (yy_did_buffer_switch_on_eof) )
+            YY_NEW_FILE;
 #ifdef __cplusplus
-                                       return yyinput();
+          return yyinput();
 #else
-                                       return input();
+          return input();
 #endif
-                                       }
+          }
 
-                               case EOB_ACT_CONTINUE_SCAN:
-                                       (yy_c_buf_p) = (yytext_ptr) + offset;
-                                       break;
-                               }
-                       }
-               }
+        case EOB_ACT_CONTINUE_SCAN:
+          (yy_c_buf_p) = (yytext_ptr) + offset;
+          break;
+        }
+      }
+    }
 
-       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
-       *(yy_c_buf_p) = '\0';   /* preserve yytext */
-       (yy_hold_char) = *++(yy_c_buf_p);
+  c = *(unsigned char *) (yy_c_buf_p);  /* cast for 8-bit char's */
+  *(yy_c_buf_p) = '\0';  /* preserve yytext */
+  (yy_hold_char) = *++(yy_c_buf_p);
 
-       return c;
+  return c;
 }
-#endif /* ifndef YY_NO_INPUT */
+#endif  /* ifndef YY_NO_INPUT */
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
@@ -1370,14 +1370,14 @@ static int yy_get_next_buffer (void)
     void yyrestart  (FILE * input_file )
 {
     
-       if ( ! YY_CURRENT_BUFFER ){
+  if ( ! YY_CURRENT_BUFFER ){
         yyensure_buffer_stack ();
-               YY_CURRENT_BUFFER_LVALUE =
+    YY_CURRENT_BUFFER_LVALUE =
             yy_create_buffer(yyin,YY_BUF_SIZE );
-       }
+  }
 
-       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
-       yy_load_buffer_state( );
+  yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+  yy_load_buffer_state( );
 }
 
 /** Switch to a different input buffer.
@@ -1387,40 +1387,40 @@ static int yy_get_next_buffer (void)
     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
     
-       /* TODO. We should be able to replace this entire function body
-        * with
-        *              yypop_buffer_state();
-        *              yypush_buffer_state(new_buffer);
+  /* TODO. We should be able to replace this entire function body
+   * with
+   *    yypop_buffer_state();
+   *    yypush_buffer_state(new_buffer);
      */
-       yyensure_buffer_stack ();
-       if ( YY_CURRENT_BUFFER == new_buffer )
-               return;
-
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-       yy_load_buffer_state( );
-
-       /* We don't actually know whether we did this switch during
-        * EOF (yywrap()) processing, but the only time this flag
-        * is looked at is after yywrap() is called, so it's safe
-        * to go ahead and always set it.
-        */
-       (yy_did_buffer_switch_on_eof) = 1;
+  yyensure_buffer_stack ();
+  if ( YY_CURRENT_BUFFER == new_buffer )
+    return;
+
+  if ( YY_CURRENT_BUFFER )
+    {
+    /* Flush out information for old buffer. */
+    *(yy_c_buf_p) = (yy_hold_char);
+    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+    }
+
+  YY_CURRENT_BUFFER_LVALUE = new_buffer;
+  yy_load_buffer_state( );
+
+  /* We don't actually know whether we did this switch during
+   * EOF (yywrap()) processing, but the only time this flag
+   * is looked at is after yywrap() is called, so it's safe
+   * to go ahead and always set it.
+   */
+  (yy_did_buffer_switch_on_eof) = 1;
 }
 
 static void yy_load_buffer_state  (void)
 {
-       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-       (yy_hold_char) = *(yy_c_buf_p);
+      (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+  (yy_hold_char) = *(yy_c_buf_p);
 }
 
 /** Allocate and initialize an input buffer state.
@@ -1431,26 +1431,26 @@ static void yy_load_buffer_state  (void)
  */
     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
 {
-       YY_BUFFER_STATE b;
+  YY_BUFFER_STATE b;
     
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+  b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
+  if ( ! b )
+    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
-       b->yy_buf_size = size;
+  b->yy_buf_size = size;
 
-       /* yy_ch_buf has to be 2 characters longer than the size given because
-        * we need to put in 2 end-of-buffer characters.
-        */
-       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
-       if ( ! b->yy_ch_buf )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+  /* yy_ch_buf has to be 2 characters longer than the size given because
+   * we need to put in 2 end-of-buffer characters.
+   */
+  b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
+  if ( ! b->yy_ch_buf )
+    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
-       b->yy_is_our_buffer = 1;
+  b->yy_is_our_buffer = 1;
 
-       yy_init_buffer(b,file );
+  yy_init_buffer(b,file );
 
-       return b;
+  return b;
 }
 
 /** Destroy the buffer.
@@ -1460,16 +1460,16 @@ static void yy_load_buffer_state  (void)
     void yy_delete_buffer (YY_BUFFER_STATE  b )
 {
     
-       if ( ! b )
-               return;
+  if ( ! b )
+    return;
 
-       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
-       if ( b->yy_is_our_buffer )
-               yyfree((void *) b->yy_ch_buf  );
+  if ( b->yy_is_our_buffer )
+    yyfree((void *) b->yy_ch_buf  );
 
-       yyfree((void *) b  );
+  yyfree((void *) b  );
 }
 
 #ifndef __cplusplus
@@ -1483,12 +1483,12 @@ extern int isatty (int );
     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
 {
-       int oerrno = errno;
+  int oerrno = errno;
     
-       yy_flush_buffer(b );
+  yy_flush_buffer(b );
 
-       b->yy_input_file = file;
-       b->yy_fill_buffer = 1;
+  b->yy_input_file = file;
+  b->yy_fill_buffer = 1;
 
     /* If b is the current buffer, then yy_init_buffer was _probably_
      * called from yyrestart() or through yy_get_next_buffer.
@@ -1501,7 +1501,7 @@ extern int isatty (int );
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
     
-       errno = oerrno;
+  errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
@@ -1510,25 +1510,25 @@ extern int isatty (int );
  */
     void yy_flush_buffer (YY_BUFFER_STATE  b )
 {
-       if ( ! b )
-               return;
+      if ( ! b )
+    return;
 
-       b->yy_n_chars = 0;
+  b->yy_n_chars = 0;
 
-       /* We always need two end-of-buffer characters.  The first causes
-        * a transition to the end-of-buffer state.  The second causes
-        * a jam in that state.
-        */
-       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+  /* We always need two end-of-buffer characters.  The first causes
+   * a transition to the end-of-buffer state.  The second causes
+   * a jam in that state.
+   */
+  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
-       b->yy_buf_pos = &b->yy_ch_buf[0];
+  b->yy_buf_pos = &b->yy_ch_buf[0];
 
-       b->yy_at_bol = 1;
-       b->yy_buffer_status = YY_BUFFER_NEW;
+  b->yy_at_bol = 1;
+  b->yy_buffer_status = YY_BUFFER_NEW;
 
-       if ( b == YY_CURRENT_BUFFER )
-               yy_load_buffer_state( );
+  if ( b == YY_CURRENT_BUFFER )
+    yy_load_buffer_state( );
 }
 
 /** Pushes the new state onto the stack. The new state becomes
@@ -1539,28 +1539,28 @@ extern int isatty (int );
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-       if (new_buffer == NULL)
-               return;
-
-       yyensure_buffer_stack();
-
-       /* This block is copied from yy_switch_to_buffer. */
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       /* Only push if top exists. Otherwise, replace top. */
-       if (YY_CURRENT_BUFFER)
-               (yy_buffer_stack_top)++;
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-       /* copied from yy_switch_to_buffer. */
-       yy_load_buffer_state( );
-       (yy_did_buffer_switch_on_eof) = 1;
+      if (new_buffer == NULL)
+    return;
+
+  yyensure_buffer_stack();
+
+  /* This block is copied from yy_switch_to_buffer. */
+  if ( YY_CURRENT_BUFFER )
+    {
+    /* Flush out information for old buffer. */
+    *(yy_c_buf_p) = (yy_hold_char);
+    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+    }
+
+  /* Only push if top exists. Otherwise, replace top. */
+  if (YY_CURRENT_BUFFER)
+    (yy_buffer_stack_top)++;
+  YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+  /* copied from yy_switch_to_buffer. */
+  yy_load_buffer_state( );
+  (yy_did_buffer_switch_on_eof) = 1;
 }
 
 /** Removes and deletes the top of the stack, if present.
@@ -1569,18 +1569,18 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
  */
 void yypop_buffer_state (void)
 {
-       if (!YY_CURRENT_BUFFER)
-               return;
-
-       yy_delete_buffer(YY_CURRENT_BUFFER );
-       YY_CURRENT_BUFFER_LVALUE = NULL;
-       if ((yy_buffer_stack_top) > 0)
-               --(yy_buffer_stack_top);
-
-       if (YY_CURRENT_BUFFER) {
-               yy_load_buffer_state( );
-               (yy_did_buffer_switch_on_eof) = 1;
-       }
+      if (!YY_CURRENT_BUFFER)
+    return;
+
+  yy_delete_buffer(YY_CURRENT_BUFFER );
+  YY_CURRENT_BUFFER_LVALUE = NULL;
+  if ((yy_buffer_stack_top) > 0)
+    --(yy_buffer_stack_top);
+
+  if (YY_CURRENT_BUFFER) {
+    yy_load_buffer_state( );
+    (yy_did_buffer_switch_on_eof) = 1;
+  }
 }
 
 /* Allocates the stack if it does not exist.
@@ -1588,45 +1588,45 @@ void yypop_buffer_state (void)
  */
 static void yyensure_buffer_stack (void)
 {
-       int num_to_alloc;
+  int num_to_alloc;
     
-       if (!(yy_buffer_stack)) {
+  if (!(yy_buffer_stack)) {
 
-               /* First allocation is just for 2 elements, since we don't know if this
-                * scanner will even need a stack. We use 2 instead of 1 to avoid an
-                * immediate realloc on the next call.
+    /* First allocation is just for 2 elements, since we don't know if this
+     * scanner will even need a stack. We use 2 instead of 1 to avoid an
+     * immediate realloc on the next call.
          */
-               num_to_alloc = 1;
-               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
-                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-                                                                 
-               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-                               
-               (yy_buffer_stack_max) = num_to_alloc;
-               (yy_buffer_stack_top) = 0;
-               return;
-       }
-
-       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-               /* Increase the buffer to prepare for a possible push. */
-               int grow_size = 8 /* arbitrary grow size */;
-
-               num_to_alloc = (yy_buffer_stack_max) + grow_size;
-               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
-                                                               ((yy_buffer_stack),
-                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-               /* zero only the new slots.*/
-               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-               (yy_buffer_stack_max) = num_to_alloc;
-       }
+    num_to_alloc = 1;
+    (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                (num_to_alloc * sizeof(struct yy_buffer_state*)
+                );
+    if ( ! (yy_buffer_stack) )
+      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+                  
+    memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+        
+    (yy_buffer_stack_max) = num_to_alloc;
+    (yy_buffer_stack_top) = 0;
+    return;
+  }
+
+  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+    /* Increase the buffer to prepare for a possible push. */
+    int grow_size = 8 /* arbitrary grow size */;
+
+    num_to_alloc = (yy_buffer_stack_max) + grow_size;
+    (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+                ((yy_buffer_stack),
+                num_to_alloc * sizeof(struct yy_buffer_state*)
+                );
+    if ( ! (yy_buffer_stack) )
+      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+    /* zero only the new slots.*/
+    memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+    (yy_buffer_stack_max) = num_to_alloc;
+  }
 }
 
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
@@ -1637,31 +1637,31 @@ static void yyensure_buffer_stack (void)
  */
 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 {
-       YY_BUFFER_STATE b;
+  YY_BUFFER_STATE b;
     
-       if ( size < 2 ||
-            base[size-2] != YY_END_OF_BUFFER_CHAR ||
-            base[size-1] != YY_END_OF_BUFFER_CHAR )
-               /* They forgot to leave room for the EOB's. */
-               return 0;
-
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
-       b->yy_buf_pos = b->yy_ch_buf = base;
-       b->yy_is_our_buffer = 0;
-       b->yy_input_file = 0;
-       b->yy_n_chars = b->yy_buf_size;
-       b->yy_is_interactive = 0;
-       b->yy_at_bol = 1;
-       b->yy_fill_buffer = 0;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       yy_switch_to_buffer(b  );
-
-       return b;
+  if ( size < 2 ||
+       base[size-2] != YY_END_OF_BUFFER_CHAR ||
+       base[size-1] != YY_END_OF_BUFFER_CHAR )
+    /* They forgot to leave room for the EOB's. */
+    return 0;
+
+  b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
+  if ( ! b )
+    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+  b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
+  b->yy_buf_pos = b->yy_ch_buf = base;
+  b->yy_is_our_buffer = 0;
+  b->yy_input_file = 0;
+  b->yy_n_chars = b->yy_buf_size;
+  b->yy_is_interactive = 0;
+  b->yy_at_bol = 1;
+  b->yy_fill_buffer = 0;
+  b->yy_buffer_status = YY_BUFFER_NEW;
+
+  yy_switch_to_buffer(b  );
+
+  return b;
 }
 
 /** Setup the input buffer state to scan a string. The next call to yylex() will
@@ -1675,7 +1675,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
 {
     
-       return yy_scan_bytes(yystr,strlen(yystr) );
+  return yy_scan_bytes(yystr,strlen(yystr) );
 }
 
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
@@ -1687,32 +1687,32 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
  */
 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
-       YY_BUFFER_STATE b;
-       char *buf;
-       yy_size_t n;
-       int i;
+  YY_BUFFER_STATE b;
+  char *buf;
+  yy_size_t n;
+  int i;
     
-       /* Get memory for full buffer, including space for trailing EOB's. */
-       n = _yybytes_len + 2;
-       buf = (char *) yyalloc(n  );
-       if ( ! buf )
-               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+  /* Get memory for full buffer, including space for trailing EOB's. */
+  n = _yybytes_len + 2;
+  buf = (char *) yyalloc(n  );
+  if ( ! buf )
+    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
-       for ( i = 0; i < _yybytes_len; ++i )
-               buf[i] = yybytes[i];
+  for ( i = 0; i < _yybytes_len; ++i )
+    buf[i] = yybytes[i];
 
-       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-       b = yy_scan_buffer(buf,n );
-       if ( ! b )
-               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+  b = yy_scan_buffer(buf,n );
+  if ( ! b )
+    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
-       /* It's okay to grow etc. this buffer, and we should throw it
-        * away when we're done.
-        */
-       b->yy_is_our_buffer = 1;
+  /* It's okay to grow etc. this buffer, and we should throw it
+   * away when we're done.
+   */
+  b->yy_is_our_buffer = 1;
 
-       return b;
+  return b;
 }
 
 #ifndef YY_EXIT_FAILURE
@@ -1721,26 +1721,26 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 
 static void yy_fatal_error (yyconst char* msg )
 {
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
+      (void) fprintf( stderr, "%s\n", msg );
+  exit( YY_EXIT_FAILURE );
 }
 
 /* Redefine yyless() so it works in section 3 code. */
 
 #undef yyless
 #define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
+  do \
+    { \
+    /* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-               yytext[yyleng] = (yy_hold_char); \
-               (yy_c_buf_p) = yytext + yyless_macro_arg; \
-               (yy_hold_char) = *(yy_c_buf_p); \
-               *(yy_c_buf_p) = '\0'; \
-               yyleng = yyless_macro_arg; \
-               } \
-       while ( 0 )
+    yytext[yyleng] = (yy_hold_char); \
+    (yy_c_buf_p) = yytext + yyless_macro_arg; \
+    (yy_hold_char) = *(yy_c_buf_p); \
+    *(yy_c_buf_p) = '\0'; \
+    yyleng = yyless_macro_arg; \
+    } \
+  while ( 0 )
 
 /* Accessor  methods (get/set functions) to struct members. */
 
@@ -1855,15 +1855,15 @@ int yylex_destroy  (void)
 {
     
     /* Pop the buffer stack, destroying each element. */
-       while(YY_CURRENT_BUFFER){
-               yy_delete_buffer(YY_CURRENT_BUFFER  );
-               YY_CURRENT_BUFFER_LVALUE = NULL;
-               yypop_buffer_state();
-       }
+  while(YY_CURRENT_BUFFER){
+    yy_delete_buffer(YY_CURRENT_BUFFER  );
+    YY_CURRENT_BUFFER_LVALUE = NULL;
+    yypop_buffer_state();
+  }
 
-       /* Destroy the stack itself. */
-       yyfree((yy_buffer_stack) );
-       (yy_buffer_stack) = NULL;
+  /* Destroy the stack itself. */
+  yyfree((yy_buffer_stack) );
+  (yy_buffer_stack) = NULL;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
@@ -1879,43 +1879,43 @@ int yylex_destroy  (void)
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
 {
-       register int i;
-       for ( i = 0; i < n; ++i )
-               s1[i] = s2[i];
+  register int i;
+  for ( i = 0; i < n; ++i )
+    s1[i] = s2[i];
 }
 #endif
 
 #ifdef YY_NEED_STRLEN
 static int yy_flex_strlen (yyconst char * s )
 {
-       register int n;
-       for ( n = 0; s[n]; ++n )
-               ;
+  register int n;
+  for ( n = 0; s[n]; ++n )
+    ;
 
-       return n;
+  return n;
 }
 #endif
 
 void *yyalloc (yy_size_t  size )
 {
-       return (void *) malloc( size );
+  return (void *) malloc( size );
 }
 
 void *yyrealloc  (void * ptr, yy_size_t  size )
 {
-       /* The cast to (char *) in the following accommodates both
-        * implementations that use char* generic pointers, and those
-        * that use void* generic pointers.  It works with the latter
-        * because both ANSI C and C++ allow castless assignment from
-        * any pointer type to void*, and deal with argument conversions
-        * as though doing an assignment.
-        */
-       return (void *) realloc( (char *) ptr, size );
+  /* The cast to (char *) in the following accommodates both
+   * implementations that use char* generic pointers, and those
+   * that use void* generic pointers.  It works with the latter
+   * because both ANSI C and C++ allow castless assignment from
+   * any pointer type to void*, and deal with argument conversions
+   * as though doing an assignment.
+   */
+  return (void *) realloc( (char *) ptr, size );
 }
 
 void yyfree (void * ptr )
 {
-       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
+  free( (char *) ptr );  /* see yyrealloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
index 6b509d2..81ee74b 100644 (file)
@@ -168,8 +168,8 @@ int slave(int argc, char *argv[])
   elapsed_time = MSG_get_clock() - start_time;
   
   XBT_INFO("FLOW[%d] : Receive %.0f bytes from %s to %s",
-                 id,
-                 MSG_task_get_data_size(task),
+      id,
+      MSG_task_get_data_size(task),
        masternames[id],
        slavenames[id]);
 //  MSG_task_execute(task);
index 75d0e6e..243657d 100644 (file)
@@ -27,8 +27,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_pmm,
 
 /* This example should always be executed using a deployment of
  * GRID_SIZE * GRID_SIZE nodes. */
-#define GRID_SIZE 3            /* Modify to adjust the grid's size */
-#define NODE_MATRIX_SIZE 300   /* Ammount of work done by each node*/
+#define GRID_SIZE 3    /* Modify to adjust the grid's size */
+#define NODE_MATRIX_SIZE 300  /* Ammount of work done by each node*/
 
 #define GRID_NUM_NODES GRID_SIZE * GRID_SIZE
 #define MATRIX_SIZE NODE_MATRIX_SIZE * GRID_SIZE
index d0f137d..4131089 100644 (file)
@@ -53,17 +53,17 @@ static void SD_workstation_set_available_at(SD_workstation_t workstation,
 }
 
 static SD_task_t SD_workstation_get_last_scheduled_task( SD_workstation_t workstation){
-       WorkstationAttribute attr =
-                       (WorkstationAttribute) SD_workstation_get_data(workstation);
-       return attr->last_scheduled_task;
+  WorkstationAttribute attr =
+      (WorkstationAttribute) SD_workstation_get_data(workstation);
+  return attr->last_scheduled_task;
 }
 
 static void SD_workstation_set_last_scheduled_task(SD_workstation_t workstation,
-               SD_task_t task){
-       WorkstationAttribute attr =
-                       (WorkstationAttribute) SD_workstation_get_data(workstation);
-       attr->last_scheduled_task=task;
-       SD_workstation_set_data(workstation, attr);
+    SD_task_t task){
+  WorkstationAttribute attr =
+      (WorkstationAttribute) SD_workstation_get_data(workstation);
+  attr->last_scheduled_task=task;
+  SD_workstation_set_data(workstation, attr);
 }
 
 static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
@@ -347,13 +347,13 @@ int main(int argc, char **argv)
     last_scheduled_task = 
       SD_workstation_get_last_scheduled_task(selected_workstation);
     if (last_scheduled_task && 
-       (SD_task_get_state(last_scheduled_task) != SD_DONE) &&
-       (SD_task_get_state(last_scheduled_task) != SD_FAILED) &&
-       !SD_task_dependency_exists(
-          SD_workstation_get_last_scheduled_task(selected_workstation),
-          selected_task))
+  (SD_task_get_state(last_scheduled_task) != SD_DONE) &&
+  (SD_task_get_state(last_scheduled_task) != SD_FAILED) &&
+  !SD_task_dependency_exists(
+     SD_workstation_get_last_scheduled_task(selected_workstation),
+     selected_task))
       SD_task_dependency_add("resource", NULL,
-                            last_scheduled_task, selected_task);
+           last_scheduled_task, selected_task);
     
     SD_workstation_set_last_scheduled_task(selected_workstation, selected_task);
     
index 4313e01..aa81fe6 100644 (file)
@@ -66,9 +66,9 @@ int main(int argc, char **argv)
     XBT_INFO("Simulation stopped after %.4f seconds", SD_get_clock());
     xbt_dynar_foreach(changed_tasks, ctr, task) {
       XBT_INFO("Task '%s' start time: %f, finish time: %f",
-              SD_task_get_name(task),
-              SD_task_get_start_time(task), 
-              SD_task_get_finish_time(task));
+         SD_task_get_name(task),
+         SD_task_get_start_time(task), 
+         SD_task_get_finish_time(task));
  
     }
     /* let throttle the communication for taskD if its parent is SD_DONE */
index d3c41ba..42039d7 100644 (file)
@@ -39,8 +39,8 @@ int main(int argc, char **argv)
   /* Change the access mode of the workstations */
   workstations = SD_workstation_get_list();
   for (i = 0; i < 2; i++) {
-       SD_workstation_dump(workstations[i]);
-       
+    SD_workstation_dump(workstations[i]);
+    
     SD_workstation_set_access_mode(workstations[i],
                                    SD_WORKSTATION_SEQUENTIAL_ACCESS);
     XBT_INFO(" Change access mode of %s to %s",
@@ -70,9 +70,9 @@ int main(int argc, char **argv)
 
   /* let's launch the simulation! */
   while (!xbt_dynar_is_empty(changed_tasks = SD_simulate(-1.0))) {
-       XBT_INFO(" Simulation was suspended, check workstation states"); 
+    XBT_INFO(" Simulation was suspended, check workstation states"); 
     for (i = 0; i < 2; i++) {
-         SD_workstation_dump(workstations[i]);
+    SD_workstation_dump(workstations[i]);
     }
     xbt_dynar_free(&changed_tasks);
   }
index dda4a50..9326823 100644 (file)
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
 
   for (i=0;i<SD_workstation_get_number();i++)
     XBT_INFO("%s runs at %f flops", SD_workstation_get_name(workstations[i]),
-            SD_workstation_get_power(workstations[i]));
+       SD_workstation_get_power(workstations[i]));
 
   /* creation of some typed tasks and their dependencies */
   taskA = SD_task_create_comp_seq("Task A", NULL, 1e9);
index 5d5839d..f573786 100644 (file)
@@ -32,7 +32,7 @@ DGNode *newNode(char *nm){
 }
 void nodeShow(DGNode* nd){
   fprintf( stderr,"%3d.%s: (%d,%d)\n",
-                  nd->id,nd->name,nd->inDegree,nd->outDegree);
+             nd->id,nd->name,nd->inDegree,nd->outDegree);
 /*
   if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
   else if(nd->verified==0)  fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
@@ -56,103 +56,103 @@ int AttachNode(DGraph* dg, DGNode* nd) {
   DGNode **nds =NULL, *tmpnd=NULL;
   DGArc **ar=NULL;
 
-       if (dg->numNodes == dg->maxNodes-1 ) {
-         dg->maxNodes += BLOCK_SIZE;
+  if (dg->numNodes == dg->maxNodes-1 ) {
+    dg->maxNodes += BLOCK_SIZE;
           nds =(DGNode **) calloc(dg->maxNodes,sizeof(DGNode*));
-         memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
-         free(dg->node);
-         dg->node=nds;
-       }
+    memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
+    free(dg->node);
+    dg->node=nds;
+  }
 
         len = strlen( nd->name);
-       for (i = 0; i < dg->numNodes; i++) {
-         tmpnd =dg->node[ i];
-         ar=NULL;
-         if ( strlen( tmpnd->name) != len ) continue;
-         if ( strncmp( nd->name, tmpnd->name, len) ) continue;
-         if ( nd->inDegree > 0 ) {
-           tmpnd->maxInDegree += nd->maxInDegree;
+  for (i = 0; i < dg->numNodes; i++) {
+    tmpnd =dg->node[ i];
+    ar=NULL;
+    if ( strlen( tmpnd->name) != len ) continue;
+    if ( strncmp( nd->name, tmpnd->name, len) ) continue;
+    if ( nd->inDegree > 0 ) {
+      tmpnd->maxInDegree += nd->maxInDegree;
             ar =(DGArc **) calloc(tmpnd->maxInDegree,sizeof(DGArc*));
-           memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
-           free(tmpnd->inArc);
-           tmpnd->inArc=ar;
-           for (j = 0; j < nd->inDegree; j++ ) {
-             nd->inArc[ j]->head = tmpnd;
-           }
-           memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
-           tmpnd->inDegree += nd->inDegree;
-         }     
-         if ( nd->outDegree > 0 ) {
-           tmpnd->maxOutDegree += nd->maxOutDegree;
+      memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
+      free(tmpnd->inArc);
+      tmpnd->inArc=ar;
+      for (j = 0; j < nd->inDegree; j++ ) {
+        nd->inArc[ j]->head = tmpnd;
+      }
+      memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
+      tmpnd->inDegree += nd->inDegree;
+    }   
+    if ( nd->outDegree > 0 ) {
+      tmpnd->maxOutDegree += nd->maxOutDegree;
             ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
-           memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
-           free(tmpnd->outArc);
-           tmpnd->outArc=ar;
-           for (j = 0; j < nd->outDegree; j++ ) {
-             nd->outArc[ j]->tail = tmpnd;
-           }                   
-           memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
-           tmpnd->outDegree += nd->outDegree;
-         
-         free(nd); 
-         return i;
-       }
-       nd->id = dg->numNodes;
-       dg->node[dg->numNodes] = nd;
-       dg->numNodes++;
+      memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
+      free(tmpnd->outArc);
+      tmpnd->outArc=ar;
+      for (j = 0; j < nd->outDegree; j++ ) {
+        nd->outArc[ j]->tail = tmpnd;
+      }      
+      memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
+      tmpnd->outDegree += nd->outDegree;
+    } 
+    free(nd); 
+    return i;
+  }
+  nd->id = dg->numNodes;
+  dg->node[dg->numNodes] = nd;
+  dg->numNodes++;
 return nd->id;
 }
 int AttachArc(DGraph *dg,DGArc* nar){
-int    arcId = -1;
+int  arcId = -1;
 int i=0,newNumber=0;
-DGNode *head = nar->head,
-       *tail = nar->tail; 
+DGNode  *head = nar->head,
+  *tail = nar->tail; 
 DGArc **ars=NULL,*probe=NULL;
 /*fprintf(stderr,"AttachArc %ld\n",dg->numArcs); */
-       if ( !tail || !head ) return arcId;
-       if ( dg->numArcs == dg->maxArcs-1 ) {
-         dg->maxArcs += BLOCK_SIZE;
+  if ( !tail || !head ) return arcId;
+  if ( dg->numArcs == dg->maxArcs-1 ) {
+    dg->maxArcs += BLOCK_SIZE;
           ars =(DGArc **) calloc(dg->maxArcs,sizeof(DGArc*));
-         memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
-         free(dg->arc);
-         dg->arc=ars;
-       }
-       for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
-         probe = tail->outArc[ i];
-         if(probe->head == head
-            &&
-            probe->length == nar->length
+    memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
+    free(dg->arc);
+    dg->arc=ars;
+  }
+  for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
+    probe = tail->outArc[ i];
+    if(probe->head == head
+       &&
+       probe->length == nar->length
             ){
             free(nar);
-           return probe->id;   
-         }
-       }
-       
-       nar->id = dg->numArcs;
-       arcId=dg->numArcs;
-       dg->arc[dg->numArcs] = nar;
-       dg->numArcs++;
-       
-       head->inArc[ head->inDegree] = nar;
-       head->inDegree++;
-       if ( head->inDegree >= head->maxInDegree ) {
-         newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
+      return probe->id;   
+    }
+  }
+  
+  nar->id = dg->numArcs;
+  arcId=dg->numArcs;
+  dg->arc[dg->numArcs] = nar;
+  dg->numArcs++;
+  
+  head->inArc[ head->inDegree] = nar;
+  head->inDegree++;
+  if ( head->inDegree >= head->maxInDegree ) {
+    newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
           ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
-         memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
-         free(head->inArc);
-         head->inArc=ars;
-         head->maxInDegree = newNumber;
-       }
-       tail->outArc[ tail->outDegree] = nar;
-       tail->outDegree++;
-       if(tail->outDegree >= tail->maxOutDegree ) {
-         newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
+    memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
+    free(head->inArc);
+    head->inArc=ars;
+    head->maxInDegree = newNumber;
+  }
+  tail->outArc[ tail->outDegree] = nar;
+  tail->outDegree++;
+  if(tail->outDegree >= tail->maxOutDegree ) {
+    newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
           ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
-         memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
-         free(tail->outArc);
-         tail->outArc=ars;
-         tail->maxOutDegree = newNumber;
-       }
+    memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
+    free(tail->outArc);
+    tail->outArc=ars;
+    tail->maxOutDegree = newNumber;
+  }
 /*fprintf(stderr,"AttachArc: head->in=%d tail->out=%ld\n",head->inDegree,tail->outDegree);*/
 return arcId;
 }
@@ -164,8 +164,8 @@ void graphShow(DGraph *dg,int DetailsLevel){
     DGNode *focusNode = dg->node[ i];
     if(DetailsLevel >= 2) {
       for (j = 0; j < focusNode->inDegree; j++ ) {
-       fprintf(stderr,"\t ");
-       nodeShow(focusNode->inArc[ j]->tail);
+  fprintf(stderr,"\t ");
+  nodeShow(focusNode->inArc[ j]->tail);
       }
     }
     nodeShow(focusNode);
@@ -173,7 +173,7 @@ void graphShow(DGraph *dg,int DetailsLevel){
     for (j = 0; j < focusNode->outDegree; j++ ) {
       fprintf(stderr, "\t ");
       nodeShow(focusNode->outArc[ j]->head);
-    }  
+    }  
     fprintf(stderr, "---\n");
   }
   fprintf(stderr,"----------------------------------------\n");
index d080bde..b088fbd 100644 (file)
@@ -2,7 +2,7 @@
  *                                                                       * 
  *        N  A  S     P A R A L L E L     B E N C H M A R K S  3.3       *
  *                                                                       * 
- *                                  D T                                         
+ *                                  D T           * 
  *                                                                       * 
  ************************************************************************* 
  *                                                                       * 
@@ -33,7 +33,7 @@
  *                                                                       * 
  ************************************************************************* 
  *                                                                       * 
- *   Author: M. Frumkin                                                         *                                               * 
+ *   Author: M. Frumkin               *             * 
  *                                                                       * 
  *************************************************************************/
 
@@ -62,7 +62,7 @@ void c_print_results( char   *name,
                       int    nprocs_total,
                       double t,
                       double mops,
-                     char   *optype,
+          char   *optype,
                       int    passed_verification,
                       char   *npbversion,
                       char   *compiletime,
@@ -72,7 +72,7 @@ void c_print_results( char   *name,
                       char   *cmpi_inc,
                       char   *cflags,
                       char   *clinkflags );
-                     
+          
 void    timer_clear( int n );
 void    timer_start( int n );
 void    timer_stop( int n );
@@ -98,55 +98,55 @@ int verify(char *bmname,double rnm2){
          verified = 0;
        }else if(cls=='W') {
          if(strstr(bmname,"BH")){
-          verify_value = 4102461.0;
+       verify_value = 4102461.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 204280762.0;
+       verify_value = 204280762.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 186944764.0;
+       verify_value = 186944764.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
          verified = 0;
        }else if(cls=='A') {
          if(strstr(bmname,"BH")){
-          verify_value = 17809491.0;
+       verify_value = 17809491.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 1289925229.0;
+       verify_value = 1289925229.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 610856482.0;
+       verify_value = 610856482.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
-        verified = 0;
+     verified = 0;
        }else if(cls=='B') {
          if(strstr(bmname,"BH")){
-          verify_value = 4317114.0;
+       verify_value = 4317114.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 7877279917.0;
+       verify_value = 7877279917.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 1836863082.0;
+       verify_value = 1836863082.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
-          verified = 0;
+       verified = 0;
          }
        }else if(cls=='C') {
          if(strstr(bmname,"BH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
-          verified = -1;
+       verified = -1;
          }
        }else if(cls=='D') {
          if(strstr(bmname,"BH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
@@ -156,15 +156,15 @@ int verify(char *bmname,double rnm2){
        }
        fprintf(stderr," %s L2 Norm = %f\n",bmname,rnm2);
        if(verified==-1){
-        fprintf(stderr," No verification was performed.\n");
+     fprintf(stderr," No verification was performed.\n");
        }else if( rnm2 - verify_value < epsilon &&
                  rnm2 - verify_value > -epsilon) {  /* abs here does not work on ALTIX */
-         verified = 1;
-         fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
+      verified = 1;
+      fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
        }else{
-        verified = 0;
-        fprintf(stderr," The correct verification value = %f\n",verify_value);
-        fprintf(stderr," Got value = %f\n",rnm2);
+     verified = 0;
+     fprintf(stderr," The correct verification value = %f\n",verify_value);
+     fprintf(stderr," Got value = %f\n",rnm2);
        }
     }else{
        verified = -1;
@@ -297,7 +297,7 @@ DGraph *buildWH(char cls){
       id=AttachNode(dg,nd);
       for(j=0;j<maxInDeg;j++){
         sid=i*maxInDeg+j;
-       if(sid>=numPrevLayerNodes) break;
+  if(sid>=numPrevLayerNodes) break;
         snd=dg->node[firstLayerNode+sid];
         ar=newArc(dg->node[id],snd);
         AttachArc(dg,ar);
@@ -357,7 +357,7 @@ DGraph *buildBH(char cls){
       id=AttachNode(dg,nd);
       for(j=0;j<maxInDeg;j++){
         sid=i*maxInDeg+j;
-       if(sid>=numPrevLayerNodes) break;
+  if(sid>=numPrevLayerNodes) break;
         snd=dg->node[firstLayerNode+sid];
         ar=newArc(snd,dg->node[id]);
         AttachArc(dg,ar);
@@ -486,19 +486,19 @@ Arr* WindowFilter(Arr *a, Arr* b,int w){
   if(a->len>b->len) Resample(b,a->len);
   for(i=fielddim;i<a->len-fielddim;i+=fielddim){
     rms0=(a->val[i]-b->val[i])*(a->val[i]-b->val[i])
-       +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
-       +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
-       +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
+  +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
+  +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
+  +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
     j=i+fielddim;
     rms1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
-       +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
-       +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
-       +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+      +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+      +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+      +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
     j=i-fielddim;
     rmsm1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
-        +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
-        +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
-        +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+   +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+   +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+   +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
     k=0;
     if(rms1<rms0){
       k=1;
@@ -523,7 +523,7 @@ Arr* WindowFilter(Arr *a, Arr* b,int w){
       a->val[i+1]=weight*b->val[j+1];
       a->val[i+2]=weight*b->val[j+2];
       a->val[i+3]=weight*b->val[j+3];  
-    }     
+    }     
   }
   if(timer_on){
     timer_stop(w);
@@ -734,25 +734,25 @@ int main(int argc,char **argv ){
       timer_stop(0);
       tot_time=timer_read(0);
       c_print_results( dg->name,
-                      CLASS,
-                      featnum,
-                      0,
-                      0,
-                      dg->numNodes,
-                      0,
-                      comm_size,
-                      tot_time,
-                      bytes_sent/tot_time,
-                      "bytes transmitted", 
-                      verified,
-                      NPBVERSION,
-                      COMPILETIME,
-                      MPICC,
-                      CLINK,
-                      CMPI_LIB,
-                      CMPI_INC,
-                      CFLAGS,
-                      CLINKFLAGS );
+                 CLASS,
+                 featnum,
+                 0,
+                 0,
+                 dg->numNodes,
+                 0,
+                 comm_size,
+                 tot_time,
+                 bytes_sent/tot_time,
+                 "bytes transmitted", 
+                 verified,
+                 NPBVERSION,
+                 COMPILETIME,
+                 MPICC,
+                 CLINK,
+                 CMPI_LIB,
+                 CMPI_INC,
+                 CFLAGS,
+                 CLINKFLAGS );
     }          
     MPI_Finalize();
   return 1;
index 5d5839d..f573786 100644 (file)
@@ -32,7 +32,7 @@ DGNode *newNode(char *nm){
 }
 void nodeShow(DGNode* nd){
   fprintf( stderr,"%3d.%s: (%d,%d)\n",
-                  nd->id,nd->name,nd->inDegree,nd->outDegree);
+             nd->id,nd->name,nd->inDegree,nd->outDegree);
 /*
   if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
   else if(nd->verified==0)  fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
@@ -56,103 +56,103 @@ int AttachNode(DGraph* dg, DGNode* nd) {
   DGNode **nds =NULL, *tmpnd=NULL;
   DGArc **ar=NULL;
 
-       if (dg->numNodes == dg->maxNodes-1 ) {
-         dg->maxNodes += BLOCK_SIZE;
+  if (dg->numNodes == dg->maxNodes-1 ) {
+    dg->maxNodes += BLOCK_SIZE;
           nds =(DGNode **) calloc(dg->maxNodes,sizeof(DGNode*));
-         memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
-         free(dg->node);
-         dg->node=nds;
-       }
+    memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
+    free(dg->node);
+    dg->node=nds;
+  }
 
         len = strlen( nd->name);
-       for (i = 0; i < dg->numNodes; i++) {
-         tmpnd =dg->node[ i];
-         ar=NULL;
-         if ( strlen( tmpnd->name) != len ) continue;
-         if ( strncmp( nd->name, tmpnd->name, len) ) continue;
-         if ( nd->inDegree > 0 ) {
-           tmpnd->maxInDegree += nd->maxInDegree;
+  for (i = 0; i < dg->numNodes; i++) {
+    tmpnd =dg->node[ i];
+    ar=NULL;
+    if ( strlen( tmpnd->name) != len ) continue;
+    if ( strncmp( nd->name, tmpnd->name, len) ) continue;
+    if ( nd->inDegree > 0 ) {
+      tmpnd->maxInDegree += nd->maxInDegree;
             ar =(DGArc **) calloc(tmpnd->maxInDegree,sizeof(DGArc*));
-           memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
-           free(tmpnd->inArc);
-           tmpnd->inArc=ar;
-           for (j = 0; j < nd->inDegree; j++ ) {
-             nd->inArc[ j]->head = tmpnd;
-           }
-           memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
-           tmpnd->inDegree += nd->inDegree;
-         }     
-         if ( nd->outDegree > 0 ) {
-           tmpnd->maxOutDegree += nd->maxOutDegree;
+      memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
+      free(tmpnd->inArc);
+      tmpnd->inArc=ar;
+      for (j = 0; j < nd->inDegree; j++ ) {
+        nd->inArc[ j]->head = tmpnd;
+      }
+      memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
+      tmpnd->inDegree += nd->inDegree;
+    }   
+    if ( nd->outDegree > 0 ) {
+      tmpnd->maxOutDegree += nd->maxOutDegree;
             ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
-           memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
-           free(tmpnd->outArc);
-           tmpnd->outArc=ar;
-           for (j = 0; j < nd->outDegree; j++ ) {
-             nd->outArc[ j]->tail = tmpnd;
-           }                   
-           memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
-           tmpnd->outDegree += nd->outDegree;
-         
-         free(nd); 
-         return i;
-       }
-       nd->id = dg->numNodes;
-       dg->node[dg->numNodes] = nd;
-       dg->numNodes++;
+      memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
+      free(tmpnd->outArc);
+      tmpnd->outArc=ar;
+      for (j = 0; j < nd->outDegree; j++ ) {
+        nd->outArc[ j]->tail = tmpnd;
+      }      
+      memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
+      tmpnd->outDegree += nd->outDegree;
+    } 
+    free(nd); 
+    return i;
+  }
+  nd->id = dg->numNodes;
+  dg->node[dg->numNodes] = nd;
+  dg->numNodes++;
 return nd->id;
 }
 int AttachArc(DGraph *dg,DGArc* nar){
-int    arcId = -1;
+int  arcId = -1;
 int i=0,newNumber=0;
-DGNode *head = nar->head,
-       *tail = nar->tail; 
+DGNode  *head = nar->head,
+  *tail = nar->tail; 
 DGArc **ars=NULL,*probe=NULL;
 /*fprintf(stderr,"AttachArc %ld\n",dg->numArcs); */
-       if ( !tail || !head ) return arcId;
-       if ( dg->numArcs == dg->maxArcs-1 ) {
-         dg->maxArcs += BLOCK_SIZE;
+  if ( !tail || !head ) return arcId;
+  if ( dg->numArcs == dg->maxArcs-1 ) {
+    dg->maxArcs += BLOCK_SIZE;
           ars =(DGArc **) calloc(dg->maxArcs,sizeof(DGArc*));
-         memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
-         free(dg->arc);
-         dg->arc=ars;
-       }
-       for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
-         probe = tail->outArc[ i];
-         if(probe->head == head
-            &&
-            probe->length == nar->length
+    memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
+    free(dg->arc);
+    dg->arc=ars;
+  }
+  for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
+    probe = tail->outArc[ i];
+    if(probe->head == head
+       &&
+       probe->length == nar->length
             ){
             free(nar);
-           return probe->id;   
-         }
-       }
-       
-       nar->id = dg->numArcs;
-       arcId=dg->numArcs;
-       dg->arc[dg->numArcs] = nar;
-       dg->numArcs++;
-       
-       head->inArc[ head->inDegree] = nar;
-       head->inDegree++;
-       if ( head->inDegree >= head->maxInDegree ) {
-         newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
+      return probe->id;   
+    }
+  }
+  
+  nar->id = dg->numArcs;
+  arcId=dg->numArcs;
+  dg->arc[dg->numArcs] = nar;
+  dg->numArcs++;
+  
+  head->inArc[ head->inDegree] = nar;
+  head->inDegree++;
+  if ( head->inDegree >= head->maxInDegree ) {
+    newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
           ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
-         memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
-         free(head->inArc);
-         head->inArc=ars;
-         head->maxInDegree = newNumber;
-       }
-       tail->outArc[ tail->outDegree] = nar;
-       tail->outDegree++;
-       if(tail->outDegree >= tail->maxOutDegree ) {
-         newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
+    memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
+    free(head->inArc);
+    head->inArc=ars;
+    head->maxInDegree = newNumber;
+  }
+  tail->outArc[ tail->outDegree] = nar;
+  tail->outDegree++;
+  if(tail->outDegree >= tail->maxOutDegree ) {
+    newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
           ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
-         memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
-         free(tail->outArc);
-         tail->outArc=ars;
-         tail->maxOutDegree = newNumber;
-       }
+    memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
+    free(tail->outArc);
+    tail->outArc=ars;
+    tail->maxOutDegree = newNumber;
+  }
 /*fprintf(stderr,"AttachArc: head->in=%d tail->out=%ld\n",head->inDegree,tail->outDegree);*/
 return arcId;
 }
@@ -164,8 +164,8 @@ void graphShow(DGraph *dg,int DetailsLevel){
     DGNode *focusNode = dg->node[ i];
     if(DetailsLevel >= 2) {
       for (j = 0; j < focusNode->inDegree; j++ ) {
-       fprintf(stderr,"\t ");
-       nodeShow(focusNode->inArc[ j]->tail);
+  fprintf(stderr,"\t ");
+  nodeShow(focusNode->inArc[ j]->tail);
       }
     }
     nodeShow(focusNode);
@@ -173,7 +173,7 @@ void graphShow(DGraph *dg,int DetailsLevel){
     for (j = 0; j < focusNode->outDegree; j++ ) {
       fprintf(stderr, "\t ");
       nodeShow(focusNode->outArc[ j]->head);
-    }  
+    }  
     fprintf(stderr, "---\n");
   }
   fprintf(stderr,"----------------------------------------\n");
index f649670..862cf26 100644 (file)
@@ -2,7 +2,7 @@
  *                                                                       * 
  *        N  A  S     P A R A L L E L     B E N C H M A R K S  3.3       *
  *                                                                       * 
- *                                  D T                                         
+ *                                  D T           * 
  *                                                                       * 
  ************************************************************************* 
  *                                                                       * 
@@ -33,7 +33,7 @@
  *                                                                       * 
  ************************************************************************* 
  *                                                                       * 
- *   Author: M. Frumkin                                                         *                                               * 
+ *   Author: M. Frumkin               *             * 
  *                                                                       * 
  *************************************************************************/
 
@@ -64,7 +64,7 @@ void c_print_results( char   *name,
                       int    nprocs_total,
                       double t,
                       double mops,
-                     char   *optype,
+          char   *optype,
                       int    passed_verification,
                       char   *npbversion,
                       char   *compiletime,
@@ -74,7 +74,7 @@ void c_print_results( char   *name,
                       char   *cmpi_inc,
                       char   *cflags,
                       char   *clinkflags );
-                     
+          
 void    timer_clear( int n );
 void    timer_start( int n );
 void    timer_stop( int n );
@@ -100,55 +100,55 @@ int verify(char *bmname,double rnm2){
          verified = 0;
        }else if(cls=='W') {
          if(strstr(bmname,"BH")){
-          verify_value = 4102461.0;
+       verify_value = 4102461.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 204280762.0;
+       verify_value = 204280762.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 186944764.0;
+       verify_value = 186944764.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
          verified = 0;
        }else if(cls=='A') {
          if(strstr(bmname,"BH")){
-          verify_value = 17809491.0;
+       verify_value = 17809491.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 1289925229.0;
+       verify_value = 1289925229.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 610856482.0;
+       verify_value = 610856482.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
-        verified = 0;
+     verified = 0;
        }else if(cls=='B') {
          if(strstr(bmname,"BH")){
-          verify_value = 4317114.0;
+       verify_value = 4317114.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 7877279917.0;
+       verify_value = 7877279917.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 1836863082.0;
+       verify_value = 1836863082.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
-          verified = 0;
+       verified = 0;
          }
        }else if(cls=='C') {
          if(strstr(bmname,"BH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
-          verified = -1;
+       verified = -1;
          }
        }else if(cls=='D') {
          if(strstr(bmname,"BH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
@@ -158,15 +158,15 @@ int verify(char *bmname,double rnm2){
        }
        fprintf(stderr," %s L2 Norm = %f\n",bmname,rnm2);
        if(verified==-1){
-        fprintf(stderr," No verification was performed.\n");
+     fprintf(stderr," No verification was performed.\n");
        }else if( rnm2 - verify_value < epsilon &&
                  rnm2 - verify_value > -epsilon) {  /* abs here does not work on ALTIX */
-         verified = 1;
-         fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
+      verified = 1;
+      fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
        }else{
-        verified = 0;
-        fprintf(stderr," The correct verification value = %f\n",verify_value);
-        fprintf(stderr," Got value = %f\n",rnm2);
+     verified = 0;
+     fprintf(stderr," The correct verification value = %f\n",verify_value);
+     fprintf(stderr," Got value = %f\n",rnm2);
        }
     }else{
        verified = -1;
@@ -299,7 +299,7 @@ DGraph *buildWH(char cls){
       id=AttachNode(dg,nd);
       for(j=0;j<maxInDeg;j++){
         sid=i*maxInDeg+j;
-       if(sid>=numPrevLayerNodes) break;
+  if(sid>=numPrevLayerNodes) break;
         snd=dg->node[firstLayerNode+sid];
         ar=newArc(dg->node[id],snd);
         AttachArc(dg,ar);
@@ -359,7 +359,7 @@ DGraph *buildBH(char cls){
       id=AttachNode(dg,nd);
       for(j=0;j<maxInDeg;j++){
         sid=i*maxInDeg+j;
-       if(sid>=numPrevLayerNodes) break;
+  if(sid>=numPrevLayerNodes) break;
         snd=dg->node[firstLayerNode+sid];
         ar=newArc(snd,dg->node[id]);
         AttachArc(dg,ar);
@@ -488,19 +488,19 @@ Arr* WindowFilter(Arr *a, Arr* b,int w){
   if(a->len>b->len) Resample(b,a->len);
   for(i=fielddim;i<a->len-fielddim;i+=fielddim){
     rms0=(a->val[i]-b->val[i])*(a->val[i]-b->val[i])
-       +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
-       +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
-       +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
+  +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
+  +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
+  +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
     j=i+fielddim;
     rms1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
-       +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
-       +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
-       +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+      +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+      +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+      +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
     j=i-fielddim;
     rmsm1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
-        +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
-        +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
-        +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+   +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+   +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+   +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
     k=0;
     if(rms1<rms0){
       k=1;
@@ -525,7 +525,7 @@ Arr* WindowFilter(Arr *a, Arr* b,int w){
       a->val[i+1]=weight*b->val[j+1];
       a->val[i+2]=weight*b->val[j+2];
       a->val[i+3]=weight*b->val[j+3];  
-    }     
+    }     
   }
   if(timer_on){
     timer_stop(w);
@@ -752,25 +752,25 @@ int main(int argc,char **argv ){
       timer_stop(0);
       tot_time=timer_read(0);
       c_print_results( dg->name,
-                      CLASS,
-                      featnum,
-                      0,
-                      0,
-                      dg->numNodes,
-                      0,
-                      comm_size,
-                      tot_time,
-                      bytes_sent/tot_time,
-                      "bytes transmitted", 
-                      verified,
-                      NPBVERSION,
-                      COMPILETIME,
-                      MPICC,
-                      CLINK,
-                      CMPI_LIB,
-                      CMPI_INC,
-                      CFLAGS,
-                      CLINKFLAGS );
+                 CLASS,
+                 featnum,
+                 0,
+                 0,
+                 dg->numNodes,
+                 0,
+                 comm_size,
+                 tot_time,
+                 bytes_sent/tot_time,
+                 "bytes transmitted", 
+                 verified,
+                 NPBVERSION,
+                 COMPILETIME,
+                 MPICC,
+                 CLINK,
+                 CMPI_LIB,
+                 CMPI_INC,
+                 CFLAGS,
+                 CLINKFLAGS );
     }          
     MPI_Finalize();
   return 1;
index 5d5839d..f573786 100644 (file)
@@ -32,7 +32,7 @@ DGNode *newNode(char *nm){
 }
 void nodeShow(DGNode* nd){
   fprintf( stderr,"%3d.%s: (%d,%d)\n",
-                  nd->id,nd->name,nd->inDegree,nd->outDegree);
+             nd->id,nd->name,nd->inDegree,nd->outDegree);
 /*
   if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
   else if(nd->verified==0)  fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
@@ -56,103 +56,103 @@ int AttachNode(DGraph* dg, DGNode* nd) {
   DGNode **nds =NULL, *tmpnd=NULL;
   DGArc **ar=NULL;
 
-       if (dg->numNodes == dg->maxNodes-1 ) {
-         dg->maxNodes += BLOCK_SIZE;
+  if (dg->numNodes == dg->maxNodes-1 ) {
+    dg->maxNodes += BLOCK_SIZE;
           nds =(DGNode **) calloc(dg->maxNodes,sizeof(DGNode*));
-         memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
-         free(dg->node);
-         dg->node=nds;
-       }
+    memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
+    free(dg->node);
+    dg->node=nds;
+  }
 
         len = strlen( nd->name);
-       for (i = 0; i < dg->numNodes; i++) {
-         tmpnd =dg->node[ i];
-         ar=NULL;
-         if ( strlen( tmpnd->name) != len ) continue;
-         if ( strncmp( nd->name, tmpnd->name, len) ) continue;
-         if ( nd->inDegree > 0 ) {
-           tmpnd->maxInDegree += nd->maxInDegree;
+  for (i = 0; i < dg->numNodes; i++) {
+    tmpnd =dg->node[ i];
+    ar=NULL;
+    if ( strlen( tmpnd->name) != len ) continue;
+    if ( strncmp( nd->name, tmpnd->name, len) ) continue;
+    if ( nd->inDegree > 0 ) {
+      tmpnd->maxInDegree += nd->maxInDegree;
             ar =(DGArc **) calloc(tmpnd->maxInDegree,sizeof(DGArc*));
-           memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
-           free(tmpnd->inArc);
-           tmpnd->inArc=ar;
-           for (j = 0; j < nd->inDegree; j++ ) {
-             nd->inArc[ j]->head = tmpnd;
-           }
-           memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
-           tmpnd->inDegree += nd->inDegree;
-         }     
-         if ( nd->outDegree > 0 ) {
-           tmpnd->maxOutDegree += nd->maxOutDegree;
+      memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
+      free(tmpnd->inArc);
+      tmpnd->inArc=ar;
+      for (j = 0; j < nd->inDegree; j++ ) {
+        nd->inArc[ j]->head = tmpnd;
+      }
+      memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
+      tmpnd->inDegree += nd->inDegree;
+    }   
+    if ( nd->outDegree > 0 ) {
+      tmpnd->maxOutDegree += nd->maxOutDegree;
             ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
-           memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
-           free(tmpnd->outArc);
-           tmpnd->outArc=ar;
-           for (j = 0; j < nd->outDegree; j++ ) {
-             nd->outArc[ j]->tail = tmpnd;
-           }                   
-           memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
-           tmpnd->outDegree += nd->outDegree;
-         
-         free(nd); 
-         return i;
-       }
-       nd->id = dg->numNodes;
-       dg->node[dg->numNodes] = nd;
-       dg->numNodes++;
+      memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
+      free(tmpnd->outArc);
+      tmpnd->outArc=ar;
+      for (j = 0; j < nd->outDegree; j++ ) {
+        nd->outArc[ j]->tail = tmpnd;
+      }      
+      memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
+      tmpnd->outDegree += nd->outDegree;
+    } 
+    free(nd); 
+    return i;
+  }
+  nd->id = dg->numNodes;
+  dg->node[dg->numNodes] = nd;
+  dg->numNodes++;
 return nd->id;
 }
 int AttachArc(DGraph *dg,DGArc* nar){
-int    arcId = -1;
+int  arcId = -1;
 int i=0,newNumber=0;
-DGNode *head = nar->head,
-       *tail = nar->tail; 
+DGNode  *head = nar->head,
+  *tail = nar->tail; 
 DGArc **ars=NULL,*probe=NULL;
 /*fprintf(stderr,"AttachArc %ld\n",dg->numArcs); */
-       if ( !tail || !head ) return arcId;
-       if ( dg->numArcs == dg->maxArcs-1 ) {
-         dg->maxArcs += BLOCK_SIZE;
+  if ( !tail || !head ) return arcId;
+  if ( dg->numArcs == dg->maxArcs-1 ) {
+    dg->maxArcs += BLOCK_SIZE;
           ars =(DGArc **) calloc(dg->maxArcs,sizeof(DGArc*));
-         memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
-         free(dg->arc);
-         dg->arc=ars;
-       }
-       for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
-         probe = tail->outArc[ i];
-         if(probe->head == head
-            &&
-            probe->length == nar->length
+    memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
+    free(dg->arc);
+    dg->arc=ars;
+  }
+  for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
+    probe = tail->outArc[ i];
+    if(probe->head == head
+       &&
+       probe->length == nar->length
             ){
             free(nar);
-           return probe->id;   
-         }
-       }
-       
-       nar->id = dg->numArcs;
-       arcId=dg->numArcs;
-       dg->arc[dg->numArcs] = nar;
-       dg->numArcs++;
-       
-       head->inArc[ head->inDegree] = nar;
-       head->inDegree++;
-       if ( head->inDegree >= head->maxInDegree ) {
-         newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
+      return probe->id;   
+    }
+  }
+  
+  nar->id = dg->numArcs;
+  arcId=dg->numArcs;
+  dg->arc[dg->numArcs] = nar;
+  dg->numArcs++;
+  
+  head->inArc[ head->inDegree] = nar;
+  head->inDegree++;
+  if ( head->inDegree >= head->maxInDegree ) {
+    newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
           ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
-         memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
-         free(head->inArc);
-         head->inArc=ars;
-         head->maxInDegree = newNumber;
-       }
-       tail->outArc[ tail->outDegree] = nar;
-       tail->outDegree++;
-       if(tail->outDegree >= tail->maxOutDegree ) {
-         newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
+    memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
+    free(head->inArc);
+    head->inArc=ars;
+    head->maxInDegree = newNumber;
+  }
+  tail->outArc[ tail->outDegree] = nar;
+  tail->outDegree++;
+  if(tail->outDegree >= tail->maxOutDegree ) {
+    newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
           ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
-         memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
-         free(tail->outArc);
-         tail->outArc=ars;
-         tail->maxOutDegree = newNumber;
-       }
+    memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
+    free(tail->outArc);
+    tail->outArc=ars;
+    tail->maxOutDegree = newNumber;
+  }
 /*fprintf(stderr,"AttachArc: head->in=%d tail->out=%ld\n",head->inDegree,tail->outDegree);*/
 return arcId;
 }
@@ -164,8 +164,8 @@ void graphShow(DGraph *dg,int DetailsLevel){
     DGNode *focusNode = dg->node[ i];
     if(DetailsLevel >= 2) {
       for (j = 0; j < focusNode->inDegree; j++ ) {
-       fprintf(stderr,"\t ");
-       nodeShow(focusNode->inArc[ j]->tail);
+  fprintf(stderr,"\t ");
+  nodeShow(focusNode->inArc[ j]->tail);
       }
     }
     nodeShow(focusNode);
@@ -173,7 +173,7 @@ void graphShow(DGraph *dg,int DetailsLevel){
     for (j = 0; j < focusNode->outDegree; j++ ) {
       fprintf(stderr, "\t ");
       nodeShow(focusNode->outArc[ j]->head);
-    }  
+    }  
     fprintf(stderr, "---\n");
   }
   fprintf(stderr,"----------------------------------------\n");
index ed8cfeb..d210b16 100644 (file)
@@ -2,7 +2,7 @@
  *                                                                       * 
  *        N  A  S     P A R A L L E L     B E N C H M A R K S  3.3       *
  *                                                                       * 
- *                                  D T                                         
+ *                                  D T           * 
  *                                                                       * 
  ************************************************************************* 
  *                                                                       * 
@@ -33,7 +33,7 @@
  *                                                                       * 
  ************************************************************************* 
  *                                                                       * 
- *   Author: M. Frumkin                                                         *                                               * 
+ *   Author: M. Frumkin               *             * 
  *                                                                       * 
  *************************************************************************/
 
@@ -62,7 +62,7 @@ void c_print_results( char   *name,
                       int    nprocs_total,
                       double t,
                       double mops,
-                     char   *optype,
+          char   *optype,
                       int    passed_verification,
                       char   *npbversion,
                       char   *compiletime,
@@ -72,7 +72,7 @@ void c_print_results( char   *name,
                       char   *cmpi_inc,
                       char   *cflags,
                       char   *clinkflags );
-                     
+          
 void    timer_clear( int n );
 void    timer_start( int n );
 void    timer_stop( int n );
@@ -98,55 +98,55 @@ int verify(char *bmname,double rnm2){
          verified = 0;
        }else if(cls=='W') {
          if(strstr(bmname,"BH")){
-          verify_value = 4102461.0;
+       verify_value = 4102461.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 204280762.0;
+       verify_value = 204280762.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 186944764.0;
+       verify_value = 186944764.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
          verified = 0;
        }else if(cls=='A') {
          if(strstr(bmname,"BH")){
-          verify_value = 17809491.0;
+       verify_value = 17809491.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 1289925229.0;
+       verify_value = 1289925229.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 610856482.0;
+       verify_value = 610856482.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
-        verified = 0;
+     verified = 0;
        }else if(cls=='B') {
          if(strstr(bmname,"BH")){
-          verify_value = 4317114.0;
+       verify_value = 4317114.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 7877279917.0;
+       verify_value = 7877279917.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 1836863082.0;
+       verify_value = 1836863082.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
-          verified = 0;
+       verified = 0;
          }
        }else if(cls=='C') {
          if(strstr(bmname,"BH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
-          verified = -1;
+       verified = -1;
          }
        }else if(cls=='D') {
          if(strstr(bmname,"BH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"WH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else if(strstr(bmname,"SH")){
-          verify_value = 0.0;
+       verify_value = 0.0;
          }else{
            fprintf(stderr,"No such benchmark as %s.\n",bmname);
          }
@@ -156,15 +156,15 @@ int verify(char *bmname,double rnm2){
        }
        fprintf(stderr," %s L2 Norm = %f\n",bmname,rnm2);
        if(verified==-1){
-        fprintf(stderr," No verification was performed.\n");
+     fprintf(stderr," No verification was performed.\n");
        }else if( rnm2 - verify_value < epsilon &&
                  rnm2 - verify_value > -epsilon) {  /* abs here does not work on ALTIX */
-         verified = 1;
-         fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
+      verified = 1;
+      fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
        }else{
-        verified = 0;
-        fprintf(stderr," The correct verification value = %f\n",verify_value);
-        fprintf(stderr," Got value = %f\n",rnm2);
+     verified = 0;
+     fprintf(stderr," The correct verification value = %f\n",verify_value);
+     fprintf(stderr," Got value = %f\n",rnm2);
        }
     }else{
        verified = -1;
@@ -297,7 +297,7 @@ DGraph *buildWH(char cls){
       id=AttachNode(dg,nd);
       for(j=0;j<maxInDeg;j++){
         sid=i*maxInDeg+j;
-       if(sid>=numPrevLayerNodes) break;
+  if(sid>=numPrevLayerNodes) break;
         snd=dg->node[firstLayerNode+sid];
         ar=newArc(dg->node[id],snd);
         AttachArc(dg,ar);
@@ -357,7 +357,7 @@ DGraph *buildBH(char cls){
       id=AttachNode(dg,nd);
       for(j=0;j<maxInDeg;j++){
         sid=i*maxInDeg+j;
-       if(sid>=numPrevLayerNodes) break;
+  if(sid>=numPrevLayerNodes) break;
         snd=dg->node[firstLayerNode+sid];
         ar=newArc(snd,dg->node[id]);
         AttachArc(dg,ar);
@@ -486,19 +486,19 @@ Arr* WindowFilter(Arr *a, Arr* b,int w){
   if(a->len>b->len) Resample(b,a->len);
   for(i=fielddim;i<a->len-fielddim;i+=fielddim){
     rms0=(a->val[i]-b->val[i])*(a->val[i]-b->val[i])
-       +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
-       +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
-       +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
+  +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
+  +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
+  +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
     j=i+fielddim;
     rms1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
-       +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
-       +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
-       +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+      +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+      +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+      +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
     j=i-fielddim;
     rmsm1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
-        +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
-        +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
-        +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+   +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+   +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+   +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
     k=0;
     if(rms1<rms0){
       k=1;
@@ -523,7 +523,7 @@ Arr* WindowFilter(Arr *a, Arr* b,int w){
       a->val[i+1]=weight*b->val[j+1];
       a->val[i+2]=weight*b->val[j+2];
       a->val[i+3]=weight*b->val[j+3];  
-    }     
+    }     
   }
   if(timer_on){
     timer_stop(w);
@@ -734,25 +734,25 @@ int main(int argc,char **argv ){
       timer_stop(0);
       tot_time=timer_read(0);
       c_print_results( dg->name,
-                      CLASS,
-                      featnum,
-                      0,
-                      0,
-                      dg->numNodes,
-                      0,
-                      comm_size,
-                      tot_time,
-                      bytes_sent/tot_time,
-                      "bytes transmitted", 
-                      verified,
-                      NPBVERSION,
-                      COMPILETIME,
-                      MPICC,
-                      CLINK,
-                      CMPI_LIB,
-                      CMPI_INC,
-                      CFLAGS,
-                      CLINKFLAGS );
+                 CLASS,
+                 featnum,
+                 0,
+                 0,
+                 dg->numNodes,
+                 0,
+                 comm_size,
+                 tot_time,
+                 bytes_sent/tot_time,
+                 "bytes transmitted", 
+                 verified,
+                 NPBVERSION,
+                 COMPILETIME,
+                 MPICC,
+                 CLINK,
+                 CMPI_LIB,
+                 CMPI_INC,
+                 CFLAGS,
+                 CLINKFLAGS );
     }          
     MPI_Finalize();
   return 1;
index 71e0f89..04b0c1b 100644 (file)
@@ -46,7 +46,7 @@
       {
         int i;
         long  i246m1=0x00003FFFFFFFFFFF;
-         long  LLx, Lx, La;
+    long  LLx, Lx, La;
         double d2m46;
 
 // This doesn't work, because the compiler does the calculation in 32
       La = (long)a;
       //fprintf(stdout,("================== Vranlc ================");
       //fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
-       LLx = Lx;
-       for (i=0; i< n; i++) {
-                 Lx   = Lx*La & i246m1 ;
-                 LLx = Lx;
-                 y[i] = d2m46 * (double)LLx;
-                 /*
-                    if(i == 0) {
-                    fprintf(stdout,("After loop 0:");
-                    fprintf(stdout,("Lx = " + Lx + ", La = " + La);
-                    fprintf(stdout,("d2m46 = " + d2m46);
-                    fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
-                    fprintf(stdout,("Y[0]" + y[0]);
-                    }
-                  */
-       }
+  LLx = Lx;
+  for (i=0; i< n; i++) {
+      Lx   = Lx*La & i246m1 ;
+      LLx = Lx;
+      y[i] = d2m46 * (double)LLx;
+      /*
+         if(i == 0) {
+         fprintf(stdout,("After loop 0:");
+         fprintf(stdout,("Lx = " + Lx + ", La = " + La);
+         fprintf(stdout,("d2m46 = " + d2m46);
+         fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
+         fprintf(stdout,("Y[0]" + y[0]);
+         }
+       */
+  }
 
       x = (double)LLx;
       /*
 
 //-------------- the core (unique function) -----------
       void doTest(int argc, char **argv) {
-                 double dum[3] = {1.,1.,1.};
-                 double x1, x2, sx, sy, tm, an, tt, gc;
-                 double Mops;
-                 double epsilon=1.0E-8, a = 1220703125., s=271828183.;
-                 double t1, t2, t3, t4; 
-                 double sx_verify_value, sy_verify_value, sx_err, sy_err;
+      double dum[3] = {1.,1.,1.};
+      double x1, x2, sx, sy, tm, an, tt, gc;
+      double Mops;
+      double epsilon=1.0E-8, a = 1220703125., s=271828183.;
+      double t1, t2, t3, t4; 
+      double sx_verify_value, sy_verify_value, sx_err, sy_err;
 
 #include "npbparams.h"
-                 int    mk=16, 
-                          // --> set by make : in npbparams.h
-                          //m=28, // for CLASS=A
-                          //m=30, // for CLASS=B
-                          //npm=2, // NPROCS
-                          mm = m-mk, 
-                          nn = (int)(pow(2,mm)), 
-                          nk = (int)(pow(2,mk)), 
-                          nq=10, 
-                          np, 
-                          node, 
-                          no_nodes, 
-                          i, 
-                          ik, 
-                          kk, 
-                          l, 
-                          k, nit, no_large_nodes,
-                          np_add, k_offset, j;
-                 int    me, nprocs, root=0, dp_type;
-                 int verified, 
-                           timers_enabled=true;
-                 char  size[500]; // mind the size of the string to represent a big number
-
-                 //Use in randlc..
-                 int KS = 0;
-                 double R23, R46, T23, T46;
-
-                 double *qq = (double *) malloc (10000*sizeof(double));
-                 double *start = (double *) malloc (64*sizeof(double));
-                 double *elapsed = (double *) malloc (64*sizeof(double));
-
-                 double *x = (double *) malloc (2*nk*sizeof(double));
-                 double *q = (double *) malloc (nq*sizeof(double));
-
-                 MPI_Init( &argc, &argv );
-                 MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
-                 MPI_Comm_rank( MPI_COMM_WORLD, &node);
+      int    mk=16, 
+         // --> set by make : in npbparams.h
+         //m=28, // for CLASS=A
+         //m=30, // for CLASS=B
+         //npm=2, // NPROCS
+         mm = m-mk, 
+         nn = (int)(pow(2,mm)), 
+         nk = (int)(pow(2,mk)), 
+         nq=10, 
+         np, 
+         node, 
+         no_nodes, 
+         i, 
+         ik, 
+         kk, 
+         l, 
+         k, nit, no_large_nodes,
+         np_add, k_offset, j;
+      int    me, nprocs, root=0, dp_type;
+      int verified, 
+          timers_enabled=true;
+      char  size[500]; // mind the size of the string to represent a big number
+
+      //Use in randlc..
+      int KS = 0;
+      double R23, R46, T23, T46;
+
+      double *qq = (double *) malloc (10000*sizeof(double));
+      double *start = (double *) malloc (64*sizeof(double));
+      double *elapsed = (double *) malloc (64*sizeof(double));
+
+      double *x = (double *) malloc (2*nk*sizeof(double));
+      double *q = (double *) malloc (nq*sizeof(double));
+
+      MPI_Init( &argc, &argv );
+      MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
+      MPI_Comm_rank( MPI_COMM_WORLD, &node);
 
 #ifdef USE_MPE
     MPE_Init_log();
 #endif
-                 root = 0;
-                 if (node == root ) {
-
-                           /*   Because the size of the problem is too large to store in a 32-bit
-                            *   integer for some classes, we put it into a string (for printing).
-                            *   Have to strip off the decimal point put in there by the floating
-                            *   point print statement (internal file)
-                            */
-                           fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
-                           sprintf(size,"%d",pow(2,m+1));
-                           //size = size.replace('.', ' ');
-                           fprintf(stdout," Number of random numbers generated: %s\n",size);
-                           fprintf(stdout," Number of active processes: %d\n",no_nodes);
-
-                 }
-                 verified = false;
-
-                 /* c   Compute the number of "batches" of random number pairs generated 
-                    c   per processor. Adjust if the number of processors does not evenly 
-                    c   divide the total number
+      root = 0;
+      if (node == root ) {
+
+          /*   Because the size of the problem is too large to store in a 32-bit
+           *   integer for some classes, we put it into a string (for printing).
+           *   Have to strip off the decimal point put in there by the floating
+           *   point print statement (internal file)
+           */
+          fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
+          sprintf(size,"%d",pow(2,m+1));
+          //size = size.replace('.', ' ');
+          fprintf(stdout," Number of random numbers generated: %s\n",size);
+          fprintf(stdout," Number of active processes: %d\n",no_nodes);
+
+      }
+      verified = false;
+
+      /* c   Compute the number of "batches" of random number pairs generated 
+         c   per processor. Adjust if the number of processors does not evenly 
+         c   divide the total number
 */
 
        np = nn / no_nodes;
    c   sure these initializations cannot be eliminated as dead code.
 */
 
-        //call vranlc(0, dum[1], dum[2], dum[3]);
-        // Array indexes start at 1 in Fortran, 0 in Java
-        vranlc(0, dum[0], dum[1], &(dum[2])); 
-
-        dum[0] = randlc(&(dum[1]),&(dum[2]));
-        /////////////////////////////////
-        for (i=0;i<2*nk;i++) {
-                  x[i] = -1e99;
-        }
-        Mops = log(sqrt(abs(1))); 
-
-        /*
-           c---------------------------------------------------------------------
-           c    Synchronize before placing time stamp
-           c---------------------------------------------------------------------
-         */
+   //call vranlc(0, dum[1], dum[2], dum[3]);
+   // Array indexes start at 1 in Fortran, 0 in Java
+   vranlc(0, dum[0], dum[1], &(dum[2])); 
+
+   dum[0] = randlc(&(dum[1]),&(dum[2]));
+   /////////////////////////////////
+   for (i=0;i<2*nk;i++) {
+       x[i] = -1e99;
+   }
+   Mops = log(sqrt(abs(1))); 
+
+   /*
+      c---------------------------------------------------------------------
+      c    Synchronize before placing time stamp
+      c---------------------------------------------------------------------
+    */
         MPI_Barrier( MPI_COMM_WORLD );
 
         timer_clear(&(elapsed[1]));
         timer_start(&(start[1]));
         
         t1 = a;
-       //fprintf(stdout,("(ep.f:160) t1 = " + t1);
+  //fprintf(stdout,("(ep.f:160) t1 = " + t1);
         t1 = vranlc(0, t1, a, x);
-       //fprintf(stdout,("(ep.f:161) t1 = " + t1);
-       
+  //fprintf(stdout,("(ep.f:161) t1 = " + t1);
+  
         
 /* c   Compute AN = A ^ (2 * NK) (mod 2^46). */
         
         t1 = a;
-       //fprintf(stdout,("(ep.f:165) t1 = " + t1);
+  //fprintf(stdout,("(ep.f:165) t1 = " + t1);
         for (i=1; i <= mk+1; i++) {
                t2 = randlc(&t1, &t1);
-              //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
+         //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
         } 
         an = t1;
-       //fprintf(stdout,("(ep.f:172) s = " + s);
+  //fprintf(stdout,("(ep.f:172) s = " + s);
         tt = s;
         gc = 0.;
         sx = 0.;
 
          for (i=1;i<=100 && !stop;i++) {
             ik = kk / 2;
-           //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
+      //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
             if (2 * ik != kk)  {
                 t3 = randlc(&t1, &t2);
                 //fprintf(stdout,("(ep.f:200) t1= " +t1 );
 //       Compute uniform pseudorandom numbers.
 
          //if (timers_enabled)  timer_start(3);
-        timer_start(&(start[3]));
+   timer_start(&(start[3]));
          //call vranlc(2 * nk, t1, a, x)  --> t1 and y are modified
 
-       //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
-       //fprintf(stdout,"2*nk = " + (2*nk));
-       //fprintf(stdout,"t1 = " + t1);
-       //fprintf(stdout,"a  = " + a);
-       //fprintf(stdout,"x[0] = " + x[0]);
-       //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+  //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
+  //fprintf(stdout,"2*nk = " + (2*nk));
+  //fprintf(stdout,"t1 = " + t1);
+  //fprintf(stdout,"a  = " + a);
+  //fprintf(stdout,"x[0] = " + x[0]);
+  //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
         
-       t1 = vranlc(2 * nk, t1, a, x);
-
-       //fprintf(stdout,(">>>>>>>>>>>After  Enter vranlc (l.210)<<<<<<");
-       //fprintf(stdout,("2*nk = " + (2*nk));
-       //fprintf(stdout,("t1 = " + t1);
-       //fprintf(stdout,("a  = " + a);
-       //fprintf(stdout,("x[0] = " + x[0]);
-       //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+  t1 = vranlc(2 * nk, t1, a, x);
+
+  //fprintf(stdout,(">>>>>>>>>>>After  Enter vranlc (l.210)<<<<<<");
+  //fprintf(stdout,("2*nk = " + (2*nk));
+  //fprintf(stdout,("t1 = " + t1);
+  //fprintf(stdout,("a  = " + a);
+  //fprintf(stdout,("x[0] = " + x[0]);
+  //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
         
          //if (timers_enabled)  timer_stop(3);
-        timer_stop(3,elapsed,start);
+   timer_stop(3,elapsed,start);
 
 /*       Compute Gaussian deviates by acceptance-rejection method and 
  *       tally counts in concentric square annuli.  This loop is not 
  *       vectorizable. 
  */
          //if (timers_enabled) timer_start(2);
-        timer_start(&(start[2]));
+    timer_start(&(start[2]));
          for(i=1; i<=nk;i++) {
             x1 = 2. * x[2*i-2] -1.0;
             x2 = 2. * x[2*i-1] - 1.0;
                sx   = sx + t3;
                sy   = sy + t4;
              }
-               /*
-            if(i == 1) {
+    /*
+       if(i == 1) {
                 fprintf(stdout,"x1 = " + x1);
                 fprintf(stdout,"x2 = " + x2);
                 fprintf(stdout,"t1 = " + t1);
                 fprintf(stdout,"q[l] = " + q[l]);
                 fprintf(stdout,"sx = " + sx);
                 fprintf(stdout,"sy = " + sy);
-            }
-               */
+       }
+    */
            }
          //if (timers_enabled)  timer_stop(2);
-        timer_stop(2,elapsed,start);
+    timer_stop(2,elapsed,start);
       }
 
       //int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)   
-       MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
-       sx = x[0]; //FIXME :  x[0] or x[1] => x[0] because fortran starts with 1
+  MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+  sx = x[0]; //FIXME :  x[0] or x[1] => x[0] because fortran starts with 1
       MPI_Allreduce(&sy, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
       sy = x[0];
       MPI_Allreduce(q, x, nq, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
 
       for(i = 0; i < nq; i++) {
-               q[i] = x[i];
-       }
-       for(i = 0; i < nq; i++) {
-               gc += q[i];
-       }
+    q[i] = x[i];
+  }
+  for(i = 0; i < nq; i++) {
+    gc += q[i];
+  }
 
-       timer_stop(1,elapsed,start);
+  timer_stop(1,elapsed,start);
       tm = timer_read(1,elapsed);
-       MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
-       tm = x[0];
-
-       if(node == root) {
-               nit = 0;
-               verified = true;
-
-               if(m == 24) {
-                       sx_verify_value = -3.247834652034740E3;
-                       sy_verify_value = -6.958407078382297E3;
-               } else if(m == 25) {
-                       sx_verify_value = -2.863319731645753E3;
-                       sy_verify_value = -6.320053679109499E3;
-               } else if(m == 28) {
-                       sx_verify_value = -4.295875165629892E3;
-                       sy_verify_value = -1.580732573678431E4;
-               } else if(m == 30) {
-                       sx_verify_value =  4.033815542441498E4;
-                       sy_verify_value = -2.660669192809235E4;
-               } else if(m == 32) {
-                       sx_verify_value =  4.764367927995374E4;
-                       sy_verify_value = -8.084072988043731E4;
-               } else if(m == 36) {
-                       sx_verify_value =  1.982481200946593E5;
-                       sy_verify_value = -1.020596636361769E5;
-               } else {
-                       verified = false;
-               }
-
-               /*
-               fprintf(stdout,("sx        = " + sx);
-               fprintf(stdout,("sx_verify = " + sx_verify_value);
-               fprintf(stdout,("sy        = " + sy);
-               fprintf(stdout,("sy_verify = " + sy_verify_value);
-               */
-               if(verified) {
-                       sx_err = abs((sx - sx_verify_value)/sx_verify_value);
-                       sy_err = abs((sy - sy_verify_value)/sy_verify_value);
-                       /*
-                       fprintf(stdout,("sx_err = " + sx_err);
-                       fprintf(stdout,("sy_err = " + sx_err);
-                       fprintf(stdout,("epsilon= " + epsilon);
-                       */
-                       verified = ((sx_err < epsilon) && (sy_err < epsilon));
-               }
-
-               Mops = (pow(2.0, m+1))/tm/1000;
-
-               fprintf(stdout,"EP Benchmark Results:\n");
-               fprintf(stdout,"CPU Time=%d\n",tm);
-               fprintf(stdout,"N = 2^%d\n",m);
-               fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
-               fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
-               fprintf(stdout,"Count:");
-               for(i = 0; i < nq; i++) {
-                       fprintf(stdout,"%d\t %ld\n",i,q[i]);
-               }
-
-               /*
-               print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
-                               "Random numbers generated", verified, npbversion,
-                               compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
-               fprintf(stdout,"\nEP Benchmark Completed\n");
+  MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+  tm = x[0];
+
+  if(node == root) {
+    nit = 0;
+    verified = true;
+
+    if(m == 24) {
+             sx_verify_value = -3.247834652034740E3;
+                  sy_verify_value = -6.958407078382297E3;
+    } else if(m == 25) {
+                sx_verify_value = -2.863319731645753E3;
+      sy_verify_value = -6.320053679109499E3;
+    } else if(m == 28) {
+            sx_verify_value = -4.295875165629892E3;
+      sy_verify_value = -1.580732573678431E4;
+    } else if(m == 30) {
+            sx_verify_value =  4.033815542441498E4;
+                  sy_verify_value = -2.660669192809235E4;
+    } else if(m == 32) {
+                  sx_verify_value =  4.764367927995374E4;
+                     sy_verify_value = -8.084072988043731E4;
+    } else if(m == 36) {
+            sx_verify_value =  1.982481200946593E5;
+            sy_verify_value = -1.020596636361769E5;
+    } else {
+      verified = false;
+    }
+
+    /*
+    fprintf(stdout,("sx        = " + sx);
+    fprintf(stdout,("sx_verify = " + sx_verify_value);
+    fprintf(stdout,("sy        = " + sy);
+    fprintf(stdout,("sy_verify = " + sy_verify_value);
+    */
+    if(verified) {
+      sx_err = abs((sx - sx_verify_value)/sx_verify_value);
+      sy_err = abs((sy - sy_verify_value)/sy_verify_value);
+      /*
+      fprintf(stdout,("sx_err = " + sx_err);
+      fprintf(stdout,("sy_err = " + sx_err);
+      fprintf(stdout,("epsilon= " + epsilon);
+      */
+      verified = ((sx_err < epsilon) && (sy_err < epsilon));
+    }
+
+    Mops = (pow(2.0, m+1))/tm/1000;
+
+    fprintf(stdout,"EP Benchmark Results:\n");
+    fprintf(stdout,"CPU Time=%d\n",tm);
+    fprintf(stdout,"N = 2^%d\n",m);
+    fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
+    fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+    fprintf(stdout,"Count:");
+    for(i = 0; i < nq; i++) {
+      fprintf(stdout,"%d\t %ld\n",i,q[i]);
+    }
+
+    /*
+    print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
+        "Random numbers generated", verified, npbversion,
+        compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
+    fprintf(stdout,"\nEP Benchmark Completed\n");
             fprintf(stdout,"Class           = %s\n", _class);
-               fprintf(stdout,"Size            = %s\n", size);
-               fprintf(stdout,"Iteration       = %d\n", nit);
-               fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
-               fprintf(stdout,"Total processes = %d\n",no_nodes);
-               fprintf(stdout,"Mops/s total    = %lf\n",Mops);
-               fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
-               fprintf(stdout,"Operation type  = Random number generated\n");
-               if(verified) {
-                       fprintf(stdout,"Verification    = SUCCESSFUL\n");
-               } else {
-                       fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
-               }
-               fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
-               fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
-               fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
-               }
+    fprintf(stdout,"Size            = %s\n", size);
+    fprintf(stdout,"Iteration       = %d\n", nit);
+    fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+    fprintf(stdout,"Total processes = %d\n",no_nodes);
+    fprintf(stdout,"Mops/s total    = %lf\n",Mops);
+    fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
+    fprintf(stdout,"Operation type  = Random number generated\n");
+    if(verified) {
+      fprintf(stdout,"Verification    = SUCCESSFUL\n");
+    } else {
+      fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
+    }
+             fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
+             fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
+             fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+         }
 #ifdef USE_MPE
     MPE_Finish_log(argv[0]);
 #endif
index 624b800..4de6c93 100644 (file)
 /*************    portable random number generator    ************/
 /*****************************************************************/
 
-double randlc( double *X, double *A )
+double  randlc( double *X, double *A )
 {
       static int        KS=0;
-      static double    R23, R46, T23, T46;
-      double           T1, T2, T3, T4;
-      double           A1;
-      double           A2;
-      double           X1;
-      double           X2;
-      double           Z;
-      int              i, j;
+      static double  R23, R46, T23, T46;
+      double    T1, T2, T3, T4;
+      double    A1;
+      double    A2;
+      double    X1;
+      double    X2;
+      double    Z;
+      int         i, j;
 
       if (KS == 0) 
       {
index a0cec1b..4c5f5a7 100644 (file)
@@ -48,7 +48,7 @@
       {
         int i;
         long  i246m1=0x00003FFFFFFFFFFF;
-         long  LLx, Lx, La;
+    long  LLx, Lx, La;
         double d2m46;
 
 // This doesn't work, because the compiler does the calculation in 32
       La = (long)a;
       //fprintf(stdout,("================== Vranlc ================");
       //fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
-       LLx = Lx;
-       for (i=0; i< n; i++) {
-                 Lx   = Lx*La & i246m1 ;
-                 LLx = Lx;
-                 y[i] = d2m46 * (double)LLx;
-                 /*
-                    if(i == 0) {
-                    fprintf(stdout,("After loop 0:");
-                    fprintf(stdout,("Lx = " + Lx + ", La = " + La);
-                    fprintf(stdout,("d2m46 = " + d2m46);
-                    fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
-                    fprintf(stdout,("Y[0]" + y[0]);
-                    }
-                  */
-       }
+  LLx = Lx;
+  for (i=0; i< n; i++) {
+      Lx   = Lx*La & i246m1 ;
+      LLx = Lx;
+      y[i] = d2m46 * (double)LLx;
+      /*
+         if(i == 0) {
+         fprintf(stdout,("After loop 0:");
+         fprintf(stdout,("Lx = " + Lx + ", La = " + La);
+         fprintf(stdout,("d2m46 = " + d2m46);
+         fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
+         fprintf(stdout,("Y[0]" + y[0]);
+         }
+       */
+  }
 
       x = (double)LLx;
       /*
 
 //-------------- the core (unique function) -----------
       void doTest(int argc, char **argv) {
-                 double dum[3] = {1.,1.,1.};
-                 double x1, x2, sx, sy, tm, an, tt, gc;
-                 double Mops;
-                 double epsilon=1.0E-8, a = 1220703125., s=271828183.;
-                 double t1, t2, t3, t4; 
-                 double sx_verify_value, sy_verify_value, sx_err, sy_err;
+      double dum[3] = {1.,1.,1.};
+      double x1, x2, sx, sy, tm, an, tt, gc;
+      double Mops;
+      double epsilon=1.0E-8, a = 1220703125., s=271828183.;
+      double t1, t2, t3, t4; 
+      double sx_verify_value, sy_verify_value, sx_err, sy_err;
 
 #include "npbparams.h"
-                 int    mk=16, 
-                          // --> set by make : in npbparams.h
-                          //m=28, // for CLASS=A
-                          //m=30, // for CLASS=B
-                          //npm=2, // NPROCS
-                          mm = m-mk, 
-                          nn = (int)(pow(2,mm)), 
-                          nk = (int)(pow(2,mk)), 
-                          nq=10, 
-                          np, 
-                          node, 
-                          no_nodes, 
-                          i, 
-                          ik, 
-                          kk, 
-                          l, 
-                          k, nit, no_large_nodes,
-                          np_add, k_offset, j;
-                 int    me, nprocs, root=0, dp_type;
-                 int verified, 
-                           timers_enabled=true;
-                 char  size[500]; // mind the size of the string to represent a big number
-
-                 //Use in randlc..
-                 int KS = 0;
-                 double R23, R46, T23, T46;
-
-                 double *qq = (double *) malloc (10000*sizeof(double));
-                 double *start = (double *) malloc (64*sizeof(double));
-                 double *elapsed = (double *) malloc (64*sizeof(double));
-
-                 double *x = (double *) malloc (2*nk*sizeof(double));
-                 double *q = (double *) malloc (nq*sizeof(double));
+      int    mk=16, 
+         // --> set by make : in npbparams.h
+         //m=28, // for CLASS=A
+         //m=30, // for CLASS=B
+         //npm=2, // NPROCS
+         mm = m-mk, 
+         nn = (int)(pow(2,mm)), 
+         nk = (int)(pow(2,mk)), 
+         nq=10, 
+         np, 
+         node, 
+         no_nodes, 
+         i, 
+         ik, 
+         kk, 
+         l, 
+         k, nit, no_large_nodes,
+         np_add, k_offset, j;
+      int    me, nprocs, root=0, dp_type;
+      int verified, 
+          timers_enabled=true;
+      char  size[500]; // mind the size of the string to represent a big number
+
+      //Use in randlc..
+      int KS = 0;
+      double R23, R46, T23, T46;
+
+      double *qq = (double *) malloc (10000*sizeof(double));
+      double *start = (double *) malloc (64*sizeof(double));
+      double *elapsed = (double *) malloc (64*sizeof(double));
+
+      double *x = (double *) malloc (2*nk*sizeof(double));
+      double *q = (double *) malloc (nq*sizeof(double));
 
       TRACE_smpi_set_category ("start");
 
-                 MPI_Init( &argc, &argv );
-                 MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
-                 MPI_Comm_rank( MPI_COMM_WORLD, &node);
+      MPI_Init( &argc, &argv );
+      MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
+      MPI_Comm_rank( MPI_COMM_WORLD, &node);
 
 #ifdef USE_MPE
     MPE_Init_log();
 #endif
-                 root = 0;
-                 if (node == root ) {
-
-                           /*   Because the size of the problem is too large to store in a 32-bit
-                            *   integer for some classes, we put it into a string (for printing).
-                            *   Have to strip off the decimal point put in there by the floating
-                            *   point print statement (internal file)
-                            */
-                           fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
-                           sprintf(size,"%d",pow(2,m+1));
-                           //size = size.replace('.', ' ');
-                           fprintf(stdout," Number of random numbers generated: %s\n",size);
-                           fprintf(stdout," Number of active processes: %d\n",no_nodes);
-
-                 }
-                 verified = false;
-
-                 /* c   Compute the number of "batches" of random number pairs generated 
-                    c   per processor. Adjust if the number of processors does not evenly 
-                    c   divide the total number
+      root = 0;
+      if (node == root ) {
+
+          /*   Because the size of the problem is too large to store in a 32-bit
+           *   integer for some classes, we put it into a string (for printing).
+           *   Have to strip off the decimal point put in there by the floating
+           *   point print statement (internal file)
+           */
+          fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
+          sprintf(size,"%d",pow(2,m+1));
+          //size = size.replace('.', ' ');
+          fprintf(stdout," Number of random numbers generated: %s\n",size);
+          fprintf(stdout," Number of active processes: %d\n",no_nodes);
+
+      }
+      verified = false;
+
+      /* c   Compute the number of "batches" of random number pairs generated 
+         c   per processor. Adjust if the number of processors does not evenly 
+         c   divide the total number
 */
 
        np = nn / no_nodes;
    c   sure these initializations cannot be eliminated as dead code.
 */
 
-        //call vranlc(0, dum[1], dum[2], dum[3]);
-        // Array indexes start at 1 in Fortran, 0 in Java
-        vranlc(0, dum[0], dum[1], &(dum[2])); 
-
-        dum[0] = randlc(&(dum[1]),&(dum[2]));
-        /////////////////////////////////
-        for (i=0;i<2*nk;i++) {
-                  x[i] = -1e99;
-        }
-        Mops = log(sqrt(abs(1))); 
-
-        /*
-           c---------------------------------------------------------------------
-           c    Synchronize before placing time stamp
-           c---------------------------------------------------------------------
-         */
+   //call vranlc(0, dum[1], dum[2], dum[3]);
+   // Array indexes start at 1 in Fortran, 0 in Java
+   vranlc(0, dum[0], dum[1], &(dum[2])); 
+
+   dum[0] = randlc(&(dum[1]),&(dum[2]));
+   /////////////////////////////////
+   for (i=0;i<2*nk;i++) {
+       x[i] = -1e99;
+   }
+   Mops = log(sqrt(abs(1))); 
+
+   /*
+      c---------------------------------------------------------------------
+      c    Synchronize before placing time stamp
+      c---------------------------------------------------------------------
+    */
         MPI_Barrier( MPI_COMM_WORLD );
 
 
         timer_start(&(start[1]));
         
         t1 = a;
-       //fprintf(stdout,("(ep.f:160) t1 = " + t1);
+  //fprintf(stdout,("(ep.f:160) t1 = " + t1);
         t1 = vranlc(0, t1, a, x);
-       //fprintf(stdout,("(ep.f:161) t1 = " + t1);
-       
+  //fprintf(stdout,("(ep.f:161) t1 = " + t1);
+  
         
 /* c   Compute AN = A ^ (2 * NK) (mod 2^46). */
         
         t1 = a;
-       //fprintf(stdout,("(ep.f:165) t1 = " + t1);
+  //fprintf(stdout,("(ep.f:165) t1 = " + t1);
         for (i=1; i <= mk+1; i++) {
                t2 = randlc(&t1, &t1);
-              //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
+         //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
         } 
         an = t1;
-       //fprintf(stdout,("(ep.f:172) s = " + s);
+  //fprintf(stdout,("(ep.f:172) s = " + s);
         tt = s;
         gc = 0.;
         sx = 0.;
 
          for (i=1;i<=100 && !stop;i++) {
             ik = kk / 2;
-           //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
+      //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
             if (2 * ik != kk)  {
                 t3 = randlc(&t1, &t2);
                 //fprintf(stdout,("(ep.f:200) t1= " +t1 );
 //       Compute uniform pseudorandom numbers.
 
          //if (timers_enabled)  timer_start(3);
-        timer_start(&(start[3]));
+   timer_start(&(start[3]));
          //call vranlc(2 * nk, t1, a, x)  --> t1 and y are modified
 
-       //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
-       //fprintf(stdout,"2*nk = " + (2*nk));
-       //fprintf(stdout,"t1 = " + t1);
-       //fprintf(stdout,"a  = " + a);
-       //fprintf(stdout,"x[0] = " + x[0]);
-       //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+  //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
+  //fprintf(stdout,"2*nk = " + (2*nk));
+  //fprintf(stdout,"t1 = " + t1);
+  //fprintf(stdout,"a  = " + a);
+  //fprintf(stdout,"x[0] = " + x[0]);
+  //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
         
-       t1 = vranlc(2 * nk, t1, a, x);
-
-       //fprintf(stdout,(">>>>>>>>>>>After  Enter vranlc (l.210)<<<<<<");
-       //fprintf(stdout,("2*nk = " + (2*nk));
-       //fprintf(stdout,("t1 = " + t1);
-       //fprintf(stdout,("a  = " + a);
-       //fprintf(stdout,("x[0] = " + x[0]);
-       //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+  t1 = vranlc(2 * nk, t1, a, x);
+
+  //fprintf(stdout,(">>>>>>>>>>>After  Enter vranlc (l.210)<<<<<<");
+  //fprintf(stdout,("2*nk = " + (2*nk));
+  //fprintf(stdout,("t1 = " + t1);
+  //fprintf(stdout,("a  = " + a);
+  //fprintf(stdout,("x[0] = " + x[0]);
+  //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
         
          //if (timers_enabled)  timer_stop(3);
-        timer_stop(3,elapsed,start);
+   timer_stop(3,elapsed,start);
 
 /*       Compute Gaussian deviates by acceptance-rejection method and 
  *       tally counts in concentric square annuli.  This loop is not 
  *       vectorizable. 
  */
          //if (timers_enabled) timer_start(2);
-        timer_start(&(start[2]));
+    timer_start(&(start[2]));
          for(i=1; i<=nk;i++) {
             x1 = 2. * x[2*i-2] -1.0;
             x2 = 2. * x[2*i-1] - 1.0;
                sx   = sx + t3;
                sy   = sy + t4;
              }
-               /*
-            if(i == 1) {
+    /*
+       if(i == 1) {
                 fprintf(stdout,"x1 = " + x1);
                 fprintf(stdout,"x2 = " + x2);
                 fprintf(stdout,"t1 = " + t1);
                 fprintf(stdout,"q[l] = " + q[l]);
                 fprintf(stdout,"sx = " + sx);
                 fprintf(stdout,"sy = " + sy);
-            }
-               */
+       }
+    */
            }
          //if (timers_enabled)  timer_stop(2);
-        timer_stop(2,elapsed,start);
+    timer_stop(2,elapsed,start);
       }
 
       TRACE_smpi_set_category ("finalize");
 
       //int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)   
-       MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
-       sx = x[0]; //FIXME :  x[0] or x[1] => x[0] because fortran starts with 1
+  MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+  sx = x[0]; //FIXME :  x[0] or x[1] => x[0] because fortran starts with 1
       MPI_Allreduce(&sy, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
       sy = x[0];
       MPI_Allreduce(q, x, nq, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
 
       for(i = 0; i < nq; i++) {
-               q[i] = x[i];
-       }
-       for(i = 0; i < nq; i++) {
-               gc += q[i];
-       }
+    q[i] = x[i];
+  }
+  for(i = 0; i < nq; i++) {
+    gc += q[i];
+  }
 
-       timer_stop(1,elapsed,start);
+  timer_stop(1,elapsed,start);
       tm = timer_read(1,elapsed);
-       MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
-       tm = x[0];
-
-       if(node == root) {
-               nit = 0;
-               verified = true;
-
-               if(m == 24) {
-                       sx_verify_value = -3.247834652034740E3;
-                       sy_verify_value = -6.958407078382297E3;
-               } else if(m == 25) {
-                       sx_verify_value = -2.863319731645753E3;
-                       sy_verify_value = -6.320053679109499E3;
-               } else if(m == 28) {
-                       sx_verify_value = -4.295875165629892E3;
-                       sy_verify_value = -1.580732573678431E4;
-               } else if(m == 30) {
-                       sx_verify_value =  4.033815542441498E4;
-                       sy_verify_value = -2.660669192809235E4;
-               } else if(m == 32) {
-                       sx_verify_value =  4.764367927995374E4;
-                       sy_verify_value = -8.084072988043731E4;
-               } else if(m == 36) {
-                       sx_verify_value =  1.982481200946593E5;
-                       sy_verify_value = -1.020596636361769E5;
-               } else {
-                       verified = false;
-               }
-
-               /*
-               fprintf(stdout,("sx        = " + sx);
-               fprintf(stdout,("sx_verify = " + sx_verify_value);
-               fprintf(stdout,("sy        = " + sy);
-               fprintf(stdout,("sy_verify = " + sy_verify_value);
-               */
-               if(verified) {
-                       sx_err = abs((sx - sx_verify_value)/sx_verify_value);
-                       sy_err = abs((sy - sy_verify_value)/sy_verify_value);
-                       /*
-                       fprintf(stdout,("sx_err = " + sx_err);
-                       fprintf(stdout,("sy_err = " + sx_err);
-                       fprintf(stdout,("epsilon= " + epsilon);
-                       */
-                       verified = ((sx_err < epsilon) && (sy_err < epsilon));
-               }
-
-               Mops = (pow(2.0, m+1))/tm/1000;
-
-               fprintf(stdout,"EP Benchmark Results:\n");
-               fprintf(stdout,"CPU Time=%d\n",tm);
-               fprintf(stdout,"N = 2^%d\n",m);
-               fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
-               fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
-               fprintf(stdout,"Count:");
-               for(i = 0; i < nq; i++) {
-                       fprintf(stdout,"%d\t %ld\n",i,q[i]);
-               }
-
-               /*
-               print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
-                               "Random numbers generated", verified, npbversion,
-                               compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
-               fprintf(stdout,"\nEP Benchmark Completed\n");
+  MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+  tm = x[0];
+
+  if(node == root) {
+    nit = 0;
+    verified = true;
+
+    if(m == 24) {
+             sx_verify_value = -3.247834652034740E3;
+                  sy_verify_value = -6.958407078382297E3;
+    } else if(m == 25) {
+                sx_verify_value = -2.863319731645753E3;
+      sy_verify_value = -6.320053679109499E3;
+    } else if(m == 28) {
+            sx_verify_value = -4.295875165629892E3;
+      sy_verify_value = -1.580732573678431E4;
+    } else if(m == 30) {
+            sx_verify_value =  4.033815542441498E4;
+                  sy_verify_value = -2.660669192809235E4;
+    } else if(m == 32) {
+                  sx_verify_value =  4.764367927995374E4;
+                     sy_verify_value = -8.084072988043731E4;
+    } else if(m == 36) {
+            sx_verify_value =  1.982481200946593E5;
+            sy_verify_value = -1.020596636361769E5;
+    } else {
+      verified = false;
+    }
+
+    /*
+    fprintf(stdout,("sx        = " + sx);
+    fprintf(stdout,("sx_verify = " + sx_verify_value);
+    fprintf(stdout,("sy        = " + sy);
+    fprintf(stdout,("sy_verify = " + sy_verify_value);
+    */
+    if(verified) {
+      sx_err = abs((sx - sx_verify_value)/sx_verify_value);
+      sy_err = abs((sy - sy_verify_value)/sy_verify_value);
+      /*
+      fprintf(stdout,("sx_err = " + sx_err);
+      fprintf(stdout,("sy_err = " + sx_err);
+      fprintf(stdout,("epsilon= " + epsilon);
+      */
+      verified = ((sx_err < epsilon) && (sy_err < epsilon));
+    }
+
+    Mops = (pow(2.0, m+1))/tm/1000;
+
+    fprintf(stdout,"EP Benchmark Results:\n");
+    fprintf(stdout,"CPU Time=%d\n",tm);
+    fprintf(stdout,"N = 2^%d\n",m);
+    fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
+    fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+    fprintf(stdout,"Count:");
+    for(i = 0; i < nq; i++) {
+      fprintf(stdout,"%d\t %ld\n",i,q[i]);
+    }
+
+    /*
+    print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
+        "Random numbers generated", verified, npbversion,
+        compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
+    fprintf(stdout,"\nEP Benchmark Completed\n");
             fprintf(stdout,"Class           = %s\n", _class);
-               fprintf(stdout,"Size            = %s\n", size);
-               fprintf(stdout,"Iteration       = %d\n", nit);
-               fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
-               fprintf(stdout,"Total processes = %d\n",no_nodes);
-               fprintf(stdout,"Mops/s total    = %lf\n",Mops);
-               fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
-               fprintf(stdout,"Operation type  = Random number generated\n");
-               if(verified) {
-                       fprintf(stdout,"Verification    = SUCCESSFUL\n");
-               } else {
-                       fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
-               }
-               fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
-               fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
-               fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
-               }
+    fprintf(stdout,"Size            = %s\n", size);
+    fprintf(stdout,"Iteration       = %d\n", nit);
+    fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+    fprintf(stdout,"Total processes = %d\n",no_nodes);
+    fprintf(stdout,"Mops/s total    = %lf\n",Mops);
+    fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
+    fprintf(stdout,"Operation type  = Random number generated\n");
+    if(verified) {
+      fprintf(stdout,"Verification    = SUCCESSFUL\n");
+    } else {
+      fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
+    }
+             fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
+             fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
+             fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+         }
 #ifdef USE_MPE
     MPE_Finish_log(argv[0]);
 #endif
index 624b800..4de6c93 100644 (file)
 /*************    portable random number generator    ************/
 /*****************************************************************/
 
-double randlc( double *X, double *A )
+double  randlc( double *X, double *A )
 {
       static int        KS=0;
-      static double    R23, R46, T23, T46;
-      double           T1, T2, T3, T4;
-      double           A1;
-      double           A2;
-      double           X1;
-      double           X2;
-      double           Z;
-      int              i, j;
+      static double  R23, R46, T23, T46;
+      double    T1, T2, T3, T4;
+      double    A1;
+      double    A2;
+      double    X1;
+      double    X2;
+      double    Z;
+      int         i, j;
 
       if (KS == 0) 
       {
index 753fd43..9c18da4 100644 (file)
@@ -46,7 +46,7 @@
       {
         int i;
         long  i246m1=0x00003FFFFFFFFFFF;
-         long  LLx, Lx, La;
+    long  LLx, Lx, La;
         double d2m46;
 
 // This doesn't work, because the compiler does the calculation in 32
       La = (long)a;
       //fprintf(stdout,("================== Vranlc ================");
       //fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
-       LLx = Lx;
-       for (i=0; i< n; i++) {
-                 Lx   = Lx*La & i246m1 ;
-                 LLx = Lx;
-                 y[i] = d2m46 * (double)LLx;
-                 /*
-                    if(i == 0) {
-                    fprintf(stdout,("After loop 0:");
-                    fprintf(stdout,("Lx = " + Lx + ", La = " + La);
-                    fprintf(stdout,("d2m46 = " + d2m46);
-                    fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
-                    fprintf(stdout,("Y[0]" + y[0]);
-                    }
-                  */
-       }
+  LLx = Lx;
+  for (i=0; i< n; i++) {
+      Lx   = Lx*La & i246m1 ;
+      LLx = Lx;
+      y[i] = d2m46 * (double)LLx;
+      /*
+         if(i == 0) {
+         fprintf(stdout,("After loop 0:");
+         fprintf(stdout,("Lx = " + Lx + ", La = " + La);
+         fprintf(stdout,("d2m46 = " + d2m46);
+         fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
+         fprintf(stdout,("Y[0]" + y[0]);
+         }
+       */
+  }
 
       x = (double)LLx;
       /*
 
 //-------------- the core (unique function) -----------
       void doTest(int argc, char **argv) {
-                 double dum[3] = {1.,1.,1.};
-                 double x1, x2, sx, sy, tm, an, tt, gc;
-                 double Mops;
-                 double epsilon=1.0E-8, a = 1220703125., s=271828183.;
-                 double t1, t2, t3, t4; 
-                 double sx_verify_value, sy_verify_value, sx_err, sy_err;
+      double dum[3] = {1.,1.,1.};
+      double x1, x2, sx, sy, tm, an, tt, gc;
+      double Mops;
+      double epsilon=1.0E-8, a = 1220703125., s=271828183.;
+      double t1, t2, t3, t4; 
+      double sx_verify_value, sy_verify_value, sx_err, sy_err;
 
 #include "npbparams.h"
-                 int    mk=16, 
-                          // --> set by make : in npbparams.h
-                          //m=28, // for CLASS=A
-                          //m=30, // for CLASS=B
-                          //npm=2, // NPROCS
-                          mm = m-mk, 
-                          nn = (int)(pow(2,mm)), 
-                          nk = (int)(pow(2,mk)), 
-                          nq=10, 
-                          np, 
-                          node, 
-                          no_nodes, 
-                          i, 
-                          ik, 
-                          kk, 
-                          l, 
-                          k, nit, no_large_nodes,
-                          np_add, k_offset, j;
-                 int    me, nprocs, root=0, dp_type;
-                 int verified, 
-                           timers_enabled=true;
-                 char  size[500]; // mind the size of the string to represent a big number
-
-                 //Use in randlc..
-                 int KS = 0;
-                 double R23, R46, T23, T46;
-
-                 double *qq = (double *) malloc (10000*sizeof(double));
-                 double *start = (double *) malloc (64*sizeof(double));
-                 double *elapsed = (double *) malloc (64*sizeof(double));
-
-                 double *x = (double *) malloc (2*nk*sizeof(double));
-                 double *q = (double *) malloc (nq*sizeof(double));
-
-                 MPI_Init( &argc, &argv );
-                 MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
-                 MPI_Comm_rank( MPI_COMM_WORLD, &node);
+      int    mk=16, 
+         // --> set by make : in npbparams.h
+         //m=28, // for CLASS=A
+         //m=30, // for CLASS=B
+         //npm=2, // NPROCS
+         mm = m-mk, 
+         nn = (int)(pow(2,mm)), 
+         nk = (int)(pow(2,mk)), 
+         nq=10, 
+         np, 
+         node, 
+         no_nodes, 
+         i, 
+         ik, 
+         kk, 
+         l, 
+         k, nit, no_large_nodes,
+         np_add, k_offset, j;
+      int    me, nprocs, root=0, dp_type;
+      int verified, 
+          timers_enabled=true;
+      char  size[500]; // mind the size of the string to represent a big number
+
+      //Use in randlc..
+      int KS = 0;
+      double R23, R46, T23, T46;
+
+      double *qq = (double *) malloc (10000*sizeof(double));
+      double *start = (double *) malloc (64*sizeof(double));
+      double *elapsed = (double *) malloc (64*sizeof(double));
+
+      double *x = (double *) malloc (2*nk*sizeof(double));
+      double *q = (double *) malloc (nq*sizeof(double));
+
+      MPI_Init( &argc, &argv );
+      MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
+      MPI_Comm_rank( MPI_COMM_WORLD, &node);
 
 #ifdef USE_MPE
     MPE_Init_log();
 #endif
-                 root = 0;
-                 if (node == root ) {
-
-                           /*   Because the size of the problem is too large to store in a 32-bit
-                            *   integer for some classes, we put it into a string (for printing).
-                            *   Have to strip off the decimal point put in there by the floating
-                            *   point print statement (internal file)
-                            */
-                           fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
-                           sprintf(size,"%d",pow(2,m+1));
-                           //size = size.replace('.', ' ');
-                           fprintf(stdout," Number of random numbers generated: %s\n",size);
-                           fprintf(stdout," Number of active processes: %d\n",no_nodes);
-
-                 }
-                 verified = false;
-
-                 /* c   Compute the number of "batches" of random number pairs generated 
-                    c   per processor. Adjust if the number of processors does not evenly 
-                    c   divide the total number
+      root = 0;
+      if (node == root ) {
+
+          /*   Because the size of the problem is too large to store in a 32-bit
+           *   integer for some classes, we put it into a string (for printing).
+           *   Have to strip off the decimal point put in there by the floating
+           *   point print statement (internal file)
+           */
+          fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
+          sprintf(size,"%d",pow(2,m+1));
+          //size = size.replace('.', ' ');
+          fprintf(stdout," Number of random numbers generated: %s\n",size);
+          fprintf(stdout," Number of active processes: %d\n",no_nodes);
+
+      }
+      verified = false;
+
+      /* c   Compute the number of "batches" of random number pairs generated 
+         c   per processor. Adjust if the number of processors does not evenly 
+         c   divide the total number
 */
 
        np = nn / no_nodes;
    c   sure these initializations cannot be eliminated as dead code.
 */
 
-        //call vranlc(0, dum[1], dum[2], dum[3]);
-        // Array indexes start at 1 in Fortran, 0 in Java
-        vranlc(0, dum[0], dum[1], &(dum[2])); 
-
-        dum[0] = randlc(&(dum[1]),&(dum[2]));
-        /////////////////////////////////
-        for (i=0;i<2*nk;i++) {
-                  x[i] = -1e99;
-        }
-        Mops = log(sqrt(abs(1))); 
-
-        /*
-           c---------------------------------------------------------------------
-           c    Synchronize before placing time stamp
-           c---------------------------------------------------------------------
-         */
+   //call vranlc(0, dum[1], dum[2], dum[3]);
+   // Array indexes start at 1 in Fortran, 0 in Java
+   vranlc(0, dum[0], dum[1], &(dum[2])); 
+
+   dum[0] = randlc(&(dum[1]),&(dum[2]));
+   /////////////////////////////////
+   for (i=0;i<2*nk;i++) {
+       x[i] = -1e99;
+   }
+   Mops = log(sqrt(abs(1))); 
+
+   /*
+      c---------------------------------------------------------------------
+      c    Synchronize before placing time stamp
+      c---------------------------------------------------------------------
+    */
         MPI_Barrier( MPI_COMM_WORLD );
 
         timer_clear(&(elapsed[1]));
         timer_start(&(start[1]));
         
         t1 = a;
-       //fprintf(stdout,("(ep.f:160) t1 = " + t1);
+  //fprintf(stdout,("(ep.f:160) t1 = " + t1);
         t1 = vranlc(0, t1, a, x);
-       //fprintf(stdout,("(ep.f:161) t1 = " + t1);
-       
+  //fprintf(stdout,("(ep.f:161) t1 = " + t1);
+  
         
 /* c   Compute AN = A ^ (2 * NK) (mod 2^46). */
         
         t1 = a;
-       //fprintf(stdout,("(ep.f:165) t1 = " + t1);
+  //fprintf(stdout,("(ep.f:165) t1 = " + t1);
         for (i=1; i <= mk+1; i++) {
                t2 = randlc(&t1, &t1);
-              //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
+         //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
         } 
         an = t1;
-       //fprintf(stdout,("(ep.f:172) s = " + s);
+  //fprintf(stdout,("(ep.f:172) s = " + s);
         tt = s;
         gc = 0.;
         sx = 0.;
 
          for (i=1;i<=100 && !stop;i++) {
             ik = kk / 2;
-           //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
+      //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
             if (2 * ik != kk)  {
                 t3 = randlc(&t1, &t2);
                 //fprintf(stdout,("(ep.f:200) t1= " +t1 );
 //       Compute uniform pseudorandom numbers.
 
          //if (timers_enabled)  timer_start(3);
-        timer_start(&(start[3]));
+   timer_start(&(start[3]));
          //call vranlc(2 * nk, t1, a, x)  --> t1 and y are modified
 
-       //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
-       //fprintf(stdout,"2*nk = " + (2*nk));
-       //fprintf(stdout,"t1 = " + t1);
-       //fprintf(stdout,"a  = " + a);
-       //fprintf(stdout,"x[0] = " + x[0]);
-       //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+  //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
+  //fprintf(stdout,"2*nk = " + (2*nk));
+  //fprintf(stdout,"t1 = " + t1);
+  //fprintf(stdout,"a  = " + a);
+  //fprintf(stdout,"x[0] = " + x[0]);
+  //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
         
-       t1 = vranlc(2 * nk, t1, a, x);
-
-       //fprintf(stdout,(">>>>>>>>>>>After  Enter vranlc (l.210)<<<<<<");
-       //fprintf(stdout,("2*nk = " + (2*nk));
-       //fprintf(stdout,("t1 = " + t1);
-       //fprintf(stdout,("a  = " + a);
-       //fprintf(stdout,("x[0] = " + x[0]);
-       //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+  t1 = vranlc(2 * nk, t1, a, x);
+
+  //fprintf(stdout,(">>>>>>>>>>>After  Enter vranlc (l.210)<<<<<<");
+  //fprintf(stdout,("2*nk = " + (2*nk));
+  //fprintf(stdout,("t1 = " + t1);
+  //fprintf(stdout,("a  = " + a);
+  //fprintf(stdout,("x[0] = " + x[0]);
+  //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
         
          //if (timers_enabled)  timer_stop(3);
-        timer_stop(3,elapsed,start);
+   timer_stop(3,elapsed,start);
 
 /*       Compute Gaussian deviates by acceptance-rejection method and 
  *       tally counts in concentric square annuli.  This loop is not 
  *       vectorizable. 
  */
          //if (timers_enabled) timer_start(2);
-        timer_start(&(start[2]));
+    timer_start(&(start[2]));
          for(i=1; i<=nk;i++) {
             x1 = 2. * x[2*i-2] -1.0;
             x2 = 2. * x[2*i-1] - 1.0;
                sx   = sx + t3;
                sy   = sy + t4;
              }
-               /*
-            if(i == 1) {
+    /*
+       if(i == 1) {
                 fprintf(stdout,"x1 = " + x1);
                 fprintf(stdout,"x2 = " + x2);
                 fprintf(stdout,"t1 = " + t1);
                 fprintf(stdout,"q[l] = " + q[l]);
                 fprintf(stdout,"sx = " + sx);
                 fprintf(stdout,"sy = " + sy);
-            }
-               */
+       }
+    */
            }
          //if (timers_enabled)  timer_stop(2);
-        timer_stop(2,elapsed,start);
+    timer_stop(2,elapsed,start);
       }
 
       //int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)   
-       MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
-       sx = x[0]; //FIXME :  x[0] or x[1] => x[0] because fortran starts with 1
+  MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+  sx = x[0]; //FIXME :  x[0] or x[1] => x[0] because fortran starts with 1
       MPI_Allreduce(&sy, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
       sy = x[0];
       MPI_Allreduce(q, x, nq, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
 
       for(i = 0; i < nq; i++) {
-               q[i] = x[i];
-       }
-       for(i = 0; i < nq; i++) {
-               gc += q[i];
-       }
+    q[i] = x[i];
+  }
+  for(i = 0; i < nq; i++) {
+    gc += q[i];
+  }
 
-       timer_stop(1,elapsed,start);
+  timer_stop(1,elapsed,start);
       tm = timer_read(1,elapsed);
-       MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
-       tm = x[0];
-
-       if(node == root) {
-               nit = 0;
-               verified = true;
-
-               if(m == 24) {
-                       sx_verify_value = -3.247834652034740E3;
-                       sy_verify_value = -6.958407078382297E3;
-               } else if(m == 25) {
-                       sx_verify_value = -2.863319731645753E3;
-                       sy_verify_value = -6.320053679109499E3;
-               } else if(m == 28) {
-                       sx_verify_value = -4.295875165629892E3;
-                       sy_verify_value = -1.580732573678431E4;
-               } else if(m == 30) {
-                       sx_verify_value =  4.033815542441498E4;
-                       sy_verify_value = -2.660669192809235E4;
-               } else if(m == 32) {
-                       sx_verify_value =  4.764367927995374E4;
-                       sy_verify_value = -8.084072988043731E4;
-               } else if(m == 36) {
-                       sx_verify_value =  1.982481200946593E5;
-                       sy_verify_value = -1.020596636361769E5;
-               } else {
-                       verified = false;
-               }
-
-               /*
-               fprintf(stdout,("sx        = " + sx);
-               fprintf(stdout,("sx_verify = " + sx_verify_value);
-               fprintf(stdout,("sy        = " + sy);
-               fprintf(stdout,("sy_verify = " + sy_verify_value);
-               */
-               if(verified) {
-                       sx_err = abs((sx - sx_verify_value)/sx_verify_value);
-                       sy_err = abs((sy - sy_verify_value)/sy_verify_value);
-                       /*
-                       fprintf(stdout,("sx_err = " + sx_err);
-                       fprintf(stdout,("sy_err = " + sx_err);
-                       fprintf(stdout,("epsilon= " + epsilon);
-                       */
-                       verified = ((sx_err < epsilon) && (sy_err < epsilon));
-               }
-
-               Mops = (pow(2.0, m+1))/tm/1000;
-
-               fprintf(stdout,"EP Benchmark Results:\n");
-               fprintf(stdout,"CPU Time=%d\n",tm);
-               fprintf(stdout,"N = 2^%d\n",m);
-               fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
-               fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
-               fprintf(stdout,"Count:");
-               for(i = 0; i < nq; i++) {
-                       fprintf(stdout,"%d\t %ld\n",i,q[i]);
-               }
-
-               /*
-               print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
-                               "Random numbers generated", verified, npbversion,
-                               compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
-               fprintf(stdout,"\nEP Benchmark Completed\n");
+  MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+  tm = x[0];
+
+  if(node == root) {
+    nit = 0;
+    verified = true;
+
+    if(m == 24) {
+             sx_verify_value = -3.247834652034740E3;
+                  sy_verify_value = -6.958407078382297E3;
+    } else if(m == 25) {
+                sx_verify_value = -2.863319731645753E3;
+      sy_verify_value = -6.320053679109499E3;
+    } else if(m == 28) {
+            sx_verify_value = -4.295875165629892E3;
+      sy_verify_value = -1.580732573678431E4;
+    } else if(m == 30) {
+            sx_verify_value =  4.033815542441498E4;
+                  sy_verify_value = -2.660669192809235E4;
+    } else if(m == 32) {
+                  sx_verify_value =  4.764367927995374E4;
+                     sy_verify_value = -8.084072988043731E4;
+    } else if(m == 36) {
+            sx_verify_value =  1.982481200946593E5;
+            sy_verify_value = -1.020596636361769E5;
+    } else {
+      verified = false;
+    }
+
+    /*
+    fprintf(stdout,("sx        = " + sx);
+    fprintf(stdout,("sx_verify = " + sx_verify_value);
+    fprintf(stdout,("sy        = " + sy);
+    fprintf(stdout,("sy_verify = " + sy_verify_value);
+    */
+    if(verified) {
+      sx_err = abs((sx - sx_verify_value)/sx_verify_value);
+      sy_err = abs((sy - sy_verify_value)/sy_verify_value);
+      /*
+      fprintf(stdout,("sx_err = " + sx_err);
+      fprintf(stdout,("sy_err = " + sx_err);
+      fprintf(stdout,("epsilon= " + epsilon);
+      */
+      verified = ((sx_err < epsilon) && (sy_err < epsilon));
+    }
+
+    Mops = (pow(2.0, m+1))/tm/1000;
+
+    fprintf(stdout,"EP Benchmark Results:\n");
+    fprintf(stdout,"CPU Time=%d\n",tm);
+    fprintf(stdout,"N = 2^%d\n",m);
+    fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
+    fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+    fprintf(stdout,"Count:");
+    for(i = 0; i < nq; i++) {
+      fprintf(stdout,"%d\t %ld\n",i,q[i]);
+    }
+
+    /*
+    print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
+        "Random numbers generated", verified, npbversion,
+        compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
+    fprintf(stdout,"\nEP Benchmark Completed\n");
             fprintf(stdout,"Class           = %s\n", _class);
-               fprintf(stdout,"Size            = %s\n", size);
-               fprintf(stdout,"Iteration       = %d\n", nit);
-               fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
-               fprintf(stdout,"Total processes = %d\n",no_nodes);
-               fprintf(stdout,"Mops/s total    = %lf\n",Mops);
-               fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
-               fprintf(stdout,"Operation type  = Random number generated\n");
-               if(verified) {
-                       fprintf(stdout,"Verification    = SUCCESSFUL\n");
-               } else {
-                       fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
-               }
-               fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
-               fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
-               fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
-               }
+    fprintf(stdout,"Size            = %s\n", size);
+    fprintf(stdout,"Iteration       = %d\n", nit);
+    fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+    fprintf(stdout,"Total processes = %d\n",no_nodes);
+    fprintf(stdout,"Mops/s total    = %lf\n",Mops);
+    fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
+    fprintf(stdout,"Operation type  = Random number generated\n");
+    if(verified) {
+      fprintf(stdout,"Verification    = SUCCESSFUL\n");
+    } else {
+      fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
+    }
+             fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
+             fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
+             fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+         }
 #ifdef USE_MPE
     MPE_Finish_log(argv[0]);
 #endif
index 624b800..4de6c93 100644 (file)
 /*************    portable random number generator    ************/
 /*****************************************************************/
 
-double randlc( double *X, double *A )
+double  randlc( double *X, double *A )
 {
       static int        KS=0;
-      static double    R23, R46, T23, T46;
-      double           T1, T2, T3, T4;
-      double           A1;
-      double           A2;
-      double           X1;
-      double           X2;
-      double           Z;
-      int              i, j;
+      static double  R23, R46, T23, T46;
+      double    T1, T2, T3, T4;
+      double    A1;
+      double    A2;
+      double    X1;
+      double    X2;
+      double    Z;
+      int         i, j;
 
       if (KS == 0) 
       {
index 30aa5f7..645038c 100644 (file)
@@ -259,7 +259,7 @@ const INT_TYPE2
 /***********************/
 /* function prototypes */
 /***********************/
-double randlc( double *X, double *A );
+double  randlc( double *X, double *A );
 
 void full_verify( global_data* gd );
 
@@ -273,7 +273,7 @@ void c_print_results( char   *name,
                       int    nprocs_total,
                       double t,
                       double mops,
-                     char   *optype,
+          char   *optype,
                       int    passed_verification,
                       char   *npbversion,
                       char   *compiletime,
@@ -345,17 +345,17 @@ double  timer_read(global_data* gd, int n ) {
 /*************    portable random number generator    ************/
 /*****************************************************************/
 
-double randlc( double *X, double *A )
+double  randlc( double *X, double *A )
 {
       static int        KS=0;
-      static double    R23, R46, T23, T46;
-      double           T1, T2, T3, T4;
-      double           A1;
-      double           A2;
-      double           X1;
-      double           X2;
-      double           Z;
-      int              i, j;
+      static double  R23, R46, T23, T46;
+      double    T1, T2, T3, T4;
+      double    A1;
+      double    A2;
+      double    X1;
+      double    X2;
+      double    Z;
+      int         i, j;
 
       if (KS == 0) 
       {
@@ -472,22 +472,22 @@ double   find_my_seed( int  kn,       /* my processor rank, 0<=kn<=num procs */
 /*************      C  R  E  A  T  E  _  S  E  Q      ************/
 /*****************************************************************/
 
-void   create_seq( global_data* gd, double seed, double a )
+void  create_seq( global_data* gd, double seed, double a )
 {
-       double x;
-       int    i, k;
+  double x;
+  int    i, k;
 
         k = MAX_KEY/4;
 
-       for (i=0; i<NUM_KEYS; i++)
-       {
-           x = randlc(&seed, &a);
-           x += randlc(&seed, &a);
-           x += randlc(&seed, &a);
-           x += randlc(&seed, &a);  
+  for (i=0; i<NUM_KEYS; i++)
+  {
+      x = randlc(&seed, &a);
+      x += randlc(&seed, &a);
+          x += randlc(&seed, &a);
+      x += randlc(&seed, &a);  
 
             gd->key_array[i] = k*x;
-       }
+  }
 }
 
 
@@ -825,12 +825,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'A':
                     if( i <= 2 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+(iteration-1) )
                             failed = 1;
                         else
                           gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank !=  gd->test_rank_array[i]-(iteration-1) )
@@ -841,12 +841,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'B':
                     if( i == 1 || i == 2 || i == 4 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+iteration )
                             failed = 1;
                         else
                             gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank != gd->test_rank_array[i]-iteration )
@@ -857,12 +857,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'C':
                     if( i <= 2 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+iteration )
                             failed = 1;
                         else
                             gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank != gd->test_rank_array[i]-iteration )
@@ -873,12 +873,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'D':
                     if( i < 2 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+iteration )
                             failed = 1;
                         else
                             gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank != gd->test_rank_array[i]-iteration )
index a83d998..d617726 100644 (file)
@@ -257,7 +257,7 @@ const INT_TYPE2
 /***********************/
 /* function prototypes */
 /***********************/
-double randlc( double *X, double *A );
+double  randlc( double *X, double *A );
 
 void full_verify( global_data* gd );
 
@@ -271,7 +271,7 @@ void c_print_results( char   *name,
                       int    nprocs_total,
                       double t,
                       double mops,
-                     char   *optype,
+          char   *optype,
                       int    passed_verification,
                       char   *npbversion,
                       char   *compiletime,
@@ -343,17 +343,17 @@ double  timer_read(global_data* gd, int n ) {
 /*************    portable random number generator    ************/
 /*****************************************************************/
 
-double randlc( double *X, double *A )
+double  randlc( double *X, double *A )
 {
       static int        KS=0;
-      static double    R23, R46, T23, T46;
-      double           T1, T2, T3, T4;
-      double           A1;
-      double           A2;
-      double           X1;
-      double           X2;
-      double           Z;
-      int              i, j;
+      static double  R23, R46, T23, T46;
+      double    T1, T2, T3, T4;
+      double    A1;
+      double    A2;
+      double    X1;
+      double    X2;
+      double    Z;
+      int         i, j;
 
       if (KS == 0) 
       {
@@ -470,22 +470,22 @@ double   find_my_seed( int  kn,       /* my processor rank, 0<=kn<=num procs */
 /*************      C  R  E  A  T  E  _  S  E  Q      ************/
 /*****************************************************************/
 
-void   create_seq( global_data* gd, double seed, double a )
+void  create_seq( global_data* gd, double seed, double a )
 {
-       double x;
-       int    i, k;
+  double x;
+  int    i, k;
 
         k = MAX_KEY/4;
 
-       for (i=0; i<NUM_KEYS; i++)
-       {
-           x = randlc(&seed, &a);
-           x += randlc(&seed, &a);
-           x += randlc(&seed, &a);
-           x += randlc(&seed, &a);  
+  for (i=0; i<NUM_KEYS; i++)
+  {
+      x = randlc(&seed, &a);
+      x += randlc(&seed, &a);
+          x += randlc(&seed, &a);
+      x += randlc(&seed, &a);  
 
             gd->key_array[i] = k*x;
-       }
+  }
 }
 
 
@@ -823,12 +823,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'A':
                     if( i <= 2 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+(iteration-1) )
                             failed = 1;
                         else
                           gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank !=  gd->test_rank_array[i]-(iteration-1) )
@@ -839,12 +839,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'B':
                     if( i == 1 || i == 2 || i == 4 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+iteration )
                             failed = 1;
                         else
                             gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank != gd->test_rank_array[i]-iteration )
@@ -855,12 +855,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'C':
                     if( i <= 2 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+iteration )
                             failed = 1;
                         else
                             gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank != gd->test_rank_array[i]-iteration )
@@ -871,12 +871,12 @@ void rank( global_data* gd, int iteration )
                     break;
                 case 'D':
                     if( i < 2 )
-                   {
+              {
                         if( key_rank != gd->test_rank_array[i]+iteration )
                             failed = 1;
                         else
                             gd->passed_verification++;
-                   }
+              }
                     else
                     {
                         if( key_rank != gd->test_rank_array[i]-iteration )
index d7417fb..14a9d88 100644 (file)
@@ -14,7 +14,7 @@ void c_print_results( char   *name,
                       int    nprocs_total,
                       double t,
                       double mops,
-                     char   *optype,
+          char   *optype,
                       int    passed_verification,
                       char   *npbversion,
                       char   *compiletime,
index 6766247..0390135 100644 (file)
@@ -2,19 +2,19 @@
 //   This function is C verson of random number generator randdp.f 
 //---------------------------------------------------------------------
 
-double randlc(X, A)
+double  randlc(X, A)
 double *X;
 double *A;
 {
       static int        KS=0;
-      static double    R23, R46, T23, T46;
-      double           T1, T2, T3, T4;
-      double           A1;
-      double           A2;
-      double           X1;
-      double           X2;
-      double           Z;
-      int              i, j;
+      static double  R23, R46, T23, T46;
+      double    T1, T2, T3, T4;
+      double    A1;
+      double    A2;
+      double    X1;
+      double    X2;
+      double    Z;
+      int         i, j;
 
       if (KS == 0) 
       {
index 9a4fba5..70fca1c 100644 (file)
@@ -66,7 +66,7 @@ int fortran_rec_size = 4;
 #endif
 
 void get_info(int argc, char *argv[], int *typep, int *nprocsp, char *classp,
-             int* subtypep);
+        int* subtypep);
 void check_info(int type, int nprocs, char class);
 void read_info(int type, int *nprocsp, char *classp, int *subtypep);
 void write_info(int type, int nprocs, char class, int subtype);
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
   if (class != 'U') {
 #ifdef VERBOSE
     printf("setparams: For benchmark %s: number of processors = %d class = %c\n", 
-          argv[1], nprocs, class); 
+     argv[1], nprocs, class); 
 #endif
     check_info(type, nprocs, class);
   }
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
     if (class_old != 'X') {
 #ifdef VERBOSE
       printf("setparams:     old settings: number of processors = %d class = %c\n", 
-            nprocs_old, class_old); 
+       nprocs_old, class_old); 
 #endif
     }
   } else {
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
     if (class_old != 'X') {
 #ifdef VERBOSE
       printf("setparams: Previous settings were CLASS=%c NPROCS=%d\n", 
-            class_old, nprocs_old); 
+       class_old, nprocs_old); 
 #endif
     }
     exit(1); /* exit on class==U */
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
  */
 
 void get_info(int argc, char *argv[], int *typep, int *nprocsp, char *classp,
-             int *subtypep) 
+        int *subtypep) 
 {
 
   if (argc < 4) {
@@ -307,29 +307,29 @@ void read_info(int type, int *nprocsp, char *classp, int *subtypep)
 
   switch(type) {
       case BT: {
-         char subtype_str[100];
+    char subtype_str[100];
           nread = fscanf(fp, BT_DESC_LINE, nprocsp, classp, subtype_str);
           if (nread != 3) {
             if (nread != 2) {
               printf("setparams: Error parsing config file %s. Ignoring previous settings\n", FILENAME);
               goto abort;
-           }
-           *subtypep = 0;
-           break;
+      }
+      *subtypep = 0;
+      break;
           }
           if (!strcmp(subtype_str, "full") || !strcmp(subtype_str, "FULL")) {
-               *subtypep = FULL;
+    *subtypep = FULL;
           } else if (!strcmp(subtype_str, "simple") ||
-                    !strcmp(subtype_str, "SIMPLE")) {
-               *subtypep = SIMPLE;
+         !strcmp(subtype_str, "SIMPLE")) {
+    *subtypep = SIMPLE;
           } else if (!strcmp(subtype_str, "epio") || !strcmp(subtype_str, "EPIO")) {
-               *subtypep = EPIO;
+    *subtypep = EPIO;
           } else if (!strcmp(subtype_str, "fortran") ||
-                    !strcmp(subtype_str, "FORTRAN")) {
-               *subtypep = FORTRAN;
+         !strcmp(subtype_str, "FORTRAN")) {
+    *subtypep = FORTRAN;
           } else {
-               *subtypep = -1;
-         }
+    *subtypep = -1;
+    }
           break;
       }
 
@@ -395,11 +395,11 @@ void write_info(int type, int nprocs, char class, int subtype)
   switch(type) {
       case BT:
           /* Write out the header */
-         if (subtype == -1 || subtype == 0) {
+    if (subtype == -1 || subtype == 0) {
             fprintf(fp, DESC_LINE, nprocs, class);
-         } else {
+    } else {
             fprintf(fp, BT_DESC_LINE, nprocs, class, BT_TYPES[subtype]);
-         }
+    }
           /* Print out a warning so bozos don't mess with the file */
           fprintf(fp, "\
 c  \n\
@@ -410,7 +410,7 @@ c  in this directory. Do not modify it by hand.\n\
 c  \n");
 
           break;
-       
+  
       case SP:
       case FT:
       case MG:
@@ -429,7 +429,7 @@ c  in this directory. Do not modify it by hand.\n\
 c  \n");
 
           break;
-       case EP:
+  case EP:
       case IS:
       case DT:
           fprintf(fp, DEF_CLASS_LINE, class);
@@ -510,7 +510,7 @@ void write_sp_info(FILE *fp, int nprocs, char class)
   }
   fprintf(fp, "%sinteger maxcells, problem_size, niter_default\n", FINDENT);
   fprintf(fp, "%sparameter (maxcells=%d, problem_size=%d, niter_default=%d)\n", 
-              FINDENT, maxcells, problem_size, niter);
+         FINDENT, maxcells, problem_size, niter);
   fprintf(fp, "%sdouble precision dt_default\n", FINDENT);
   fprintf(fp, "%sparameter (dt_default = %s)\n", FINDENT, dt);
 }
@@ -538,7 +538,7 @@ void write_bt_info(FILE *fp, int nprocs, char class, int io)
   wr_interval = 5;
   fprintf(fp, "%sinteger maxcells, problem_size, niter_default\n", FINDENT);
   fprintf(fp, "%sparameter (maxcells=%d, problem_size=%d, niter_default=%d)\n", 
-              FINDENT, maxcells, problem_size, niter);
+         FINDENT, maxcells, problem_size, niter);
   fprintf(fp, "%sdouble precision dt_default\n", FINDENT);
   fprintf(fp, "%sparameter (dt_default = %s)\n", FINDENT, dt);
   fprintf(fp, "%sinteger wr_default\n", FINDENT);
@@ -548,23 +548,23 @@ void write_bt_info(FILE *fp, int nprocs, char class, int io)
   if (io) {
     fprintf(fp, "%scharacter*(*) filenm\n", FINDENT);
     switch (io) {
-       case FULL:
-           fprintf(fp, "%sparameter (filenm = 'btio.full.out')\n", FINDENT);
-           break;
-       case SIMPLE:
-           fprintf(fp, "%sparameter (filenm = 'btio.simple.out')\n", FINDENT);
-           break;
-       case EPIO:
-           fprintf(fp, "%sparameter (filenm = 'btio.epio.out')\n", FINDENT);
-           break;
-       case FORTRAN:
-           fprintf(fp, "%sparameter (filenm = 'btio.fortran.out')\n", FINDENT);
-           fprintf(fp, "%sinteger fortran_rec_sz\n", FINDENT);
-           fprintf(fp, "%sparameter (fortran_rec_sz = %d)\n",
-                   FINDENT, fortran_rec_size);
-           break;
-       default:
-           break;
+  case FULL:
+      fprintf(fp, "%sparameter (filenm = 'btio.full.out')\n", FINDENT);
+      break;
+  case SIMPLE:
+      fprintf(fp, "%sparameter (filenm = 'btio.simple.out')\n", FINDENT);
+      break;
+  case EPIO:
+      fprintf(fp, "%sparameter (filenm = 'btio.epio.out')\n", FINDENT);
+      break;
+  case FORTRAN:
+      fprintf(fp, "%sparameter (filenm = 'btio.fortran.out')\n", FINDENT);
+      fprintf(fp, "%sinteger fortran_rec_sz\n", FINDENT);
+      fprintf(fp, "%sparameter (fortran_rec_sz = %d)\n",
+        FINDENT, fortran_rec_size);
+      break;
+  default:
+      break;
     }
   }
 }
@@ -607,17 +607,17 @@ void write_lu_info(FILE *fp, int nprocs, char class)
   fprintf(fp, "\nc full problem size\n");
   fprintf(fp, "%sinteger isiz01, isiz02, isiz03\n", FINDENT);
   fprintf(fp, "%sparameter (isiz01=%d, isiz02=%d, isiz03=%d)\n", 
-         FINDENT, problem_size, problem_size, problem_size);
+    FINDENT, problem_size, problem_size, problem_size);
 
   fprintf(fp, "\nc sub-domain array size\n");
   fprintf(fp, "%sinteger isiz1, isiz2, isiz3\n", FINDENT);
   fprintf(fp, "%sparameter (isiz1=%d, isiz2=%d, isiz3=isiz03)\n", 
-              FINDENT, isiz1, isiz2);
+         FINDENT, isiz1, isiz2);
 
   fprintf(fp, "\nc number of iterations and how often to print the norm\n");
   fprintf(fp, "%sinteger itmax_default, inorm_default\n", FINDENT);
   fprintf(fp, "%sparameter (itmax_default=%d, inorm_default=%d)\n", 
-         FINDENT, itmax, inorm);
+    FINDENT, itmax, inorm);
 
   fprintf(fp, "%sdouble precision dt_default\n", FINDENT);
   fprintf(fp, "%sparameter (dt_default = %s)\n", FINDENT, dt_default);
@@ -657,15 +657,15 @@ void write_mg_info(FILE *fp, int nprocs, char class)
   fprintf(fp, "%sparameter (nprocs_compiled = %d)\n", FINDENT, nprocs);
   fprintf(fp, "%sinteger nx_default, ny_default, nz_default\n", FINDENT);
   fprintf(fp, "%sparameter (nx_default=%d, ny_default=%d, nz_default=%d)\n", 
-         FINDENT, problem_size, problem_size, problem_size);
+    FINDENT, problem_size, problem_size, problem_size);
   fprintf(fp, "%sinteger nit_default, lm, lt_default\n", FINDENT);
   fprintf(fp, "%sparameter (nit_default=%d, lm = %d, lt_default=%d)\n", 
-         FINDENT, nit, lm, lt_default);
+    FINDENT, nit, lm, lt_default);
   fprintf(fp, "%sinteger debug_default\n", FINDENT);
   fprintf(fp, "%sparameter (debug_default=%d)\n", FINDENT, 0);
   fprintf(fp, "%sinteger ndim1, ndim2, ndim3\n", FINDENT);
   fprintf(fp, "%sparameter (ndim1 = %d, ndim2 = %d, ndim3 = %d)\n", 
-         FINDENT, ndim1, ndim2, ndim3);
+    FINDENT, ndim1, ndim2, ndim3);
 }
 
 
@@ -966,7 +966,7 @@ setparams: File %s doesn't exist. To build the NAS benchmarks\n\
           put_string(fp, "cs4", fmpi_inc);
           put_string(fp, "cs5", fflags);
           put_string(fp, "cs6", flinkflags);
-         put_string(fp, "cs7", randfile);
+    put_string(fp, "cs7", randfile);
           break;
       case IS:
       case EP:
index 674aa81..c304c5d 100644 (file)
@@ -19,14 +19,14 @@ int main(int argc, char *argv[]) {
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    
   if (rank==1) {
-         data=22;
-         MPI_Send(&data,1,MPI_INT,(rank+1)%2,666,MPI_COMM_WORLD);
-//      smpi_sleep(1000);
+    data=22;
+    MPI_Send(&data,1,MPI_INT,(rank+1)%2,666,MPI_COMM_WORLD);
+//   smpi_sleep(1000);
   } else {
-         MPI_Recv(&data,1,MPI_INT,-1,666,MPI_COMM_WORLD,NULL);
-         if (data !=22) {
-                 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
-         }
+    MPI_Recv(&data,1,MPI_INT,-1,666,MPI_COMM_WORLD,NULL);
+    if (data !=22) {
+      printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
+    }
   }
 
   XBT_INFO("rank %d: data exchanged", rank);
index c840eb6..7b36a83 100644 (file)
@@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(sem_basic,
 
 
 
-#define THREAD_THREADS_MAX                     ((unsigned int)10)
+#define THREAD_THREADS_MAX      ((unsigned int)10)
 
 /*
  * the thread funtion.
index 64a6bf1..337d8c5 100644 (file)
@@ -17,14 +17,14 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(sem_sched,
                              "Messages specific for this sem example");
 
 #ifndef ENOBUFS
-#define ENOBUFS                1024
+#define ENOBUFS    1024
 #endif
 
-#define CTX_MAX                        ((unsigned int)1000)
+#define CTX_MAX      ((unsigned int)1000)
 
 
-#define MAX_ARG                                                30
-#define MAX_ARGS                                       10
+#define MAX_ARG            30
+#define MAX_ARGS          10
 
 typedef int (*pfn_func_t) (int, char **);
 
index 9ea2893..1a665a8 100644 (file)
 #ifdef HAVE_JEDULE
 
 struct jed_event {
-       int event_id;
-       char *name;
-       double start_time;
-       double end_time;
-       char *type;
-       xbt_dynar_t resource_subsets;
-       xbt_dynar_t characteristics_list; /* just a list of names (strings) */
-       xbt_dict_t info_hash;     /* key/value pairs */
+  int event_id;
+  char *name;
+  double start_time;
+  double end_time;
+  char *type;
+  xbt_dynar_t resource_subsets;
+  xbt_dynar_t characteristics_list; /* just a list of names (strings) */
+  xbt_dict_t info_hash;     /* key/value pairs */
 };
 
 typedef struct jed_event s_jed_event_t, *jed_event_t;
index a735ff7..1e3287a 100644 (file)
@@ -26,7 +26,7 @@ void jedule_cleanup_output(void);
 void jedule_store_event(jed_event_t event);
 
 void write_jedule_output(FILE *file, jedule_t jedule,
-               xbt_dynar_t event_list, xbt_dict_t meta_info_dict);
+    xbt_dynar_t event_list, xbt_dict_t meta_info_dict);
 
 #endif
 
index 8999e03..282821e 100644 (file)
 #ifdef HAVE_JEDULE
 
 typedef struct jed_simgrid_container s_jed_simgrid_container_t,
-               *jed_simgrid_container_t;
+    *jed_simgrid_container_t;
 
 
 struct jed_simgrid_container {
-       char *name;
-       xbt_dynar_t container_children;
-       jed_simgrid_container_t parent;
-       xbt_dynar_t resource_list;
-       xbt_dict_t name2id;
-       int last_id;
-       int is_lowest;
+  char *name;
+  xbt_dynar_t container_children;
+  jed_simgrid_container_t parent;
+  xbt_dynar_t resource_list;
+  xbt_dict_t name2id;
+  int last_id;
+  int is_lowest;
 };
 
 
@@ -35,16 +35,16 @@ struct jed_simgrid_container {
  *
  */
 struct jed_res_subset {
-       jed_simgrid_container_t parent;
-       int start_idx; // start idx in resource_list of container
-       int nres;      // number of resources spanning starting at start_idx
+  jed_simgrid_container_t parent;
+  int start_idx; // start idx in resource_list of container
+  int nres;      // number of resources spanning starting at start_idx
 };
 
 typedef struct jed_res_subset s_jed_res_subset_t, *jed_res_subset_t;
 
 struct jedule_struct {
-       jed_simgri