Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add option to set the threshold where smpi send stops behaving like isend.
authorAugustin Degomme <degomme@idpann.imag.fr>
Mon, 11 Feb 2013 14:50:16 +0000 (15:50 +0100)
committerAugustin Degomme <degomme@idpann.imag.fr>
Mon, 11 Feb 2013 15:19:33 +0000 (16:19 +0100)
This was hardcoded to 65536, but experiments show that sometimes 327680 might be better

src/simgrid/sg_config.c
src/smpi/smpi_base.c

index 3d853d4..5a6faa9 100644 (file)
@@ -663,6 +663,12 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_int, &default_small_messages_threshold, 1, 1, NULL,
                      NULL);
 
                      xbt_cfgelm_int, &default_small_messages_threshold, 1, 1, NULL,
                      NULL);
 
+    int default_send_is_detached_threshold = 65536;
+    xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
+                     "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
+                     xbt_cfgelm_int, &default_send_is_detached_threshold, 1, 1, NULL,
+                     NULL);
+
     //For smpi/bw_factor and smpi/lat_factor
     //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
     //test is if( size >= thresholdN ) return valueN;
     //For smpi/bw_factor and smpi/lat_factor
     //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
     //test is if( size >= thresholdN ) return valueN;
index 38a9b54..19cce6b 100644 (file)
@@ -313,7 +313,7 @@ void smpi_mpi_start(MPI_Request request)
       XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf);
       mailbox = smpi_process_remote_mailbox(receiver);
     }
       XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf);
       mailbox = smpi_process_remote_mailbox(receiver);
     }
-    if (request->size < 64*1024 ) { //(FIXME: this limit should be configurable)
+    if (request->size < sg_cfg_get_int("smpi/send_is_detached_thres") ) { //(FIXME: this limit should be configurable)
       void *oldbuf = NULL;
       request->detached = 1;
       request->refcount++;
       void *oldbuf = NULL;
       request->detached = 1;
       request->refcount++;