Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

Intel MPI and Unicode in Windows

Seifer_Lin
Beginner
1,191 Views
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
1,191 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
0 Kudos
James_T_Intel
Moderator
1,191 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
0 Kudos
SergeyKostrov
Valued Contributor II
1,191 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
0 Kudos
Seifer_Lin
Beginner
1,191 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
0 Kudos
James_T_Intel
Moderator
1,191 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
0 Kudos
SergeyKostrov
Valued Contributor II
1,191 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

0 Kudos
Reply