Recent

Author Topic: efficiency problem  (Read 43668 times)

photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #60 on: March 31, 2015, 04:33:59 pm »
I have tested your code. Compiling is ok, but when running it gives an error message "libgfortran-3.dll not found", why?

You need to download mingw32_dll.zip (or mingw64_dll.zip) from that same link.
Of course I have mingw64.dll, otherwise there would be an error message "mingw64.dll not found" before the libgfortran-3.dll one.

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: efficiency problem
« Reply #61 on: March 31, 2015, 04:45:49 pm »
Of course I have mingw64.dll, otherwise there would be an error message "mingw64.dll not found"

Yes, sure. You *might* have mingw64.dll alone. The link provides libgfortran-3.dll, libgcc_s_seh-1.dll, and libquadmath-0.dll which you need to put in the same directory (or path) with your exe file. So yes, you need to download mingw64_dll.zip and expand it and put the files visible to your application.

Nitorami

  • Sr. Member
  • ****
  • Posts: 496
Re: efficiency problem
« Reply #62 on: March 31, 2015, 04:47:17 pm »
The dlls are loaded at runtime, and need to be found by the operating system. Put them in the search path, or in the same folder as the exe file.

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: efficiency problem
« Reply #63 on: March 31, 2015, 08:10:58 pm »
I have not followed him in a while but you should check into the stuff "aminer" offers.  I believe I saw he offered a multi threaded matrix multiply a while ago were the times were almost 50 times faster than a single thread.
I have checked aminer's stuff, but it has gone.
here is a post for his demo for matrix back in 2013
http://forum.lazarus.freepascal.org/index.php/topic,23009.msg136762.html#msg136762
he still has the code on his web site at
http://pages.videotron.com/aminer/
were he says he worked off a math library from "mrsoft" @
http://www.mrsoft.org/home/index.html
hope that helps
« Last Edit: March 31, 2015, 08:13:28 pm by mas steindorff »
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #64 on: April 04, 2015, 04:31:32 am »
Of course I have mingw64.dll, otherwise there would be an error message "mingw64.dll not found"

Yes, sure. You *might* have mingw64.dll alone. The link provides libgfortran-3.dll, libgcc_s_seh-1.dll, and libquadmath-0.dll which you need to put in the same directory (or path) with your exe file. So yes, you need to download mingw64_dll.zip and expand it and put the files visible to your application.
Thanks. Following your instruction, I downloaded mingw64_dll.zip and obtained all the dll files needed. This time the test program compiled and run, but finally raised an exeption class "External: SIGSEGV". Has anybody successfully tested this in the 64bit case?

photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #65 on: April 04, 2015, 04:39:12 am »
I have not followed him in a while but you should check into the stuff "aminer" offers.  I believe I saw he offered a multi threaded matrix multiply a while ago were the times were almost 50 times faster than a single thread.
I have checked aminer's stuff, but it has gone.
here is a post for his demo for matrix back in 2013
http://forum.lazarus.freepascal.org/index.php/topic,23009.msg136762.html#msg136762
he still has the code on his web site at
http://pages.videotron.com/aminer/
were he says he worked off a math library from "mrsoft" @
http://www.mrsoft.org/home/index.html
hope that helps
I have checked all of these. The download links on his website are all redirected to a docs.google.com site, and returned a "not found" message eventually.

Nitorami

  • Sr. Member
  • ****
  • Posts: 496
Re: efficiency problem
« Reply #66 on: April 04, 2015, 10:40:06 am »
Yes, I had the same issue with aminers files. But having a single core CPU only, his major approach of splitting up tasks into threads ("workers") won't be a benefit for me anyway.

I have not tried the 64bit version because I already thought this might be a step too far and would cause problems, most likely with passing the parameters. Even in a 32bit environment, it took me a while to translate the C expectations into Pascal syntax, using constref and var as required, and I receives many sigsevs before I got it right.
In the 64bit version, the parameters will yet be passed differently, in different registers and what not. It may be easier with the 64bit FPC cross compiler, which is available but without IDE; to work with an IDE, you will have to make an own built in the first place. My advice is - the 32bit version spares you a lot of hassle, and you will not get a factor 2 improvement from using 64bit anyway.


photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #67 on: April 05, 2015, 03:36:06 pm »
Yes, I had the same issue with aminers files. But having a single core CPU only, his major approach of splitting up tasks into threads ("workers") won't be a benefit for me anyway.

I have not tried the 64bit version because I already thought this might be a step too far and would cause problems, most likely with passing the parameters. Even in a 32bit environment, it took me a while to translate the C expectations into Pascal syntax, using constref and var as required, and I receives many sigsevs before I got it right.
In the 64bit version, the parameters will yet be passed differently, in different registers and what not. It may be easier with the 64bit FPC cross compiler, which is available but without IDE; to work with an IDE, you will have to make an own built in the first place. My advice is - the 32bit version spares you a lot of hassle, and you will not get a factor 2 improvement from using 64bit anyway.
But where can I download the 64bit FPC cross compiler?

Nitorami

  • Sr. Member
  • ****
  • Posts: 496
Re: efficiency problem
« Reply #68 on: April 05, 2015, 04:32:28 pm »
http://www.freepascal.org/download.var

But if you do not absolutely need it, better stay with the standard 32 bit version !!!
« Last Edit: April 05, 2015, 04:42:25 pm by Nitorami »

photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #69 on: April 05, 2015, 04:41:38 pm »
http://www.freepascal.org/download.var
Thanks. But all the download links on that page will be redirected to
http://sourceforge.net/projects/freepascal/files/
, and I still cannot find the cross compiler there, sorry.

Nitorami

  • Sr. Member
  • ****
  • Posts: 496
Re: efficiency problem
« Reply #70 on: April 05, 2015, 04:44:54 pm »
Instead of sourceforge, go to austria

photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #71 on: April 05, 2015, 05:39:43 pm »
Instead of sourceforge, go to austria
Ok, I see.

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: efficiency problem
« Reply #72 on: April 06, 2015, 08:16:47 pm »

I have checked all of these. The download links on his website are all redirected to a docs.google.com site, and returned a "not found" message eventually.
[/quote]
FYI I just tried downloading a few zips from these links with success (using chrome).   may have been down when you tried.
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: efficiency problem
« Reply #73 on: April 07, 2015, 03:11:35 am »
Thanks. Following your instruction, I downloaded mingw64_dll.zip and obtained all the dll files needed. This time the test program compiled and run, but finally raised an exeption class "External: SIGSEGV". Has anybody successfully tested this in the 64bit case?

Sorry I missed your post. I am on a 32bit OS so I can't be sure. But I see that the 64bit OpenBLAS comes in two flavors:
Quote
Win64-int32 for 64-bit Windows with 32-bit int (default on 64-bit Windows)
Win64-int64 for 64-bit Windows with 64-bit int
You might want to try the first one, as Nitorami's code is suitable for 32bit int:
Code: [Select]
int = longint;
OR (and this is just a guess) make:
Code: [Select]
  int = int64;

photor

  • New Member
  • *
  • Posts: 49
Re: efficiency problem
« Reply #74 on: April 08, 2015, 03:50:15 pm »
Thank you very much!
After I replace "longint" with "int64", the 64bit version works!

Thanks. Following your instruction, I downloaded mingw64_dll.zip and obtained all the dll files needed. This time the test program compiled and run, but finally raised an exeption class "External: SIGSEGV". Has anybody successfully tested this in the 64bit case?

Sorry I missed your post. I am on a 32bit OS so I can't be sure. But I see that the 64bit OpenBLAS comes in two flavors:
Quote
Win64-int32 for 64-bit Windows with 32-bit int (default on 64-bit Windows)
Win64-int64 for 64-bit Windows with 64-bit int
You might want to try the first one, as Nitorami's code is suitable for 32bit int:
Code: [Select]
int = longint;
OR (and this is just a guess) make:
Code: [Select]
  int = int64;

 

TinyPortal © 2005-2018