It is pretty simple to install and use MPI with Delphi, fortunately for us programming the MPI is no bother too.
The second part is about calling MPI functions from Delphi.
Name Convention
No change here. Since we are using a direct translation of the original MPI header, all the original names are there.
Sending, Receiving Data
No surprise here too, here are some pointers:
Variables
Since MPI needs pointers to variables, use @ operator to get the pointer to your variables.
MPI_Comm_rank(MPI_COMM_WORLD,@myid);
For getting the size of variables use the sizeoff function.
Arrays
Again we need the starting address of the arrays.
Lets say we have an array named as “sizeArray”
For dynamic arrays use @(sizeArray[0])
For static arrays use @(sizeArray[1]) // assuming the array starts from 1
Strings
Since no one knows the memory map of a Delphi string you cannot use them with MPI. You have to go with short strings.
Debugging
Bad news here, Delphi has no support for parallel debugging. You have to go with displaying data to screen, or using a log file.
I was going to write a 3rd article about creating parallel applications with GUI, but since it is a general subject I decided to write the article separately, so this series and here.
I want to quote your post in my blog. It can?
And you et an account on Twitter?
Sure you can, no I don’t.