Internally, in order to speed up execution, we use a counter to keep track
on how often we already checked if the handle is now valid or not. Hence, we
actually use counter*SLEEP_TIME, that is, the time MPI_Test() causes the process
- to sleep increases linearly with the number of previously failed testk.
+ to sleep increases linearly with the number of previously failed tests. This
+ behavior can be disabled by setting smpi/grow-injected-times to no. This will
+ also disable this behavior for MPI_Iprobe.
\subsection options_model_smpi_use_shared_malloc smpi/use-shared-malloc: Factorize malloc()s
- \c smpi/comp-adjustment-file: \ref options_model_smpi_adj_file
- \c smpi/cpu-threshold: \ref options_smpi_bench
- \c smpi/display-timing: \ref options_smpi_timing
+- \c smpi/grow-injected-times: \ref options_model_smpi_test
- \c smpi/host-speed: \ref options_smpi_bench
- \c smpi/IB-penalty-factors: \ref options_model_network_coefs
- \c smpi/iprobe: \ref options_model_smpi_iprobe
{
msg_host_priv_t priv = xbt_new0(s_msg_host_priv_t, 1);
- priv->dp_objs = xbt_dict_new();
+ priv->dp_objs = nullptr;
priv->dp_enabled = 0;
priv->dp_updated_by_deleted_tasks = 0;
priv->is_migrating = 0;
- priv->file_descriptor_table = new std::vector<int>(sg_storage_max_file_descriptors);
- std::iota (priv->file_descriptor_table->rbegin(), priv->file_descriptor_table->rend(), 0); // Fill with ..., 1, 0.
+ priv->file_descriptor_table = nullptr;
sg_host_msg_set(host,priv);
{
if (priv == nullptr)
return;
- unsigned int size = xbt_dict_size(priv->dp_objs);
+ unsigned int size = priv->dp_objs ? xbt_dict_size(priv->dp_objs) : 0;
if (size > 0)
XBT_WARN("dp_objs: %u pending task?", size);
xbt_dict_free(&priv->dp_objs);
int __MSG_host_get_file_descriptor_id(msg_host_t host){
msg_host_priv_t priv = sg_host_msg(host);
+ if(!priv->file_descriptor_table){
+ priv->file_descriptor_table = new std::vector<int>(sg_storage_max_file_descriptors);
+ std::iota (priv->file_descriptor_table->rbegin(), priv->file_descriptor_table->rend(), 0); // Fill with ..., 1, 0.
+ }
xbt_assert(!priv->file_descriptor_table->empty(), "Too much files are opened! Some have to be closed.");
int desc = priv->file_descriptor_table->back();
priv->file_descriptor_table->pop_back();
char *key = nullptr;
xbt_dict_cursor_t cursor = nullptr;
dirty_page_t dp = nullptr;
+ if (!priv->dp_objs) return;
xbt_dict_foreach(priv->dp_objs, cursor, key, dp) {
double remaining = MSG_task_get_flops_amount(dp->task);
dp->prev_clock = MSG_get_clock();
dp->prev_clock = MSG_get_clock();
dp->prev_remaining = remaining;
}
-
+ if(!priv->dp_objs) priv->dp_objs = xbt_dict_new();
xbt_assert(xbt_dict_get_or_null(priv->dp_objs, key) == nullptr);
xbt_dict_set(priv->dp_objs, key, dp, nullptr);
XBT_DEBUG("add %s on %s (remaining %f, dp_enabled %d)", key, sg_host_get_name(host), remaining, priv->dp_enabled);
char *key = bprintf("%s-%p", task->name, task);
- dirty_page_t dp = (dirty_page_t) xbt_dict_get_or_null(priv->dp_objs, key);
+ dirty_page_t dp = (dirty_page_t) (priv->dp_objs ? xbt_dict_get_or_null(priv->dp_objs, key) : NULL);
xbt_assert(dp->task == task);
/* If we are in the middle of dirty page tracking, we record how much computation has been done until now, and keep
priv->dp_updated_by_deleted_tasks += updated;
}
-
- xbt_dict_remove(priv->dp_objs, key);
+ if(priv->dp_objs)
+ xbt_dict_remove(priv->dp_objs, key);
xbt_free(dp);
XBT_DEBUG("del %s on %s", key, sg_host_get_name(host));
#define SURF_MODEL_H_
#include <cstddef>
+#include <string>
#include <xbt.h>
#include <memory>