coding, parallel

delphi and mpi, closer look 2

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.

2 Comments

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*Required Fields