MPI is also a scripting language used in TinyMUCK FuzzBall to perform simple tasks. Quite powerful, and the wizards can get on your tail quickly if you abuse it.

MPI (the scripting language), while quite useful and fun to play with on FuzzBall TinyMUCKs, also has some of the nastiest syntax known. To wit:

   {with:awake,,{foreach:player,{contents:here,player},{if:{awake:{&player}},{set:awake,
   {mklist:{&awake},{name:{&player}}}}}},{color:{nl}~&160{commas:{&awake},
   ~&R~&170 and ~&R~&160,player,{if:{ge:{idle:*{&player}},60},{&player}~&R~&040(idle
   {div:{idle:*{&player}},60}m{mod:{idle:*{&player}},60}s)~&R~&160,{&player}}}}
   {color:~&R~&170 {if:{eq:{count:{&awake}},1},is ,are }awake here.~&R}}

And that's actually a fairly well-coded example. It will return a list of characters awake in a room, in ANSI color.

MPI, on FuzzBall TinyMUCKs, was developed by Revar Desmera, at http://www.belfry.com/. The official name is Message Parsing Interpreter, but Revar says that it also stands for My Personal Insanity (after all, she had to have been insane to write 30,000 lines of C code to implement the damned thing.)

In FB, MPI has a much easier time dealing with property lists, which are trees of properties stored on objects within the database.

The function call syntax of MPI (the MUCK one) is actually not too dissimilar in its structure from that of Lisp or Scheme. However, since bare strings in MPI evaluate to themselves (i.e. they do not need to be quoted to be literals) the overall effect is that of Scheme crossed with, say, MUSH's attribute language.

Here's Space Butler's example reformatted. Note that because the original contains string expressions that have been split up here to illustrate the Lispishness going on, the following will probably not run (well):

{with:  awake,,
  {foreach:  player, {contents:here,player},
    {if:  {awake:{&player}},
          {set:awake,{mklist:{&awake},{name:{&player}}}}
    }
  },
  {color:  {nl}~&160
    {commas:  {&awake},
          ~&R~&170 and ~&R~&160,player,
      {if:  {ge:  {idle:*{&player}},60},
            {&player}~&R~&040
              (idle 
                {div:  {idle:*{&player}},60}
              m
                {mod:  {idle:*{&player}},60}
              s)
              ~&R~&160,
                {&player}
      }
    }
  }
   {color:~&R~&170
    {if:  {eq:{count:{&awake}},1},
      is ,
      are 
    }
    awake here.~&R
  }
} 
As you can see, the function call syntax resembles Lisp, but uses curly brackets instead of parentheses, delimits the function name from the arguments with a colon, and delimits arguments themselves with commas. As a result, MPI's function calls do not share syntax with lists, as Lisp's do: MPI lists are delimited by carriage return. Nevertheless, MPI is certainly much more of a functional language than are most MU* languages.

back to: parallel programming languages

2.a Message Passing Interface (MPI)

MPI is a message passing API standard created by a "broadly based comittee" of vendors and users called the MPI Forum. The MPI standard has language bindings for C, C++, and Fortran.1

Most MPI programs applications have a fixed set of processes initialized at startup, with one process per processor. MPI provides basic point to point send and receive operations (both synchronous and asynchronous). It also provides a mechanism for a group of processes to call a collective operation, such as summation, synchronization, and broadcasting.2

Although MPI is a large library of over 100 functions, one can be quickly productive using less than 10 f these functions. Currently, the use of MPI is the most popular method of creating parallel applications.

While MPI is becoming the de facto standard for parallel programming, there are many reasons to look at other approaches to parallel programming.


1 MPI Home Page at http://http://www-unix.mcs.anl.gov/mpi/
2 Ian Foster, Designing and Building Parallel Programs, http://www-unix.mcs.anl.gov/dbpp/

Log in or register to write something here or to contact authors.