1 /* Copyright 2004,2007-2012,2014,2015 IPB, Universite de Bordeaux, INRIA & CNRS 2 ** 3 ** This file is part of the Scotch software package for static mapping, 4 ** graph partitioning and sparse matrix ordering. 5 ** 6 ** This software is governed by the CeCILL-C license under French law 7 ** and abiding by the rules of distribution of free software. You can 8 ** use, modify and/or redistribute the software under the terms of the 9 ** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following 10 ** URL: "http://www.cecill.info". 11 ** 12 ** As a counterpart to the access to the source code and rights to copy, 13 ** modify and redistribute granted by the license, users are provided 14 ** only with a limited warranty and the software's author, the holder of 15 ** the economic rights, and the successive licensors have only limited 16 ** liability. 17 ** 18 ** In this respect, the user's attention is drawn to the risks associated 19 ** with loading, using, modifying and/or developing or reproducing the 20 ** software by the user in light of its specific status of free software, 21 ** that may mean that it is complicated to manipulate, and that also 22 ** therefore means that it is reserved for developers and experienced 23 ** professionals having in-depth computer knowledge. Users are therefore 24 ** encouraged to load and test the software's suitability as regards 25 ** their requirements in conditions enabling the security of their 26 ** systems and/or data to be ensured and, more generally, to use and 27 ** operate it in the same conditions as regards security. 28 ** 29 ** The fact that you are presently reading this means that you have had 30 ** knowledge of the CeCILL-C license and that you accept its terms. 31 */ 32 /************************************************************/ 33 /** **/ 34 /** NAME : library.h **/ 35 /** **/ 36 /** AUTHOR : Francois PELLEGRINI **/ 37 /** Jun-Ho HER (v6.0) **/ 38 /** Sebastien FOURESTIER (v6.0) **/ 39 /** **/ 40 /** FUNCTION : Declaration file for the LibScotch **/ 41 /** static mapping and sparse matrix block **/ 42 /** ordering library. **/ 43 /** **/ 44 /** DATES : # Version 3.2 : from : 07 sep 1996 **/ 45 /** to 22 aug 1998 **/ 46 /** # Version 3.3 : from : 02 oct 1998 **/ 47 /** to 31 may 1999 **/ 48 /** # Version 3.4 : from : 10 oct 1999 **/ 49 /** to 15 nov 2001 **/ 50 /** # Version 4.0 : from : 11 dec 2001 **/ 51 /** to 20 dec 2005 **/ 52 /** # Version 5.0 : from : 26 apr 2006 **/ 53 /** to : 20 feb 2008 **/ 54 /** # Version 5.1 : from : 30 nov 2007 **/ 55 /** to : 07 aug 2011 **/ 56 /** # Version 6.0 : from : 12 sep 2008 **/ 57 /** to 28 feb 2015 **/ 58 /** **/ 59 /************************************************************/ 60 61 #ifndef SCOTCH_H 62 #define SCOTCH_H 63 64 /* 65 ** The type and structure definitions. 66 */ 67 68 /*+ Version flags. +*/ 69 70 #define SCOTCH_VERSION DUMMYVERSION 71 #define SCOTCH_RELEASE DUMMYRELEASE 72 #define SCOTCH_PATCHLEVEL DUMMYPATCHLEVEL 73 74 /*+ Integer type. +*/ 75 76 typedef DUMMYIDX SCOTCH_Idx; 77 78 typedef DUMMYINT SCOTCH_Num; 79 80 #define SCOTCH_NUMMAX DUMMYMAXINT 81 #define SCOTCH_NUMSTRING DUMMYNUMSTRING 82 83 /*+ Coarsening flags +*/ 84 85 #define SCOTCH_COARSENNONE 0x0000 86 #define SCOTCH_COARSENFOLD 0x0100 87 #define SCOTCH_COARSENFOLDDUP 0x0300 88 #define SCOTCH_COARSENNOMERGE 0x4000 89 90 /*+ Strategy string parametrization values +*/ 91 92 #define SCOTCH_STRATDEFAULT 0x0000 93 #define SCOTCH_STRATQUALITY 0x0001 94 #define SCOTCH_STRATSPEED 0x0002 95 #define SCOTCH_STRATBALANCE 0x0004 96 #define SCOTCH_STRATSAFETY 0x0008 97 #define SCOTCH_STRATSCALABILITY 0x0010 98 #define SCOTCH_STRATRECURSIVE 0x0100 99 #define SCOTCH_STRATREMAP 0x0200 100 #define SCOTCH_STRATLEVELMAX 0x1000 101 #define SCOTCH_STRATLEVELMIN 0x2000 102 #define SCOTCH_STRATLEAFSIMPLE 0x4000 103 #define SCOTCH_STRATSEPASIMPLE 0x8000 104 105 /*+ Opaque objects. The dummy sizes of these 106 objects, computed at compile-time by program 107 "dummysizes", are given as double values for 108 proper padding +*/ 109 110 typedef struct { 111 double dummy[DUMMYSIZEARCH]; 112 } SCOTCH_Arch; 113 114 typedef struct { 115 double dummy[DUMMYSIZEGEOM]; 116 } SCOTCH_Geom; 117 118 typedef struct { 119 double dummy[DUMMYSIZEGRAPH]; 120 } SCOTCH_Graph; 121 122 typedef struct { 123 double dummy[DUMMYSIZEMESH]; 124 } SCOTCH_Mesh; 125 126 typedef struct { 127 double dummy[DUMMYSIZEMAP]; 128 } SCOTCH_Mapping; 129 130 typedef struct { 131 double dummy[DUMMYSIZEORDER]; 132 } SCOTCH_Ordering; 133 134 typedef struct { 135 double dummy[DUMMYSIZESTRAT]; 136 } SCOTCH_Strat; 137 138 /* 139 ** The function prototypes. 140 */ 141 142 #ifdef __cplusplus 143 extern "C" { 144 #endif /* __cplusplus */ 145 146 SCOTCH_Arch * SCOTCH_archAlloc (void); 147 int SCOTCH_archInit (SCOTCH_Arch * const); 148 void SCOTCH_archExit (SCOTCH_Arch * const); 149 int SCOTCH_archLoad (SCOTCH_Arch * const, FILE * const); 150 int SCOTCH_archSave (const SCOTCH_Arch * const, FILE * const); 151 int SCOTCH_archBuild (SCOTCH_Arch * const, const SCOTCH_Graph * const, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Strat * const); 152 char * SCOTCH_archName (const SCOTCH_Arch * const); 153 SCOTCH_Num SCOTCH_archSize (const SCOTCH_Arch * const); 154 int SCOTCH_archVar (const SCOTCH_Arch * const); 155 int SCOTCH_archCmplt (SCOTCH_Arch * const, const SCOTCH_Num); 156 int SCOTCH_archCmpltw (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num * const); 157 int SCOTCH_archHcub (SCOTCH_Arch * const, const SCOTCH_Num); 158 int SCOTCH_archMesh2 (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num); 159 int SCOTCH_archMesh3 (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num); 160 int SCOTCH_archTleaf (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const); 161 int SCOTCH_archTorus2 (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num); 162 int SCOTCH_archTorus3 (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num); 163 int SCOTCH_archVcmplt (SCOTCH_Arch * const); 164 int SCOTCH_archVhcub (SCOTCH_Arch * const); 165 166 void SCOTCH_errorProg (const char * const); 167 void SCOTCH_errorPrint (const char * const, ...); 168 void SCOTCH_errorPrintW (const char * const, ...); 169 170 SCOTCH_Geom * SCOTCH_geomAlloc (void); 171 int SCOTCH_geomInit (SCOTCH_Geom * const); 172 void SCOTCH_geomExit (SCOTCH_Geom * const); 173 void SCOTCH_geomData (const SCOTCH_Geom * const, SCOTCH_Num * const, double ** const); 174 175 SCOTCH_Graph * SCOTCH_graphAlloc (void); 176 int SCOTCH_graphInit (SCOTCH_Graph * const); 177 void SCOTCH_graphExit (SCOTCH_Graph * const); 178 void SCOTCH_graphFree (SCOTCH_Graph * const); 179 int SCOTCH_graphLoad (SCOTCH_Graph * const, FILE * const, const SCOTCH_Num, const SCOTCH_Num); 180 int SCOTCH_graphSave (const SCOTCH_Graph * const, FILE * const); 181 int SCOTCH_graphBuild (SCOTCH_Graph * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const); 182 int SCOTCH_graphCoarsen (const SCOTCH_Graph * const, SCOTCH_Graph * const, SCOTCH_Num * const, const SCOTCH_Num, const double); 183 int SCOTCH_graphCoarsenBuild (const SCOTCH_Graph * const, SCOTCH_Graph * const, SCOTCH_Num * const, const SCOTCH_Num, SCOTCH_Num * const); 184 int SCOTCH_graphColor (const SCOTCH_Graph * const, SCOTCH_Num * const, SCOTCH_Num * const, const SCOTCH_Num); 185 SCOTCH_Num SCOTCH_graphBase (SCOTCH_Graph * const, const SCOTCH_Num baseval); 186 int SCOTCH_graphCheck (const SCOTCH_Graph * const); 187 void SCOTCH_graphSize (const SCOTCH_Graph * const, SCOTCH_Num * const, SCOTCH_Num * const); 188 void SCOTCH_graphData (const SCOTCH_Graph * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num * const, SCOTCH_Num ** const, SCOTCH_Num ** const); 189 void SCOTCH_graphStat (const SCOTCH_Graph * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, double * const, double * const, SCOTCH_Num * const, SCOTCH_Num * const, double * const, double * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, double * const, double * const); 190 int SCOTCH_graphGeomLoadChac (SCOTCH_Graph * const, SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 191 int SCOTCH_graphGeomLoadHabo (SCOTCH_Graph * const, SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 192 int SCOTCH_graphGeomLoadMmkt (SCOTCH_Graph * const, SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 193 int SCOTCH_graphGeomLoadScot (SCOTCH_Graph * const, SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 194 int SCOTCH_graphGeomSaveChac (const SCOTCH_Graph * const, const SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 195 int SCOTCH_graphGeomSaveMmkt (const SCOTCH_Graph * const, const SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 196 int SCOTCH_graphGeomSaveScot (const SCOTCH_Graph * const, const SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 197 198 int SCOTCH_graphMapInit (const SCOTCH_Graph * const, SCOTCH_Mapping * const, const SCOTCH_Arch * const, SCOTCH_Num * const); 199 void SCOTCH_graphMapExit (const SCOTCH_Graph * const, SCOTCH_Mapping * const); 200 int SCOTCH_graphMapLoad (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const); 201 int SCOTCH_graphTabLoad (const SCOTCH_Graph * const, SCOTCH_Num * const, FILE * const); 202 int SCOTCH_graphMapSave (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const); 203 int SCOTCH_graphMapView (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, FILE * const); 204 int SCOTCH_graphRemapView (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, const SCOTCH_Mapping * const, const double, SCOTCH_Num *, FILE * const); 205 int SCOTCH_graphRemapViewRaw (const SCOTCH_Graph * const, const SCOTCH_Mapping * const, const SCOTCH_Mapping * const, const double, SCOTCH_Num *, FILE * const); 206 int SCOTCH_graphMapCompute (SCOTCH_Graph * const, SCOTCH_Mapping * const, SCOTCH_Strat * const); 207 int SCOTCH_graphMapFixedCompute (SCOTCH_Graph * const, SCOTCH_Mapping * const, SCOTCH_Strat * const); 208 int SCOTCH_graphRemapCompute (SCOTCH_Graph * const, SCOTCH_Mapping * const, SCOTCH_Mapping * const, const double, const SCOTCH_Num *, SCOTCH_Strat * const); 209 int SCOTCH_graphRemapFixedCompute (SCOTCH_Graph * const, SCOTCH_Mapping * const, SCOTCH_Mapping * const, const double, const SCOTCH_Num *, SCOTCH_Strat * const); 210 int SCOTCH_graphMap (SCOTCH_Graph * const, const SCOTCH_Arch * const, SCOTCH_Strat * const, SCOTCH_Num * const); 211 int SCOTCH_graphMapFixed (SCOTCH_Graph * const, const SCOTCH_Arch * const, SCOTCH_Strat * const, SCOTCH_Num * const); 212 int SCOTCH_graphRemap (SCOTCH_Graph * const, const SCOTCH_Arch * const, SCOTCH_Num *, const double, const SCOTCH_Num *, SCOTCH_Strat * const, SCOTCH_Num * const); 213 int SCOTCH_graphRemapFixed (SCOTCH_Graph * const, const SCOTCH_Arch * const, SCOTCH_Num *, const double, const SCOTCH_Num *, SCOTCH_Strat * const, SCOTCH_Num * const); 214 int SCOTCH_graphPart (SCOTCH_Graph * const, const SCOTCH_Num, SCOTCH_Strat * const, SCOTCH_Num * const); 215 int SCOTCH_graphPartFixed (SCOTCH_Graph * const, const SCOTCH_Num, SCOTCH_Strat * const, SCOTCH_Num * const); 216 int SCOTCH_graphPartOvl (SCOTCH_Graph * const, const SCOTCH_Num, SCOTCH_Strat * const, SCOTCH_Num * const); 217 int SCOTCH_graphRepart (SCOTCH_Graph * const, const SCOTCH_Num, SCOTCH_Num * const, const double, const SCOTCH_Num *, SCOTCH_Strat * const, SCOTCH_Num * const); 218 int SCOTCH_graphRepartFixed (SCOTCH_Graph * const, const SCOTCH_Num, SCOTCH_Num * const, const double, const SCOTCH_Num *, SCOTCH_Strat * const, SCOTCH_Num * const); 219 220 int SCOTCH_graphOrderInit (const SCOTCH_Graph * const, SCOTCH_Ordering * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 221 void SCOTCH_graphOrderExit (const SCOTCH_Graph * const, SCOTCH_Ordering * const); 222 int SCOTCH_graphOrderLoad (const SCOTCH_Graph * const, SCOTCH_Ordering * const, FILE * const); 223 int SCOTCH_graphOrderSave (const SCOTCH_Graph * const, const SCOTCH_Ordering * const, FILE * const); 224 int SCOTCH_graphOrderSaveMap (const SCOTCH_Graph * const, const SCOTCH_Ordering * const, FILE * const); 225 int SCOTCH_graphOrderSaveTree (const SCOTCH_Graph * const, const SCOTCH_Ordering * const, FILE * const); 226 int SCOTCH_graphOrderCompute (SCOTCH_Graph * const, SCOTCH_Ordering * const, SCOTCH_Strat * const); 227 int SCOTCH_graphOrderComputeList (SCOTCH_Graph * const, SCOTCH_Ordering * const, const SCOTCH_Num, const SCOTCH_Num * const, SCOTCH_Strat * const); 228 int SCOTCH_graphOrderFactor (const SCOTCH_Graph * const, const SCOTCH_Ordering * const, SCOTCH_Graph * const); 229 int SCOTCH_graphOrderView (const SCOTCH_Graph * const, const SCOTCH_Ordering * const, FILE * const); 230 int SCOTCH_graphOrder (SCOTCH_Graph * const, SCOTCH_Strat * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 231 int SCOTCH_graphOrderList (SCOTCH_Graph * const, const SCOTCH_Num, const SCOTCH_Num * const, SCOTCH_Strat * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 232 int SCOTCH_graphOrderCheck (const SCOTCH_Graph * const, const SCOTCH_Ordering * const); 233 234 SCOTCH_Mapping * SCOTCH_mapAlloc (void); 235 236 void SCOTCH_memFree (void * const); 237 SCOTCH_Idx SCOTCH_memCur (void); 238 SCOTCH_Idx SCOTCH_memMax (void); 239 240 int SCOTCH_meshInit (SCOTCH_Mesh * const); 241 void SCOTCH_meshExit (SCOTCH_Mesh * const); 242 int SCOTCH_meshLoad (SCOTCH_Mesh * const, FILE * const, const SCOTCH_Num); 243 int SCOTCH_meshSave (const SCOTCH_Mesh * const, FILE * const); 244 int SCOTCH_meshBuild (SCOTCH_Mesh * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num, const SCOTCH_Num * const); 245 int SCOTCH_meshCheck (const SCOTCH_Mesh * const); 246 void SCOTCH_meshSize (const SCOTCH_Mesh * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 247 void SCOTCH_meshData (const SCOTCH_Mesh * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num ** const, SCOTCH_Num * const, SCOTCH_Num ** const, SCOTCH_Num * const); 248 void SCOTCH_meshStat (const SCOTCH_Mesh * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, double * const, double * const, SCOTCH_Num * const, SCOTCH_Num * const, double * const, double * const, SCOTCH_Num * const, SCOTCH_Num * const, double * const, double * const); 249 int SCOTCH_meshGraph (const SCOTCH_Mesh * const, SCOTCH_Graph * const); 250 int SCOTCH_meshGeomLoadHabo (SCOTCH_Mesh * const, SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 251 int SCOTCH_meshGeomLoadScot (SCOTCH_Mesh * const, SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 252 int SCOTCH_meshGeomSaveScot (const SCOTCH_Mesh * const, const SCOTCH_Geom * const, FILE * const, FILE * const, const char * const); 253 254 int SCOTCH_meshOrderInit (const SCOTCH_Mesh * const, SCOTCH_Ordering * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 255 void SCOTCH_meshOrderExit (const SCOTCH_Mesh * const, SCOTCH_Ordering * const); 256 int SCOTCH_meshOrderSave (const SCOTCH_Mesh * const, const SCOTCH_Ordering * const, FILE * const); 257 int SCOTCH_meshOrderSaveMap (const SCOTCH_Mesh * const, const SCOTCH_Ordering * const, FILE * const); 258 int SCOTCH_meshOrderSaveTree (const SCOTCH_Mesh * const, const SCOTCH_Ordering * const, FILE * const); 259 int SCOTCH_meshOrderCompute (SCOTCH_Mesh * const, SCOTCH_Ordering * const, SCOTCH_Strat * const); 260 int SCOTCH_meshOrderComputeList (SCOTCH_Mesh * const, SCOTCH_Ordering * const, const SCOTCH_Num, const SCOTCH_Num * const, SCOTCH_Strat * const); 261 int SCOTCH_meshOrder (SCOTCH_Mesh * const, SCOTCH_Strat * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 262 int SCOTCH_meshOrderList (SCOTCH_Mesh * const, const SCOTCH_Num, const SCOTCH_Num * const, SCOTCH_Strat * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const, SCOTCH_Num * const); 263 int SCOTCH_meshOrderCheck (const SCOTCH_Mesh * const, const SCOTCH_Ordering * const); 264 265 int SCOTCH_numSizeof (void); 266 267 SCOTCH_Ordering * SCOTCH_orderAlloc (void); 268 269 void SCOTCH_randomReset (void); 270 void SCOTCH_randomSeed (SCOTCH_Num); 271 272 SCOTCH_Strat * SCOTCH_stratAlloc (void); 273 int SCOTCH_stratInit (SCOTCH_Strat * const); 274 void SCOTCH_stratExit (SCOTCH_Strat * const); 275 void SCOTCH_stratFree (SCOTCH_Strat * const); 276 int SCOTCH_stratSave (const SCOTCH_Strat * const, FILE * const); 277 int SCOTCH_stratGraphBipart (SCOTCH_Strat * const, const char * const); 278 int SCOTCH_stratGraphMap (SCOTCH_Strat * const, const char * const); 279 int SCOTCH_stratGraphMapBuild (SCOTCH_Strat * const, const SCOTCH_Num, const SCOTCH_Num, const double); 280 int SCOTCH_stratGraphClusterBuild (SCOTCH_Strat * const, const SCOTCH_Num, const SCOTCH_Num, const double, const double); 281 int SCOTCH_stratGraphPartOvl (SCOTCH_Strat * const, const char * const); 282 int SCOTCH_stratGraphPartOvlBuild (SCOTCH_Strat * const, const SCOTCH_Num, const SCOTCH_Num, const double); 283 int SCOTCH_stratGraphOrder (SCOTCH_Strat * const, const char * const); 284 int SCOTCH_stratGraphOrderBuild (SCOTCH_Strat * const, const SCOTCH_Num, const SCOTCH_Num, const double); 285 int SCOTCH_stratMeshOrder (SCOTCH_Strat * const, const char * const); 286 int SCOTCH_stratMeshOrderBuild (SCOTCH_Strat * const, const SCOTCH_Num, const double); 287 288 void SCOTCH_version (int * const, int * const, int * const); 289 290 #ifdef __cplusplus 291 } 292 #endif /* __cplusplus */ 293 294 #endif /* SCOTCH_H */ 295