double values[4];//arbitrary set to 4
} s_smpi_factor_multival_t;
-xbt_dynar_t smpi_os_values = NULL;
-xbt_dynar_t smpi_or_values = NULL;
-xbt_dynar_t smpi_ois_values = NULL;
+xbt_dynar_t smpi_os_values = nullptr;
+xbt_dynar_t smpi_or_values = nullptr;
+xbt_dynar_t smpi_ois_values = nullptr;
static simgrid::config::Flag<double> smpi_wtime_sleep(
"smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
}
}
- request->buf = buf;
+ request->buf = buf;
// This part handles the problem of non-contiguous memory (for the unserialisation at the reception)
- request->old_buf = old_buf;
+ request->old_buf = old_buf;
request->old_type = datatype;
request->size = smpi_datatype_size(datatype) * count;
smpi_datatype_use(datatype);
- request->src = src;
- request->dst = dst;
- request->tag = tag;
+ request->src = src;
+ request->dst = dst;
+ request->tag = tag;
request->comm = comm;
smpi_comm_use(request->comm);
- request->action = NULL;
- request->flags = flags;
- request->detached = 0;
- request->detached_sender = NULL;
- request->real_src = 0;
-
- request->truncated = 0;
- request->real_size = 0;
- request->real_tag = 0;
- if(flags & PERSISTENT)
+ request->action = nullptr;
+ request->flags = flags;
+ request->detached = 0;
+ request->detached_sender = nullptr;
+ request->real_src = 0;
+ request->truncated = 0;
+ request->real_size = 0;
+ request->real_tag = 0;
+ if (flags & PERSISTENT)
request->refcount = 1;
else
request->refcount = 0;
- request->op = MPI_REPLACE;
+ request->op = MPI_REPLACE;
request->send = 0;
request->recv = 0;
{
smx_mailbox_t mailbox;
- xbt_assert(!request->action, "Cannot (re)start a non-finished communication");
+ xbt_assert(request->action == nullptr, "Cannot (re-)start unfinished communication");
request->flags &= ~PREPARED;
request->flags &= ~FINISHED;
request->refcount++;
mailbox = smpi_process_remote_mailbox(receiver);
XBT_DEBUG("Is there a corresponding recv already posted in the large mailbox %p?", mailbox);
smx_synchro_t action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, static_cast<void*>(request));
- if(action == nullptr){
- if ((request->flags & SSEND) == 0){
- mailbox = smpi_process_remote_mailbox_small(receiver);
- XBT_DEBUG("No, nothing in the large mailbox, message is to be sent on the small one %p", mailbox);
- } else{
- mailbox = smpi_process_remote_mailbox_small(receiver);
- XBT_DEBUG("SSEND : Is there a corresponding recv already posted in the small mailbox %p?", mailbox);
- action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, static_cast<void*>(request));
- if(action == nullptr){
- XBT_DEBUG("No, we are first, send to large mailbox");
- mailbox = smpi_process_remote_mailbox(receiver);
- }
- }
- }else{
+ if (action == nullptr) {
+ if ((request->flags & SSEND) == 0){
+ mailbox = smpi_process_remote_mailbox_small(receiver);
+ XBT_DEBUG("No, nothing in the large mailbox, message is to be sent on the small one %p", mailbox);
+ }
+ else {
+ mailbox = smpi_process_remote_mailbox_small(receiver);
+ XBT_DEBUG("SSEND : Is there a corresponding recv already posted in the small mailbox %p?", mailbox);
+ action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, static_cast<void*>(request));
+ if (action == nullptr) {
+ XBT_DEBUG("No, we are first, send to large mailbox");
+ mailbox = smpi_process_remote_mailbox(receiver);
+ }
+ }
+ }
+ else {
XBT_DEBUG("Yes there was something for us in the large mailbox");
}
- }else{
+ }
+ else {
mailbox = smpi_process_remote_mailbox(receiver);
XBT_DEBUG("Send request %p is in the large mailbox %p (buf: %p)",mailbox, request,request->buf);
}
XBT_DEBUG("send simcall posted");
/* FIXME: detached sends are not traceable (request->action == nullptr) */
- if (request->action)
+ if (request->action != nullptr)
simcall_set_category(request->action, TRACE_internal_smpi_get_category());
if (async_small_thresh != 0 || ((request->flags & RMA)!=0))
request->action = simcall_comm_iprobe(mailbox, 0, request->src,request->tag, &match_recv, static_cast<void*>(request));
}
- if (request->action){
+ if (request->action != nullptr){
simgrid::simix::Comm *sync_comm = static_cast<simgrid::simix::Comm*>(request->action);
MPI_Request req = static_cast<MPI_Request>(sync_comm->src_data);
*flag = 1;