Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Start my first C++/inline assembler project to run on cluster server

andyngandyng Member Posts: 1
[b][red]This message was edited by andyng at 2004-8-13 1:19:12[/red][/b][hr]
[b][red]This message was edited by andyng at 2004-8-13 0:56:11[/red][/b][hr]
Hi everyone,
I just registered here to read answers to learn things i need to do my work. Hope that my first post being a question does not violate any rule here.

I been working on a research problem. i have coded it in java and c++. Both are running fine but not as fast. My C++ program calculates millions of int arrays...that could take days to find the answer. I have this program running on a cluster server of 60 p4 2.6Ghz computers for several days now but it's not as fast as we hope.
In my quest to make it faster, I know i have to do it in assembler.

I should be able to pick up the books and do it quickly but being new at this i think i should swallow my pride and ask for anyone here to give me a jumpstart point.

Here is the algorithm to do it in assembler.

This code will be inserted into the C++ program. The program will call the assembler function and provide it with int h, int k and int array A of the form A = {A0 A1 A2....Ak }

for exp, A = { 0 1 2 4 } h =2 and k = 3
The assembler function will create a bit string B(r) of the length r.Ak with 1<=r<=h

In B(r), bit x =1 if x is a value of A
For example B(1) has length 1.A3=1.4= 4.B(1) start at bit 0, bit 1 and so on
B(1) = 1 1 1 0 1 because bit 0,1,2,4 =1 (0,1,2,4 are value of A) but bit 3 =0 because 3 is not a value of A
We will then shift the B(1) to the right 0,1,2,4 time. This will look like this

B(1) = 1 1 1 0 1
0 1 1 1 0 1 shift to the right 1 bit
0 0 1 1 1 0 1 shift to the right 2 bit
0 0 0 0 1 1 1 0 1 shift to the right 4 bit
Result 1 1 1 1 1 1 1 0 1

We got the result by OR operation all of those bit string column by column. We now scan result bit string from left to right....we will stop at first 0 bit...in this case will stop at bit 7

This little piece of info i think is enough to get started...i will ask more .Thanks everyone.





Sign In or Register to comment.