-
- res->peer_name = strdup(MSG_host_get_name(sockdata->to_host));
-
- remote_hd=(gras_hostdata_t *)MSG_host_get_data(sockdata->to_host);
- xbt_assert0(remote_hd,"Run gras_process_init!!");
-
- sockdata->to_chan = -1;
- res->peer_port = -10;
- for (cursor=0; cursor<XBT_MAX_CHANNEL; cursor++) {
- if (remote_hd->proc[cursor] == r_pid) {
- sockdata->to_chan = cursor;
- DEBUG2("Chan %d on %s is for my pal",
- cursor,res->peer_name);
-
- xbt_dynar_foreach(remote_hd->ports, cpt, pr) {
- if (sockdata->to_chan == pr.tochan) {
- if (pr.meas) {
- DEBUG0("Damn, it's for measurement");
- continue;
- }
-
- res->peer_port = pr.port;
- DEBUG1("Cool, it points to port %d", pr.port);
- break;
- } else {
- DEBUG2("Wrong port (tochan=%d, looking for %d)\n",
- pr.tochan,sockdata->to_chan);
- }
- }
- if (res->peer_port == -10) {
- /* was for measurement */
- sockdata->to_chan = -1;
- } else {
- /* found it, don't let it override by meas */
- break;
- }
- }
- }
- xbt_assert0(sockdata->to_chan != -1,
- "Got a message from a process without channel");
-
+
+ XBT_DEBUG("Create socket to process:%s(Port %d) from process: %s(Port %d)",
+ SIMIX_req_process_get_name(sockdata->from_process),
+ res->peer_port,
+ SIMIX_req_process_get_name(sockdata->to_process), res->port);
+