parallel programing

Please discuss general Delphi programming topics here.

parallel programing

Postby hani » April 13th, 2006, 10:33 am

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 :cry: :cry: :cry:
hani
Active Member
Active Member
 
Posts: 17
Joined: October 17th, 2005, 9:15 am

Postby kokkoras » April 13th, 2006, 10:38 am

what is "mpi" ??
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

What is Mpi

Postby hani » April 19th, 2006, 7:36 am

Hi

MPI is library in C++ used to create More than one process to do
the same procedure so the result will be fast
hani
Active Member
Active Member
 
Posts: 17
Joined: October 17th, 2005, 9:15 am

Re: What is Mpi

Postby kokkoras » April 19th, 2006, 8:15 am

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
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby hani » April 19th, 2006, 8:56 am

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
hani
Active Member
Active Member
 
Posts: 17
Joined: October 17th, 2005, 9:15 am

Postby werdnareid » April 21st, 2006, 10:25 pm

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: Select all
procedure blah(some var :of some type): enternal 'some_mpi_dll"
werdnareid
Active Member
Active Member
 
Posts: 22
Joined: August 6th, 2003, 5:35 pm

Postby hani » April 24th, 2006, 9:02 am

Hi all
ok Iwill do that
Thank you all
hani
Active Member
Active Member
 
Posts: 17
Joined: October 17th, 2005, 9:15 am

Postby werdnareid » April 26th, 2006, 12:45 am

Note that i has a type in my inteded sample
procedure blah(some var :of some type): enternal 'some_mpi_dll"

corrected

procedure blah(some var :of 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 ... packg.html
werdnareid
Active Member
Active Member
 
Posts: 22
Joined: August 6th, 2003, 5:35 pm

Postby kokkoras » April 26th, 2006, 9:04 am

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.
Last edited by kokkoras on April 26th, 2006, 11:10 pm, edited 2 times in total.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby werdnareid » April 26th, 2006, 10:38 pm

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
werdnareid
Active Member
Active Member
 
Posts: 22
Joined: August 6th, 2003, 5:35 pm

Postby kokkoras » April 26th, 2006, 11:04 pm

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
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece


Return to Delphi Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron