mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2009-01-04, 15:34   #12
Greenk12
 
Oct 2008

1410 Posts
Default

Hello Jasonp.

i read your matrix file again, everything is right.

when i read your code, in function:
Quote:
static void mul_unpacked(packed_matrix_t *matrix,
uint64 *x, uint64 *b)
it has:

Quote:
if (num_dense_rows)
{
for (i = 0; i < ncols; i++) {
la_col_t *col = A + i;
uint32 *row_entries = col->data + col->weight;
uint64 tmp = x[i];

for (j = 0; j < num_dense_rows; j++) {
if (row_entries[j / 32] &
((uint32)1 << (j % 32))) -->
I don't understand this{
b[j] ^= tmp;
}
}
}
}
I don't understand variable num_dense_rows in your matrix file, when you use matrix vector multiplication, you check variable num_dense_rows and multiple to vector b product. (what is your idea?).

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?.
Greenk12 is offline   Reply With Quote
Old 2009-01-04, 15:58   #13
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

354110 Posts
Default

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
jasonp is offline   Reply With Quote
Old 2009-01-04, 16:52   #14
Greenk12
 
Oct 2008

2·7 Posts
Default

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:
Originally Posted by Jasonp
Finally, if you want to paste code into a forum post, put 'code' tags around it to preserve the indenting.
i will be careful in next post. Thank you.
Greenk12 is offline   Reply With Quote
Old 2009-01-04, 19:17   #15
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

354110 Posts
Default

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.
jasonp is offline   Reply With Quote
Old 2009-01-04, 20:43   #16
frmky
 
frmky's Avatar
 
Jul 2003
So Cal

2·34·13 Posts
Default

Quote:
Originally Posted by Greenk12 View Post
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.
Are you wanting one bigger than the 1.6M x 1.6M matrix you picked up from me? I probably have a ~2M x 2M lying around, but after that it probably jumps to ~7M x 7M since I often don't save the small ones.

Greg
frmky is offline   Reply With Quote
Old 2009-01-05, 01:54   #17
Greenk12
 
Oct 2008

2·7 Posts
Default

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
Greenk12 is offline   Reply With Quote
Old 2009-01-05, 08:28   #18
10metreh
 
10metreh's Avatar
 
Nov 2008

91216 Posts
Default

Quote:
Originally Posted by Greenk12 View Post
I will try learning how GGNFS works.
Check out the "Running GGNFS" thread.
10metreh is offline   Reply With Quote
Reply

Thread Tools


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

All times are UTC. The time now is 01:31.


Sat Jul 17 01:31:29 UTC 2021 up 49 days, 23:18, 1 user, load averages: 1.72, 1.37, 1.26

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.