<div dir="ltr">On Wed, May 29, 2013 at 6:43 AM, Joon hee Choi <span dir="ltr"><<a href="mailto:choi240@purdue.edu" target="_blank">choi240@purdue.edu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
I am trying to compute the multiplication of large matrices using petsc. First,<br>
<br>
I=2.6*10^7, J=4.8*10^7.<br>
The matrix X is as follows: size of I*(I*J), block size of I, and non-zeros of 1.4*10^8.<br>
-> X=[X1 X2 ...]<br>
The matrix B is as follows: size of I*1, and dense.<br>
The matrix M is as follows: size of I*J. M is the multiplication of each block of the matrix X and the matrix B.<br>
-> M=[X1*B X2*B ...]<br>
<br>
I have to get the matrix M, given X and B. I successfully set up very large aij matrix X. However, I don't know what I have to do next. I tried two ways, but I failed.<br>
<br>
First, I tried to get each block X1, X2,... using ISCreate and MatGetLocalSubMatrix, compute X1*B, X2*B,... using MatMatMult, and then set up the matrix M using ISLocalToGlobalMappingCreate and MatSetLocalToGlobalMapping. However, I got "No support for this operation for this object type" error. Also, this code was very slow because of 48 million loops.<br>
</blockquote><div><br></div><div style>Look, we have rules on this list. Without them, we cannot help you. You MUST send the ENTIRE error output.</div><div style>Without that, we are just guessing.</div><div style><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Second, I tried to set up the new matrix BB from B. The matrix BB has the size of (I*J)*J and the block size of I*1. And every diagonal block of BB is B and all other blocks are 0 matrices. That is,<br>
<br>
     | B 0 0 .. 0 |<br>
BB = | 0 B 0 .. 0 |<br>
     | ...        |<br>
     | 0 0 0 .. B |<br>
<br>
This is not a block diagonal matrix because B is not square. Anyway, if I set up BB, I can get M easily because M=X*BB. However, I got "out of memory" error from MatCreateSeqAIJ. I think this is because BB has non-zeros of I*J=10^15.<br>
</blockquote><div><br></div><div style>If you get an Out Of Memory error (which we need to see), it means that you are out of memory.</div><div style><br></div><div style>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I never have any other ideas. If someone can fix my wrong ways correctly or has new ideas, then please please let me know. Thank you very much.<br>
<span class="HOEnZb"><font color="#888888"><br>
Joon<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>