DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

parallel programing

 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
hani
Member


Joined: 17 Oct 2005
Posts: 10

PostPosted: 13/04/06 10:33    Post subject: parallel programing Reply with quote

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 Crying or Very sad Crying or Very sad Crying or Very sad
Back to top
View user's profile Send private message
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 170
Location: Thessaloniki, Greece

PostPosted: 13/04/06 10:38    Post subject: Reply with quote

what is "mpi" ??
_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
hani
Member


Joined: 17 Oct 2005
Posts: 10

PostPosted: 19/04/06 07:36    Post subject: What is Mpi Reply with quote

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
View user's profile Send private message
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 170
Location: Thessaloniki, Greece

PostPosted: 19/04/06 08:15    Post subject: Re: What is Mpi Reply with quote

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
View user's profile Send private message Visit poster's website
hani
Member


Joined: 17 Oct 2005
Posts: 10

PostPosted: 19/04/06 08:56    Post subject: Reply with quote

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
View user's profile Send private message
werdnareid
Member


Joined: 06 Aug 2003
Posts: 17

PostPosted: 21/04/06 22:25    Post subject: Reply with quote

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
View user's profile Send private message
hani
Member


Joined: 17 Oct 2005
Posts: 10

PostPosted: 24/04/06 09:02    Post subject: Reply with quote

Hi all
ok Iwill do that
Thank you all
Back to top
View user's profile Send private message
werdnareid
Member


Joined: 06 Aug 2003
Posts: 17

PostPosted: 26/04/06 00:45    Post subject: Reply with quote

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
View user's profile Send private message
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 170
Location: Thessaloniki, Greece

PostPosted: 26/04/06 09:04    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
werdnareid
Member


Joined: 06 Aug 2003
Posts: 17

PostPosted: 26/04/06 22:38    Post subject: Reply with quote

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
View user's profile Send private message
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 170
Location: Thessaloniki, Greece

PostPosted: 26/04/06 23:04    Post subject: Reply with quote

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. Smile 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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group