• Question

  • Hi all.  I'm curious what the workarounds are for compiling UNICODE apps with MSMPI.  In short, here's the problem.  A typical windows app is defined like this:


    int _tmain(int argc, _TCHAR* argv[ ])







    If UNICODE is defined, then _TCHAR becomes a WCHAR, i.e. a UNICODE character.  In this case, the call to MPI_Init fails to compile, since MPI is defined assuming ANSI characters, not UNICODE:


      MPI_Init(&argc, &argv);   // type error, since prototype is int MPIAPI MPI_Init(int *argc, char ***argv)


    Is this a known limitation?  Or maybe I'm missing something?  I have a workaround, which amounts to overriding MPI_Init and replacing it with a UNICODE-compatible version. 


    Thanks for any ideas/pointers.  Cheers,


      - joe

    Tuesday, March 4, 2008 1:58 AM


  • Hi Joe,

    The MPI standard currently does not support Unicode. The way to work with wide character strings is to convert them to ASCII using string conversion API's.  Your approach using function overloading is an elegant solution.


    Microsoft is working with the MPI forum to obtain support for UTF-8 and possibly Unicode in MPI 3.0.

    - Phil


    • Marked as answer by Don Pattee Thursday, June 25, 2009 11:10 PM
    Thursday, March 6, 2008 5:46 AM