MPITcl provides a Tcl friendly interface to the Message Passing Interface (MPI) library for parallel sequential computing. MPI is a commonly used library for parallel computing. MPITcl is not part of SpecTcl proper, rather it is a separate package. It serves as the basis for parallel batch SpecTcl.
MPItcl is an extended Tcl interpreter with additions that support Tcl scripts as MPI programs.
In this chapter we will:
Introduce some of the concepts behind MPI.
Describe how MPI concepts are realized in MPITcl
Describe the MPITcl command ensemble that supports MPITcl.
Show how to run MPITcl and provide a very simple script that shows how it can be used.
Note that whle you can package require Tk in an MPITcl script, this will fail in most cluster computing environments as they are intended for batch computing. Finally, refer to the reference section for a full discussion of the MPITcl command ensemble.
MPI programs consist of a single program. Several copies of this single program are run across several cores which may, in turn be distributed across several network nodes.
A Message passing MPI allows copies of the program to exchange messages that consist of well defined data types. MPI further supports dividing the computation into distinct intercommunicating groups. Furthermore, messages have tags assocciated with them that can describe the type of information in the message.
Each instance of a program in an MPI application has one or more ranks. A program instance's rank is just an integer numbered from zero to the size of the group. A program can inquire as to its rank within all groups it belongs to.
Communication within a group is handled via group's communicator. A special communicator is predefined MPI_COMM_WORLD that communicates with all the program instances in an application.