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->comm = comm;
+ smpi_comm_use(request->comm);
request->action = NULL;
request->flags = flags;
request->detached = 0;
request->op = MPI_REPLACE;
request->send = 0;
request->recv = 0;
- // if (flags & SEND) smpi_datatype_unuse(datatype);
return request;
}
// we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
request->real_size=request->size;
- smpi_datatype_use(request->old_type);
- smpi_comm_use(request->comm);
request->action = simcall_comm_irecv(SIMIX_process_self(), mailbox, request->buf, &request->real_size, &match_recv,
!smpi_process_get_replaying()? &smpi_comm_copy_buffer_callback
: &smpi_comm_null_copy_buffer_callback, request, -1.0);
// we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
request->real_size=request->size;
- smpi_datatype_use(request->old_type);
- smpi_comm_use(request->comm);
request->action = simcall_comm_isend(SIMIX_process_from_PID(request->src+1), mailbox, request->size, -1.0,
buf, request->real_size, &match_send,
&xbt_free_f, // how to free the userdata if a detached send fails
if((*request)->refcount<0) xbt_die("wrong refcount");
if((*request)->refcount==0){
+ smpi_datatype_unuse((*request)->old_type);
+ smpi_comm_unuse((*request)->comm);
print_request("Destroying", (*request));
xbt_free(*request);
*request = MPI_REQUEST_NULL;
request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src, dst, tag,
comm, RMA | NON_PERSISTENT | ISEND | SEND | PREPARED | ACCUMULATE);
request->op = op;
+// smpi_datatype_use(datatype);
}
return request;
}
request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src, dst, tag,
comm, RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE);
request->op = op;
+// smpi_datatype_use(datatype);
}
return request;
}
smpi_op_apply(req->op, req->buf, req->old_buf, &n, &datatype);
}
}
- smpi_comm_unuse(req->comm);
- smpi_datatype_unuse(req->old_type);
}
if (TRACE_smpi_view_internals()) {
}
if(req->detached_sender!=NULL){
- smpi_datatype_unuse(req->detached_sender->old_type);
- smpi_comm_unuse(req->detached_sender->comm);
smpi_mpi_request_free(&(req->detached_sender));
}
if(req->flags & PERSISTENT)
int ret=MPI_SUCCESS;
*new_t= xbt_new(s_smpi_mpi_datatype_t,1);
memcpy(*new_t, datatype, sizeof(s_smpi_mpi_datatype_t));
+ (*new_t)->in_use=1;
if (datatype->sizeof_substruct){
(*new_t)->substruct=xbt_malloc(datatype->sizeof_substruct);
memcpy((*new_t)->substruct, datatype->substruct, datatype->sizeof_substruct);
if(elem && elem->copy_fn!=MPI_NULL_COPY_FN){
ret = elem->copy_fn(datatype, *key, NULL, value_in, &value_out, &flag );
if(ret!=MPI_SUCCESS){
+ smpi_datatype_unuse(*new_t);
*new_t=MPI_DATATYPE_NULL;
return ret;
}
new_t->base.unserialize = &unserialize_indexed;
new_t->base.subtype_free = &free_indexed;
new_t->base.subtype_use = &use_indexed;
- //TODO : add a custom function for each time to clean these
new_t->block_lengths= xbt_new(int, block_count);
new_t->block_indices= xbt_new(int, block_count);
int i;
new_t->base.unserialize = &unserialize_hindexed;
new_t->base.subtype_free = &free_hindexed;
new_t->base.subtype_use = &use_hindexed;
- //TODO : add a custom function for each time to clean these
new_t->block_lengths= xbt_new(int, block_count);
new_t->block_indices= xbt_new(MPI_Aint, block_count);
int i;
new_t->base.unserialize = &unserialize_struct;
new_t->base.subtype_free = &free_struct;
new_t->base.subtype_use = &use_struct;
- //TODO : add a custom function for each time to clean these
new_t->block_lengths= xbt_new(int, block_count);
new_t->block_indices= xbt_new(MPI_Aint, block_count);
new_t->old_types= xbt_new(MPI_Datatype, block_count);
new_t->old_types[i]=old_types[i];
smpi_datatype_use(new_t->old_types[i]);
}
- //new_t->block_lengths = block_lengths;
- //new_t->block_indices = block_indices;
new_t->block_count = block_count;
- //new_t->old_types = old_types;
return new_t;
}
MPI_Win recv_win = win->connected_wins[target_rank];
void* recv_addr = (void*) ( ((char*)recv_win->base) + target_disp * recv_win->disp_unit);
- smpi_datatype_use(origin_datatype);
- smpi_datatype_use(target_datatype);
XBT_DEBUG("Entering MPI_Put to %d", target_rank);
if(target_rank != smpi_comm_rank(win->comm)){
MPI_Win send_win = win->connected_wins[target_rank];
void* send_addr = (void*)( ((char*)send_win->base) + target_disp * send_win->disp_unit);
- smpi_datatype_use(origin_datatype);
- smpi_datatype_use(target_datatype);
XBT_DEBUG("Entering MPI_Get from %d", target_rank);
if(target_rank != smpi_comm_rank(win->comm)){
void* recv_addr = (void*)( ((char*)recv_win->base) + target_disp * recv_win->disp_unit);
XBT_DEBUG("Entering MPI_Accumulate to %d", target_rank);
- smpi_datatype_use(origin_datatype);
- smpi_datatype_use(target_datatype);
-
//prepare send_request
MPI_Request sreq = smpi_rma_send_init(origin_addr, origin_count, origin_datatype,
smpi_process_index(), smpi_group_index(smpi_comm_group(win->comm),target_rank), RMA_TAG+3, win->comm, op);