Initializes the MPI environment. This variant of the Environment constructor initializes the MPI environment with the Serialized threading model.

Namespace:  MPI
Assembly:  MPI (in MPI.dll)
Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public Environment(
	ref string[] args
)
Visual Basic (Declaration)
Public Sub New ( _
	ByRef args As String() _
)
Visual C++
public:
Environment(
	array<String^>^% args
)

Parameters

args
Type: array< System..::.String >[]()[] %
Arguments passed to the Main function in your program. MPI may use some of these arguments for its initialization, and will remove them from this argument before returning.

Remarks

This routine must be invoked before using any other MPI facilities. Be sure to call Dispose() to finalize the MPI environment before exiting!

Examples

This simple program initializes MPI and writes out the rank of each processor:
CopyC#
using MPI;

public class Hello 
{
    static void Main(string[] args)
    {
        using (MPI.Environment env = new MPI.Environment(ref args))
        {
            System.Console.WriteLine("Hello, from process number " 
                + MPI.Communicator.world.Rank.ToString() + " of "
                + MPI.Communicator.world.Size.ToString());
        }
    }
}

See Also