Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Seifer_Lin
Beginner
89 Views

Intel MPI and Unicode in Windows

Hi all:
For a Windows unicode console program (MyUnicodeAPP.exe), my way to display unicode characters in the screen is:
(1)Convert all wchar_t to char with UTF8 encoding
(2)Change the codepage of console to 65001 (UTF8)
(3)printf the UTF8 encoded strings
But when I use the following command, the UTF8 encoded strings can't be displayed correctly.
mpiexec.exe -localonly -n 2 MyUnicodeApp.exe
I think the MyUnicodeApp.exe launched by smpd.exe has its own codepage of console rather than 65001 of the main console.
Is there anyway to print unicode strings in a MPI app?
regards,
Seifer

0 Kudos
6 Replies
Seifer_Lin
Beginner
89 Views

Hi:
I have done another test and find that if the unicode string is read from a unicode encoded text file, there is no display issue.
But if the unicode string is passed as the argument of MyUnicodeApp.exe, the unicode strings can't be displayed correctly.
Note: MyUnicodeApp.exe already use
int wmain(int argc, wchar_t **argv)
to replace
int main(int argc, char **argv)
I think mpiexec.exe can't get unicode string argument corretly, therefore smpd will launch MyUnicodeApp.exe with an incorrect argument.
mpiexec.exe -localonly -n 2 MyUnicodeApp.exe []
regards,
Seifer
James_T_Intel
Moderator
89 Views

Hi Seifer,

Are there any Unicode characters in the path to your application or to your MPI installation folder?

Sincerely,
James Tullos
Technical Consulting Engineer
Intel Cluster Tools
SergeyKostrov
Valued Contributor II
89 Views

Quoting Seifer Lin
...
Is there anyway to print unicode strings in a MPI app?

Hi Seifer,

I use two CRT functions mbstowcs and wcstombs to do all stringconversions.

Best regards,
Sergey
Seifer_Lin
Beginner
89 Views

Hi All:
When running my app without mpiexec.exe as the following ([UnicodeCharacter] is the argument for MyMPIAPP.exe) :
MyMPIApp.exe [UnicodeCharacter]
The console shows[UnicodeCharacter] correctly.
But when I run my app with mpiexec.exe
mpiexec -localonly -n 2 MyMPIApp.exe [UnicodeCharater]
The console shows:
[??????????]
[??????????]
all the unicode characters are displayed as question marks.
regards,
Seifer
James_T_Intel
Moderator
89 Views

Hi Seifer,

I've checked with our development team, and Unicode is currently unsupported by the Intel MPI Library. In order to add support, there will need to be significant changes throughout, and as such it is not expected to be completed in the near future.

Sincerely,
James Tullos
Technical Consulting Engineer
Intel Cluster Tools
SergeyKostrov
Valued Contributor II
89 Views

Quoting Seifer Lin
...But when I run my app with mpiexec.exe
mpiexec -localonly -n 2 MyMPIApp.exe [UnicodeCharater]
The console shows:
[??????????]
[??????????]
all the unicode characters are displayed as question marks...


Did you try to execute that command with a simple Win32 Consoleapplication ( UNICODE )?

The code could look like:

...
void main( void )
{
...
DWORD dwCreationFlags = ( ... | CREATE_UNICODE_ENVIRONMENT | ... );
...
CreateProcess( NULL, _T("mpiexec -localonly -n 2 MyMPIApp.exe [UnicodeCharacter]"), ..., dwCreationFlags, ...);
...
}
...

Best regards,
Sergey

Reply