File: CleanupMPI.c

package info (click to toggle)
spooles 2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 19,012 kB
  • sloc: ansic: 146,834; csh: 3,615; makefile: 2,040; perl: 74
file content (82 lines) | stat: -rw-r--r-- 1,920 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*  CleanupMPI.c  */

#include "../BridgeMPI.h"

#define MYDEBUG 1

#if MYDEBUG > 0
static int count_Cleanup = 0 ;
static double time_Cleanup = 0.0 ;
#endif

/*--------------------------------------------------------------------*/
/*
   --------------------------------------------
   purpose -- to free the owned data structures

   return values --
      1 -- normal return
     -1 -- data is NULL

   created -- 98aug10, cca
   --------------------------------------------
*/
int
CleanupMPI (
   void   *data
) {
BridgeMPI   *bridge = (BridgeMPI *) data ;
#if MYDEBUG > 0
double   t1, t2 ;
MARKTIME(t1) ;
count_Cleanup++ ;
if ( bridge->myid == 0 ) {
   fprintf(stdout, "\n (%d) CleanupMPI()", count_Cleanup) ;
   fflush(stdout) ;
}
#endif
#if MYDEBUG > 1
fprintf(bridge->msgFile, "\n (%d) CleanupMPI()", count_Cleanup) ;
fflush(bridge->msgFile) ;
#endif

bridge->pencil->inpmtxA = NULL ;
bridge->pencil->inpmtxB = NULL ;
Pencil_free(bridge->pencil) ;
IVL_free(bridge->symbfacIVL) ;
FrontMtx_free(bridge->frontmtx) ;
ETree_free(bridge->frontETree) ;
SubMtxManager_free(bridge->mtxmanager) ;
IV_free(bridge->oldToNewIV) ;
IV_free(bridge->newToOldIV) ;
IV_free(bridge->vtxmapIV) ;
IV_free(bridge->ownersIV) ;
IV_free(bridge->myownedIV) ;
if ( bridge->rowmapIV != NULL ) {
   IV_free(bridge->rowmapIV) ;
}
if ( bridge->info != NULL ) {
   MatMul_cleanup(bridge->info) ;
   DenseMtx_free(bridge->Xloc) ;
   DenseMtx_free(bridge->Yloc) ;
}
SolveMap_free(bridge->solvemap) ;

#if MYDEBUG > 0
MARKTIME(t2) ;
time_Cleanup += t2 - t1 ;
if ( bridge->myid == 0 ) {
   fprintf(stdout, ", %8.3f seconds, %8.3f total seconds, ",
           t2 - t1, time_Cleanup) ;
   fflush(stdout) ;
}
#endif
#if MYDEBUG > 1
fprintf(bridge->msgFile, ", %8.3f seconds, %8.3f total seconds, ",
        t2 - t1, time_Cleanup) ;
fflush(bridge->msgFile) ;
#endif

return(1) ; }

/*--------------------------------------------------------------------*/