Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge with master and fix conflicts
authoralebre <adrien.lebre@inria.fr>
Thu, 21 Feb 2013 12:02:15 +0000 (13:02 +0100)
committeralebre <adrien.lebre@inria.fr>
Thu, 21 Feb 2013 12:02:15 +0000 (13:02 +0100)
20 files changed:
1  2 
buildtools/Cmake/DefinePackages.cmake
include/msg/datatypes.h
include/msg/msg.h
include/simgrid/simix.h
include/xbt/ex.h
src/include/surf/surf.h
src/msg/msg_private.h
src/msg/msg_vm.c
src/simgrid/sg_config.c
src/simix/smx_host.c
src/simix/smx_network.c
src/simix/smx_process.c
src/simix/smx_smurf_private.h
src/simix/smx_user.c
src/surf/storage.c
src/surf/surf.c
src/surf/surf_private.h
src/surf/workstation.c
src/surf/workstation_ptask_L07.c
src/xbt/ex.c

Simple merge
@@@ -80,15 -81,23 +80,14 @@@ typedef struct msg_task 
   */
  typedef struct msg_task *msg_task_t;
  
 -/* ********************************  VM ************************************* */
 -typedef struct msg_vm *msg_vm_t;
 -
 -typedef enum {
 -  msg_vm_state_suspended, msg_vm_state_running, msg_vm_state_migrating
 -} e_msg_vm_state_t;
 -
 -typedef struct msg_vm {
 -  char *name;
 -  s_xbt_swag_hookup_t all_vms_hookup;
 -  s_xbt_swag_hookup_t host_vms_hookup;
 -  xbt_dynar_t processes;
 -  e_msg_vm_state_t state;
 -  msg_host_t location;
 -  int coreAmount;
 -} s_msg_vm_t;
 +/* ******************************** VM ************************************* */
 +typedef msg_host_t msg_vm_t;
 +typedef msg_host_priv_t msg_vm_priv_t;
 +
 +static inline msg_vm_priv_t MSG_vm_priv(msg_vm_t vm){
 +  return xbt_lib_get_level(vm, MSG_HOST_LEVEL);
 +}
  
  /* ******************************** File ************************************ */
  typedef struct simdata_file *simdata_file_t;
  
Simple merge
Simple merge
Simple merge
@@@ -465,20 -401,9 +461,9 @@@ XBT_PUBLIC(void) surf_cpu_model_init_Ca
   *  \brief Initializes the CPU model with trace integration [Deprecated]
   *
   *  You shouldn't have to call it by yourself.
-  *  \see surf_workstation_model_init_CLM03()
   */
 -XBT_PUBLIC(void) surf_cpu_model_init_ti(void);
 +XBT_PUBLIC(surf_model_t) surf_cpu_model_init_ti(void);
  
- /** \brief This function call the share resources function needed
-  *
-  */
- XBT_PUBLIC(double) generic_share_resources(double now);
- /** \brief This function call the update action state function needed
-  *
-  */
- XBT_PUBLIC(void)   generic_update_actions_state(double now, double delta);
  /** \ingroup SURF_models
   *  \brief The list of all available optimization modes (both for cpu and networks).
   *  These optimization modes can be set using --cfg=cpu/optim:... and --cfg=network/optim:...
Simple merge
@@@ -325,54 -161,60 +325,52 @@@ void MSG_vm_resume(msg_vm_t vm
    #endif
  }
  
 -/** @brief Immediately kills all processes within the given VM. Any memory that they allocated will be leaked.
 +
 +/** @brief Immediately save the execution of all processes within the given VM.
   *  @ingroup msg_VMs
   *
 - * No extra delay occurs. If you want to simulate this too, you want to
 - * use a #MSG_process_sleep() or something. I'm not quite sure.
 + * This function stops the exection of the VM. All the processes on this VM
 + * will pause. The state of the VM is perserved. We can later resume it again.
 + *
 + * FIXME: No suspension cost occurs. If you want to simulate this too, you want to
 + * use a \ref MSG_file_write() before or after, depending on the exact semantic
 + * of VM save to you.
   */
 -void MSG_vm_shutdown(msg_vm_t vm)
 +void MSG_vm_save(msg_vm_t vm)
  {
 -  msg_process_t process;
 -  XBT_DEBUG("%lu processes in the VM", xbt_dynar_length(vm->processes));
 -  while (!xbt_dynar_is_empty(vm->processes)) {
 -    process = xbt_dynar_get_as(vm->processes,0,msg_process_t);
 -    MSG_process_kill(process);
 -  }
 -
 +  simcall_vm_save(vm);
    #ifdef HAVE_TRACING
 -  TRACE_msg_vm_kill(vm);
 +  TRACE_msg_vm_save(vm);
    #endif
 -
  }
  
 -/**
 - * \ingroup msg_VMs
 - * \brief Reboot the VM, restarting all the processes in it.
 +/** @brief Restore the execution of the VM. All processes on the VM run again.
 + *  @ingroup msg_VMs
 + *
 + * FIXME: No restore cost occurs. If you want to simulate this too, you want to
 + * use a \ref MSG_file_read() before or after, depending on the exact semantic
 + * of VM restore to you.
   */
 -void MSG_vm_reboot(msg_vm_t vm)
 +void MSG_vm_restore(msg_vm_t vm)
  {
 -  xbt_dynar_t process_list = xbt_dynar_new(sizeof(msg_process_t), NULL);
 -  msg_process_t process;
 -  unsigned int cpt;
 -
 -  xbt_dynar_foreach(vm->processes, cpt, process) {
 -    xbt_dynar_push_as(process_list, msg_process_t, process);
 -  }
 +  simcall_vm_restore(vm);
  
 -  xbt_dynar_foreach(process_list, cpt, process) {
 -    msg_process_t new_process = MSG_process_restart(process);
 -    MSG_vm_bind(vm, new_process);
 -  }
 -
 -  xbt_dynar_free(&process_list);
 +  #ifdef HAVE_TRACING
 +  TRACE_msg_vm_restore(vm);
 +  #endif
  }
  
 -/** @brief Destroy a msg_vm_t.
 +
 +/** @brief Destroy a VM. Destroy the VM object from the simulation.
   *  @ingroup msg_VMs
   */
 -void MSG_vm_destroy(msg_vm_t vm) {
 -  unsigned int cpt;
 -  msg_process_t process;
 -  xbt_dynar_foreach(vm->processes,cpt,process) {
 -    //FIXME: Slow ?
 -    simdata_process_t simdata = simcall_process_get_data(process);
 -    simdata->vm = NULL;
 -  }
 +void MSG_vm_destroy(msg_vm_t vm)
 +{
 +  /* First, terminate all processes on the VM */
 +  simcall_vm_shutdown(vm);
 +
 +  /* Then, destroy the VM object */
 +  simcall_vm_destroy(vm);
  
    #ifdef HAVE_TRACING
    TRACE_msg_vm_end(vm);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc src/surf/surf.c
Simple merge
Simple merge
@@@ -475,25 -450,16 +475,23 @@@ void surf_workstation_model_init_curren
    surf_cpu_model_init_Cas01();
    surf_network_model_init_LegrandVelho();
  
 +  /* surf_cpu_mode_pm and surf_network_model must be initialized in advance. */
 +  xbt_assert(surf_cpu_model_pm);
 +  xbt_assert(surf_network_model);
 +  surf_workstation_model_init_internal();
 +
    xbt_dynar_push(model_list, &surf_workstation_model);
 +  xbt_dynar_push(model_list_invoke, &surf_workstation_model);
    sg_platf_host_add_cb(workstation_new);
- //  sg_platf_postparse_add_cb(create_workstations);
  }
  
  void surf_workstation_model_init_compound()
  {
 -
 -  xbt_assert(surf_cpu_model, "No CPU model defined yet!");
 +  xbt_assert(surf_cpu_model_pm, "No CPU model defined yet!");
    xbt_assert(surf_network_model, "No network model defined yet!");
 +
    surf_workstation_model_init_internal();
    xbt_dynar_push(model_list, &surf_workstation_model);
 +  xbt_dynar_push(model_list_invoke, &surf_workstation_model);
    sg_platf_host_add_cb(workstation_new);
- //  sg_platf_postparse_add_cb(create_workstations);
  }
Simple merge
diff --cc src/xbt/ex.c
Simple merge