From 56ac3ccc6b9d7ff1843570eda320e4d547fed157 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Mon, 11 Feb 2013 15:50:16 +0100 Subject: [PATCH] add option to set the threshold where smpi send stops behaving like isend. This was hardcoded to 65536, but experiments show that sometimes 327680 might be better --- src/simgrid/sg_config.c | 6 ++++++ src/smpi/smpi_base.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 3d853d4482..5a6faa9fa5 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -663,6 +663,12 @@ void sg_config_init(int *argc, char **argv) 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; diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 38a9b54eea..19cce6ba09 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -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); } - 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++; -- 2.20.1