-
- memset(hd->proc, 0, sizeof(hd->proc[0]) * XBT_MAX_CHANNEL);
-
- if (MSG_host_set_data(MSG_host_self(),(void*)hd) != MSG_OK)
- return unknown_error;
- }
-
- /* take a free channel for this process */
- trp_pd = (gras_trp_procdata_t)gras_libdata_get("gras_trp");
- for (i=0; i<XBT_MAX_CHANNEL && hd->proc[i]; i++);
- if (i == XBT_MAX_CHANNEL)
- RAISE2(system_error,
- "GRAS: Can't add a new process on %s, because all channel are already in use. Please increase MAX CHANNEL (which is %d for now) and recompile GRAS\n.",
- MSG_host_get_name(MSG_host_self()),XBT_MAX_CHANNEL);
-
- trp_pd->chan = i;
- hd->proc[ i ] = MSG_process_self_PID();
-
- /* regiter it to the ports structure */
- pr.port = -1;
- pr.tochan = i;
- pr.meas = 0;
- xbt_dynar_push(hd->ports,&pr);
-
- /* take a free meas channel for this process */
- for (i=0; i<XBT_MAX_CHANNEL && hd->proc[i]; i++);
- if (i == XBT_MAX_CHANNEL) {
- RAISE2(system_error,
- "GRAS: Can't add a new process on %s, because all channel are already in use. Please increase MAX CHANNEL (which is %d for now) and recompile GRAS\n.",
- MSG_host_get_name(MSG_host_self()),XBT_MAX_CHANNEL);