Thank you Matt<br><br> It seems a god idea I 'll try it. <br><br>Waad<br><br><b><i>Matthew Knepley <knepley@gmail.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Tue, May 20, 2008 at 7:15 PM, Waad Subber <w_subber@yahoo.com> wrote:<br>> Thank you Matt and Barry,<br>><br>> The system I am trying to solve is the interface problem in iterative<br>> substructuring DDM. Where A_i represents [R_i^T*S_i*R_i] and f_i is<br>> [R_i^T*g_i].<br>><br>> Each process constructs the local Schur complement matrix (S_i) , the<br>> restriction matrix(R_i) as SeqAIJ and the RHS vector (g_i) as a sequential<br>> vector.<br>><br>> Now having the Schur complement matrix for each subdomain, I need to solve<br>> the interface problem (Sum[R_i^T*S_i*R_i])u=Sum[R_i^T*g_i], .. i=1.. to No.<br>> of process (subdomains) in parallel.<br><br>Barry knows much more than me
about substructuring, however:<br>You could form this matrix in parallel, but I thought that involved significant<br>communication. I would think that an unassembled form would be better.<br>To do this you would<br><br> 1) Construct the VecScatter from the set of local vectors to the global vector<br><br> 2) Create a MatShell and put the VecScatter in the user context<br><br> 3) For MatMult(), you would<br><br> a) Scatter the input vector into the local copies<br><br> b) Do each local MatMult()<br><br> c) Scatter the result back to the output vector<br><br>Some work, but not that complicated.<br><br> Matt<br><br>> For the global vector I construct one MPI vector and use VecGetArray () for<br>> each of the sequential vector then use VecSetValues () to add the values<br>> into the global MPI vector. That works fine.<br>><br>> However for the global schur complement matix I try the same idea by<br>> creating one parallel MPIAIJ matrix and
using MatGetArray( ) and<br>> MatSetValues () in order to add the values to the global matrix.<br>> MatGetArray( ) gives me only the values without indices, so I don't know how<br>> to add these valuse to the global MPI matrix.<br>><br>> Thanks agin<br>><br>> Waad<br>><br>> Barry Smith <bsmith@mcs.anl.gov> wrote:<br>><br>> On May 20, 2008, at 3:16 PM, Waad Subber wrote:<br>><br>>> Thank you Matt,<br>>><br>>> Any suggestion to solve the problem I am trying to tackle. I want to<br>>> solve a linear system:<br>>><br>>> Sum(A_i) u= Sum(f_i) , i=1.... to No. of CPUs.<br>>><br>>> Where A_i is a sparse sequential matrix and f_i is a sequential<br>>> vector. Each CPU has one matrix and one vector of the same size. Now<br>>> I want to sum up and solve the system in parallel.<br>><br>> Does each A_i have nonzero entries (mostly) associated with one<br>> part of the matrix? Or
does each process have values<br>> scattered all around the matrix?<br>><br>> In the former case you should simply create one parallel MPIAIJ<br>> matrix and call MatSetValues() to put the values<br>> into it. We don't have any kind of support for the later case, perhaps<br>> if you describe how the matrix entries come about someone<br>> would have suggestions on how to proceed.<br>><br>> Barry<br>><br>>><br>>><br>>> Thanks again<br>>><br>>> Waad<br>>><br>>> Matthew Knepley wrote: On Tue, May 20, 2008 at<br>>> 2:12 PM, Waad Subber wrote:<br>>> > Hi,<br>>> ><br>>> > I am trying to construct a sparse parallel matrix (MPIAIJ) by<br>>> adding up<br>>> > sparse sequential matrices (SeqAIJ) from each CPU. I am using<br>>> ><br>>> > MatMerge_SeqsToMPI(MPI_Comm comm,Mat seqmat,PetscInt m,PetscInt<br>>> n,MatReuse<br>>> > scall,Mat
*mpimat)<br>>> ><br>>> > to do that. However, when I compile the code I get the following<br>>> ><br>>> > undefined reference to `matmerge_seqstompi_'<br>>> > collect2: ld returned 1 exit status<br>>> > make: *** [all] Error 1<br>>> ><br>>> > Am I using this function correctly ?<br>>><br>>> These have no Fortran bindings right now.<br>>><br>>> Matt<br>>><br>>> > Thanks<br>>> ><br>>> > Waad<br>>> ><br>>><br>>><br>>><br>>> --<br>>> What most experimenters take for granted before they begin their<br>>> experiments is infinitely more interesting than any results to which<br>>> their experiments lead.<br>>> -- Norbert Wiener<br>>><br>>><br>>><br>><br>><br>><br><br><br><br>-- <br>What most experimenters take for granted before they begin their<br>experiments is
infinitely more interesting than any results to which<br>their experiments lead.<br>-- Norbert Wiener<br><br></bsmith@mcs.anl.gov></w_subber@yahoo.com></blockquote><br><p>