X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b9e5f3cda750dceba00cad0b026441b56c86096c..1a39cc6fdc908c33507b5b0f8bae61f7286fd4ca:/src/smpi/smpi_util.c diff --git a/src/smpi/smpi_util.c b/src/smpi/smpi_util.c index cc7399bcb7..29f570bfcc 100644 --- a/src/smpi/smpi_util.c +++ b/src/smpi/smpi_util.c @@ -1,8 +1,15 @@ +/* Copyright (c) 2007, 2009, 2010. 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 "private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_util, smpi, "Logging specific to SMPI (utilities)"); +/* int smpi_gettimeofday(struct timeval *tv, struct timezone *tz) { double now; @@ -23,34 +30,13 @@ int smpi_gettimeofday(struct timeval *tv, struct timezone *tz) unsigned int smpi_sleep(unsigned int seconds) { smx_host_t host; - smx_mutex_t mutex; - smx_cond_t cond; smx_action_t action; - e_surf_action_state_t state; smpi_bench_end(); - host = SIMIX_host_self(); - mutex = smpi_host_mutex(); - cond = smpi_host_cond(); - - SIMIX_mutex_lock(mutex); - - // FIXME: explicit conversion to double? - action = SIMIX_action_sleep(host, seconds); - - SIMIX_register_action_to_condition(action, cond); - for (state = SIMIX_action_get_state(action); - state == SURF_ACTION_READY || - state == SURF_ACTION_RUNNING; state = SIMIX_action_get_state(action) - ) { - SIMIX_cond_wait(cond, mutex); - } - SIMIX_unregister_action_to_condition(action, cond); + action = SIMIX_action_sleep(host, (double)seconds); + smpi_process_wait_action(action); SIMIX_action_destroy(action); - - SIMIX_mutex_unlock(mutex); - smpi_bench_begin(); return 0; } @@ -62,3 +48,4 @@ void smpi_exit(int status) SIMIX_process_kill(SIMIX_process_self()); return; } +*/