Lines Matching refs:xxt_handle

54 static PetscErrorCode do_xxt_solve(xxt_ADT xxt_handle, PetscScalar *rhs);
55 static PetscErrorCode check_handle(xxt_ADT xxt_handle);
56 static PetscErrorCode det_separators(xxt_ADT xxt_handle);
58 static PetscErrorCode xxt_generate(xxt_ADT xxt_handle);
59 static PetscErrorCode do_xxt_factor(xxt_ADT xxt_handle);
64 xxt_ADT xxt_handle; in XXT_new() local
68 xxt_handle = (xxt_ADT)malloc(sizeof(struct xxt_CDT)); in XXT_new()
69 xxt_handle->id = ++n_xxt; in XXT_new()
70 xxt_handle->info = NULL; in XXT_new()
71 xxt_handle->mvi = NULL; in XXT_new()
73 return xxt_handle; in XXT_new()
76 PetscErrorCode XXT_factor(xxt_ADT xxt_handle, /* prev. … in XXT_factor() argument
85 PetscCall(check_handle(xxt_handle)); in XXT_factor()
88 …PetscCheck((1 << (xxt_handle->level = PCTFS_i_log2_num_nodes)) == PCTFS_num_nodes, PETSC_COMM_SELF… in XXT_factor()
91 xxt_handle->info = (xxt_info *)malloc(sizeof(xxt_info)); in XXT_factor()
94xxt_handle->mvi = set_mvi(local2global, n, m, (PetscErrorCode (*)(mv_info *, PetscScalar *, PetscS… in XXT_factor()
98 xxt_handle->ns = 0; in XXT_factor()
101 PetscCall(det_separators(xxt_handle)); in XXT_factor()
103 PetscCall(do_xxt_factor(xxt_handle)); in XXT_factor()
107 PetscErrorCode XXT_solve(xxt_ADT xxt_handle, PetscScalar *x, PetscScalar *b) in XXT_solve() argument
111 PetscCall(check_handle(xxt_handle)); in XXT_solve()
114 if (b) PetscCall(PCTFS_rvec_copy(x, b, xxt_handle->mvi->n)); in XXT_solve()
115 PetscCall(do_xxt_solve(xxt_handle, x)); in XXT_solve()
119 PetscErrorCode XXT_free(xxt_ADT xxt_handle) in XXT_free() argument
123 PetscCall(check_handle(xxt_handle)); in XXT_free()
126 free(xxt_handle->info->nsep); in XXT_free()
127 free(xxt_handle->info->lnsep); in XXT_free()
128 free(xxt_handle->info->fo); in XXT_free()
129 free(xxt_handle->info->stages); in XXT_free()
130 free(xxt_handle->info->solve_uu); in XXT_free()
131 free(xxt_handle->info->solve_w); in XXT_free()
132 free(xxt_handle->info->x); in XXT_free()
133 free(xxt_handle->info->col_vals); in XXT_free()
134 free(xxt_handle->info->col_sz); in XXT_free()
135 free(xxt_handle->info->col_indices); in XXT_free()
136 free(xxt_handle->info); in XXT_free()
137 free(xxt_handle->mvi->local2global); in XXT_free()
138 PetscCall(PCTFS_gs_free(xxt_handle->mvi->PCTFS_gs_handle)); in XXT_free()
139 free(xxt_handle->mvi); in XXT_free()
140 free(xxt_handle); in XXT_free()
161 static PetscErrorCode do_xxt_factor(xxt_ADT xxt_handle) in do_xxt_factor() argument
163 return xxt_generate(xxt_handle); in do_xxt_factor()
166 static PetscErrorCode xxt_generate(xxt_ADT xxt_handle) in xxt_generate() argument
180 PetscInt a_n = xxt_handle->mvi->n; in xxt_generate()
181 PetscInt a_m = xxt_handle->mvi->m; in xxt_generate()
182 PetscInt *a_local2global = xxt_handle->mvi->local2global; in xxt_generate()
192 n = xxt_handle->mvi->n; in xxt_generate()
193 nsep = xxt_handle->info->nsep; in xxt_generate()
194 lnsep = xxt_handle->info->lnsep; in xxt_generate()
195 fo = xxt_handle->info->fo; in xxt_generate()
197 level = xxt_handle->level; in xxt_generate()
198 PCTFS_gs_handle = xxt_handle->mvi->PCTFS_gs_handle; in xxt_generate()
204 m = j - xxt_handle->ns; in xxt_generate()
205 …null space exists %" PetscInt_FMT " %" PetscInt_FMT " %" PetscInt_FMT "\n", m, j, xxt_handle->ns)); in xxt_generate()
238 n_global = xxt_handle->info->n_global; in xxt_generate()
281 PetscCall(do_matvec(xxt_handle->mvi, v, u)); in xxt_generate()
320 PetscCall(do_matvec(xxt_handle->mvi, v, u)); in xxt_generate()
382 xxt_handle->info->n = xxt_handle->mvi->n; in xxt_generate()
383 xxt_handle->info->m = m; in xxt_generate()
384 xxt_handle->info->nnz = xxt_nnz; in xxt_generate()
385 xxt_handle->info->max_nnz = xxt_max_nnz; in xxt_generate()
386 xxt_handle->info->msg_buf_sz = stages[level] - stages[0]; in xxt_generate()
387 xxt_handle->info->solve_uu = (PetscScalar *)malloc(m * sizeof(PetscScalar)); in xxt_generate()
388 xxt_handle->info->solve_w = (PetscScalar *)malloc(m * sizeof(PetscScalar)); in xxt_generate()
389 xxt_handle->info->x = x; in xxt_generate()
390 xxt_handle->info->col_vals = col_vals; in xxt_generate()
391 xxt_handle->info->col_sz = col_sz; in xxt_generate()
392 xxt_handle->info->col_indices = col_indices; in xxt_generate()
393 xxt_handle->info->stages = stages; in xxt_generate()
394 xxt_handle->info->nsolves = 0; in xxt_generate()
395 xxt_handle->info->tot_solve_time = 0.0; in xxt_generate()
407 static PetscErrorCode do_xxt_solve(xxt_ADT xxt_handle, PetscScalar *uc) in do_xxt_solve() argument
410 PetscInt level = xxt_handle->level; in do_xxt_solve()
411 PetscInt n = xxt_handle->info->n; in do_xxt_solve()
412 PetscInt m = xxt_handle->info->m; in do_xxt_solve()
413 PetscInt *stages = xxt_handle->info->stages; in do_xxt_solve()
414 PetscInt *col_indices = xxt_handle->info->col_indices; in do_xxt_solve()
416 PetscScalar *solve_uu = xxt_handle->info->solve_uu; in do_xxt_solve()
417 PetscScalar *solve_w = xxt_handle->info->solve_w; in do_xxt_solve()
418 PetscScalar *x = xxt_handle->info->x; in do_xxt_solve()
450 static PetscErrorCode check_handle(xxt_ADT xxt_handle) in check_handle() argument
455 …PetscCheck(xxt_handle, PETSC_COMM_SELF, PETSC_ERR_PLIB, "check_handle() :: bad handle :: NULL %p",… in check_handle()
457 vals[0] = vals[1] = xxt_handle->id; in check_handle()
459xxt_handle->id <= 0), PETSC_COMM_SELF, PETSC_ERR_PLIB, "check_handle() :: bad handle :: id mismatc… in check_handle()
463 static PetscErrorCode det_separators(xxt_ADT xxt_handle) in det_separators() argument
473 PCTFS_gs_ADT PCTFS_gs_handle = xxt_handle->mvi->PCTFS_gs_handle; in det_separators()
474 PetscInt *local2global = xxt_handle->mvi->local2global; in det_separators()
475 PetscInt n = xxt_handle->mvi->n; in det_separators()
476 PetscInt m = xxt_handle->mvi->m; in det_separators()
477 PetscInt level = xxt_handle->level; in det_separators()
513 xxt_handle->info->n_global = xxt_handle->info->m_global = (PetscInt)rsum[0]; in det_separators()
514 xxt_handle->mvi->n_global = xxt_handle->mvi->m_global = (PetscInt)rsum[0]; in det_separators()
702 xxt_handle->info->nsep = nsep; in det_separators()
703 xxt_handle->info->lnsep = lnsep; in det_separators()
704 xxt_handle->info->fo = fo; in det_separators()
705 xxt_handle->info->nfo = nfo; in det_separators()