From f5107861b83c82ea2d0a94511f37390054b45940 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 9 Jul 2013 15:44:13 +0200 Subject: [PATCH 1/1] fix usage of MPI_Initialized before run --- src/smpi/smpi_global.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 8c7edeac53..de39759a21 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -99,8 +99,8 @@ void smpi_process_finalize(void) */ int smpi_process_finalized() { + return (smpi_process_index()==-100); // If finalized, this value has been set to -100; - return process_data[smpi_process_index()]->index==-100; } @@ -170,8 +170,8 @@ int smpi_process_count(void) int smpi_process_index(void) { smpi_process_data_t data = smpi_process_data(); - - return data->index; + //return -1 if not initialized + return data? data->index : MPI_UNDEFINED; } smx_rdv_t smpi_process_mailbox(void) { -- 2.30.2