#include <errno.h>
#include "simix/smx_private.h"
#include "surf/surf.h"
+#include "simgrid/sg_config.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)");
if(datatype->has_subtype == 1){
// This part handles the problem of non-contiguous memory
old_buf = buf;
- buf = malloc(count*smpi_datatype_size(datatype));
+ buf = xbt_malloc(count*smpi_datatype_size(datatype));
if (flags & SEND) {
subtype->serialize(old_buf, buf, count, datatype->substruct);
}
"Cannot (re)start a non-finished communication");
if(request->flags & RECV) {
print_request("New recv", request);
- if (request->size < surf_cfg_get_int("smpi/async_small_thres"))
+ if (request->size < sg_cfg_get_int("smpi/async_small_thres"))
mailbox = smpi_process_mailbox_small();
else
mailbox = smpi_process_mailbox();
/* return;*/
/* }*/
print_request("New send", request);
- if (request->size < surf_cfg_get_int("smpi/async_small_thres")) { // eager mode
+ if (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 (oldbuf){
- request->buf = malloc(request->size);
+ request->buf = xbt_malloc(request->size);
memcpy(request->buf,oldbuf,request->size);
}
}
print_request("New iprobe", request);
// We have to test both mailboxes as we don't know if we will receive one one or another
- if (surf_cfg_get_int("smpi/async_small_thres")>0){
+ if (sg_cfg_get_int("smpi/async_small_thres")>0){
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("trying to probe the perm recv mailbox");
request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);