![]() |
|
|
#12 | ||
|
Oct 2008
2×7 Posts |
Hello Jasonp.
i read your matrix file again, everything is right. when i read your code, in function: Quote:
Quote:
Ah, when i use your matrix file and multiple it to random vector X, it took about 0.1 seconds I'm programming to parallel matrix vector multiplication above, but i think time is too small. I'm right? if i wrong, could you show me what wrong i did?. |
||
|
|
|
|
|
#13 |
|
Tribal Bullet
Oct 2004
67258 Posts |
The number of nonzero elements in a given matrix row is highly variable; the most dense rows, corresponding to the smallest primes, are essentially completely dense. In that case you should not store one nonzero entry per 32-bit word like in the rest of the matrix, but should use packing to save memory. Every matrix column has num_dense_rows additional elements, stored one per bit and starting after the array of sparse nonzeros.
When you do a matrix multiply, the dense part of the matrix has to participate in the multiply as well. You do that by picking one bit at a time out of the num_dense_rows available, and if the bit is 1 then you XOR the corresponding word out of x[] into the word at position 'bit' of b[]. The code checks if num_dense_rows is 0 because the QS code in msieve might only generate a small matrix, which does not need its densest rows packed. You are correct that this is probably not a good example to attempt to run in parallel, but if you want a larger matrix and nobody sends you one, then you will have to generate it yourself. Also, if you let the Lanczos code call mul_packed instead of mul_unpacked, this matrix will get solved in literally half the time. I'm sorry that the code is very complex, but the complexity is unavoidable when solving real problems as fast as possible. Finally, if you want to paste code into a forum post, put 'code' tags around it to preserve the indenting. Last fiddled with by jasonp on 2009-01-04 at 16:00 |
|
|
|
|
|
#14 | |
|
Oct 2008
2·7 Posts |
Yeah, thanks Jasonp. I see what is num_dense_rows
i read two function: mul_packed() and mul_unpacked() In mul_packed, you program with multithread, and split matrix into block ( on each threads : size's block = size's cache2). It is complex, but i will try reading it. Not easy! When i program parallel matrix vector multiplication, i learnt your idea about multithread, and i'm working to convert it run on multicomputer. So, when i read your code, if i don't understand code, i will post it on here. I hope you will continue helping me. ![]() About matrix file, i will try finding who can send me a bigger matrix. Because, at this moment i don't know how to generate a matrix file. I will learn how to generate a matrix file, early. Quote:
|
|
|
|
|
|
|
#15 |
|
Tribal Bullet
Oct 2004
3,541 Posts |
The easiest way to generate your own matrix is to learn how GGNFS works and factor a small number, then use msieve for the postprocessing. Starting the msieve linear algebra will produce a matrix file on disk that you already know how to read.
Another possibility is to randomly generate matrix columns with the same statistical distribution of nonzero entries that you see in a real matrix. |
|
|
|
|
|
#16 | |
|
Jul 2003
So Cal
2·34·13 Posts |
Quote:
Greg |
|
|
|
|
|
|
#17 |
|
Oct 2008
168 Posts |
Hello Jasonp.
I will try learning how GGNFS works and factor a small number, then i will have a matrix file that i need. I generated randomly a matrix file, too. But it is not real, so i don't know matrix that i generated is for what number. ![]() Hello frmky. You are right, i got your 1.6M x 1.6M matrix and i need a bigger matrix. Maybe, i will ask for your help. My english is not good, if my post is impolite for everybody, please don't care. My idea is not bad or impolite. I will try carefully. Thank you everybody for helping me. Last fiddled with by Greenk12 on 2009-01-05 at 01:58 |
|
|
|
|
|
#18 |
|
Nov 2008
2·33·43 Posts |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| P-1 File Name Bug | NBtarheel_33 | Software | 2 | 2010-06-06 08:29 |
| Msieve: deleted the log file | Zeta-Flux | Factoring | 4 | 2010-04-20 08:27 |
| Dat File? | Xentar | Sierpinski/Riesel Base 5 | 10 | 2008-06-23 02:09 |
| FILE vs. MDB | HiddenWarrior | Software | 1 | 2004-02-19 04:38 |
| How to change Pxxxx.001 file to Pxxxx file? | edorajh | Software | 3 | 2003-12-31 12:30 |