Dear PETSc Developers, I have an MPIAIJ matrix, I want to use MatPartitioning functions to repartition the matrix. Before doing this, I need to do MatCreateMPIAdj to generate an Adj Mat. Could you give me some hints about how to get "i" and "j" ( http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMPI...) from existing MPIAIJ matrix? Thank you very much, Yujie
On Mon, Feb 20, 2012 at 16:18, recrusader <[email protected]> wrote:
Dear PETSc Developers,
I have an MPIAIJ matrix, I want to use MatPartitioning functions to repartition the matrix. Before doing this, I need to do MatCreateMPIAdj to generate an Adj Mat. Could you give me some hints about how to get "i" and "j" ( http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMPI...) from existing MPIAIJ matrix?
MatConvert(), though some of the partitioning routines can do the conversion transparently on their own.
Dear Jed, Thank you very much for your prompt reply. Actually, I want to reorder MPIAIJ matrix using Parmetis. The reordering function needs the same information with the partitioning, that is "i" and "j". I need to directly get them and then use the function in Parmetis. Thanks a lot, Yujie On Mon, Feb 20, 2012 at 4:20 PM, Jed Brown <[email protected]> wrote:
On Mon, Feb 20, 2012 at 16:18, recrusader <[email protected]> wrote:
Dear PETSc Developers,
I have an MPIAIJ matrix, I want to use MatPartitioning functions to repartition the matrix. Before doing this, I need to do MatCreateMPIAdj to generate an Adj Mat. Could you give me some hints about how to get "i" and "j" ( http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMPI...) from existing MPIAIJ matrix?
MatConvert(), though some of the partitioning routines can do the conversion transparently on their own.
On Mon, Feb 20, 2012 at 16:27, recrusader <[email protected]> wrote:
Thank you very much for your prompt reply. Actually, I want to reorder MPIAIJ matrix using Parmetis. The reordering function needs the same information with the partitioning, that is "i" and "j".
Are you just redistributing the matrix? Or other data?
I need to directly get them and then use the function in Parmetis.
MatConvert()
Dear Jed, It is not only redistribute the matrix. I want to get the reorder information and use matpermute to reorder the matrix. Thanks Yujie On Feb 20, 2012, at 4:31 PM, Jed Brown <[email protected]> wrote:
On Mon, Feb 20, 2012 at 16:27, recrusader <[email protected]> wrote: Thank you very much for your prompt reply. Actually, I want to reorder MPIAIJ matrix using Parmetis. The reordering function needs the same information with the partitioning, that is "i" and "j".
Are you just redistributing the matrix? Or other data?
I need to directly get them and then use the function in Parmetis.
MatConvert()
On Mon, Feb 20, 2012 at 16:45, Recrusader <[email protected]> wrote:
It is not only redistribute the matrix. I want to get the reorder information and use matpermute to reorder the matrix.
MatConvert(). ISPartitioningToNumbering() might also be useful for you.
Dear Jed, I am taking a look at ex15 ( http://www.mcs.anl.gov/petsc/petsc-current/src/mat/examples/tutorials/ex15.c... ). I am very confused with this. In Section 3.5 Partitioning of the manual, one special Mat, that is 'adj', need to be established. However, in ex15, the common matrix is created. Does the matrix automatically contain the connection information? Thanks a lot, Yujie On Mon, Feb 20, 2012 at 4:45 PM, Jed Brown <[email protected]> wrote:
On Mon, Feb 20, 2012 at 16:45, Recrusader <[email protected]> wrote:
It is not only redistribute the matrix. I want to get the reorder information and use matpermute to reorder the matrix.
MatConvert().
ISPartitioningToNumbering() might also be useful for you.
On Mon, Feb 20, 2012 at 20:09, recrusader <[email protected]> wrote:
I am taking a look at ex15 ( http://www.mcs.anl.gov/petsc/petsc-current/src/mat/examples/tutorials/ex15.c... ). I am very confused with this. In Section 3.5 Partitioning of the manual, one special Mat, that is 'adj', need to be established. However, in ex15, the common matrix is created. Does the matrix automatically contain the connection information?
Most (perhaps all?) of the partitioning implementations work with normal AIJ matrices. Internally, they usually have to convert to the MPIAdj because that is the interface to ParMETIS and others. Your code doesn't have to think about it.
What types of AIJ matrices can directly use partitioning implementation? The matrix I am using doesn't work? I have to use ParMETIS since it can provide fill-reducing matrix ordering.
From my understanding, MatConvert can only reorder the matrix and doesn't provide the reordering information.
Thanks, Yujie On Mon, Feb 20, 2012 at 8:13 PM, Jed Brown <[email protected]> wrote:
On Mon, Feb 20, 2012 at 20:09, recrusader <[email protected]> wrote:
I am taking a look at ex15 ( http://www.mcs.anl.gov/petsc/petsc-current/src/mat/examples/tutorials/ex15.c... ). I am very confused with this. In Section 3.5 Partitioning of the manual, one special Mat, that is 'adj', need to be established. However, in ex15, the common matrix is created. Does the matrix automatically contain the connection information?
Most (perhaps all?) of the partitioning implementations work with normal AIJ matrices. Internally, they usually have to convert to the MPIAdj because that is the interface to ParMETIS and others. Your code doesn't have to think about it.
On Mon, Feb 20, 2012 at 20:22, recrusader <[email protected]> wrote:
What types of AIJ matrices can directly use partitioning implementation? The matrix I am using doesn't work? I have to use ParMETIS since it can provide fill-reducing matrix ordering. From my understanding, MatConvert can only reorder the matrix and doesn't provide the reordering information.
We've exchanged a lot of emails now, but I'm still having trouble extracting context from your confusion. You can 1. Make a normal matrix (e.g. AIJ), create a MatPartitioning object and call MatPartitioningApply(). 2. Create an MPIAdj matrix (perhaps by creating an AIJ matrix and using MatConvert()), then use either MatPartitioning or (if you insist) calling ParMETIS directly (you'll write the same code as is in src/mat/partition/impls/pmetis/pmetis.c).
I am sorry for these emails. I will further try them. Thanks a lot. Best, Yujie On Mon, Feb 20, 2012 at 8:26 PM, Jed Brown <[email protected]> wrote:
On Mon, Feb 20, 2012 at 20:22, recrusader <[email protected]> wrote:
What types of AIJ matrices can directly use partitioning implementation? The matrix I am using doesn't work? I have to use ParMETIS since it can provide fill-reducing matrix ordering. From my understanding, MatConvert can only reorder the matrix and doesn't provide the reordering information.
We've exchanged a lot of emails now, but I'm still having trouble extracting context from your confusion. You can
1. Make a normal matrix (e.g. AIJ), create a MatPartitioning object and call MatPartitioningApply().
2. Create an MPIAdj matrix (perhaps by creating an AIJ matrix and using MatConvert()), then use either MatPartitioning or (if you insist) calling ParMETIS directly (you'll write the same code as is in src/mat/partition/impls/pmetis/pmetis.c).
participants (3)
-
Jed Brown -
recrusader -
Recrusader