[This is preliminary documentation and is subject to change.]
Initializes the MPI environment. This variant of the Environment constructor
initializes the MPI environment with the Serialized threading model.
Namespace:
MPIAssembly: MPI (in MPI)
Version: 0.5.0.0 (0.5.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()); } } }