[This is preliminary documentation and is subject to change.]

Initializes the MPI environment.

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

Syntax

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

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.
threading
Type: MPI..::.Threading
The level of threading support requested of the MPI implementation. The implementation will attempt to provide this level of threading support. However, the actual level of threading support provided will be published via the Threading property.

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