DeinoMPI Forum

Forum dedicated to discussing DeinoMPI
Welcome to DeinoMPI Forum Sign in | Join | Help

Re: Writing C# Programs with DeinoMPI

  •  10-20-2007, 12:52 PM

    Re: Writing C# Programs with DeinoMPI

    First of all, I tried to pass NULL, NULL - to lead to crash.
    What you said about passing &argc and &argv is not correct. If you were correct - the prototype of MPI::Init should look like this:

    Init(int *argc, char ***args)

    But it looks like this:

    Init(int &argc, char **& args)

    Which means that you pass it by reference, and not passing the pointer-of (with ampersand).

    Any ideas what causes the crash?

    I found a workaround, to declare a constant size array of char*:

    char * pArgv[100];
    for (int i=0;i<argc && i<100;i
    ++)
    {
       std::string str = ToCppString(arrArgv[i
    ]);
       int len = str.size
    ();
       pArgv[i] = new char[ len
    + 1];
       strcpy_s(pArgv[i], len+1, str.c_str
    ());
    }

    This works, again, I don't understand why. Maybe you can explain...\

    Thanks!

View Complete Thread
Powered by Community Server, by Telligent Systems