| /petsc/src/ksp/pc/impls/vpbjacobi/cuda/ |
| H A D | vpbjacobi_cuda.cu | 8 PetscInt nblocks; /* number of point blocks */ member 21 …cobi_CUDA(PetscInt n, PetscInt nblocks, PetscInt nsize, const PetscInt *bsizes, MatScalar *diag_h)… in PC_VPBJacobi_CUDA() 24 PetscCallVoid(PetscMalloc3(nblocks + 1, &bs_h, nblocks + 1, &bs2_h, n, &matIdx_h)); in PC_VPBJacobi_CUDA() 25 PetscCallCUDAVoid(cudaMalloc(&bs_d, sizeof(PetscInt) * (nblocks + 1))); in PC_VPBJacobi_CUDA() 26 PetscCallCUDAVoid(cudaMalloc(&bs2_d, sizeof(PetscInt) * (nblocks + 1))); in PC_VPBJacobi_CUDA() 36 PetscCallCUDA(cudaMemcpy(bs_d, bs_h, sizeof(PetscInt) * (nblocks + 1), cudaMemcpyHostToDevice)); in UpdateOffsetsOnDevice() 37 … PetscCallCUDA(cudaMemcpy(bs2_d, bs2_h, sizeof(PetscInt) * (nblocks + 1), cudaMemcpyHostToDevice)); in UpdateOffsetsOnDevice() 40 … PetscCall(PetscLogCpuToGpu(sizeof(PetscInt) * (2 * nblocks + 2 + n) + sizeof(MatScalar) * nsize)); in UpdateOffsetsOnDevice() 58 for (PetscInt i = 0; i < nblocks; i++) { in ComputeOffsetsOnHost() 164 PetscInt i, n, nblocks, nsize = 0; in PCSetUp_VPBJacobi_CUDA() local [all …]
|
| /petsc/src/ksp/pc/impls/vpbjacobi/kokkos/ |
| H A D | vpbjacobi_kok.kokkos.cxx | 14 PetscInt nblocks; /* number of point blocks */ member 32 PC_VPBJacobi_Kokkos(PetscInt n, PetscInt nblocks, PetscInt nsize, const PetscInt *bsizes) : in PC_VPBJacobi_Kokkos() 33 n(n), nblocks(nblocks), nsize(nsize), bs_dual(NoInit("bs_dual"), nblocks + 1), in PC_VPBJacobi_Kokkos() 34 bs2_dual(NoInit("bs2_dual"), nblocks + 1), blkMap_dual(NoInit("blkMap_dual"), n), in PC_VPBJacobi_Kokkos() 51 for (PetscInt i = 0; i < nblocks; i++) { in BuildHelperArrays() 91 …label, Kokkos::TeamPolicy<>(PetscGetKokkosExecutionSpace(), jac->nblocks, Kokkos::AUTO()), KOKKOS_… in PCApplyOrTranspose_VPBJacobi_Kokkos() 148 PetscInt i, nlocal, nblocks, nsize = 0; in PCSetUp_VPBJacobi_Kokkos() local 154 PetscCall(MatGetVariableBlockSizes(pc->pmat, &nblocks, &bsizes)); in PCSetUp_VPBJacobi_Kokkos() 156 …PetscCheck(!nlocal || nblocks, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must call MatSetVariabl… in PCSetUp_VPBJacobi_Kokkos() 160 for (i = 0; i < nblocks; i++) { in PCSetUp_VPBJacobi_Kokkos() [all …]
|
| /petsc/src/mat/impls/sell/seq/seqcuda/ |
| H A D | sellcuda.cu | 576 PetscInt nblocks, blocksize = 512; /* blocksize must be multiple of SLICE_HEIGHT*32 */ in MatMult_SeqSELLCUDA() local 599 nblocks = 1 + (nrows - 1) / sliceheight; in MatMult_SeqSELLCUDA() 601 …matmult_seqsell_tiled_kernel9<2><<<nblocks, dim3(32, 2)>>>(nrows, sliceheight, acolidx, aval, slii… in MatMult_SeqSELLCUDA() 603 …matmult_seqsell_tiled_kernel9<4><<<nblocks, dim3(32, 4)>>>(nrows, sliceheight, acolidx, aval, slii… in MatMult_SeqSELLCUDA() 605 …matmult_seqsell_tiled_kernel9<8><<<nblocks, dim3(32, 8)>>>(nrows, sliceheight, acolidx, aval, slii… in MatMult_SeqSELLCUDA() 607 …matmult_seqsell_tiled_kernel9<16><<<nblocks, dim3(32, 16)>>>(nrows, sliceheight, acolidx, aval, sl… in MatMult_SeqSELLCUDA() 609 …matmult_seqsell_tiled_kernel9<32><<<nblocks, dim3(32, 32)>>>(nrows, sliceheight, acolidx, aval, sl… in MatMult_SeqSELLCUDA() 611 …matmult_seqsell_tiled_kernel9<2><<<nblocks, dim3(32, 2)>>>(nrows, sliceheight, acolidx, aval, slii… in MatMult_SeqSELLCUDA() 615 nblocks = 1 + (nrows - 1) / (2 * sliceheight); in MatMult_SeqSELLCUDA() 617 …matmult_seqsell_tiled_kernel7<<<nblocks, dim3(32, 2)>>>(nrows, sliceheight, acolidx, aval, sliidx,… in MatMult_SeqSELLCUDA() [all …]
|
| /petsc/src/ksp/ksp/tutorials/ |
| H A D | ex19.c | 19 PetscInt i, j, Ii, J, Istart, Iend, n = 7, m = 8, its, nblocks = 2; in main() local 32 PetscCall(PetscOptionsGetInt(NULL, NULL, "-num_local_blocks", &nblocks, NULL)); in main() 86 PetscCall(PCASMCreateSubdomains(Aseq, nblocks, &loc_blocks)); // A in main() 89 for (PetscInt bid = 0; bid < nblocks; bid++) { in main() 93 array[bid * nblocks + bid] = matblock; in main() 98 PetscCall(MatNestSetSubMats(nest, nblocks, NULL, nblocks, NULL, array)); in main() 102 for (PetscInt bid = 0; bid < nblocks; bid++) PetscCall(MatDestroy(&array[bid * nblocks + bid])); in main() 151 if (flg && nblocks > 0) { in main() 152 for (PetscInt bid = 0, gid0 = Istart; bid < nblocks; bid++) { in main() 161 PetscCall(PCASMSetLocalSubdomains(pc, nblocks, loc_blocks, NULL)); in main() [all …]
|
| /petsc/src/mat/impls/sell/seq/seqhip/ |
| H A D | sellhip.hip.cxx | 581 PetscInt nblocks, blocksize = 512; /* blocksize is fixed to be 512 */ in MatMult_SeqSELLHIP() local 604 nblocks = 1 + (nrows - 1) / sliceheight; in MatMult_SeqSELLHIP() 606 …matmult_seqsell_tiled_kernel9<2><<<nblocks, dim3(WARP_SIZE, 2)>>>(nrows, sliceheight, acolidx, ava… in MatMult_SeqSELLHIP() 608 …matmult_seqsell_tiled_kernel9<4><<<nblocks, dim3(WARP_SIZE, 4)>>>(nrows, sliceheight, acolidx, ava… in MatMult_SeqSELLHIP() 610 …matmult_seqsell_tiled_kernel9<8><<<nblocks, dim3(WARP_SIZE, 8)>>>(nrows, sliceheight, acolidx, ava… in MatMult_SeqSELLHIP() 612 …matmult_seqsell_tiled_kernel9<16><<<nblocks, dim3(WARP_SIZE, 16)>>>(nrows, sliceheight, acolidx, a… in MatMult_SeqSELLHIP() 614 …matmult_seqsell_tiled_kernel9<2><<<nblocks, dim3(WARP_SIZE, 2)>>>(nrows, sliceheight, acolidx, ava… in MatMult_SeqSELLHIP() 618 nblocks = 1 + (nrows - 1) / (hipstruct->blocky * sliceheight); in MatMult_SeqSELLHIP() 620 …matmult_seqsell_tiled_kernel7<<<nblocks, dim3(WARP_SIZE, 2)>>>(nrows, sliceheight, acolidx, aval, … in MatMult_SeqSELLHIP() 622 …matmult_seqsell_tiled_kernel7<<<nblocks, dim3(WARP_SIZE, 4)>>>(nrows, sliceheight, acolidx, aval, … in MatMult_SeqSELLHIP() [all …]
|
| /petsc/src/mat/tests/ |
| H A D | ex178.c | 10 PetscInt i, j, rows[2], *parts, cnt, N = 21, nblocks, *blocksizes; in main() local 67 nblocks = rand * 10; in main() 68 nblocks = PetscMax(nblocks, 2); in main() 70 PetscCall(PetscMalloc1(nblocks, &blocksizes)); in main() 71 for (i = 0; i < nblocks - 1; i++) { in main() 77 nblocks = i + 1; in main() 81 if (cnt < N) blocksizes[nblocks - 1] = N - cnt; in main() 83 PetscCall(BuildMatrix(parts, nblocks, blocksizes, &A)); in main() 131 PetscErrorCode BuildMatrix(const PetscInt *parts, PetscInt nblocks, const PetscInt *blocksizes, Mat… in BuildMatrix() argument 141 for (i = 0; i < nblocks; i++) { in BuildMatrix()
|
| /petsc/src/ksp/pc/impls/vpbjacobi/ |
| H A D | vpbjacobi.c | 12 PetscInt nblocks; in PCApply_VPBJacobi() local 16 PetscCall(MatGetVariableBlockSizes(pc->pmat, &nblocks, &bsizes)); in PCApply_VPBJacobi() 19 for (i = 0; i < nblocks; i++) { in PCApply_VPBJacobi() 114 PetscInt nblocks; in PCApplyTranspose_VPBJacobi() local 118 PetscCall(MatGetVariableBlockSizes(pc->pmat, &nblocks, &bsizes)); in PCApplyTranspose_VPBJacobi() 121 for (i = 0; i < nblocks; i++) { in PCApplyTranspose_VPBJacobi() 214 PetscInt nblocks; in PCSetUp_VPBJacobi_Host() local 218 PetscCall(MatGetVariableBlockSizes(pc->pmat, &nblocks, &bsizes)); in PCSetUp_VPBJacobi_Host() 220 …PetscCheck(!nlocal || nblocks, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must call MatSetVariabl… in PCSetUp_VPBJacobi_Host() 223 for (i = 0; i < nblocks; i++) { in PCSetUp_VPBJacobi_Host() [all …]
|
| H A D | vpbjacobi.h | 9 PetscInt nblocks, min_bs, max_bs; // Stats recorded during setup for viewing member
|
| /petsc/src/mat/utils/ |
| H A D | matstash.c | 823 PetscCount nblocks; in MatStashScatterBegin_BTS() local 835 PetscCall(PetscSegBufferGetSize(stash->segsendblocks, &nblocks)); in MatStashScatterBegin_BTS() 844 for (; b < nblocks; b++) { in MatStashScatterBegin_BTS() 857 for (rowstart = 0; rowstart < nblocks;) { in MatStashScatterBegin_BTS() 863 …for (i = rowstart + 1; i < nblocks; i++) { /* Move forward through a run of blocks with the same o… in MatStashScatterBegin_BTS() 875 for (rowstart = 0; rowstart < nblocks;) { in MatStashScatterBegin_BTS() 884 …for (i = rowstart + 1; i < nblocks; i++) { /* Move forward through a run of blocks with the same o… in MatStashScatterBegin_BTS() 901 for (PetscCount i = 0; i < nblocks; i++) { in MatStashScatterBegin_BTS()
|
| /petsc/src/mat/interface/ |
| H A D | matrix.c | 1200 …PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)viewer), mat->nblocks, mat->bsizes, PETSC_U… in MatView() 7917 PetscErrorCode MatSetVariableBlockSizes(Mat mat, PetscInt nblocks, const PetscInt bsizes[]) in MatSetVariableBlockSizes() argument 7924 …nblocks >= 0 && nblocks <= nlocal, PETSC_COMM_SELF, PETSC_ERR_ARG_SIZ, "Number of local blocks %" … in MatSetVariableBlockSizes() 7925 for (PetscInt i = 0; i < nblocks; i++) ncnt += bsizes[i]; in MatSetVariableBlockSizes() 7928 mat->nblocks = nblocks; in MatSetVariableBlockSizes() 7929 PetscCall(PetscMalloc1(nblocks, &mat->bsizes)); in MatSetVariableBlockSizes() 7930 PetscCall(PetscArraycpy(mat->bsizes, bsizes, nblocks)); in MatSetVariableBlockSizes() 7950 PetscErrorCode MatGetVariableBlockSizes(Mat mat, PetscInt *nblocks, const PetscInt *bsizes[]) in MatGetVariableBlockSizes() argument 7954 if (nblocks) *nblocks = mat->nblocks; in MatGetVariableBlockSizes() 8001 for (PetscInt b = 0, gr = rStart, i = 0; b < A->nblocks; ++b) { in MatSelectVariableBlockSizes() [all …]
|
| /petsc/src/binding/petsc4py/test/ |
| H A D | test_vec.py | 118 nblocks = list(range(1, lsize + 1)) 123 for nb in nblocks
|
| /petsc/src/vec/is/sf/impls/basic/cupm/ |
| H A D | sfcupm_impl.hpp | 323 PetscInt nblocks = (count + nthreads - 1) / nthreads; in ScatterAndOp() local 328 nblocks = PetscMin(nblocks, link->maxResidentThreadsPerGPU / nthreads); in ScatterAndOp()
|
| /petsc/src/mat/impls/aij/seq/klu/ |
| H A D | klu.c | 202 …CIIPrintf(viewer, " Number of diagonal blocks: %" PetscInt_FMT "\n", (PetscInt)Numeric->nblocks)); in MatView_Info_KLU()
|
| /petsc/src/mat/impls/aij/mpi/mumps/ |
| H A D | mumps.c | 2767 PetscInt nblocks, p, *blkptr = NULL; in MatSetFromOptions_MUMPS() local 2771 PetscCall(MatGetVariableBlockSizes(A, &nblocks, &bsizes)); in MatSetFromOptions_MUMPS() 2773 for (p = 0; p < nblocks; ++p) { in MatSetFromOptions_MUMPS() 2776 if (p == nblocks) flg = PETSC_FALSE; in MatSetFromOptions_MUMPS() 2782 PetscCall(PetscMPIIntCast(nblocks, &n)); in MatSetFromOptions_MUMPS()
|
| /petsc/src/mat/impls/aij/seq/kokkos/ |
| H A D | aijkok.kokkos.cxx | 1495 PetscInt nblocks = bs.extent(0) - 1; in MatInvertVariableBlockDiagonal_SeqAIJKokkos() local 1512 …Kokkos::TeamPolicy<>(PetscGetKokkosExecutionSpace(), nblocks, ts), KOKKOS_LAMBDA(const KokkosTeamM… in MatInvertVariableBlockDiagonal_SeqAIJKokkos()
|
| /petsc/src/mat/impls/aij/seq/ |
| H A D | aij.c | 1737 static PetscErrorCode MatInvertVariableBlockDiagonal_SeqAIJ(Mat A, PetscInt nblocks, const PetscInt… in MatInvertVariableBlockDiagonal_SeqAIJ() argument 1748 for (i = 0; i < nblocks; i++) ncnt += bsizes[i]; in MatInvertVariableBlockDiagonal_SeqAIJ() 1750 for (i = 0; i < nblocks; i++) bsizemax = PetscMax(bsizemax, bsizes[i]); in MatInvertVariableBlockDiagonal_SeqAIJ() 1754 for (i = 0; i < nblocks; i++) { in MatInvertVariableBlockDiagonal_SeqAIJ()
|
| /petsc/include/petsc/private/ |
| H A D | matimpl.h | 503 …PetscInt nblocks, *bsizes; /* support for MatSetVariableBlockSizes() */ member
|
| /petsc/src/dm/impls/forest/p4est/ |
| H A D | pforest.h | 104 static uint32_t DMPforestHash(const uint32_t *blocks, uint32_t nblocks) in DMPforestHash() argument 113 int len = nblocks * 4; in DMPforestHash() 116 for (i = 0; i < nblocks; i++) { in DMPforestHash()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plex.c | 3013 PetscInt nblocks = 0; in DMCreateMatrix_Plex() local 3020 pblocks[nblocks - 1] += pblocks[i]; in DMCreateMatrix_Plex() 3022 pblocks[nblocks++] = pblocks[i]; // nblocks always <= i in DMCreateMatrix_Plex() 3027 PetscCall(MatSetVariableBlockSizes(*J, nblocks, pblocks)); in DMCreateMatrix_Plex()
|
| /petsc/src/ksp/pc/impls/bddc/ |
| H A D | bddcprivate.c | 4197 static PetscErrorCode MatSeqAIJInvertVariableBlockDiagonalMat(Mat A, PetscInt nblocks, const PetscI… in MatSeqAIJInvertVariableBlockDiagonalMat() argument 4209 for (PetscInt i = 0; i < nblocks; i++) { in MatSeqAIJInvertVariableBlockDiagonalMat() 4214 for (PetscInt i = 0; i < nblocks; i++) bsizemax = PetscMax(bsizemax, bsizes[i]); in MatSeqAIJInvertVariableBlockDiagonalMat() 4226 for (PetscInt i = 0; i < nblocks; i++) { in MatSeqAIJInvertVariableBlockDiagonalMat()
|
| /petsc/src/mat/impls/aij/mpi/ |
| H A D | mpiaij.c | 2689 static PetscErrorCode MatInvertVariableBlockDiagonal_MPIAIJ(Mat A, PetscInt nblocks, const PetscInt… in MatInvertVariableBlockDiagonal_MPIAIJ() argument 2694 PetscCall(MatInvertVariableBlockDiagonal(a->A, nblocks, bsizes, diag)); in MatInvertVariableBlockDiagonal_MPIAIJ()
|