Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   OPR-computation-related linear algebra problem (http://www.chiefdelphi.com/forums/showthread.php?t=117072)

Nikhil Bajaj 31-05-2013 09:22

Re: OPR-computation-related linear algebra problem
 
I can check after work in the lab this evening if no one gets to it first, Ether!

Foster 31-05-2013 10:30

Re: OPR-computation-related linear algebra problem
 
Quote:

Originally Posted by RyanCahoon (Post 1277890)
I tried reversing the indices and it took 59.1 (vs 11.9) seconds. A couple other websites say Pascal is row-major.

Long, long ago I was the support for a Pascal compiler that ran on the Unisys A-Series. That compiler did Row major, since that was the underlying architecture of a stack machine. A 2D array consisted of an array of pointers, each pointer referencing a row. Once you got the row, it was fast to "walk the row" since the elements were contiguous in memory.

Walking the matrix in col order caused two memory accesses per read, one for the pointer (and the time to do the reference fetch) and the read of the data elements. You could see a -10x reduction in speed doing column order vs row order. -- Thanks for the "back when" reminder.

Ether: Just for grins, I tried RLab on our 16 way cluster. For some reason I'm not getting responses to tic()/toc(); What Windows OS are you running RLab under?

Ether 31-05-2013 10:57

Re: OPR-computation-related linear algebra problem
 
Quote:

Originally Posted by Foster (Post 1277971)
Ether: Just for grins, I tried RLab on our 16 way cluster. For some reason I'm not getting responses to tic()/toc(); What Windows OS are you running RLab under?

32-bit XP Pro SP3 on a Pentium D 3.4GHz

Don't forget to leave the semi-colon off the toc() if you want it to display.

Here's the code:
Code:

diary("output.txt");

tic();
d=readm("d.dat");
toc()


tic();
N=readm("N.dat");
toc()


tic();
x = solve(N,d,"S");
toc()


Here's the output.txt file:
Code:

// RLaB diary file: output.txt. Opened Fri May 31 10:53:02 2013


tic();
d=readm("d.dat");
toc()
        0 


tic();
N=readm("N.dat");
toc()
      3.8 


tic();
x = solve(N,d,"S");
toc()
    14.5

If you run it interactively, by cutting-and-pasting the code directly into the RLaB window (or by typing the commands at the RLaB prompt one at a time), here's the output that will display on the screen:

Code:

Welcome to RLaB. New users type `help INTRO'
RLaB version 2.1.05 Copyright (C) 1992-97 Ian Searle
RLaB comes with ABSOLUTELY NO WARRANTY; for details type `help warranty'
This is free software, and you are welcome to redistribute it under
certain conditions; type `help conditions' for details
>
> tic();
> d=readm("d.dat");
> toc()
        0
>
>
> tic();
> N=readm("N.dat");
> toc()
    3.67
>
>
> tic();
> x = solve(N,d,"S");
> toc()
    14.4
>



Ether 31-05-2013 10:59

Re: OPR-computation-related linear algebra problem
 
Quote:

Originally Posted by Nikhil Bajaj (Post 1277967)
I can check after work in the lab this evening if no one gets to it first, Ether!

Thank you.



Foster 31-05-2013 14:46

Re: OPR-computation-related linear algebra problem
 
Code:

Welcome to RLaB. New users type `help INTRO'
RLaB version 2.1.05 Copyright (C) 1992-97 Ian Searle
RLaB comes with ABSOLUTELY NO WARRANTY; for details type `help warranty'
This is free software, and you are welcome to redistribute it under
certain conditions; type `help conditions' for details
> tic();
> d=readm("d.dat");
> toc()
    21.9
> tic();
> N=readm("N.dat");
> toc()
    28.8
> tic();
> x = solve(N,d,"S");
> toc()
    34.8
>

And right, if you do toc(); you don't get the output. Which isn't wasn't what I expected.

Xeon 2.93 Ghz cluster. But this code may not be doing any multithreading.

Joe Ross 21-06-2013 15:10

Re: OPR-computation-related linear algebra problem
 
I just got a new computer at work with a Xeon E5-1620 and a Quadro 4000 GPU (256 CUDA cores). Using Matlab 2012b:

CPU Invert and Multiply: 1.4292s
CPU Linear Solver: 0.22521s
CPU Sparse Linear Solver: 0.034423s

GPU Invert and Multiply: 0.537926s
GPU Linear Solver: 0.218403s

Loading the N matrix into the GPU was 1.890602s.
Creating the Sparse Matrix for N was 0.032979s.


All times are GMT -5. The time now is 07:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi