Actual source code: petscis.h

  1: /*
  2:    An index set is a generalization of a subset of integers.  Index sets
  3:    are used for defining scatters and gathers.
  4: */
  5: #if !defined(PETSCIS_H)
  6: #define PETSCIS_H

  8: #include <petscsys.h>
  9: #include <petscsftypes.h>
 10: #include <petscsectiontypes.h>
 11: #include <petscistypes.h>

 13: /* SUBMANSEC = IS */

 15: #define IS_FILE_CLASSID 1211218
 16: PETSC_EXTERN PetscClassId IS_CLASSID;

 18: PETSC_EXTERN PetscErrorCode ISInitializePackage(void);

 20: /*J
 21:     ISType - String with the name of a PETSc index set type

 23:    Level: beginner

 25: .seealso: `ISSetType()`, `IS`, `ISCreate()`, `ISRegister()`
 26: J*/
 27: typedef const char* ISType;
 28: #define ISGENERAL      "general"
 29: #define ISSTRIDE       "stride"
 30: #define ISBLOCK        "block"

 32: /* Dynamic creation and loading functions */
 33: PETSC_EXTERN PetscFunctionList ISList;
 34: PETSC_EXTERN PetscErrorCode ISSetType(IS,ISType);
 35: PETSC_EXTERN PetscErrorCode ISGetType(IS,ISType*);
 36: PETSC_EXTERN PetscErrorCode ISRegister(const char[],PetscErrorCode (*)(IS));
 37: PETSC_EXTERN PetscErrorCode ISCreate(MPI_Comm,IS*);

 39: PETSC_EXTERN PetscErrorCode ISDestroy(IS*);
 40: PETSC_EXTERN PetscErrorCode ISSetPermutation(IS);
 41: PETSC_EXTERN PetscErrorCode ISPermutation(IS,PetscBool*);
 42: PETSC_EXTERN PetscErrorCode ISSetIdentity(IS);
 43: PETSC_EXTERN PetscErrorCode ISIdentity(IS,PetscBool*);
 44: PETSC_EXTERN PetscErrorCode ISContiguousLocal(IS,PetscInt,PetscInt,PetscInt*,PetscBool*);

 46: /*E
 47:     ISInfo - Info that may either be computed or set as known for an index set

 49:     Level: beginner

 51:    Developer Notes:
 52:    Entries that are negative need not be called collectively by all processes.

 54:    Any additions/changes here MUST also be made in include/petsc/finclude/petscis.h

 56:    Any additions/changes here must also be made in src/vec/vec/interface/dlregisvec.c in ISInfos[]

 58: .seealso: `ISSetInfo()`
 59: E*/
 60: typedef enum {IS_INFO_MIN = -1,
 61:               IS_SORTED = 0,
 62:               IS_UNIQUE = 1,
 63:               IS_PERMUTATION = 2,
 64:               IS_INTERVAL = 3,
 65:               IS_IDENTITY = 4,
 66:               IS_INFO_MAX = 5} ISInfo;

 68: typedef enum {IS_LOCAL, IS_GLOBAL} ISInfoType;

 70: PETSC_EXTERN PetscErrorCode ISSetInfo(IS,ISInfo,ISInfoType,PetscBool,PetscBool);
 71: PETSC_EXTERN PetscErrorCode ISGetInfo(IS,ISInfo,ISInfoType,PetscBool,PetscBool*);
 72: PETSC_EXTERN PetscErrorCode ISClearInfoCache(IS,PetscBool);
 73: PETSC_EXTERN PetscErrorCode ISGetIndices(IS,const PetscInt*[]);
 74: PETSC_EXTERN PetscErrorCode ISRestoreIndices(IS,const PetscInt*[]);
 75: PETSC_EXTERN PetscErrorCode ISGetTotalIndices(IS,const PetscInt*[]);
 76: PETSC_EXTERN PetscErrorCode ISRestoreTotalIndices(IS,const PetscInt*[]);
 77: PETSC_EXTERN PetscErrorCode ISGetNonlocalIndices(IS,const PetscInt*[]);
 78: PETSC_EXTERN PetscErrorCode ISRestoreNonlocalIndices(IS,const PetscInt*[]);
 79: PETSC_EXTERN PetscErrorCode ISGetNonlocalIS(IS,IS*);
 80: PETSC_EXTERN PetscErrorCode ISRestoreNonlocalIS(IS,IS*);
 81: PETSC_EXTERN PetscErrorCode ISGetSize(IS,PetscInt*);
 82: PETSC_EXTERN PetscErrorCode ISGetLocalSize(IS,PetscInt*);
 83: PETSC_EXTERN PetscErrorCode ISInvertPermutation(IS,PetscInt,IS*);
 84: PETSC_EXTERN PetscErrorCode ISView(IS,PetscViewer);
 85: PETSC_EXTERN PetscErrorCode ISViewFromOptions(IS,PetscObject,const char[]);
 86: PETSC_EXTERN PetscErrorCode ISLoad(IS,PetscViewer);
 87: PETSC_EXTERN PetscErrorCode ISEqual(IS,IS,PetscBool*);
 88: PETSC_EXTERN PetscErrorCode ISEqualUnsorted(IS,IS,PetscBool *);
 89: PETSC_EXTERN PetscErrorCode ISSort(IS);
 90: PETSC_EXTERN PetscErrorCode ISSortRemoveDups(IS);
 91: PETSC_EXTERN PetscErrorCode ISSorted(IS,PetscBool*);
 92: PETSC_EXTERN PetscErrorCode ISDifference(IS,IS,IS*);
 93: PETSC_EXTERN PetscErrorCode ISSum(IS,IS,IS*);
 94: PETSC_EXTERN PetscErrorCode ISExpand(IS,IS,IS*);
 95: PETSC_EXTERN PetscErrorCode ISIntersect(IS,IS,IS*);
 96: PETSC_EXTERN PetscErrorCode ISGetMinMax(IS,PetscInt*,PetscInt*);

 98: PETSC_EXTERN PetscErrorCode ISLocate(IS,PetscInt,PetscInt*);
 99: PETSC_EXTERN PetscErrorCode ISGetPointRange(IS,PetscInt*,PetscInt*,const PetscInt**);
100: PETSC_EXTERN PetscErrorCode ISRestorePointRange(IS,PetscInt*,PetscInt*,const PetscInt**);
101: PETSC_EXTERN PetscErrorCode ISGetPointSubrange(IS,PetscInt,PetscInt,const PetscInt*);

103: PETSC_EXTERN PetscErrorCode ISGetBlockSize(IS,PetscInt*);
104: PETSC_EXTERN PetscErrorCode ISSetBlockSize(IS,PetscInt);

106: PETSC_EXTERN PetscErrorCode ISToGeneral(IS);

108: PETSC_EXTERN PetscErrorCode ISDuplicate(IS,IS*);
109: PETSC_EXTERN PetscErrorCode ISCopy(IS,IS);
110: PETSC_EXTERN PetscErrorCode ISShift(IS,PetscInt,IS);
111: PETSC_EXTERN PetscErrorCode ISAllGather(IS,IS*);
112: PETSC_EXTERN PetscErrorCode ISComplement(IS,PetscInt,PetscInt,IS*);
113: PETSC_EXTERN PetscErrorCode ISConcatenate(MPI_Comm,PetscInt,const IS[],IS*);
114: PETSC_EXTERN PetscErrorCode ISListToPair(MPI_Comm,PetscInt,IS[],IS*,IS*);
115: PETSC_EXTERN PetscErrorCode ISPairToList(IS,IS,PetscInt*,IS*[]);
116: PETSC_EXTERN PetscErrorCode ISEmbed(IS,IS,PetscBool,IS*);
117: PETSC_EXTERN PetscErrorCode ISSortPermutation(IS,PetscBool,IS*);
118: PETSC_EXTERN PetscErrorCode ISOnComm(IS,MPI_Comm,PetscCopyMode,IS*);
119: PETSC_EXTERN PetscErrorCode ISRenumber(IS,IS,PetscInt*,IS*);
120: PETSC_EXTERN PetscErrorCode ISCreateSubIS(IS,IS,IS*);

122: /* ISGENERAL specific */
123: PETSC_EXTERN PetscErrorCode ISCreateGeneral(MPI_Comm,PetscInt,const PetscInt[],PetscCopyMode,IS*);
124: PETSC_EXTERN PetscErrorCode ISGeneralSetIndices(IS,PetscInt,const PetscInt[],PetscCopyMode);
125: PETSC_EXTERN PetscErrorCode ISGeneralSetIndicesFromMask(IS,PetscInt,PetscInt,const PetscBool[]);
126: PETSC_EXTERN PetscErrorCode ISGeneralFilter(IS,PetscInt,PetscInt);

128: /* ISBLOCK specific */
129: PETSC_EXTERN PetscErrorCode ISCreateBlock(MPI_Comm,PetscInt,PetscInt,const PetscInt[],PetscCopyMode,IS*);
130: PETSC_EXTERN PetscErrorCode ISBlockSetIndices(IS,PetscInt,PetscInt,const PetscInt[],PetscCopyMode);
131: PETSC_EXTERN PetscErrorCode ISBlockGetIndices(IS,const PetscInt*[]);
132: PETSC_EXTERN PetscErrorCode ISBlockRestoreIndices(IS,const PetscInt*[]);
133: PETSC_EXTERN PetscErrorCode ISBlockGetLocalSize(IS,PetscInt*);
134: PETSC_EXTERN PetscErrorCode ISBlockGetSize(IS,PetscInt*);

136: /* ISSTRIDE specific */
137: PETSC_EXTERN PetscErrorCode ISCreateStride(MPI_Comm,PetscInt,PetscInt,PetscInt,IS*);
138: PETSC_EXTERN PetscErrorCode ISStrideSetStride(IS,PetscInt,PetscInt,PetscInt);
139: PETSC_EXTERN PetscErrorCode ISStrideGetInfo(IS,PetscInt*,PetscInt*);

141: /* --------------------------------------------------------------------------*/
142: PETSC_EXTERN PetscClassId IS_LTOGM_CLASSID;

144: /*E
145:     ISGlobalToLocalMappingMode - Indicates mapping behavior if global indices are missing

147:    `IS_GTOLM_MASK` - missing global indices are masked by mapping them to a local index of -1
148:    `IS_GTOLM_DROP` - missing global indices are dropped

150:    Level: beginner

152: .seealso: `ISGlobalToLocalMappingApplyBlock()`, `ISGlobalToLocalMappingApply()`

154: E*/
155: typedef enum {IS_GTOLM_MASK,IS_GTOLM_DROP} ISGlobalToLocalMappingMode;

157: /*J
158:     ISLocalToGlobalMappingType - String with the name of a mapping method

160:    Level: beginner

162: .seealso: `ISLocalToGlobalMappingSetType()`, `ISLocalToGlobalSetFromOptions()`
163: J*/
164: typedef const char* ISLocalToGlobalMappingType;
165: #define ISLOCALTOGLOBALMAPPINGBASIC "basic"
166: #define ISLOCALTOGLOBALMAPPINGHASH  "hash"

168: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingSetType(ISLocalToGlobalMapping,ISLocalToGlobalMappingType);
169: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetType(ISLocalToGlobalMapping,ISLocalToGlobalMappingType*);
170: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRegister(const char[],PetscErrorCode (*)(ISLocalToGlobalMapping));
171: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRegisterAll(void);
172: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingCreate(MPI_Comm,PetscInt,PetscInt,const PetscInt[],PetscCopyMode,ISLocalToGlobalMapping*);
173: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingCreateIS(IS,ISLocalToGlobalMapping *);
174: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingCreateSF(PetscSF,PetscInt,ISLocalToGlobalMapping*);
175: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingSetFromOptions(ISLocalToGlobalMapping);
176: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingSetUp(ISLocalToGlobalMapping);
177: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingView(ISLocalToGlobalMapping,PetscViewer);
178: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingViewFromOptions(ISLocalToGlobalMapping,PetscObject,const char[]);

180: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingDestroy(ISLocalToGlobalMapping*);
181: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingApply(ISLocalToGlobalMapping,PetscInt,const PetscInt[],PetscInt[]);
182: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingApplyBlock(ISLocalToGlobalMapping,PetscInt,const PetscInt[],PetscInt[]);
183: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingApplyIS(ISLocalToGlobalMapping,IS,IS*);
184: PETSC_EXTERN PetscErrorCode ISGlobalToLocalMappingApply(ISLocalToGlobalMapping,ISGlobalToLocalMappingMode,PetscInt,const PetscInt[],PetscInt*,PetscInt[]);
185: PETSC_EXTERN PetscErrorCode ISGlobalToLocalMappingApplyBlock(ISLocalToGlobalMapping,ISGlobalToLocalMappingMode,PetscInt,const PetscInt[],PetscInt*,PetscInt[]);
186: PETSC_EXTERN PetscErrorCode ISGlobalToLocalMappingApplyIS(ISLocalToGlobalMapping,ISGlobalToLocalMappingMode,IS,IS*);
187: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetSize(ISLocalToGlobalMapping,PetscInt*);
188: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetNodeInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt**[]);
189: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreNodeInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt**[]);
190: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]);
191: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]);
192: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetBlockInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]);
193: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreBlockInfo(ISLocalToGlobalMapping,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]);
194: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetIndices(ISLocalToGlobalMapping,const PetscInt**);
195: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreIndices(ISLocalToGlobalMapping,const PetscInt**);
196: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetBlockIndices(ISLocalToGlobalMapping,const PetscInt**);
197: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingRestoreBlockIndices(ISLocalToGlobalMapping,const PetscInt**);
198: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingConcatenate(MPI_Comm,PetscInt,const ISLocalToGlobalMapping[],ISLocalToGlobalMapping*);
199: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingGetBlockSize(ISLocalToGlobalMapping,PetscInt*);
200: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingSetBlockSize(ISLocalToGlobalMapping,PetscInt);
201: PETSC_EXTERN PetscErrorCode ISLocalToGlobalMappingDuplicate(ISLocalToGlobalMapping,ISLocalToGlobalMapping*);

203: /* --------------------------------------------------------------------------*/
204: /*E
205:     ISColoringType - determines if the coloring is for the entire parallel grid/graph/matrix
206:                      or for just the local ghosted portion

208:     Level: beginner

210: $   `IS_COLORING_GLOBAL` - does not include the colors for ghost points, this is used when the function
211: $                        is called synchronously in parallel. This requires generating a "parallel coloring".
212: $   `IS_COLORING_LOCAL` - includes colors for ghost points, this is used when the function can be called
213: $                         separately on individual processes with the ghost points already filled in. Does not
214: $                         require a "parallel coloring", rather each process colors its local + ghost part.
215: $                         Using this can result in much less parallel communication. Currently only works
216: $                         with DMDA and if you call MatFDColoringSetFunction() with the local function.

218: .seealso: `DMCreateColoring()`
219: E*/
220: typedef enum {IS_COLORING_GLOBAL,IS_COLORING_LOCAL} ISColoringType;
221: PETSC_EXTERN const char *const ISColoringTypes[];
222: typedef unsigned PETSC_IS_COLORING_VALUE_TYPE ISColoringValue;
223: #define IS_COLORING_MAX PETSC_IS_COLORING_MAX
224: #define MPIU_COLORING_VALUE PETSC_MPIU_IS_COLORING_VALUE_TYPE
225: PETSC_EXTERN PetscErrorCode ISAllGatherColors(MPI_Comm,PetscInt,ISColoringValue*,PetscInt*,ISColoringValue*[]);

227: PETSC_EXTERN PetscErrorCode ISColoringCreate(MPI_Comm,PetscInt,PetscInt,const ISColoringValue[],PetscCopyMode,ISColoring*);
228: PETSC_EXTERN PetscErrorCode ISColoringDestroy(ISColoring*);
229: PETSC_EXTERN PetscErrorCode ISColoringView(ISColoring,PetscViewer);
230: PETSC_EXTERN PetscErrorCode ISColoringViewFromOptions(ISColoring,PetscObject,const char[]);
231: PETSC_EXTERN PetscErrorCode ISColoringGetIS(ISColoring,PetscCopyMode,PetscInt*,IS*[]);
232: PETSC_EXTERN PetscErrorCode ISColoringRestoreIS(ISColoring,PetscCopyMode,IS*[]);
233: PETSC_EXTERN PetscErrorCode ISColoringReference(ISColoring);
234: PETSC_EXTERN PetscErrorCode ISColoringSetType(ISColoring,ISColoringType);
235: PETSC_EXTERN PetscErrorCode ISColoringGetType(ISColoring,ISColoringType*);
236: PETSC_EXTERN PetscErrorCode ISColoringGetColors(ISColoring,PetscInt*,PetscInt*,const ISColoringValue**);

238: /* --------------------------------------------------------------------------*/
239: PETSC_EXTERN PetscErrorCode ISBuildTwoSided(IS,IS,IS*);
240: PETSC_EXTERN PetscErrorCode ISPartitioningToNumbering(IS,IS*);
241: PETSC_EXTERN PetscErrorCode ISPartitioningCount(IS,PetscInt,PetscInt[]);

243: PETSC_EXTERN PetscErrorCode ISCompressIndicesGeneral(PetscInt,PetscInt,PetscInt,PetscInt,const IS[],IS[]);
244: PETSC_EXTERN PetscErrorCode ISCompressIndicesSorted(PetscInt,PetscInt,PetscInt,const IS[],IS[]);
245: PETSC_EXTERN PetscErrorCode ISExpandIndicesGeneral(PetscInt,PetscInt,PetscInt,PetscInt,const IS[],IS[]);

247: struct _n_PetscLayout{
248:   MPI_Comm               comm;
249:   PetscMPIInt            size;
250:   PetscInt               n,N;         /* local, global vector size */
251:   PetscInt               rstart,rend; /* local start, local end + 1 */
252:   PetscInt               *range;      /* the offset of each processor */
253:   PetscBool              range_alloc; /* should range be freed in Destroy? */
254:   PetscInt               bs;          /* number of elements in each block (generally for multi-component
255:                                        * problems). Defaults to -1 and can be arbitrarily lazy so always use
256:                                        * PetscAbs(map->bs) when accessing directly and expecting result to be
257:                                        * positive. Do NOT multiply above numbers by bs */
258:   PetscInt               refcnt;      /* MPI Vecs obtained with VecDuplicate() and from MatCreateVecs() reuse map of input object */
259:   ISLocalToGlobalMapping mapping;     /* mapping used in Vec/MatSetValuesLocal() */
260:   PetscBool              setupcalled; /* Forbid setup more than once */
261:   PetscInt               oldn,oldN;   /* Checking if setup is allowed */
262:   PetscInt               oldbs;       /* And again */
263: };

265: /*@C
266:      PetscLayoutFindOwner - Find the owning rank for a global index

268:     Not Collective

270:    Input Parameters:
271: +    map - the layout
272: -    idx - global index to find the owner of

274:    Output Parameter:
275: .    owner - the owning rank

277:    Level: developer

279:     Fortran Note:
280:       Not available from Fortran

282: .seealso: `PetscLayoutFindOwnerIndex()`
283: @*/
284: static inline PetscErrorCode PetscLayoutFindOwner(PetscLayout map,PetscInt idx,PetscMPIInt *owner)
285: {
286:   PetscMPIInt lo = 0,hi,t;

288:   *owner = -1;                  /* GCC erroneously issues warning about possibly uninitialized use when error condition */
289: #if defined(PETSC_USE_DEBUG)
292: #endif
293:   hi = map->size;
294:   while (hi - lo > 1) {
295:     t = lo + (hi - lo) / 2;
296:     if (idx < map->range[t]) hi = t;
297:     else                     lo = t;
298:   }
299:   *owner = lo;
300:   return 0;
301: }

303: /*@C
304:      PetscLayoutFindOwnerIndex - Find the owning rank and the local index for a global index

306:     Not Collective

308:    Input Parameters:
309: +    map   - the layout
310: -    idx   - global index to find the owner of

312:    Output Parameters:
313: +    owner - the owning rank
314: -    lidx  - local index used by the owner for idx

316:    Level: developer

318:     Fortran Note:
319:       Not available from Fortran

321: .seealso: `PetscLayoutFindOwner()`

323: @*/
324: static inline PetscErrorCode PetscLayoutFindOwnerIndex(PetscLayout map,PetscInt idx,PetscMPIInt *owner,PetscInt *lidx)
325: {
326:   PetscMPIInt lo = 0,hi,t;

328: #if defined(PETSC_USE_DEBUG)
331: #endif
332:   hi = map->size;
333:   while (hi - lo > 1) {
334:     t = lo + (hi - lo) / 2;
335:     if (idx < map->range[t]) hi = t;
336:     else                     lo = t;
337:   }
338:   if (owner) *owner = lo;
339:   if (lidx) *lidx  = idx - map->range[lo];
340:   return 0;
341: }

343: PETSC_EXTERN PetscErrorCode PetscLayoutCreate(MPI_Comm,PetscLayout*);
344: PETSC_EXTERN PetscErrorCode PetscLayoutCreateFromSizes(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscLayout*);
345: PETSC_EXTERN PetscErrorCode PetscLayoutCreateFromRanges(MPI_Comm,const PetscInt[],PetscCopyMode,PetscInt,PetscLayout*);
346: PETSC_EXTERN PetscErrorCode PetscLayoutSetUp(PetscLayout);
347: PETSC_EXTERN PetscErrorCode PetscLayoutDestroy(PetscLayout*);
348: PETSC_EXTERN PetscErrorCode PetscLayoutDuplicate(PetscLayout,PetscLayout*);
349: PETSC_EXTERN PetscErrorCode PetscLayoutReference(PetscLayout,PetscLayout*);
350: PETSC_EXTERN PetscErrorCode PetscLayoutSetLocalSize(PetscLayout,PetscInt);
351: PETSC_EXTERN PetscErrorCode PetscLayoutGetLocalSize(PetscLayout,PetscInt *);
352: PETSC_EXTERN PetscErrorCode PetscLayoutSetSize(PetscLayout,PetscInt);
353: PETSC_EXTERN PetscErrorCode PetscLayoutGetSize(PetscLayout,PetscInt*);
354: PETSC_EXTERN PetscErrorCode PetscLayoutSetBlockSize(PetscLayout,PetscInt);
355: PETSC_EXTERN PetscErrorCode PetscLayoutGetBlockSize(PetscLayout,PetscInt*);
356: PETSC_EXTERN PetscErrorCode PetscLayoutGetRange(PetscLayout,PetscInt*,PetscInt*);
357: PETSC_EXTERN PetscErrorCode PetscLayoutGetRanges(PetscLayout,const PetscInt*[]);
358: PETSC_EXTERN PetscErrorCode PetscLayoutCompare(PetscLayout,PetscLayout,PetscBool*);
359: PETSC_EXTERN PetscErrorCode PetscLayoutSetISLocalToGlobalMapping(PetscLayout,ISLocalToGlobalMapping);
360: PETSC_EXTERN PetscErrorCode PetscLayoutMapLocal(PetscLayout,PetscInt,const PetscInt[],PetscInt*,PetscInt**,PetscInt**);

362: PETSC_EXTERN PetscErrorCode PetscParallelSortInt(PetscLayout, PetscLayout, PetscInt*, PetscInt*);

364: PETSC_EXTERN PetscErrorCode ISGetLayout(IS,PetscLayout*);
365: PETSC_EXTERN PetscErrorCode ISSetLayout(IS,PetscLayout);

367: #endif