Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Remove code for the cpu tag
[simgrid.git] / src / surf / surfxml_parse.c
index ad461b9..05820ac 100644 (file)
@@ -7,14 +7,14 @@
 #include <errno.h>
 #include <math.h>
 #include <stdarg.h> /* va_arg */
-#include <libgen.h>
 
 #include "xbt/misc.h"
 #include "xbt/log.h"
 #include "xbt/str.h"
+#include "xbt/file.h"
 #include "xbt/dict.h"
 #include "surf/surfxml_parse.h"
-#include "surf/surf_private.h"
+#include "src/surf/surf_private.h"
 #include "surf/random_mgr.h"
 #include "simgrid/sg_config.h"
 
@@ -374,7 +374,7 @@ void surf_parse_free_callbacks(void)
 /* Stag and Etag parse functions */
 
 void STag_surfxml_platform(void) {
-  _XBT_GNUC_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version);
+  XBT_ATTRIB_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version);
 
   xbt_assert((version >= 1.0), "******* BIG FAT WARNING *********\n "
       "You're using an ancient XML file.\n"
@@ -479,6 +479,7 @@ void ETag_surfxml_host(void)    {
   host.coord = A_surfxml_host_coordinates;
 
   sg_platf_new_host(&host);
+  xbt_dynar_free(&host.power_peak);
   current_property_set = NULL;
 }
 
@@ -974,22 +975,8 @@ void STag_surfxml_model___prop(void){
   xbt_dict_set(current_model_property_set, A_surfxml_model___prop_id, xbt_strdup(A_surfxml_model___prop_value), NULL);
 }
 
-/* ***************************************** */
-/* TUTORIAL: New TAG                         */
-void STag_surfxml_gpu(void)
-{
-  XBT_DEBUG("STag_surfxml_gpu");
-}
-void ETag_surfxml_gpu(void)
-{
-  s_sg_platf_gpu_cbarg_t gpu = SG_PLATF_GPU_INITIALIZER;
-  memset(&gpu,0,sizeof(gpu));
-
-  gpu.name = A_surfxml_gpu_name;
-
-  sg_platf_new_gpu(&gpu);
-}
-/* ***************************************** */
+void STag_surfxml_gpu(void) {}
+void ETag_surfxml_gpu(void) {}
 
 /* nothing to do in those functions */
 void ETag_surfxml_prop(void){}
@@ -1028,8 +1015,9 @@ void surf_parse_open(const char *file)
 
   if (!surf_parsed_filename_stack)
     surf_parsed_filename_stack = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
+
   surf_parsed_filename = xbt_strdup(file);
-  char *dir = dirname(surf_parsed_filename);
+  char *dir = xbt_dirname(file);
   xbt_dynar_push(surf_path, &dir);
 
   surf_file_to_parse = surf_fopen(file, "r");