Beispiel #1
0
void MSG_post_create_environment(void) {
  xbt_lib_cursor_t cursor;
  void **data;
  char *name;

  /* Initialize MSG hosts */
  xbt_lib_foreach(host_lib, cursor, name, data) {
	__MSG_host_create(xbt_dict_cursor_get_elm(cursor));
  }
Beispiel #2
0
void MSG_post_create_environment(void) {
    xbt_lib_cursor_t cursor;
    void **data;
    char *name;

    /* Initialize MSG hosts */
    xbt_lib_foreach(host_lib, cursor, name, data) {
        if(data[SIMIX_HOST_LEVEL])
            __MSG_host_create(xbt_dict_cursor_get_elm(cursor));
    }

    /* Initialize MSG storages */
    xbt_lib_foreach(storage_lib, cursor, name, data) {
        if(data[SIMIX_STORAGE_LEVEL])
            __MSG_storage_create(xbt_dict_cursor_get_elm(cursor));
    }

}
Beispiel #3
0
/** \ingroup m_host_management
 * \brief Return a dynar containing all the hosts declared at a given point of time
 */
xbt_dynar_t MSG_hosts_as_dynar(void) {
  xbt_lib_cursor_t cursor;
  char *key;
  void **data;
  xbt_dynar_t res = xbt_dynar_new(sizeof(msg_host_t),NULL);

  xbt_lib_foreach(host_lib, cursor, key, data) {
    if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST) {
      xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor);
      xbt_dynar_push(res, &elm);
    }
  }
  return res;
}
Beispiel #4
0
/**
 * \brief Returns the workstation list
 *
 * Use SD_workstation_get_number() to know the array size.
 *
 * \return an array of \ref SD_workstation_t containing all workstations
 * \see SD_workstation_get_number()
 */
const SD_workstation_t *SD_workstation_get_list(void)
{

  xbt_lib_cursor_t cursor;
  char *key;
  void **data;
  int i;

  xbt_assert(SD_workstation_get_number() > 0, "There is no workstation!");

  if (sd_global->workstation_list == NULL) {    /* this is the first time the function is called */
    sd_global->workstation_list =
      xbt_new(SD_workstation_t, xbt_lib_length(host_lib));

    i = 0;
    xbt_lib_foreach(host_lib, cursor, key, data) {
      if(data[SD_HOST_LEVEL])
        sd_global->workstation_list[i++] = xbt_dict_cursor_get_elm(cursor);
    }
  }
Beispiel #5
0
 /* Initialize MSG storages */
 xbt_lib_foreach(storage_lib, cursor, name, data) {
   if(data[SIMIX_STORAGE_LEVEL])
     __MSG_storage_create(xbt_dict_cursor_get_elm(cursor));
 }