- if (request->size < 64*1024 ) { // eager mode => detached send (FIXME: this limit should be configurable)
- void *oldbuf = request->buf;
- detached = 1;
- request->buf = malloc(request->size);
- memcpy(request->buf,oldbuf,request->size);
- XBT_DEBUG("Send request %p is detached; buf %p copied into %p",request,oldbuf,request->buf);
- } else {
- XBT_DEBUG("Send request %p is not detached (buf: %p)",request,request->buf);
+ if (request->size < xbt_cfg_get_int(_surf_cfg_set, "smpi/async_small_thres")) { // eager mode => detached send (FIXME: this limit should be configurable)
+ mailbox = smpi_process_remote_mailbox_small(
+ smpi_group_index(smpi_comm_group(request->comm), request->dst));
+ }else{
+ XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf);
+ mailbox = smpi_process_remote_mailbox(
+ smpi_group_index(smpi_comm_group(request->comm), request->dst));
+ }
+ if (request->size < 64*1024 ) { //(FIXME: this limit should be configurable)
+ void *oldbuf = request->buf;
+ detached = 1;
+ request->buf = malloc(request->size);
+ memcpy(request->buf,oldbuf,request->size);
+ XBT_DEBUG("Send request %p is detached; buf %p copied into %p",request,oldbuf,request->buf);
+ }else{
+ XBT_DEBUG("Send request %p is not detached (buf: %p)",request,request->buf);
+ mailbox = smpi_process_remote_mailbox(
+ smpi_group_index(smpi_comm_group(request->comm), request->dst));
+ }
+
+ request->action =
+ simcall_comm_isend(mailbox, request->size, -1.0,
+ request->buf, request->size,
+ &match_send,
+ &smpi_mpi_request_free_voidp, // how to free the userdata if a detached send fails
+ request,
+ // detach if msg size < eager/rdv switch limit
+ detached);
+
+ #ifdef HAVE_TRACING
+ /* FIXME: detached sends are not traceable (request->action == NULL) */
+ if (request->action)
+ simcall_set_category(request->action, TRACE_internal_smpi_get_category());
+ #endif
+