Is there a way to run my Pascal programs in parallel?

Please note: The FAQ pages at the HPCVL website are continuously being revised. Some pages might pertain to an older configuration of the system. Please let us know if you encounter problems or inaccuracies, and we will correct the entries.

There is indeed, but it's not going to be easy. One way of "parallelizing" your programs is to include "message passing" in the code. Different portions of the code are thereby executed by different processors, and information is shared by passing messages between the processors. The most widely used method to do this is called Message Passing Interface (MPI), and is available in the form of libraries on the SUN Fire muti-processor machines of HPCVL. However, MPI works only with FORTRAN and C directly. The libraries consist of subroutines that can be called from code written in those two languages. In order to write parallel code in Pascal, you therefore have to do the following things.

    • Write your code in a "single code multiple data" manner by inserting calls to message-passing functions. The interface with these functions will have to be designed by you.
    • Implement the message-passing functions in C and use the C-bindings of the MPI library inside of those functions.
    • Compile your Pascal routines with GPC, and your C-routines with the native C-compiler to produce object code. Include the proper header files in the C functions via the "-I" option. Collect the C-functions in a library using the ar command.
    • Link the object code with GPC, including the C-functions in the form of a library. MPI is linked in by specifying "-l", "-L", "-R", and "-I" options.

You can read our Parallel Programming FAQ to make yourself familiar with the usage of the native C compiler on the Sun systems. You will also need to follow up some of the links in that file to make yourself familiar with usage of MPI.