示例#1
0
void umf4sol (Int *sys, double x [ ], double b [ ], void **Numeric,
    double Control [UMFPACK_CONTROL], double Info [UMFPACK_INFO])
{
    Control [UMFPACK_IRSTEP] = 0 ;
    (void) UMFPACK_solve (*sys, (Int *) NULL, (Int *) NULL, (double *) NULL,
	x, b, *Numeric, Control, Info) ;
}
示例#2
0
void MergedSolver::solve(double* local_x, const double* local_b)
{
    const index_t rank = mpi_info->rank;
    const dim_t count = counts[rank];

#ifdef ESYS_MPI
    MPI_Gatherv(const_cast<double*>(local_b), count, MPI_DOUBLE, b, counts,
                offset, MPI_DOUBLE, 0, mpi_info->comm);
#else
#pragma omp parallel for
    for (dim_t i=0; i<count; i++) {
        b[i] = local_b[i];
        x[i] = local_x[i];
    }
#endif
    if (rank == 0) {
        switch (A->solver_package) {
            case PASO_MKL:
                MKL_solve(A, x, b, reordering, refinements, verbose);
                break;
            case PASO_UMFPACK:
                UMFPACK_solve(A, x, b, refinements, verbose);
                break;
            case PASO_SMOOTHER:
                Preconditioner_LocalSmoother_solve(A, reinterpret_cast<Preconditioner_LocalSmoother*>(A->solver_p), x, b, sweeps, false);
                break;
        }
    }
#ifdef ESYS_MPI
    // now we need to distribute the solution to all ranks
    MPI_Scatterv(x, counts, offset, MPI_DOUBLE, local_x, count, MPI_DOUBLE,
                 0, mpi_info->comm);
#else
#pragma omp parallel for
    for (dim_t i=0; i<count; i++)
        local_x[i] = x[i];
#endif
}
示例#3
0
void umf4solr (Int *sys, Int Ap [ ], Int Ai [ ], double Ax [ ],
    double x [ ], double b [ ], void **Numeric,
    double Control [UMFPACK_CONTROL], double Info [UMFPACK_INFO])
{
    (void) UMFPACK_solve (*sys, Ap, Ai, Ax, x, b, *Numeric, Control, Info) ;
}