diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2008-03-01 15:25:31 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2008-03-01 15:25:31 +0000 |
commit | 5aefbc571e067944423d1f5cb2a83cec17f9da25 (patch) | |
tree | 1528393c6b2807cbf7b9bc23f14a8e3f0fad72a3 /src | |
parent | 22bb0dd378621db596f04635f20f2e55c5413336 (diff) |
Move the output of the schedule timers and the call to MPI_Finalize
from CactusDefaultShutdown to CCTKi_ShutdownCactus, which is executed
as the last function. This also means that drivers don't have to do
this any more, as it is now always done by the flesh.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4467 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r-- | src/main/CactusDefaultShutdown.c | 41 | ||||
-rw-r--r-- | src/main/ShutdownCactus.c | 41 |
2 files changed, 41 insertions, 41 deletions
diff --git a/src/main/CactusDefaultShutdown.c b/src/main/CactusDefaultShutdown.c index 422842cd..abac0ffb 100644 --- a/src/main/CactusDefaultShutdown.c +++ b/src/main/CactusDefaultShutdown.c @@ -13,40 +13,10 @@ #include "cctk_Comm.h" #include "CactusMainDefaults.h" -#ifdef CCTK_MPI -#include "mpi.h" -#endif - static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_CactusDefaultShutdown_c); -#ifdef CCTK_MPI -extern char MPI_Active; -#endif - -#ifdef CCTK_MPI -#define CACTUS_MPI_ERROR(xf) \ - do \ - { \ - int errcode; \ - \ - \ - if((errcode = xf) != MPI_SUCCESS) \ - { \ - char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ - int resultlen; \ - \ - \ - MPI_Error_string(errcode, mpi_error_string, &resultlen); \ - fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ - #xf, errcode, mpi_error_string); \ - fprintf(stderr, "At line %d of file %s\n", \ - __LINE__, __FILE__); \ - } \ - } while (0) -#endif - /*@@ @routine CactusDefaultShutdown @date Tue Sep 29 12:45:04 1998 @@ -80,16 +50,5 @@ int CactusDefaultShutdown(tFleshConfig *config) CCTK_Traverse(config->GH[conv_level], "CCTK_SHUTDOWN"); } - printf("--------------------------------------------------------------------------------\n"); - printf("Done.\n"); - fflush(stdout); - -#ifdef CCTK_MPI - if(MPI_Active) - { - CACTUS_MPI_ERROR(MPI_Finalize()); - } -#endif - return 0; } diff --git a/src/main/ShutdownCactus.c b/src/main/ShutdownCactus.c index 1ed6155c..63fb720d 100644 --- a/src/main/ShutdownCactus.c +++ b/src/main/ShutdownCactus.c @@ -16,10 +16,40 @@ #include "cctk_Parameters.h" #include "cctk_Schedule.h" +#ifdef CCTK_MPI +#include "mpi.h" +#endif + static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_ShutdownCactus_c); +#ifdef CCTK_MPI +extern char MPI_Active; +#endif + +#ifdef CCTK_MPI +#define CACTUS_MPI_ERROR(xf) \ + do \ + { \ + int errcode; \ + \ + \ + if((errcode = xf) != MPI_SUCCESS) \ + { \ + char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ + int resultlen; \ + \ + \ + MPI_Error_string(errcode, mpi_error_string, &resultlen); \ + fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ + #xf, errcode, mpi_error_string); \ + fprintf(stderr, "At line %d of file %s\n", \ + __LINE__, __FILE__); \ + } \ + } while (0) +#endif + /*@@ @routine CCTKi_ShutdownCactus @date Mon Sep 28 14:50:50 1998 @@ -53,5 +83,16 @@ int CCTKi_ShutdownCactus(tFleshConfig *ConfigData) CCTK_SchedulePrintTimes (NULL); } + printf("--------------------------------------------------------------------------------\n"); + printf("Done.\n"); + fflush(stdout); + +#ifdef CCTK_MPI + if(MPI_Active) + { + CACTUS_MPI_ERROR(MPI_Finalize()); + } +#endif + return 0; } |