X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ee52f84fe512219acf534c4d4654c3df56659e91..0541e4c5f26c349751e57e7e499ff35c38962a57:/src/smpi/smpi_global.c diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 1c5039687f..718d079bed 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -1,13 +1,9 @@ -/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2007-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include -#include - #include "private.h" #include "smpi_mpi_dt_private.h" #include "mc/mc.h" @@ -15,6 +11,10 @@ #include "simix/smx_private.h" #include "simgrid/sg_config.h" +#include // DBL_MAX +#include +#include +#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (kernel)"); @@ -295,6 +295,10 @@ void smpi_global_init(void) for (i = 0; i < process_count; i++) { smpi_group_set_mapping(group, i, i); } + + //check correctness of MPI parameters + + xbt_assert(sg_cfg_get_int("smpi/async_small_thres")<=sg_cfg_get_int("smpi/send_is_detached_thres")); } void smpi_global_destroy(void) @@ -303,8 +307,8 @@ void smpi_global_destroy(void) int i; smpi_bench_destroy(); - smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD)); - smpi_comm_destroy(MPI_COMM_WORLD); + while(smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD))>0); + xbt_free(MPI_COMM_WORLD); MPI_COMM_WORLD = MPI_COMM_NULL; for (i = 0; i < count; i++) { smpi_group_unuse(smpi_comm_group(process_data[i]->comm_self)); @@ -461,6 +465,11 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]) mpi_coll_barrier_fun = (int (*)(MPI_Comm comm)) mpi_coll_barrier_description[barrier_id].coll; + smpi_cpu_threshold = sg_cfg_get_double("smpi/cpu_threshold"); + smpi_running_power = sg_cfg_get_double("smpi/running_power"); + if (smpi_cpu_threshold < 0) + smpi_cpu_threshold = DBL_MAX; + smpi_global_init(); /* Clean IO before the run */