| /petsc/src/mat/utils/ |
| H A D | compressedrow.c | 30 PETSC_EXTERN PetscErrorCode MatCheckCompressedRow(Mat A, PetscInt nrows, Mat_CompressedRow *compres… in MatCheckCompressedRow() argument 39 nrows = mbs - nrows; in MatCheckCompressedRow() 42 if (nrows < ratio * mbs) { in MatCheckCompressedRow() 45 …localrows %" PetscInt_FMT ") < %g. Do not use CompressedRow routines.\n", nrows, mbs, (double)rati… in MatCheckCompressedRow() 49 …)/(num_localrows %" PetscInt_FMT ") > %g. Use CompressedRow routines.\n", nrows, mbs, (double)rati… in MatCheckCompressedRow() 52 nrows = mbs - nrows; /* num of non-zero rows */ in MatCheckCompressedRow() 53 PetscCall(PetscMalloc2(nrows + 1, &cpi, nrows, &ridx)); in MatCheckCompressedRow() 62 while (row < nrows) ridx[row++] = -1; // pad array in MatCheckCompressedRow() 63 compressedrow->nrows = nrows; in MatCheckCompressedRow()
|
| /petsc/src/mat/impls/aij/seq/bas/ |
| H A D | spbas.c | 37 matrix.nrows * sizeof(PetscInt) + /* row_nnz[*] */ in spbas_memory_requirement() 38 matrix.nrows * sizeof(PetscInt *); /* icols[*] */ in spbas_memory_requirement() 41 if (matrix.col_idx_type == SPBAS_OFFSET_ARRAY) memreq += matrix.nrows * sizeof(PetscInt); in spbas_memory_requirement() 48 memreq += matrix.nrows * sizeof(PetscScalar *); /* values[*] */ in spbas_memory_requirement() 62 PetscInt nrows = result->nrows; in spbas_allocate_pattern() local 67 PetscCall(PetscMalloc1(nrows, &result->row_nnz)); in spbas_allocate_pattern() 68 PetscCall(PetscMalloc1(nrows, &result->icols)); in spbas_allocate_pattern() 72 PetscCall(PetscMalloc1(nrows, &result->icol0)); in spbas_allocate_pattern() 79 PetscCall(PetscMalloc1(nrows, &result->values)); in spbas_allocate_pattern() 98 PetscInt nrows = result->nrows; in spbas_allocate_data() local [all …]
|
| H A D | spbas_cholesky.h | 43 PetscInt nrows = result->nrows; in spbas_cholesky_garbage_collect() local 69 for (i = i_row; i < nrows; i++) { in spbas_cholesky_garbage_collect() 115 for (i = *n_row_alloc_ok; i < nrows; i++) { in spbas_cholesky_garbage_collect() 138 for (i = *n_row_alloc_ok; i < nrows; i++) { in spbas_cholesky_garbage_collect() 167 for (i = 0; i < nrows; i++) { in spbas_cholesky_garbage_collect() 181 …for (i = 0; i < nrows; i++) result->values[i] = result->alloc_val + (result->icols[i] - result->al… in spbas_cholesky_garbage_collect() 197 for (i = *n_row_alloc_ok; i < nrows; i++) { in spbas_cholesky_garbage_collect() 245 PetscInt nrows, ncols; in spbas_incomplete_cholesky() local 269 PetscCall(MatGetSize(A, &nrows, &ncols)); in spbas_incomplete_cholesky() 272 epsdiag *= epsdiag_in / nrows; in spbas_incomplete_cholesky() [all …]
|
| /petsc/src/mat/impls/sell/seq/seqcuda/ |
| H A D | sellcuda.cu | 75 static __global__ void matmult_seqsell_basic_kernel(PetscInt nrows, PetscInt sliceheight, const Pet… in matmult_seqsell_basic_kernel() argument 81 if (row < nrows) { in matmult_seqsell_basic_kernel() 90 static __global__ void matmultadd_seqsell_basic_kernel(PetscInt nrows, PetscInt sliceheight, const … in matmultadd_seqsell_basic_kernel() argument 96 if (row < nrows) { in matmultadd_seqsell_basic_kernel() 108 __global__ void matmult_seqsell_tiled_kernel9(PetscInt nrows, PetscInt sliceheight, const PetscInt … in matmult_seqsell_tiled_kernel9() argument 119 if (row < nrows) { in matmult_seqsell_tiled_kernel9() 132 if (row < nrows && threadIdx.y == 0 && threadIdx.x < sliceheight) y[row] = shared[0][threadIdx.x]; in matmult_seqsell_tiled_kernel9() 137 __global__ void matmultadd_seqsell_tiled_kernel9(PetscInt nrows, PetscInt sliceheight, const PetscI… in matmultadd_seqsell_tiled_kernel9() argument 148 if (row < nrows) { in matmultadd_seqsell_tiled_kernel9() 161 …if (row < nrows && threadIdx.y == 0 && threadIdx.x < sliceheight) z[row] = y[row] + shared[0][thre… in matmultadd_seqsell_tiled_kernel9() [all …]
|
| /petsc/src/mat/impls/sell/seq/seqhip/ |
| H A D | sellhip.hip.cxx | 78 static __global__ void matmult_seqsell_basic_kernel(PetscInt nrows, PetscInt sliceheight, const Pet… in matmult_seqsell_basic_kernel() argument 84 if (row < nrows) { in matmult_seqsell_basic_kernel() 93 static __global__ void matmultadd_seqsell_basic_kernel(PetscInt nrows, PetscInt sliceheight, const … in matmultadd_seqsell_basic_kernel() argument 99 if (row < nrows) { in matmultadd_seqsell_basic_kernel() 112 __global__ void matmult_seqsell_tiled_kernel9(PetscInt nrows, PetscInt sliceheight, const PetscInt … in matmult_seqsell_tiled_kernel9() argument 123 if (row < nrows) { in matmult_seqsell_tiled_kernel9() 136 if (row < nrows && threadIdx.y == 0 && threadIdx.x < sliceheight) y[row] = shared[0][threadIdx.x]; in matmult_seqsell_tiled_kernel9() 141 __global__ void matmultadd_seqsell_tiled_kernel9(PetscInt nrows, PetscInt sliceheight, const PetscI… in matmultadd_seqsell_tiled_kernel9() argument 152 if (row < nrows) { in matmultadd_seqsell_tiled_kernel9() 165 …if (row < nrows && threadIdx.y == 0 && threadIdx.x < sliceheight) z[row] = y[row] + shared[0][thre… in matmultadd_seqsell_tiled_kernel9() [all …]
|
| /petsc/src/mat/tests/ |
| H A D | ex89.c | 9 PetscInt M, N, Z, i, nrows; in main() local 51 PetscCall(MatGetRowIJ(A, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 54 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 57 PetscCall(MatRestoreRowIJ(A, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 61 PetscCall(MatGetRowIJ(AA, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 64 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 67 PetscCall(MatRestoreRowIJ(AA, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 68 PetscCall(MatGetRowIJ(AB, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 71 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 74 PetscCall(MatRestoreRowIJ(AB, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main()
|
| H A D | ex39.c | 9 PetscInt i, j, m = 5, n, nrows, ncols; in main() local 32 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 36 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 42 for (i = 0; i < nrows; i++) { in main() 50 for (i = 0; i < nrows; i++) { in main() 54 PetscCall(MatSetValues(C, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main() 109 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 113 for (i = 0; i < nrows; i++) { in main() 116 PetscCall(MatSetValues(B, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
|
| H A D | ex245.c | 9 PetscInt m = 5, n, p, i, j, nrows, ncols; in main() local 43 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 47 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 48 for (i = 0; i < nrows; i++) { in main() 54 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main() 63 …_FMT ", m %" PetscInt_FMT "; ncols %" PetscInt_FMT ", n %" PetscInt_FMT "\n", nrows, m, ncols, n)); in main() 75 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 79 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 80 for (i = 0; i < nrows; i++) { in main() 86 PetscCall(MatSetValues(B, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main() [all …]
|
| H A D | ex111.c | 41 PetscInt m, n, M, N, i, nrows; in main() local 99 PetscCall(MatGetRowIJ(A, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 102 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 105 PetscCall(MatRestoreRowIJ(A, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 109 PetscCall(MatGetRowIJ(AA, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 112 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 115 PetscCall(MatRestoreRowIJ(AA, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 116 PetscCall(MatGetRowIJ(AB, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 119 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 122 PetscCall(MatRestoreRowIJ(AB, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main()
|
| H A D | ex103.c | 15 PetscInt i, j, M = 10, N = 5, nrows, ncols; in main() local 39 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 43 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 45 for (i = 0; i < nrows; i++) { in main() 54 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
|
| H A D | ex243.c | 8 PetscInt i, j, M = 10, N = 5, nloc, mloc, nrows, ncols; in main() local 36 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 40 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 42 for (i = 0; i < nrows; i++) { in main() 51 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
|
| H A D | ex145.c | 9 PetscInt m = 5, n, p, i, j, nrows, ncols; in main() local 44 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 48 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 49 for (i = 0; i < nrows; i++) { in main() 55 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main() 64 …_FMT ", m %" PetscInt_FMT "; ncols %" PetscInt_FMT ", n %" PetscInt_FMT "\n", nrows, m, ncols, n)); in main() 76 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 80 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 81 for (i = 0; i < nrows; i++) { in main() 87 PetscCall(MatSetValues(B, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main() [all …]
|
| H A D | ex96.c | 43 PetscInt m, n, M, N, i, nrows; in main() local 109 PetscCall(MatGetRowIJ(A, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 112 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 115 PetscCall(MatRestoreRowIJ(A, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 119 PetscCall(MatGetRowIJ(AA, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 122 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 125 PetscCall(MatRestoreRowIJ(AA, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 126 PetscCall(MatGetRowIJ(AB, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main() 129 for (i = 0; i < ia[nrows]; i++) array[i] = one; in main() 132 PetscCall(MatRestoreRowIJ(AB, 0, PETSC_FALSE, PETSC_FALSE, &nrows, &ia, &ja, &flg)); in main()
|
| H A D | ex242.c | 9 PetscInt i, j, M = 5, N, mb = 2, nb, nrows, ncols, mloc, nloc; in main() local 42 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 46 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 47 for (i = 0; i < nrows; i++) { in main() 50 PetscCall(MatSetValues(C, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main() 107 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 111 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 112 for (i = 0; i < nrows; i++) { in main() 115 PetscCall(MatSetValues(B, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
|
| H A D | ex38.c | 8 PetscInt i, j, m = 5, n, nrows, ncols; in main() local 50 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 54 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 55 for (i = 0; i < nrows; i++) { in main() 61 PetscCall(MatSetValues(C, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
|
| H A D | ex104.c | 12 PetscInt i, M = 10, N = 5, j, nrows, ncols, am, an, rstart, rend; in main() local 45 PetscCall(ISGetLocalSize(isrows, &nrows)); in main() 49 PetscCall(PetscMalloc1(nrows * ncols, &v)); in main() 50 for (i = 0; i < nrows; i++) { in main() 56 PetscCall(MatSetValues(A, nrows, rows, ncols, cols, v, INSERT_VALUES)); in main()
|
| /petsc/src/mat/impls/aij/seq/ |
| H A D | fdaij.c | 64 PetscInt i, j, nrows, nbcols, brows = c->brows, bcols = c->bcols, mbs = c->m, nis = c->ncolors; in MatFDColoringSetUpBlocked_AIJ_Private() local 89 color_start[j + 1] = c->nrows[i + j] + color_start[j]; in MatFDColoringSetUpBlocked_AIJ_Private() 98 nrows = c->nrows[i + j]; in MatFDColoringSetUpBlocked_AIJ_Private() 100 while (row_start[j] < nrows) { in MatFDColoringSetUpBlocked_AIJ_Private() 134 color_start[j + 1] = c->nrows[i + j] + color_start[j]; in MatFDColoringSetUpBlocked_AIJ_Private() 143 nrows = c->nrows[i + j]; in MatFDColoringSetUpBlocked_AIJ_Private() 145 while (row_start[j] < nrows) { in MatFDColoringSetUpBlocked_AIJ_Private() 171 PetscCall(PetscFree(c->nrows)); in MatFDColoringSetUpBlocked_AIJ_Private() 172 c->nrows = nrows_new; in MatFDColoringSetUpBlocked_AIJ_Private() 178 …PetscInt i, n, nrows, mbs = c->m, j, k, m, ncols, col, nis = iscoloring->n, *rowhit, bs,… in MatFDColoringSetUp_SeqXAIJ() local [all …]
|
| /petsc/src/dm/impls/stag/tests/ |
| H A D | ex40.c | 598 PetscInt nrows = 0; in FormFunction2D() local 601 row[nrows].c = c; in FormFunction2D() 602 row[nrows].loc = DMSTAG_DOWN_LEFT; in FormFunction2D() 603 ++nrows; in FormFunction2D() 606 row[nrows].c = c; in FormFunction2D() 607 row[nrows].loc = DMSTAG_LEFT; in FormFunction2D() 608 ++nrows; in FormFunction2D() 611 row[nrows].c = c; in FormFunction2D() 612 row[nrows].loc = DMSTAG_DOWN; in FormFunction2D() 613 ++nrows; in FormFunction2D() [all …]
|
| /petsc/src/tao/constrained/tutorials/ |
| H A D | maros.c | 121 PetscInt nrows, ncols, i; in InitializeProblem() local 137 PetscCall(VecGetSize(user->d, &nrows)); in InitializeProblem() 139 user->n = nrows; in InitializeProblem() 146 PetscCall(MatSetSizes(user->H, PETSC_DECIDE, PETSC_DECIDE, nrows, nrows)); in InitializeProblem() 149 PetscCall(MatGetSize(user->H, &nrows, &ncols)); in InitializeProblem() 150 PetscCheck(nrows == user->n, comm, PETSC_ERR_ARG_SIZ, "H: nrows != n"); in InitializeProblem() 160 PetscCall(MatGetSize(user->Aeq, &nrows, &ncols)); in InitializeProblem() 163 user->me = nrows; in InitializeProblem() 171 PetscCall(VecGetSize(user->beq, &nrows)); in InitializeProblem() 172 PetscCheck(nrows == user->me, comm, PETSC_ERR_ARG_SIZ, "Aeq nrows != Beq n"); in InitializeProblem()
|
| /petsc/src/mat/impls/aij/mpi/ |
| H A D | fdmpiaij.c | 45 …PetscInt ncolors = coloring->ncolors, *ncolumns = coloring->ncolumns, *nrows = coloring->nrows; in MatFDColoringApply_BAIJ() local 142 nrows_k = nrows[k]; in MatFDColoringApply_BAIJ() 196 …PetscInt ncolors = coloring->ncolors, *ncolumns = coloring->ncolumns, *nrows = coloring->nrows; in MatFDColoringApply_AIJ() local 298 nrows_k = nrows[nbcols++]; in MatFDColoringApply_AIJ() 366 nrows_k = nrows[k]; in MatFDColoringApply_AIJ() 406 PetscInt n, nrows, nrows_i, j, k, m, ncols, col, *rowhit, cstart, cend, colb; in MatFDColoringSetUp_MPIXAIJ() local 514 PetscCall(PetscMalloc1(nis, &c->nrows)); in MatFDColoringSetUp_MPIXAIJ() 575 nrows = A_ci[col - cstart + 1] - tmp; in MatFDColoringSetUp_MPIXAIJ() 576 nrows_i += nrows; in MatFDColoringSetUp_MPIXAIJ() 579 for (k = 0; k < nrows; k++) { in MatFDColoringSetUp_MPIXAIJ() [all …]
|
| /petsc/share/petsc/matlab/ |
| H A D | UFgetPetscMat.m | 16 f = find (index.nrows == index.ncols & index.nrows > 940000 & index.isReal) ; 17 [y, j] = sort (index.nrows (f)) ;
|
| /petsc/src/mat/impls/aij/seq/kokkos/ |
| H A D | aijkok.hpp | 119 …Mat_SeqAIJKokkos(Mat A, PetscInt nrows, PetscInt ncols, Mat_SeqAIJ *aseq, PetscObjectState nzstate… in Mat_SeqAIJKokkos() 128 MatRowMapKokkosViewHost i_h(const_cast<MatRowMapType *>(aseq->i), nrows + 1); in Mat_SeqAIJKokkos() 130 MatRowMapKokkosViewHost diag_h(aseq->diag, nrows); in Mat_SeqAIJKokkos() 169 …nrows, PetscInt ncols, PetscInt nnz, const MatRowMapKokkosView &i_d, const MatColIdxKokkosView &j_… in Mat_SeqAIJKokkos() 179 MatColIdxType nrows() { return csrmat.numRows(); } in nrows() function 188 MatRowMapKokkosViewHost diag_h(const_cast<MatRowMapType *>(diag), nrows()); in SetDiagonal()
|
| /petsc/src/mat/tutorials/ |
| H A D | ex16.c | 16 PetscInt row, ncols, j, nrows, nnzA = 0, nnzAsp = 0; in main() local 62 nrows = 0; in main() 75 if (!norm) nrows++; in main() 82 …local size %d,%d; nnzA %d, %g percent; No. of zero rows: %d\n", rank, m, n, nnzA, percent, nrows)); in main()
|
| /petsc/src/ts/impls/eimex/ |
| H A D | eimex.c | 356 PetscInt np = 2, nrows = TSEIMEXDefault; in TSSetFromOptions_EIMEX() local 364 …rows", "Define the maximum number of rows used", "TSEIMEXSetMaxRows", nrows, &nrows, &flg)); /* de… in TSSetFromOptions_EIMEX() 365 if (flg) PetscCall(TSEIMEXSetMaxRows(ts, nrows)); in TSSetFromOptions_EIMEX() 393 PetscErrorCode TSEIMEXSetMaxRows(TS ts, PetscInt nrows) in TSEIMEXSetMaxRows() argument 397 PetscTryMethod(ts, "TSEIMEXSetMaxRows_C", (TS, PetscInt), (ts, nrows)); in TSEIMEXSetMaxRows() 444 static PetscErrorCode TSEIMEXSetMaxRows_EIMEX(TS ts, PetscInt nrows) in TSEIMEXSetMaxRows_EIMEX() argument 450 …nrows >= 0 && nrows <= 100, ((PetscObject)ts)->comm, PETSC_ERR_ARG_OUTOFRANGE, "Max number of rows… in TSEIMEXSetMaxRows_EIMEX() 452 ext->max_rows = nrows; in TSEIMEXSetMaxRows_EIMEX() 453 PetscCall(PetscMalloc1(nrows, &ext->N)); in TSEIMEXSetMaxRows_EIMEX() 454 for (i = 0; i < nrows; i++) ext->N[i] = i + 1; in TSEIMEXSetMaxRows_EIMEX()
|
| /petsc/src/mat/graphops/color/utils/ |
| H A D | valid.c | 11 PetscInt ncolors, nrows, ncols; in MatColoringTest() local 27 PetscCall(PetscSFGetGraph(etor, &nrows, &nleafrows, NULL, NULL)); in MatColoringTest() 31 PetscCall(PetscMalloc1(nrows, &staterow)); in MatColoringTest() 48 for (i = 0; i < nrows; i++) nentries += degrees[i]; in MatColoringTest() 50 for (i = 0; i < nrows; i++) { in MatColoringTest()
|