Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
merging tracing changes
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Sat, 9 Apr 2011 12:45:31 +0000 (14:45 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Sat, 9 Apr 2011 12:45:31 +0000 (14:45 +0200)
examples/smpi/NAS/EP-sampling/Makefile [new file with mode: 0644]
examples/smpi/NAS/EP-sampling/ep.c
src/include/surf/surf.h
src/simix/smx_deployment.c
src/surf/surfxml_parse.c

diff --git a/examples/smpi/NAS/EP-sampling/Makefile b/examples/smpi/NAS/EP-sampling/Makefile
new file mode 100644 (file)
index 0000000..6205cb4
--- /dev/null
@@ -0,0 +1,28 @@
+SHELL=/bin/sh
+BENCHMARK=ep
+BENCHMARKU=EP
+
+include ../config/make.def
+
+#OBJS = ep.o ${COMMON}/print_results.o ${COMMON}/${RAND}.o ${COMMON}/timers.o
+OBJS = ep.o randlc.o
+
+include ../sys/make.common
+
+${PROGRAM}: config ${OBJS}
+#      ${FLINK} ${FLINKFLAGS} -o ${PROGRAM} ${OBJS} ${FMPI_LIB}
+       ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${CMPI_LIB}
+
+
+#ep.o:         ep.f  mpinpb.h npbparams.h
+#      ${FCOMPILE} ep.f
+
+ep.o:  ep.c randlc.c ../EP/mpinpb.h npbparams.h
+       ${CCOMPILE} ep.c
+
+clean:
+       - rm -f *.o *~ 
+       - rm -f npbparams.h core
+
+
+
index 41de955..71e0f89 100644 (file)
          k_offset = no_large_nodes*(np+1) + (node-no_large_nodes)*np -1;
      
       int stop = false;
-      for(k = 1; k <= np; k++) SMPI_SAMPLE_LOCAL(0.25 * np) {
+      for(k = 1; k <= np; k++) SMPI_SAMPLE_LOCAL(0.25 * np, 0.03) {
          stop = false;
          kk = k_offset + k ;
          t1 = s;
index cef3ab7..5672742 100644 (file)
@@ -696,7 +696,9 @@ XBT_PUBLIC(void) surf_exit(void);
 
 /* Prototypes of the functions that handle the properties */
 XBT_PUBLIC_DATA(xbt_dict_t) current_property_set;       /* the prop set for the currently parsed element (also used in SIMIX) */
-XBT_PUBLIC_DATA(void) parse_properties(void);
+XBT_PUBLIC_DATA(void) parse_properties(const char* prop_id, const char* prop_value);
+XBT_PUBLIC_DATA(void) parse_properties_XML(void);
+XBT_PUBLIC_DATA(void) parse_properties_lua(const char* prop_id, const char* prop_value);
 
 /* surf parse file related (public because called from a test suite) */
 XBT_PUBLIC(void) parse_platform_file(const char *file);
index 96e9981..c1f8dd5 100644 (file)
@@ -114,7 +114,7 @@ void SIMIX_launch_application(const char *file)
 
   surfxml_add_callback(STag_surfxml_process_cb_list, parse_process_init);
   surfxml_add_callback(ETag_surfxml_argument_cb_list, parse_argument);
-  surfxml_add_callback(STag_surfxml_prop_cb_list, parse_properties);
+  surfxml_add_callback(STag_surfxml_prop_cb_list, parse_properties_XML);
   surfxml_add_callback(ETag_surfxml_process_cb_list,
                        parse_process_finalize);
 
index 01d41de..af80730 100644 (file)
@@ -524,25 +524,41 @@ void parse_platform_file(const char *file)
 
 /* Prop tag functions */
 
-void parse_properties(void)
-{
-  char *value = NULL;
-  if (!current_property_set)
-    current_property_set = xbt_dict_new();      // Maybe, it should be make a error
-  if(!strcmp(A_surfxml_prop_id,"coordinates")){
-         if(!strcmp(A_surfxml_prop_value,"yes") && !COORD_HOST_LEVEL)
-         {
-                   XBT_INFO("Configuration change: Set '%s' to '%s'", A_surfxml_prop_id, A_surfxml_prop_value);
-                       COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp);
-                       COORD_ASR_LEVEL  = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp);
+void parse_properties(const char* prop_id, const char* prop_value)
+{
+    char *value = NULL;
+       if (!current_property_set)
+           current_property_set = xbt_dict_new();      // Maybe, it should be make a error
+       if(!strcmp(prop_id,"coordinates")){
+               if(!strcmp(prop_value,"yes") && !COORD_HOST_LEVEL)
+                 {
+                           XBT_INFO("Configuration change: Set '%s' to '%s'", prop_id, prop_value);
+                               COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp);
+                               COORD_ASR_LEVEL  = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp);
+                 }
+               if(strcmp(A_surfxml_prop_value,"yes"))
+                         xbt_die("Setting XML prop coordinates must be \"yes\"");
          }
-         if(strcmp(A_surfxml_prop_value,"yes"))
-                 xbt_die("Setting XML prop coordinates must be \"yes\"");
-  }
-  else{
-         value = xbt_strdup(A_surfxml_prop_value);
-         xbt_dict_set(current_property_set, A_surfxml_prop_id, value, free);
-  }
+       else{
+                 value = xbt_strdup(prop_value);
+                 xbt_dict_set(current_property_set, prop_id, value, free);
+        }
+}
+
+/**
+ * With XML parser
+ */
+void parse_properties_XML(void)
+{
+  parse_properties(A_surfxml_prop_id, A_surfxml_prop_value);
+}
+
+/*
+ * With lua console
+ */
+void parse_properties_lua(const char* prop_id, const char* prop_value)
+{
+        parse_properties(prop_id, prop_value);
 }
 
 /* Trace management functions */