[petsc-users] is it possible to gather a distributed matrix to a subset of processors?
Barry Smith
bsmith at mcs.anl.gov
Fri Mar 6 19:30:46 CST 2015
MatCreateRedundantMatrix()
Or you can use PCREDUNDANT -pc_type redundant see the manual page that automatically handles the gather of the matrix onto the smaller number of processes and setting up and solving the system.
For example see the rules in src/ksp/ksp/examples/tutorials/makefile (there is nothing special about MUMPS it can be done with SuperLU_Dist and even iterative solvers).
NSUBCOMM = 8 7 6 5 4 3 2 1
runex10_mumps_redundant:
- at touch ex10_mumps_redundant.tmp
- at for nsubcomm in ${NSUBCOMM}; do \
${MPIEXEC} -n 8 ./ex10 -f0 ${DATAFILESPATH}/matrices/medium -ksp_type preonly -pc_type redundant -pc_redundant_number $$nsubcomm -redundant_pc_factor_mat_solver_package mumps -num_numfac 2 -num_rhs 2 >> ex10_mumps_redundant.tmp 2>&1; \
done;
- at if (${DIFF} output/ex10_mumps_redundant.out ex10_mumps_redundant.tmp) then true; \
else printf "${PWD}\nPossible problem with ex10_mumps_redundant, diffs above\n=========================================\n"; fi; \
${RM} -f ex10_mumps_redundant.tmp;
Barry
> On Mar 6, 2015, at 7:13 PM, Fande Kong <fdkong.jd at gmail.com> wrote:
>
> Hi all,
>
> I want to solve a coarse problem on a subset of processors, but the matrix already has been distributed across all processors. The coarse problem is not small enough to solve using a single core. I want to solve this coarse problem using superLU on a small number of processors. Is it possible to gather a distributed matrix to a subset of processors?
>
> Thanks,
>
> Fande,
More information about the petsc-users
mailing list