Lines Matching refs:rp

55 static PetscErrorCode RunWithDM(RunParams rp, DM dm, const char *ceed_resource) {  in RunWithDM()  argument
104 PetscCall(MatCreateShell(rp->comm, l_size, l_size, g_size, g_size, op_apply_ctx, &mat_O)); in RunWithDM()
110 if (!rp->test_mode) { in RunWithDM()
111 PetscInt P = rp->degree + 1, Q = P + rp->q_extra; in RunWithDM()
116 bool is_combined_bp = rp->bp_choice > CEED_BP6; in RunWithDM()
120 …PetscCall(PetscSNPrintf(bp_name, 6, "%d + %d", rp->bp_choice % 2 ? 2 : 1, rp->bp_choice - CEED_BP4… in RunWithDM()
122 PetscCall(PetscSNPrintf(bp_name, 6, "%d", rp->bp_choice + 1)); in RunWithDM()
134 PetscCall(MPI_Comm_size(rp->comm, &comm_size)); in RunWithDM()
135 PetscCall(PetscPrintf(rp->comm, in RunWithDM()
155 …bp_name, rp->hostname, comm_size, rp->ranks_per_node, vec_type, used_resource, CeedMemTypes[mem_ty… in RunWithDM()
156rp->q_extra, g_size / rp->num_comp_u, c_end - c_start, CeedElemTopologies[elem_topo], l_size / rp-… in RunWithDM()
157 rp->num_comp_u)); in RunWithDM()
167 …(SetupLibceedByDegree(dm, ceed, rp->degree, rp->dim, rp->q_extra, rp->dim, rp->num_comp_u, g_size,… in RunWithDM()
177 …CeedQFunctionCreateInterior(ceed, 1, bp_options[rp->bp_choice].error, bp_options[rp->bp_choice].er… in RunWithDM()
178 CeedQFunctionAddInput(qf_error, "u", rp->num_comp_u, CEED_EVAL_INTERP); in RunWithDM()
179 CeedQFunctionAddInput(qf_error, "true_soln", rp->num_comp_u, CEED_EVAL_NONE); in RunWithDM()
181 CeedQFunctionAddOutput(qf_error, "error", rp->num_comp_u, CEED_EVAL_INTERP); in RunWithDM()
191 PetscCall(SetupApplyOperatorCtx(rp->comm, dm, ceed, ceed_data, X_loc, op_apply_ctx)); in RunWithDM()
192 PetscCall(KSPCreate(rp->comm, &ksp)); in RunWithDM()
196 …if (rp->bp_choice == CEED_BP1 || rp->bp_choice == CEED_BP2 || rp->bp_choice == CEED_BP13 || rp->bp… in RunWithDM()
197 rp->bp_choice == CEED_BP15 || rp->bp_choice == CEED_BP26) { in RunWithDM()
199 …if (rp->simplex || rp->bp_choice == CEED_BP13 || rp->bp_choice == CEED_BP24 || rp->bp_choice == CE… in RunWithDM()
218 PetscCall(MPI_Allreduce(MPI_IN_PLACE, &my_rt, 1, MPI_DOUBLE, MPI_MIN, rp->comm)); in RunWithDM()
221 PetscCall(KSPSetTolerances(ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT, rp->ksp_max_it_clip[0])); in RunWithDM()
223 PetscCall(KSPSetTolerances(ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT, rp->ksp_max_it_clip[1])); in RunWithDM()
232 PetscCall(PetscLogStagePush(rp->solve_stage)); in RunWithDM()
252 if (!rp->test_mode || reason < 0 || rnorm > 1e-8) { in RunWithDM()
253 PetscCall(PetscPrintf(rp->comm, in RunWithDM()
261 if (!rp->test_mode) { in RunWithDM()
262 PetscCall(PetscPrintf(rp->comm, " Performance:\n")); in RunWithDM()
266 … PetscCall(SetupErrorOperatorCtx(rp->comm, dm, ceed, ceed_data, X_loc, op_error, op_error_ctx)); in RunWithDM()
273 … PetscReal tol = rp->bp_choice < CEED_BP3 ? 5e-4 : (5e-2 + (rp->bp_choice % 2 == 1 ? 5e-3 : 0)); in RunWithDM()
274 if (!rp->test_mode || l2_error > tol) { in RunWithDM()
275 PetscCall(MPI_Allreduce(&my_rt, &rt_min, 1, MPI_DOUBLE, MPI_MIN, rp->comm)); in RunWithDM()
276 PetscCall(MPI_Allreduce(&my_rt, &rt_max, 1, MPI_DOUBLE, MPI_MAX, rp->comm)); in RunWithDM()
277 PetscCall(PetscPrintf(rp->comm, in RunWithDM()
283 if (!rp->test_mode) { in RunWithDM()
284 …PetscCall(PetscPrintf(rp->comm, " DoFs/Sec in CG : %g (%g) million\n",… in RunWithDM()
289 if (rp->write_solution) { in RunWithDM()
292 PetscCall(PetscViewerCreate(rp->comm, &vtk_viewer_soln)); in RunWithDM()
319 static PetscErrorCode Run(RunParams rp, PetscInt num_resources, char *const *ceed_resources, PetscI… in Run() argument
324 PetscCall(CreateDistributedDM(rp, &dm)); in Run()
329 PetscInt q_extra = rp->q_extra; in Run()
330 rp->bp_choice = bp_choices[b]; in Run()
331 rp->num_comp_u = bp_options[rp->bp_choice].num_comp_u; in Run()
332 rp->q_extra = q_extra < 0 ? bp_options[rp->bp_choice].q_extra : q_extra; in Run()
339 …PetscCall(SetupDMByDegree(dm_deg, rp->degree, rp->q_extra, rp->num_comp_u, dim, bp_options[rp->bp_… in Run()
341 PetscCall(RunWithDM(rp, dm_deg, ceed_resources[r])); in Run()
344 rp->q_extra = q_extra; in Run()
353 RunParams rp; in main() local
384 PetscCall(PetscMalloc1(1, &rp)); in main()
385 rp->comm = comm; in main()
397 rp->test_mode = PETSC_FALSE; in main()
398 …-test", "Testing mode (do not print unless error is large)", NULL, rp->test_mode, &rp->test_mode, … in main()
399 rp->write_solution = PETSC_FALSE; in main()
400 …ool("-write_solution", "Write solution for visualization", NULL, rp->write_solution, &rp->write_so… in main()
401 rp->simplex = PETSC_FALSE; in main()
402 …PetscCall(PetscOptionsBool("-simplex", "Element topology (default:hex)", NULL, rp->simplex, &rp->s… in main()
403 if ((bp_choices[0] == CEED_BP5 || bp_choices[0] == CEED_BP6) && (rp->simplex)) { in main()
406 degree[0] = rp->test_mode ? 3 : 2; in main()
409 rp->q_extra = PETSC_DECIDE; in main()
410 …-q_extra", "Number of extra quadrature points (-1 for auto)", NULL, rp->q_extra, &rp->q_extra, NUL… in main()
421 rp->read_mesh = PETSC_FALSE; in main()
422 …tring("-mesh", "Read mesh from file", NULL, filename, filename, sizeof(filename), &rp->read_mesh)); in main()
423 rp->filename = filename; in main()
424 if (!rp->read_mesh) { in main()
432 NULL, local_nodes, &num_local_nodes, &rp->user_l_nodes)); in main()
436 rp->ksp_max_it_clip[0] = 5; in main()
437 rp->ksp_max_it_clip[1] = 20; in main()
438 …lip", "Min and max number of iterations to use during benchmarking", NULL, rp->ksp_max_it_clip, &t… in main()
457 PetscCall(PetscLogStageRegister("Solve Stage", &rp->solve_stage)); in main()
459 rp->hostname = hostname; in main()
460 rp->dim = dim; in main()
461 rp->mesh_elem = mesh_elem; in main()
462 rp->ranks_per_node = ranks_per_node; in main()
467 rp->degree = deg; in main()
468 rp->local_nodes = n; in main()
469 PetscCall(Run(rp, num_ceed_resources, ceed_resources, num_bp_choices, bp_choices)); in main()
473 PetscCall(PetscFree(rp)); in main()