Recent

Author Topic: My Parallel Sort Library and benchmarks ...  (Read 37044 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3887
  • I like bugs.
Re: My Parallel Sort Library and benchmarks ...
« Reply #30 on: May 12, 2010, 08:22:42 am »
You could have quick help for your installation in #lazarus-ide chat channel. I also will be present there now for ~2 hours.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux.

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: My Parallel Sort Library and benchmarks ...
« Reply #31 on: May 12, 2010, 11:50:08 am »

Hello all, hello JuhaManninen,

I have installed Linux OpenSUSE and i have solved
the problem, you have to add cthreads to the uses
and delete ringbuffer and parallequeuerb.

You can download version 2.12 from my website..

http://pages.videotron.com/aminer/

and don't forget to compile with -dUnix


Amine.









jarto

  • Full Member
  • ***
  • Posts: 106
Re: My Parallel Sort Library and benchmarks ...
« Reply #32 on: May 12, 2010, 11:54:00 am »

Here it is jarto , i have solved the problem, you can
download version 2.11 from my website:

http://pages.videotron.com/aminer/

Please test it  and tell me if all is ok...

This version works well. I could not reproduce the bug any more. I'm still interested in seeing results from you using my test app...

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: My Parallel Sort Library and benchmarks ...
« Reply #33 on: May 12, 2010, 11:57:04 am »

Hello all,

Now, i have tested my Parallel Sort Library with
Windows and Linux and it is working correctly..

Can someone else test it on Mac OSX (x86)... ?



Amine.
 

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: My Parallel Sort Library and benchmarks ...
« Reply #34 on: May 12, 2010, 12:00:12 pm »

Next step i will compile and test my Parallel Compression
Library etc. in Linux...


FreePascal is fun...


Amine.



jarto

  • Full Member
  • ***
  • Posts: 106
Re: My Parallel Sort Library and benchmarks ...
« Reply #35 on: May 12, 2010, 12:04:49 pm »
Some feedback about your uses-lines:

You don't have to add cmem and cthreads to the unit files. They only have to be once in the project and they are in the *.lpr -file. Now you have cmem ParallelSort.pas and ThreadPool.pas, which is completely unnecessary.

SysUtils, Classes, SyncObjs do not need any ifdefs either. They are all available in both Delphi and FPC/Lazarus on all platforms.

This should clean up your code somewhat.

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: My Parallel Sort Library and benchmarks ...
« Reply #36 on: May 12, 2010, 12:15:08 pm »

jarto wrote
>This version works well. I could not reproduce
>the bug any more.

Happy for you.

>I'm still interested in seeing results from you using my test app...


Here is it is with i have tested it with 1 and 2 cores:

With 10 millions it's still ~3x on two cores.


D:\tmp10>parallelsorttest 10000
Cores: 2
10000 names sorted in 00:00:015
Cores: 1
10000 names sorted in 00:00:032


D:\tmp10>parallelsorttest 50000
Cores: 2
50000 names sorted in 00:00:063
Cores: 1
50000 names sorted in 00:00:141


D:\tmp10>parallelsorttest 200000
Cores: 2
200000 names sorted in 00:00:375
Cores: 1
200000 names sorted in 00:00:719


D:\tmp10>parallelsorttest 300000
Cores: 2
300000 names sorted in 00:00:609
Cores: 1
300000 names sorted in 00:01:110


D:\tmp10>diff results-1.txt results-2.txt

D:\tmp10>del results-1.txt

D:\tmp10>del results-2.txt

D:\tmp10>parallelsorttest 5000000
Cores: 2
5000000 names sorted in 00:15:047
Cores: 1
5000000 names sorted in 00:27:688


D:\tmp10>parallelsorttest 10000000
Cores: 2
10000000 names sorted in 00:32:890
Cores: 1
10000000 names sorted in 01:01:797




Amine.


aminer

  • Hero Member
  • *****
  • Posts: 956
Re: My Parallel Sort Library and benchmarks ...
« Reply #37 on: May 12, 2010, 01:21:04 pm »

Hello all,


I have updated Parallel Sort Library to version 2.13

http://pages.videotron.com/aminer/

Inside ParallelSort.pas , i have corrected a
minor memory leak in the following part:

------------------------------------

if rest<>0
then
  begin
    for i:=0 to nbrprocs-1 do TParams(arr1).free;
  end
else
  begin
   for i:=0 to nbrprocs-1 do TParams(arr1).free;
  end;

-----------------------------------


I have changed it to


------------------------------------

if rest<>0
then
  begin
    for i:=0 to nbrprocs do TParams(arr1).free;
  end
else
  begin
   for i:=0 to nbrprocs-1 do TParams(arr1).free;
  end;

-----------------------------------




Sincerely,
Amine.





gymgoal

  • New Member
  • *
  • Posts: 15
    • http://www.gymgoal.com
Re: My Parallel Sort Library and benchmarks ...
« Reply #38 on: May 17, 2010, 11:18:39 pm »
Here is it is with i have tested it with 1 and 2 cores:

With 10 millions it's still ~3x on two cores.

...

D:\tmp10>parallelsorttest 10000000
Cores: 2
10000000 names sorted in 00:32:890
Cores: 1
10000000 names sorted in 01:01:797

Are you saying that 01:01:797 is 3x of 00:32:890?

Lazlover

  • Newbie
  • Posts: 2
Re: My Parallel Sort Library and benchmarks ...
« Reply #39 on: May 20, 2010, 12:17:56 am »

Are you saying that 01:01:797 is 3x of 00:32:890?
Nice catch..  ;)

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: My Parallel Sort Library and benchmarks ...
« Reply #40 on: November 15, 2010, 04:11:56 pm »
All I can say is; O:-)
Thank you very much  :D

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: My Parallel Sort Library and benchmarks ...
« Reply #41 on: November 18, 2010, 02:29:11 pm »

xenablaise wrote:
>All I can say is;
>Thank you very much 

Thank you...

And as you have noticed it's very easy to work
with my Parallel Sort Library...

Long life to FreePascal !

You are welcome:

http://pages.videotron.com/aminer/


Sincerely,
Amine Moulay Ramadne.


xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: My Parallel Sort Library and benchmarks ...
« Reply #42 on: November 19, 2010, 03:35:10 pm »
aminer;

I'm a delphi/lazarus newbie, all I know are basic programming in delphi/lazarus, basic file handling, basic multi-threading, basic database development, basics.  But I'm learning each day, repeating task.

To tell you frankly, I don't know how to use your units, only your samples/demos/links made me convinced that your a delphi/lazarus genius.

And I'm keeping this post in my favorites.

To let you know, I'm glad participating on this post.

I hope you can help me if I apply your paralleled ideas to my app [in-case] if I want a speed up.   PM would be better.

thank you :D

 

TinyPortal © 2005-2018