Home
last modified time | relevance | path

Searched refs:map (Results 1 – 25 of 222) sorted by relevance

123456789

/petsc/src/vec/is/utils/
H A Dpmap.c50 PetscErrorCode PetscLayoutCreate(MPI_Comm comm, PetscLayout *map) in PetscLayoutCreate() argument
53 PetscCall(PetscNew(map)); in PetscLayoutCreate()
54 PetscCallMPI(MPI_Comm_size(comm, &(*map)->size)); in PetscLayoutCreate()
55 (*map)->comm = comm; in PetscLayoutCreate()
56 (*map)->bs = 1; in PetscLayoutCreate()
57 (*map)->n = -1; in PetscLayoutCreate()
58 (*map)->N = -1; in PetscLayoutCreate()
59 (*map)->range = NULL; in PetscLayoutCreate()
60 (*map)->range_alloc = PETSC_TRUE; in PetscLayoutCreate()
61 (*map)->rstart = 0; in PetscLayoutCreate()
[all …]
H A Disio.c9 PetscLayout map; in ISView_Binary() local
17 PetscCall(ISGetLayout(is, &map)); in ISView_Binary()
18 PetscCall(PetscLayoutGetLocalSize(map, &n)); in ISView_Binary()
19 PetscCall(PetscLayoutGetRange(map, &s, NULL)); in ISView_Binary()
20 PetscCall(PetscLayoutGetSize(map, &N)); in ISView_Binary()
48 PetscCall(PetscViewerHDF5Load(viewer, isname, is->map, H5T_NATIVE_LLONG, (void **)&ind)); in ISLoad_HDF5()
50 PetscCall(PetscViewerHDF5Load(viewer, isname, is->map, H5T_NATIVE_INT, (void **)&ind)); in ISLoad_HDF5()
52 PetscCall(ISGeneralSetIndices(is, is->map->n, ind, PETSC_OWN_POINTER)); in ISLoad_HDF5()
53 …ject with name %s of size %" PetscInt_FMT ":%" PetscInt_FMT "\n", isname, is->map->n, is->map->N)); in ISLoad_HDF5()
62 PetscLayout map; in ISLoad_Binary() local
[all …]
H A Dpsort.c168 static PetscErrorCode PetscParallelRedistribute(PetscLayout map, PetscInt n, PetscInt arrayin[], Pe… in PetscParallelRedistribute() argument
180 PetscCallMPI(MPI_Comm_size(map->comm, &size)); in PetscParallelRedistribute()
181 PetscCallMPI(MPI_Comm_rank(map->comm, &rank)); in PetscParallelRedistribute()
182 PetscCall(PetscCommGetNewTag(map->comm, &firsttag)); in PetscParallelRedistribute()
183 PetscCall(PetscCommGetNewTag(map->comm, &secondtag)); in PetscParallelRedistribute()
185 PetscCallMPI(MPI_Scan(&n, &nextOffset, 1, MPIU_INT, MPI_SUM, map->comm)); in PetscParallelRedistribute()
187 total = map->range[rank + 1] - map->range[rank]; in PetscParallelRedistribute()
188 …if (total > 0) PetscCallMPI(MPIU_Irecv(arrayout, total, MPIU_INT, MPI_ANY_SOURCE, firsttag, map->c… in PetscParallelRedistribute()
195 itotal = map->range[i + 1] - map->range[i]; in PetscParallelRedistribute()
197 oStart = PetscMax(myOffset, map->range[i]); in PetscParallelRedistribute()
[all …]
/petsc/src/vec/is/is/tests/
H A Dex8.c10 ISLocalToGlobalMapping map; in main() local
14 …PetscCall(ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, 1, 12, indices, PETSC_COPY_VALUES, &map)); in main()
15 PetscCall(ISLocalToGlobalMappingView(map, NULL)); in main()
16 PetscCall(ISLocalToGlobalMappingSetBlockSize(map, 2)); in main()
17 PetscCall(ISLocalToGlobalMappingView(map, NULL)); in main()
18 PetscCall(ISLocalToGlobalMappingSetBlockSize(map, 4)); in main()
19 PetscCall(ISLocalToGlobalMappingView(map, NULL)); in main()
20 PetscCall(ISLocalToGlobalMappingSetBlockSize(map, 2)); in main()
21 PetscCall(ISLocalToGlobalMappingView(map, NULL)); in main()
22 PetscCall(ISLocalToGlobalMappingSetBlockSize(map, 1)); in main()
[all …]
H A Dex11.c13 PetscLayout map, mapeven; in main() local
51 PetscCall(ISGetLayout(is, &map)); in main()
52 PetscCall(PetscLayoutCreateFromSizes(map->comm, PETSC_DECIDE, map->N, 1, &mapeven)); in main()
56 PetscCall(PetscParallelSortInt(map, mapeven, keys, keyseven)); in main()
61 PetscCall(PetscParallelSortInt(map, map, keys, keyssorted)); in main()
62 PetscCall(PetscParallelSortedInt(map->comm, map->n, keyssorted, &sorted)); in main()
66 PetscCall(PetscParallelSortInt(map, map, keys, keys)); in main()
67 PetscCall(PetscParallelSortedInt(map->comm, map->n, keys, &sorted)); in main()
H A Dex12.c11 PetscLayout map; in main() local
29 PetscCall(ISGetLayout(is0, &map)); in main()
30 PetscCall(PetscLayoutGetRange(map, &start, &end)); in main()
40 PetscCall(ISSetLayout(is1, map)); in main()
/petsc/src/sys/tests/
H A Dex64.cxx175 PetscErrorCode view_map(const map_type &map) const noexcept in view_map()
182 PetscCallCXX(oss << " size: " << map.size() << '\n'); in view_map()
183 PetscCallCXX(oss << " capacity: " << map.capacity() << '\n'); in view_map()
184 PetscCallCXX(oss << " bucket count: " << map.bucket_count() << '\n'); in view_map()
185 PetscCallCXX(oss << " empty: " << map.empty() << '\n'); in view_map()
189 …for (auto &&entry : map) PetscCallCXX(oss << " key: [" << this->key_printer(entry.first) << "] … in view_map()
203 PetscErrorCode check_size_capacity_coherent(map_type &map) const noexcept in check_size_capacity_coherent()
205 const auto msize = map.size(); in check_size_capacity_coherent()
206 const auto mcap = map.capacity(); in check_size_capacity_coherent()
209map, msize == map.size(), PETSC_COMM_SELF, PETSC_ERR_PLIB, "Map size appears to change each time i… in check_size_capacity_coherent()
[all …]
/petsc/src/ksp/pc/impls/tfs/
H A Dgs.c386 PetscInt *map; in gsi_via_bit_mask() local
400 map = gs->companion; in gsi_via_bit_mask()
408 map = gs->companion; in gsi_via_bit_mask()
416 **reduce = map[**reduce]; in gsi_via_bit_mask()
447 for (i = 0; i < nel; i++) elms[i] = map[elms[i]]; in gsi_via_bit_mask()
451 for (i = 0; i < nel; i++) elms[i] = map[elms[i]]; in gsi_via_bit_mask()
820 PetscInt *num, *map, **reduce; in PCTFS_gs_gop_local_out() local
826 while ((map = *reduce++)) { in PCTFS_gs_gop_local_out()
830 vals[map[1]] = vals[map[0]]; in PCTFS_gs_gop_local_out()
833 vals[map[2]] = vals[map[1]] = vals[map[0]]; in PCTFS_gs_gop_local_out()
[all …]
/petsc/src/vec/is/is/impls/block/
H A Dblock.c37 PetscCall(PetscLayoutGetBlockSize(is->map, &bs)); in ISLocate_Block()
38 PetscCall(PetscLayoutGetLocalSize(is->map, &numIdx)); in ISLocate_Block()
70 PetscCall(PetscLayoutGetBlockSize(in->map, &bs)); in ISGetIndices_Block()
71 PetscCall(PetscLayoutGetLocalSize(in->map, &n)); in ISGetIndices_Block()
96 PetscCall(PetscLayoutGetBlockSize(is->map, &bs)); in ISRestoreIndices_Block()
101 …PetscCheck(is->map->n <= 0 || *idx == sub->idx, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Must restor… in ISRestoreIndices_Block()
114 PetscCall(PetscLayoutGetBlockSize(is->map, &bs)); in ISInvertPermutation_Block()
115 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISInvertPermutation_Block()
132 PetscCall(PetscLayoutGetBlockSize(is->map, &bs)); in ISView_Block()
133 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISView_Block()
[all …]
/petsc/src/vec/is/utils/hdf5/
H A Dhdf5io.c79 PetscLayout map; in PetscViewerHDF5ReadSizes_Private() local
84 map = *map_; in PetscViewerHDF5ReadSizes_Private()
183 PetscCall(PetscLayoutSetBlockSize(map, bs)); in PetscViewerHDF5ReadSizes_Private()
184 if (map->N < 0) PetscCall(PetscLayoutSetSize(map, N)); in PetscViewerHDF5ReadSizes_Private()
185map->N == N, PetscObjectComm((PetscObject)viewer), PETSC_ERR_FILE_UNEXPECTED, "Global size of arra… in PetscViewerHDF5ReadSizes_Private()
186 if (setup) PetscCall(PetscLayoutSetUp(map)); in PetscViewerHDF5ReadSizes_Private()
190 …5ReadSelectHyperslab_Private(PetscViewer viewer, HDF5ReadCtx ctx, PetscLayout map, hid_t *memspace) in PetscViewerHDF5ReadSelectHyperslab_Private() argument
199 PetscCall(PetscLayoutSetUp(map)); in PetscViewerHDF5ReadSelectHyperslab_Private()
200 PetscCall(PetscLayoutGetBlockSize(map, &bs)); in PetscViewerHDF5ReadSelectHyperslab_Private()
201 PetscCall(PetscLayoutGetLocalSize(map, &n)); in PetscViewerHDF5ReadSelectHyperslab_Private()
[all …]
/petsc/src/vec/vec/interface/
H A Dveccreate.c51 PetscCall(PetscLayoutCreate(comm, &v->map)); in VecCreate()
93 PetscErrorCode VecCreateWithLayout_Private(PetscLayout map, Vec *vec) in VecCreateWithLayout_Private() argument
101 …PetscCall(PetscHeaderCreate(v, VEC_CLASSID, "Vec", "Vector", "Vec", map->comm, VecDestroy, VecView… in VecCreateWithLayout_Private()
102 v->map = map; in VecCreateWithLayout_Private()
103 map->refcnt++; in VecCreateWithLayout_Private()
105 v->bstash.bs = map->bs; in VecCreateWithLayout_Private()
/petsc/src/vec/vec/impls/shared/
H A Dshvec.c17 …etscSharedMalloc(PetscObjectComm((PetscObject)win), win->map->n * sizeof(PetscScalar), win->map->N… in VecDuplicate_Shared()
20 PetscCall(VecSetSizes(*v, win->map->n, win->map->N)); in VecDuplicate_Shared()
22 PetscCall(PetscLayoutReference(win->map, &(*v)->map)); in VecDuplicate_Shared()
41 PetscCall(PetscSplitOwnership(PetscObjectComm((PetscObject)vv), &vv->map->n, &vv->map->N)); in VecCreate_Shared()
42 …l(PetscSharedMalloc(PetscObjectComm((PetscObject)vv), vv->map->n * sizeof(PetscScalar), vv->map->N… in VecCreate_Shared()
/petsc/src/sys/objects/device/interface/
H A Dmemory.cxx107 map_type map{}; member in MemoryMap
127 PetscCall(map.reserve(16)); in register_finalize_()
135 PetscCallCXX(map = map_type{}); in finalize_()
158 const auto end_it = map.end(); in search_for()
159 auto it = map.find(const_cast<map_type::key_type>(ptr)); in search_for()
166 it = std::find_if(map.begin(), end_it, [ptr](map_type::const_iterator::reference map_it) { in search_for()
192 auto &map = memory_map.map; in PetscDeviceRegisterMemory_Private() local
196 if (it == map.cend()) { in PetscDeviceRegisterMemory_Private()
203 for (const auto &entry : map) { in PetscDeviceRegisterMemory_Private()
213 PetscCallCXX(map.emplace( in PetscDeviceRegisterMemory_Private()
[all …]
/petsc/src/vec/is/is/impls/stride/
H A Dstride.c36 …PetscCall(ISCreateStride(PetscObjectComm((PetscObject)is), is->map->n, sub->first, sub->step, newI… in ISDuplicate_Stride()
48 PetscInt start = is->map->rstart, n = is->map->n; in ISInvertPermutation_Stride()
59 const PetscInt *indices, n = is->map->n; in ISInvertPermutation_Stride()
137 if ((rem < is->map->n) && !(key % step)) *location = rem; in ISLocate_Stride()
151 PetscCall(PetscMalloc1(is->map->n, (PetscInt **)idx)); in ISGetIndices_Stride()
152 if (is->map->n) { in ISGetIndices_Stride()
154 for (i = 1; i < is->map->n; i++) (*dx)[i] = (*dx)[i - 1] + sub->step; in ISGetIndices_Stride()
169 PetscInt i, n = is->map->n; in ISView_Stride()
221 sub->first += (is->map->n - 1) * sub->step; in ISSort_Stride()
241 if (!is->map->n || sub->step != 0) *flg = PETSC_TRUE; in ISUniqueLocal_Stride()
[all …]
/petsc/src/vec/is/ao/impls/memscalable/
H A Daomemscalable.c11 PetscLayout map; /* determines the local sizes of ao */ member
24 PetscLayout map = aomems->map; in AOView_MemoryScalable() local
42 PetscCall(PetscMalloc2(map->N, &app, map->N, &petsc)); in AOView_MemoryScalable()
43 len = map->n; in AOView_MemoryScalable()
50 len = map->range[i + 1] - map->range[i]; in AOView_MemoryScalable()
51 app_loc = app + map->range[i]; in AOView_MemoryScalable()
52 petsc_loc = petsc + map->range[i]; in AOView_MemoryScalable()
56 …tscInt_FMT " %3" PetscInt_FMT " %3" PetscInt_FMT "\n", map->range[i] + j, app_loc[j], map->ran… in AOView_MemoryScalable()
62 …PetscCallMPI(MPIU_Send((void *)aomems->app_loc, map->n, MPIU_INT, 0, tag_app, PetscObjectComm((Pet… in AOView_MemoryScalable()
63 …PetscCallMPI(MPIU_Send((void *)aomems->petsc_loc, map->n, MPIU_INT, 0, tag_petsc, PetscObjectComm(… in AOView_MemoryScalable()
[all …]
/petsc/src/sys/dll/
H A Dreg.c184 PetscHMapFunc map; member
238 static PetscErrorCode PetscHMapFuncInsert_Private(PetscHMapFunc map, const char name[], PetscErrorC… in PetscHMapFuncInsert_Private() argument
246 PetscCall(PetscHMapFuncFind(map, name, &it, &found)); in PetscHMapFuncInsert_Private()
249 PetscCall(PetscHMapFuncIterSet(map, it, fnc)); in PetscHMapFuncInsert_Private()
254 PetscCall(PetscHMapFuncSet(map, tmp_name, fnc)); in PetscHMapFuncInsert_Private()
259 PetscHashIterGetKey(map, it, tmp_name); in PetscHMapFuncInsert_Private()
261 PetscCall(PetscHMapFuncIterDel(map, it)); in PetscHMapFuncInsert_Private()
271 PetscCall(PetscHMapFuncCreateWithSize(size, &(*fl)->map)); in PetscFunctionListCreate_Private()
312 PetscCall(PetscHMapFuncInsert_Private((*fl)->map, name, fptr)); in PetscFunctionListAdd_Private()
333 PetscCall(PetscHMapFuncDestroy(&(*fl)->map)); in PetscFunctionListDestroy()
[all …]
/petsc/src/vec/vec/utils/
H A Dvecio.c16 PetscLayout map; in VecView_Binary() local
25 PetscCall(VecGetLayout(vec, &map)); in VecView_Binary()
26 PetscCall(PetscLayoutGetLocalSize(map, &n)); in VecView_Binary()
27 PetscCall(PetscLayoutGetRange(map, &s, NULL)); in VecView_Binary()
28 PetscCall(PetscLayoutGetSize(map, &N)); in VecView_Binary()
58 …PETSC_COMM_SELF, info, "-%svecload_block_size %" PetscInt_FMT "\n", pre ? pre : "", vec->map->bs)); in VecView_Binary()
69 PetscLayout map; in VecLoad_Binary() local
75 PetscCall(VecGetLayout(vec, &map)); in VecLoad_Binary()
76 PetscCall(PetscLayoutGetSize(map, &N)); in VecLoad_Binary()
98 PetscCall(PetscLayoutGetBlockSize(map, &bs)); in VecLoad_Binary()
[all …]
/petsc/src/vec/vec/impls/seq/seqviennacl/
H A Dvecviennacl.cxx170 PetscInt n = v->map->n; in VecViennaCLAllocateCheckHost()
195 ((Vec_ViennaCL *)v->spptr)->GPUarray_allocated = new ViennaCLVector((PetscBLASInt)v->map->n); in VecViennaCLAllocateCheck()
211 if (v->map->n > 0) { in VecViennaCLCopyToGPU()
216 … viennacl::fast_copy(*(PetscScalar **)v->data, *(PetscScalar **)v->data + v->map->n, vec->begin()); in VecViennaCLCopyToGPU()
221 PetscCall(PetscLogCpuToGpu(v->map->n * sizeof(PetscScalar))); in VecViennaCLCopyToGPU()
246 PetscCall(PetscLogGpuToCpu(v->map->n * sizeof(PetscScalar))); in VecViennaCLCopyFromGPU()
265 PetscCall(PetscArraycpy(ya, xa, xin->map->n)); in VecCopy_SeqViennaCL_Private()
274 PetscInt n = xin->map->n, i; in VecSetRandom_SeqViennaCL_Private()
290 PetscCall(PetscLogObjectState((PetscObject)v, "Length=%" PetscInt_FMT, v->map->n)); in VecDestroy_SeqViennaCL_Private()
327 if (alpha != 0.0 && xin->map->n > 0) { in VecAYPX_SeqViennaCL()
[all …]
/petsc/src/vec/is/is/impls/general/
H A Dgeneral.c13 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISDuplicate_General()
15 PetscCall(PetscLayoutGetBlockSize(is->map, &bs)); in ISDuplicate_General()
16 PetscCall(PetscLayoutSetBlockSize((*newIS)->map, bs)); in ISDuplicate_General()
40 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISCopy_General()
51 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISShift_General()
63 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISOnComm_General()
71 PetscCall(PetscLayoutSetBlockSize(is->map, bs)); in ISSetBlockSize_General()
83 PetscCall(PetscLayoutGetLocalSize(is->map, &n)); in ISContiguousLocal_General()
106 PetscCall(PetscLayoutGetLocalSize(is->map, &numIdx)); in ISLocate_General()
138 …PetscCheck(in->map->n <= 0 || *idx == sub->idx, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Must restor… in ISRestoreIndices_General()
[all …]
/petsc/src/mat/tutorials/
H A Dex3.c28 ISLocalToGlobalMapping map; in main() local
42 PetscCall(ISLocalToGlobalMappingCreate(comm, 1, overlapSize, globalIdx, PETSC_COPY_VALUES, &map)); in main()
44 PetscCall(MatCreateIS(comm, 1, PETSC_DECIDE, PETSC_DECIDE, size + 1, size + 1, map, map, &A)); in main()
46 PetscCall(ISLocalToGlobalMappingDestroy(&map)); in main()
/petsc/src/mat/tests/
H A Dex240.c9 PetscInt N, mx = 5, my = 4, i, j, nc, nrow, n, ncols, rstart, *colors, *map; in main() local
34 PetscCall(PetscMalloc1(n, &map)); in main()
35 for (i = 0; i < n; i++) map[i] = i; in main()
36 PetscCall(ISLocalToGlobalMappingApply(ltog, n, map, map)); in main()
40 for (i = 0; i < n; i++) colors[map[i]] = icolors[i]; in main()
41 PetscCall(PetscFree(map)); in main()
/petsc/src/vec/vec/impls/mpi/
H A Dpdvec.c31 PetscCall(PetscLogObjectState((PetscObject)v, "Length=%" PetscInt_FMT, v->map->N)); in VecDestroy_MPI()
56 PetscInt i, work = xin->map->n, cnt, nLen; in VecView_MPI_ASCII()
68 PetscInt nmax = 0, nmin = xin->map->n, navg; in VecView_MPI_ASCII()
70 nmax = PetscMax(nmax, xin->map->range[i + 1] - xin->map->range[i]); in VecView_MPI_ASCII()
71 nmin = PetscMin(nmin, xin->map->range[i + 1] - xin->map->range[i]); in VecView_MPI_ASCII()
73 navg = xin->map->N / size; in VecView_MPI_ASCII()
93 for (i = 0; i < xin->map->n; i++) { in VecView_MPI_ASCII()
127 for (i = 0; i < xin->map->n; i++) { in VecView_MPI_ASCII()
154 PetscCall(PetscViewerASCIIPrintf(viewer, "%" PetscInt_FMT "\n", xin->map->N / bs)); in VecView_MPI_ASCII()
215 for (i = 0; i < xin->map->n; i++) { in VecView_MPI_ASCII()
[all …]
/petsc/src/sys/objects/
H A Dgarbage.c14 garbage->map = garbage_map; in GarbageGetHMap_Private()
81 PetscCall(PetscHMapObjSet(garbage.map, (*obj)->cidx, *obj)); in PetscObjectDelayedDestroy()
223 PetscCall(PetscHMapObjGetSize(garbage.map, &entries)); in PetscGarbageCleanup()
226 PetscCall(PetscHMapObjGetKeys(garbage.map, &offset, keys)); in PetscGarbageCleanup()
234 PetscCall(PetscHMapObjGet(garbage.map, keys[ii], &obj)); in PetscGarbageCleanup()
237 PetscCall(PetscHMapObjDel(garbage.map, keys[ii])); in PetscGarbageCleanup()
270 PetscCall(PetscHMapObjGetSize(garbage.map, &entries)); in PetscGarbageView()
273 PetscCall(PetscHMapObjGetKeys(garbage.map, &offset, keys)); in PetscGarbageView()
285 PetscCall(PetscHMapObjGet(garbage.map, keys[ii], &obj)); in PetscGarbageView()
/petsc/src/vec/is/is/interface/
H A Dindex.c37 PetscLayout map; in ISRenumber() local
108 PetscCall(PetscLayoutCreate(PetscObjectComm((PetscObject)subset), &map)); in ISRenumber()
109 PetscCall(PetscLayoutSetBlockSize(map, 1)); in ISRenumber()
110 PetscCall(PetscLayoutSetSize(map, N_n)); in ISRenumber()
111 PetscCall(PetscLayoutSetUp(map)); in ISRenumber()
112 PetscCall(PetscLayoutGetLocalSize(map, &Nl)); in ISRenumber()
118 PetscCall(PetscSFSetGraphLayout(sf, map, npos, ilocal, PETSC_USE_POINTER, gidxs)); in ISRenumber()
119 PetscCall(PetscLayoutDestroy(&map)); in ISRenumber()
263 PetscCall(PetscLayoutFindOwnerIndex(is->map, comps_indices[i], &owner, &lidx)); in ISCreateSubIS()
587 PetscCall(PetscParallelSortInt(is->map, is->map, idx, idx)); in ISGetInfo_Unique_Private()
[all …]
/petsc/src/vec/is/is/interface/ftn-custom/
H A Dzindexf90.c16 PETSC_EXTERN void petsclayoutgetranges_(PetscLayout *map, F90Array1d *ptr, int *ierr PETSC_F90_2PTR… in petsclayoutgetranges_() argument
21 *ierr = PetscLayoutGetRanges(*map, &fa); in petsclayoutgetranges_()
23 *ierr = MPI_Comm_size((*map)->comm, &size); in petsclayoutgetranges_()
28 PETSC_EXTERN void petsclayoutrestoreranges_(PetscLayout *map, F90Array1d *ptr, int *ierr PETSC_F90_… in petsclayoutrestoreranges_() argument

123456789