20/01/2008
Cleaner way to begin parallel processing
A method was added to the ProcessorGroup class to help instantiating, starting, waiting, and disposing of the mpi service host threads. Along w/ using an anonymous delegate, the code cleans up rather nicely.
static void Main(string[] args)
{
ProcessorGroup.Process("MPIEnvironment",
delegate(IDictionary<string, Comm> comms)
{
Comm comm = comms["MPI_COMM_WORLD"];
Console.WriteLine("Rank: {0}", comm.Rank);
string broadcastRoot = comm.Rank.ToString();
comm.Broadcast<string>(1, ref broadcastRoot);
Console.WriteLine("Broadcast root: {0}", broadcastRoot);
});
}