| View previous topic :: View next topic |
| Author |
Message |
hani Member
Joined: 17 Oct 2005 Posts: 10
|
Posted: 13/04/06 10:33 Post subject: parallel programing |
|
|
hi all
i want to use mpi library in delphi
(Mpi library is used in C++) is there any way to use it(mpi)Such as component in delphi
Thanks
|
|
| Back to top |
|
 |
kokkoras Senior Member

Joined: 12 Mar 2005 Posts: 170 Location: Thessaloniki, Greece
|
Posted: 13/04/06 10:38 Post subject: |
|
|
what is "mpi" ??
_________________ Fotis |
|
| Back to top |
|
 |
hani Member
Joined: 17 Oct 2005 Posts: 10
|
Posted: 19/04/06 07:36 Post subject: What is Mpi |
|
|
Hi
MPI is library in C++ used to create More than one process to do
the same procedure so the result will be fast
|
|
| Back to top |
|
 |
kokkoras Senior Member

Joined: 12 Mar 2005 Posts: 170 Location: Thessaloniki, Greece
|
Posted: 19/04/06 08:15 Post subject: Re: What is Mpi |
|
|
| hani wrote: | | Hi MPI is library in C++ used to create More than one process to do the same procedure so the result will be fast |
IMHO, you can't have any serious speed-up on single CPU machines. Have you consider using threads in Delphi?
_________________ Fotis |
|
| Back to top |
|
 |
hani Member
Joined: 17 Oct 2005 Posts: 10
|
Posted: 19/04/06 08:56 Post subject: |
|
|
Hi
Mpi like Threads in delphi but it is not threads
let me say if you want to sort a very large numer of numbers in one array
it will take alot of time but if you create more than one process(thread)
and each one sort a specific number of numbers and in the end we will
see the numbers is sorted
Mpi contain functions to do that without using thread
for example MPi_init used to create process........
_____________________________
Thanks
Hani
|
|
| Back to top |
|
 |
werdnareid Member
Joined: 06 Aug 2003 Posts: 17
|
Posted: 21/04/06 22:25 Post subject: |
|
|
A quick explanation will help. MPI or Message Processing Interfaace is library designed to allow an application to run on multiple machines in the form of a process on each machine. which is unlike a thread which is designed to run as processes on the same machine as the main process which they serve(off course this excludes services).
i dont think there is a component designed to use MPI. you may have to work am a implimentation library then work on a component. i too have intrest in MPI but have not invested much time into it....there is a version that runs on windows.
the cool thing about delphi is that it should not bee too hard to make a package which staticically links to the functions found in the library.
dummy example below:
| Code: | | procedure blah(some var :of some type): enternal 'some_mpi_dll" |
|
|
| Back to top |
|
 |
hani Member
Joined: 17 Oct 2005 Posts: 10
|
Posted: 24/04/06 09:02 Post subject: |
|
|
Hi all
ok Iwill do that
Thank you all
|
|
| Back to top |
|
 |
werdnareid Member
Joined: 06 Aug 2003 Posts: 17
|
Posted: 26/04/06 00:45 Post subject: |
|
|
Note that i has a type in my inteded sample
procedure blah(some var f some type): enternal 'some_mpi_dll"
corrected
procedure blah(some var f some type): external 'some_mpi_dll"
or
procedure DoSomething; external 'MYLIB.DLL';
note that this method of calling the function/method directly from the dll is know as static there is another method which is a little more involved but more flexible check the page below.
http://info.borland.com/techpubs/delphi/delphi5/oplg/dllpackg.html
|
|
| Back to top |
|
 |
kokkoras Senior Member

Joined: 12 Mar 2005 Posts: 170 Location: Thessaloniki, Greece
|
Posted: 26/04/06 09:04 Post subject: |
|
|
| werdnareid wrote: | | A quick explanation will help. MPI or Message Processing Interfaace is library designed to allow an application to run on multiple machines in the form of a process on each machine. which is unlike a thread which is designed to run as processes on the same machine as the main process which they serve(off course this excludes services). |
That's fine. BUT, where do we expect speed-up if we do all these in a single machine? Apart from some possible speed-up from better utilising the pipelining features of modern CPUs, I can't see anything more. In order to gain serious speed-up from parallelism you either have to run the same algorithm on different data (data parellelism) or run different algorithms/functions on the same data (function parallelism). In both cases you need more that one machines.
EDIT: I think I messed up the definitions (data parellelism vs. function parallelism). It should be the other way around.
_________________ Fotis
Last edited by kokkoras on 26/04/06 23:10; edited 2 times in total |
|
| Back to top |
|
 |
werdnareid Member
Joined: 06 Aug 2003 Posts: 17
|
Posted: 26/04/06 22:38 Post subject: |
|
|
Firstly let me say, that I was off the impression that you were fully aware of what MPI was and how it would benefit your project. If you aim is simply to gain speed (running application like word, excel or msaaccess) then you are barking up the wrong tree. MPI aims for improving the “speed i.e. applications that are CPU intensive”.
Applications like weather forecasting, cluster communication, vehicle crash modeling and the like are the focus of MPI.
Again if your plan is to write a applicaton to do faster word processing or a desktop applicatoin to talk to a database, MPI may no be the thing
|
|
| Back to top |
|
 |
kokkoras Senior Member

Joined: 12 Mar 2005 Posts: 170 Location: Thessaloniki, Greece
|
Posted: 26/04/06 23:04 Post subject: |
|
|
| werdnareid wrote: | | Firstly let me say, that I was off the impression that you were fully aware of what MPI was and how it would benefit your project. |
I guess you are not replying to me. BTW, I am not aware of the MPI lib. I was talking generally on parallelism. Consider the application of filters to an image. You either assign each filter to a CPU (function parallelism) and have each CPU process the full image OR have all the filters to every CPU and process _a_part_ of the image (data parellelism).
_________________ Fotis |
|
| Back to top |
|
 |
|