action_fp=NULL;
if (path) {
action_fp = fopen(path, "r");
- xbt_assert(action_fp != NULL, "Cannot open %s: %s", path,
- strerror(errno));
+ if (action_fp == NULL)
+ xbt_die("Cannot open %s: %s", path, strerror(errno));
}
if (!xbt_dict_is_empty(action_queues)) {
if (request->flags & RECV) {
print_request("New recv", request);
//FIXME: if receive is posted with a large size, but send is smaller, mailboxes may not match !
- if (request->size < sg_cfg_get_int("smpi/async_small_thres"))
+ if (request->flags & RMA || request->size < sg_cfg_get_int("smpi/async_small_thres"))
mailbox = smpi_process_mailbox_small();
else
mailbox = smpi_process_mailbox();
smpi_comm_use(request->comm);
request->action = simcall_comm_irecv(mailbox, request->buf,
&request->real_size, &match_recv,
+ (request->flags & ACCUMULATE)? NULL : &smpi_comm_copy_buffer_callback,
request, -1.0);
//integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
/* return;*/
/* }*/
print_request("New send", request);
- if (request->size < sg_cfg_get_int("smpi/async_small_thres")) { // eager mode
+ if (request->flags & RMA || request->size < sg_cfg_get_int("smpi/async_small_thres")) { // eager mode
mailbox = smpi_process_remote_mailbox_small(receiver);
}else{
XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf);
if(request->old_type->has_subtype == 0){
oldbuf = request->buf;
if (!_xbt_replay_is_active() && oldbuf && request->size!=0){
+ if((smpi_privatize_global_variables)
+ && ((char*)request->buf >= start_data_exe)
+ && ((char*)request->buf < start_data_exe + size_data_exe )){
+ XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
+ switch_data_segment(smpi_process_index());
+ }
buf = xbt_malloc(request->size);
memcpy(buf,oldbuf,request->size);
}
simcall_comm_isend(mailbox, request->size, -1.0,
buf, request->real_size,
&match_send,
- &xbt_free, // how to free the userdata if a detached send fails
+ &xbt_free_f, // how to free the userdata if a detached send fails
+ (request->flags & ACCUMULATE)? NULL : &smpi_comm_copy_buffer_callback,
request,
// detach if msg size < eager/rdv switch limit
request->detached);
}
}
+
+MPI_Request smpi_rma_send_init(void *buf, int count, MPI_Datatype datatype,
+ int src, int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+ request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf , count, datatype, src, dst, tag,
+ comm, RMA | NON_PERSISTENT | ISEND | SEND | PREPARED);
+ return request;
+}
+
+MPI_Request smpi_rma_recv_init(void *buf, int count, MPI_Datatype datatype,
+ int src, int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+ request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src, dst, tag,
+ comm, RMA | NON_PERSISTENT | RECV | PREPARED);
+ return request;
+}
+
+
MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype,
int dst, int tag, MPI_Comm comm)
{
return request;
}
-
-
MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype,
int src, int tag, MPI_Comm comm)
{
MPI_Datatype datatype = req->old_type;
if(datatype->has_subtype == 1){
+ if (!_xbt_replay_is_active()){
+ if( smpi_privatize_global_variables
+ && ((char*)req->old_buf >= start_data_exe)
+ && ((char*)req->old_buf < start_data_exe + size_data_exe )
+ ){
+ XBT_VERB("Privatization : We are unserializing to a zone in global memory - Switch data segment ");
+ switch_data_segment(smpi_process_index());
+ }
+ }
// This part handles the problem of non-contignous memory
// the unserialization at the reception
s_smpi_subtype_t *subtype = datatype->substruct;
if ((*request)->action != NULL) { // this is not a detached send
simcall_comm_wait((*request)->action, -1.0);
#ifdef HAVE_MC
- if(MC_is_active())
+ if(MC_is_active() && (*request)->action)
(*request)->action->comm.dst_data = NULL; // dangling pointer : dst_data is freed with a wait, need to set it to NULL for system state comparison
#endif
}