X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7e5c2f3a409fb782e912f80867b8573a54e0dc09..55a9b9fe5663cb2fe2398c14f0e9b11d4a31e3b3:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index a6a3c57dc5..2d6a64bbce 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2013. The SimGrid Team. +/* Copyright (c) 2007-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -77,7 +77,8 @@ xbt_dynar_t smpi_ois_values = NULL; static int factor_cmp(const void *pa, const void *pb) { - return (((s_smpi_factor_t*)pa)->factor > ((s_smpi_factor_t*)pb)->factor); + return (((s_smpi_factor_t*)pa)->factor > ((s_smpi_factor_t*)pb)->factor) ? 1 : + (((s_smpi_factor_t*)pa)->factor < ((s_smpi_factor_t*)pb)->factor) ? -1 : 0; } @@ -93,6 +94,7 @@ static xbt_dynar_t parse_factor(const char *smpi_coef_string) smpi_factor = xbt_dynar_new(sizeof(s_smpi_factor_t), NULL); radical_elements = xbt_str_split(smpi_coef_string, ";"); xbt_dynar_foreach(radical_elements, iter, value) { + memset(&fact, 0, sizeof(s_smpi_factor_t)); radical_elements2 = xbt_str_split(value, ":"); if (xbt_dynar_length(radical_elements2) <2 || xbt_dynar_length(radical_elements2) > 5) xbt_die("Malformed radical for smpi factor!"); @@ -329,7 +331,9 @@ void smpi_mpi_start(MPI_Request request) request->real_size=request->size; smpi_datatype_use(request->old_type); smpi_comm_use(request->comm); - request->action = simcall_comm_irecv(mailbox, request->buf, &request->real_size, &match_recv, request); + request->action = simcall_comm_irecv(mailbox, request->buf, + &request->real_size, &match_recv, + request, -1.0); //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0 double sleeptime = request->detached ? smpi_or(request->size) : 0.0; @@ -760,12 +764,11 @@ void smpi_mpi_wait(MPI_Request * request, MPI_Status * status) if ((*request)->action != NULL) { // this is not a detached send simcall_comm_wait((*request)->action, -1.0); - } - #ifdef HAVE_MC if(MC_is_active()) (*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 + } finish_wait(request, status); *request = MPI_REQUEST_NULL;