Open MPI with D

Jacob Carlborg doob at me.com
Fri Nov 25 01:28:30 PST 2011


On 2011-11-25 09:13, Jude Young wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ok, so I finally got mpi.h to compile and link with D.
>
> A few problems are left to fix, like the fact that I didn't realize
> that OpenMPI does not care about the types, unless you are building it...
>
> Anyways applied a temp fix and got the first program running!
> young at Dan-Laptop:~/bin/DlanguageBindings/OpenMPI/examples$ mpirun hello_d
> Hello, world, I am 0 of 1
>
> Not great, but its a start...
> One thing that has been buggin me..
> I don't fully understand how C handles the arguments given to the
> program, but I do know that MPI handles them directly.
> int MPI_Init(int *argc, const char ***argv);
>
>
> Is there an easy way to turn D style (string[] args) into C style?

If you just want to forward the arguments your application received you 
can use _NSGetEnviron() function on Mac OS X and "environ" global 
variable on other Posix systems. There are probably similar 
function/variable available on Windows.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list