Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Thu, 26 Sep 2013 06:57:41 +0000 (08:57 +0200)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Thu, 26 Sep 2013 06:57:41 +0000 (08:57 +0200)
1  2 
include/simgrid/simix.h
src/include/surf/surf.h
src/msg/msg_host.c
src/msg/msg_io.c
src/simix/smx_smurf_private.h
src/simix/smx_user.c
src/surf/storage.c

diff --combined include/simgrid/simix.h
@@@ -1,4 -1,4 +1,4 @@@
- /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ /* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
   * All rights reserved.                                                     */
  
  /* This program is free software; you can redistribute it and/or modify it
@@@ -496,7 -496,6 +496,7 @@@ XBT_PUBLIC(xbt_dict_t) simcall_storage_
  XBT_PUBLIC(void*) SIMIX_storage_get_data(smx_storage_t storage);
  XBT_PUBLIC(void) SIMIX_storage_set_data(smx_storage_t storage, void *data);
  XBT_PUBLIC(xbt_dict_t) SIMIX_storage_get_content(smx_storage_t storage);
 +XBT_PUBLIC(xbt_dict_t) simcall_storage_get_content(smx_storage_t storage);
  XBT_PUBLIC(const char*) SIMIX_storage_get_name(smx_host_t host);
  /************************** AS router   **********************************/
  XBT_PUBLIC(xbt_dict_t) SIMIX_asr_get_properties(const char *name);
diff --combined src/include/surf/surf.h
@@@ -1,4 -1,4 +1,4 @@@
- /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+ /* Copyright (c) 2004-2013. The SimGrid Team.
   * All rights reserved.                                                     */
  
  /* This program is free software; you can redistribute it and/or modify it
@@@ -238,7 -238,7 +238,7 @@@ typedef struct surf_storage_model_exten
    surf_action_t(*stat) (void *storage, surf_file_t fd);
    surf_action_t(*ls) (void *storage, const char *path);
    xbt_dict_t(*get_properties) (const void *storage);
 -  xbt_dict_t(*get_content) (const void *storage);
 +  xbt_dict_t(*get_content) (void *storage);
  } s_surf_model_extension_storage_t;
  
       /** \ingroup SURF_models
diff --combined src/msg/msg_host.c
@@@ -1,4 -1,4 +1,4 @@@
- /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+ /* Copyright (c) 2004-2013. The SimGrid Team.
   * All rights reserved.                                                     */
  
  /* This program is free software; you can redistribute it and/or modify it
@@@ -364,7 -364,7 +364,7 @@@ xbt_dynar_t MSG_host_get_storage_conten
    xbt_dynar_t storage_list = simcall_host_get_storage_list(host);
    xbt_dynar_foreach(storage_list, i, storage_name){
        storage = xbt_lib_get_elm_or_null(storage_lib,storage_name);
 -      xbt_dict_t content = SIMIX_storage_get_content(storage);
 +      xbt_dict_t content = simcall_storage_get_content(storage);
        xbt_dynar_push(contents, &content);
    }
    return contents;
diff --combined src/msg/msg_io.c
@@@ -1,4 -1,4 +1,4 @@@
- /* Copyright (c) 2004 - 2013. The SimGrid Team.
+ /* Copyright (c) 2004-2013. The SimGrid Team.
   * All rights reserved.                                                       */
  
  /* This program is free software; you can redistribute it and/or modify it
@@@ -316,10 -316,8 +316,10 @@@ void *MSG_storage_get_data(msg_storage_
   *
   * \brief Returns the content (file list) of a #msg_storage_t.
   * \param storage a storage
 + * \return The content of this storage element as a dict (full path file => size)
   */
  xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
  {
 -      return SIMIX_storage_get_content(storage);
 +  return SIMIX_storage_get_content(storage);
 +  //return (simcall_storage_get_properties(storage));
  }
@@@ -1,4 -1,4 +1,4 @@@
- /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ /* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
   * All rights reserved.                                                     */
  
  /* This program is free software; you can redistribute it and/or modify it
@@@ -360,7 -360,6 +360,7 @@@ ACTION(SIMCALL_FILE_GET_INFO, file_get_
  ACTION(SIMCALL_STORAGE_GET_FREE_SIZE, storage_get_free_size, WITH_ANSWER, TSIZE(result), TSTRING(name)) sep \
  ACTION(SIMCALL_STORAGE_GET_USED_SIZE, storage_get_used_size, WITH_ANSWER, TSIZE(result), TSTRING(name)) sep \
  ACTION(SIMCALL_STORAGE_GET_PROPERTIES, storage_get_properties, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSPEC(storage, smx_storage_t)) sep \
 +ACTION(SIMCALL_STORAGE_GET_CONTENT, storage_get_content, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSPEC(storage, smx_storage_t)) sep \
  ACTION(SIMCALL_ASR_GET_PROPERTIES, asr_get_properties, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSTRING(name)) sep 
  
  /* SIMCALL_COMM_IS_LATENCY_BOUNDED and SIMCALL_SET_CATEGORY make things complicated
diff --combined src/simix/smx_user.c
@@@ -1,6 -1,7 +1,7 @@@
  /* smx_user.c - public interface to simix                                   */
  
- /* Copyright (c) 2010-2012. Da SimGrid team. All rights reserved.          */
+ /* Copyright (c) 2010-2013. The SimGrid Team.
+    All rights reserved.                                                     */
  
  /* This program is free software; you can redistribute it and/or modify it
   * under the terms of the license (GNU LGPL) which comes with this package. */
@@@ -1311,17 -1312,6 +1312,17 @@@ xbt_dict_t simcall_storage_get_properti
    return simcall_BODY_storage_get_properties(storage);
  }
  
 +/**
 + * \ingroup simix_storage_management
 + * \brief Returns a dict containing the content of a storage element.
 + *
 + * \param storage A storage element
 + * \return The content of this storage element as a dict (full path file => size)
 + */
 +xbt_dict_t simcall_storage_get_content(smx_storage_t storage)
 +{
 +  return simcall_BODY_storage_get_content(storage);
 +}
  
  #ifdef HAVE_MC
  
diff --combined src/surf/storage.c
@@@ -1,8 -1,8 +1,8 @@@
- /* Copyright (c) 2004 - 2013. The SimGrid Team.
-  * All rights reserved.                                                                 */
+ /* Copyright (c) 2004-2013. The SimGrid Team.
+  * All rights reserved.                                                     */
  
  /* This program is free software; you can redistribute it and/or modify it
-  * under the terms of the license (GNU LGPL) which comes with this package.             */
+  * under the terms of the license (GNU LGPL) which comes with this package. */
  
  #include "xbt/ex.h"
  #include "xbt/dict.h"
@@@ -197,17 -197,16 +197,17 @@@ static xbt_dict_t storage_get_propertie
    return surf_resource_properties(surf_storage_resource_priv(storage));
  }
  
 -static xbt_dict_t storage_get_content(const void *storage)
 +static xbt_dict_t storage_get_content(void *storage)
  {
    /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */
 -  /* surf_action_t action = storage_action_execute(storage,0, LS); */
 +  /*surf_action_t action = storage_action_execute(storage,0, LS);*/
 +
 +  void *st = surf_storage_resource_priv(storage);
    xbt_dict_t content_dict = xbt_dict_new();
    xbt_dict_cursor_t cursor = NULL;
    char *file;
    size_t size;
 -
 -  xbt_dict_foreach(((storage_t)storage)->content, cursor, file, size){
 +  xbt_dict_foreach(((storage_t)st)->content, cursor, file, size){
      xbt_dict_set(content_dict,file,&size,NULL);
    }
    return content_dict;