Force MPI to not use network adapter - mpich

I am running a multi-process calculations using MPICH2 from Argonne National Laboratory. The run is on a single machine, so -localonly option of mpiexec is used. Usually everything works.
If the network adapter is enabled when the run starts, and if I disable it during the run, the run fails with error stating:
op_read error on left context: Error = -1
op_read error on parent context: Error = -1
unable to read the cmd header on the left context, Error = -1
.
unable to read the cmd header on the parent context, Error = -1
.
Error posting readv, An existing connection was forcibly closed by the remote host.(10054)
connection to my parent broken, aborting.
state machine failed.
However, if the network adapter is disabled when the run is started, I can enable/disable the adapter as many times as I want, and the run still proceeds to the end.
Is there a way to run mpiexec or modify smpd configuration such that MPICH2 is not using network adapter for inter-process communication for local runs even if the adapter is available when the run starts?
Update
The platform is Windows 7 Professional.
The version of MPICH2 is 1.4.1 (32-bit) which is latest version of MPICH2 that I can find.

As was posted on the mailing list, you're using a very old version of MPICH. You should update to a newer version that does all of this automatically.
UPDATE: As has been pointed out, on Windows, it's not possible to update MPICH past 1.4.1. For anything beyond that, you should use either MS-MPI or Intel MPI.

Related

Debug remotely on STM32CubeIDE with an STM32 eval board

I want to setup the following environment: I've got a STM32H753I-EVAL2 eval board, connected on a Windows PC. Until now I was developping and debugging locally on this PC with STM32CubeIDE. For several reasons my code source is on a Linux server (Samba mounting) so it takes forever to build a project. Hence I want to develop on the linux server from my Windows machine.
Compiling is working fine (and is way faster) but the issue is about debugging. I know it is possible to debug remotely, the Debug Configuration window from Eclipse (I'm using OpenOcd) allows to connect to a remote GDB server. What I don't know is how to start a GDB server on the Windows machine that will connect to the STM32 board ?
Sorry for the "answer to myself" but I think it might be useful for others (and even to me when I have forgotten in a few weeks ;) ).
Here is how to do.
on host side (on the machine where the eval board is physically plugged in) you have to manually launch the GDB server application that comes with STM32CubeIDE installation. See STMicro application note UM2576 for details. The default command line is:
ST-LINK_gdbserver.exe -d -v -cp "C:\ST\STM32CubeIDE_1.0.0.19w12patch\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.0.0.201903011553\tools\bin"
Now you've done the hardest. On server/remote side you have to setup the Debug Configuration to use OpenOcd with option "Connect to remote GDB server" and simply enter IP address and port number (which is not 3333 by default but 61234, but it can be modified).
This setup is working fine, even if I encoutered some instabilities during debugging once in a while.
I see two (maybe three) options
Use an alternate GDB server (see below)
Run the GDB server from STMCubeIDE in isolation (see OP's answer for Windows, this answer for Linux)
GDB Serial (not really an option right now but I'll share my experience so far)
I have used the second option to succesfully debug my target using arbitary GDBs such as gdb-multiarch command line and in the (non STMCube-ified) Eclipse CDT
Alternative GDB Servers
You could try STLink open source. I did. The problem is, your device might not be supported properly. I built 1.6.1 from Github to enable support for STM32G03x device. While moving to this version enabled it to detect the device, and I can use st-flash to program the device, the debugger is unusable (try and alter a register, it alters the wrong one, try and single step a program, it crashes immediately).
Do try it though .. it's easy and quick to install (or build), so it's worth checking if your device will work correctly with it.
Openocd is another option, but seems not to support SWD connection. I tried a build that allegedly had a patch for this but no luck.
If you can get one of these open source alternatives to work, they have another advantage, you may be able run them on something like a Raspberry PI, which means you don't have to get a PC physically close to your target.
Run the GDB server from STMCubeIDE in isolation
For Windows, see the OP's answer. For Linux, I do this alter the pathnames to suit your installation
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/apps/st/stm32cubeide_1.5.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_1.5.0.202011040924/tools/bin/native/linux_x64/ /home/user/apps/st/stm32cubeide_1.5.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_1.5.0.202011040924/tools/bin/ST-LINK_gdbserver -p 61234 -l 1 -d -s -cp /home/user/apps/st/stm32cubeide_1.5.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_1.5.0.202011040924/tools/bin -m 0 -k
How did I get to this? Firstly launched a debugging session from STMCubeIDE, then ran
ps aux | grep gdbserver
Then we can see how Eclipse (STMCube) is launching the gdbserver and work from there.
If you find it complains about a .so file, locate that file from the STMCube installation and ensure the path to the directory containing it is in LD_LIBRARY_PATH (as per my example)
You can also launch the program with --help to show more options.
If add -e (persistent) you can disconnect and reconnect a GDB client without resetting the target (it will reset on initial invocation of the gdb server though, even without -k).
GDB Serial
This is where the target implements the GDB server end of the protocol. The GDB stub usually runs in an exception handler. This would usually be your breakpoint handler but you can also make it the default handler for unhandled exceptions, or, for example, the ctrl-c interrupt.
I have done a lot of Googling about this recently and basically when people ask about it on forums they usually get responses along the lines of "Here be dragons" or "Why don't you use JTAG?"
So the drivers for this, you might like to know, are in the GDB sources git://sourceware.org/git/binutils-gdb.git under gdb/stubs. The documentation is here. There isn't a stub implementation there for arm. Which is sad really, I used to use GDB remote serial regularly where I worked, and some of those targets were indeed ARM. The operating system was ecos.
So could ecos GDB stubs be ported to bare metal? Having giving it a good coat of looking at, I believe yes they could. The stubs are based on the ones from the GDB sources but they are heavily polluted with Ecos and Redboot build macros and copyright (the ogiringals were written by HP and released without copyright). We don't know what bugs the Ecos stubs may contain (I fixed at least one back in the day and I don't recall whether I submitted a patch). We don't know if they really support the latests architectures properly. And, we don't know if, after that, they simply use up too much memory - my STM32 has 8K of SRAM and I already see buffers that have a default size of 2K (not saying that's necessary but you see how work needs to be done here..)
So this third option, I will revisit this one day but for now, for me, it's a nope.

Eclipse error during remote debug session: sh: locale: not found

I'm really hoping to get an answer on this. I am using Eclipse to remote debug a C++ program on a (minimal) linux machine. I am aware that the linux machine does not have the locale binary installed. First off, the error received is the following in Eclipse after pressing the debug or run button:
org.eclipse.remote.core.exception.RemoteConnectionException: sh:
locale: not found
After the first run, successive runs do not display the error, only the first run. If I restart the linux machine, the error will come back for the first run again.
What is most obvious is that Eclipse, or the running program is calling locale on the linux machine and it is not available, not installed.
This machine is quite minimal and doesn't even have a package manager - it's an embedded system. So I tried to install "locales", "locale" as well as "locale-all" using multistrap when building the linux image. None worked.
When using debian repositories, multistrap returns
E: Unable to locate packages locales
So I guess my real questions are:
1) What debian package supplies "locale" found in /usr/bin/locale? How
can I install it without adding a lot of of overhead on an ARM system? (assuming no package manager)
2) Where is the source code for locale?
And third,
3) In Eclipse, can I prevent the running program or Eclipse from
calling locale? This is preferred.
After scouring the forums, I found one guy that said he got the same issue and "manually fixed it", however he did not provide the fix.. Hope to get some help!
That reference can be found https://www.eclipse.org/forums/index.php/t/1081283/
Thanks,
I had the same, so I changed the encoding to ISO-8859-1 in the debug settings.

Visual Studio 2015 error: Unable to start debugging. Unexpected GDB output from command "-target-select remote :5039". Remote connection closed

I see the following error whenever I try to debug "Cross Platform" under "C++" category: "Unable to start debugging. Unexpected GDB output from command "-target-select remote :5039". Remote connection closed"
I've installed all of the contents when I downloaded Visual Studio 2015 community and I ran it on Windows 10 Pro which supports Hyper-V.
I've been searching a solution for this and I've found an assumption:
"What is your debug target, the VS Android Emulator? When we saw this before it turned out to be a bad emulator image. Do you have this problem with all targets (e.g. if you try a physical device) or just one?"
In my case, I just tried this via Emulator(VS Emulator 5" Lolipop (5.0) XXHDP Phone (0x86 -...)
So I've sent an Email to VS 2015.
And the answer was like this:
"Sorry for the delay in responding we were looking at an emulator image of another user that ran into this problem so I was waiting until we had the results of that investigation to report back. We actually were not able to find anything wrong the emulator itself, our current hypothesis is that it is a network or adb problem interfering with GDB’s ability to connect to GDB server on the remote machine. Do you see this error every time you try to debug, or if you reboot the emulator will it work sometimes right after the reboot? Next time you see the error, can you open the emulator’s console mode by going go the Hyper-V manager and double clicking the emulator. Then find the location your app installed to and run “gdbserver --version" from the app path and let me know what it says? This will validate if the correct version of gdbserver is on the device."
So we are trying to solve this problem but I'm also asking here just in case.
Is there anyone who has magical solution for this problem?
I'll put a comment on this if I figure out how to solve this.
Thanks in advance.
** Following answer is from the manager of Visual Studio 2015:
You are only the second person who has run into this issue, and the first person that ran into it provided their everything works correctly when we run their .vhd on our machines so it appears to be some strange problem where gdbserver (which comes from the Android NDK provided by Google) crashes only when running on certain machines. Unfortunately the .vhd you provided does not appear to be the correct one it won’t boot for me. You can see the .vhd file being used by the emulator if you look under the settings of the emulator in your Hyper-V manager. .However given we got the other person’s .vhd you can hold off providing any additional information at this point. I’m waiting to hear back from the emulator team on if they have any ideas since this appears to be an issue only on specific machines since.
If you don’t mind my asking, if you don’t have a background in computers what inspired you to try C++ on Android? That scenario will be significantly more complicated than doing Java on Android.
It's been almost two months since I got this answer but I haven't got any additional response from them yet. So, I ended up quitting developing an application by using VS2015.
If you run into this problem, there are only two ways to go. Change your computer or stop developing application via VS2015.
If the project name contains spaces, the whole remote debugging fails. Visual Studio also creates weird paths. When checking out the "Blink1 for Raspberry Pi" template, I named the Project "Blink1 for Pi", which resulted in a path like this:
~/projects/Blink1?/for/pi/PI/for/pi....
And all the debugging failed. When I recreated this keeping the project name "Blink1", everything worked fine. It's a pity, that spaces aren't handled here...

System crash with QMediaPlayer and gstreamer

I am currently writing an application with build-in audio player.
When I setup QMediaPlayer, I (always) get the following error:
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
There are some google results about that, but I did not find any solution to fix it.
Please note that I do not use jack.
So far I can live with that error message, but there is a much worse problem. Most of the time, the application works fine and does the expected but sporadically it freezes. The whole system freezes. I can turn the mouse around (with a poor frame rate) but I cannot click on anything or interact with any other program. Even switching to a text terminal with Ctrl+Alt+F1 does not help which make me think there should be an issue with a driver or a kernel module.
I tried mp3 and vorbis, with and without debugger, in debug and in release mode. Always the same.
There is no additional warning, error etc.
The error also occurs when starting the application from console (an executable that ran just before without any problems).
System:
Linux t420s 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
Qt 5.1.1, C++11
qmake:
qmake .../CAN.pro -r -spec linux-g++-64 CONFIG+=debug
The part of code causing the issue:
QMediaPlayer* _player = 0;
_player = new QMediaPlayer(this);
...
QFile tmpFile(filename);
tmpFile.open(QIODevice::ReadWrite);
tmpFile.write(_mediaFile);
_player->setMedia(QUrl::fromLocalFile(filename)); // <-- this line causes the freezing
The last system update/upgrade was on November 9, 2014.
Btw, the whole project is publicly hosted on github. I also asked the same question here but did not receive any answer. Sorry for multipost.
One or two months ago, I had to reinstall my system for irrelevant reasons. I decided to install Ubunutu 14.04 instead of Debian.
Since then, the error did not show up again. So I guess this issue is solved. Although I'd be glad to know the reasons...

Libpurple can't connect - purple_presence_is_online failed

I am writing myself a small jabber client. I have used code from Libpurple.com and on Linux (Mint) everything works fine. With libraries linked program compiles with no errors and receives messages.
But when I use the same code on Windows 7, link all neccessary libraries and with Cygwin installed and PATH set, program compiles with no errors, but then NetBeans (IDE I use in Windows and Linux) says 'RUN FAILED'
When I run program from windows command line it says:
libpurple initialized. Running version 2.10.7.
** <myclient.exe:6500>: CRITICAL **: purple_presence_is_online: assertion 'presence != NULL' failed
and then it freeze. I already tried going back to libpurple 2.10.3 (the version I have in Linux) but still the same. Turning firewall off did'n help either.
Few things to note:
Each OS has its own issues when a program is deployed. So, ignore the fact that your client is working in Linux. Start with the fact, that your program / libpurple didn't work in Windows.
Try to see if there is a client ( pidgin etc ) which uses the same code path ( the function where the assertion fails ), and succeeds. This is to do basic sanity check that the libpurple code is in fact usable in that environment ( Cygwin )
If there is any traffic between your client and the server, try getting a wireshark traffic dump, and compare it between working ( Linux ) and failing ( Cygwin ) environment.
Why not use a simple XMPP client library like GLOOX (http://camaya.net/gloox) instead of libPurple. GLOOX is a cross platform library that do not need CYGWIN on Windows to compile. And its complete, providing implementation for all the essentail XMPP estensions.
However, if you want to connect to other non-XMPP networks like Yahoo, Facebook, then libPurple will definitely is the answer.
Since your issue is hard to reproduce, I'd suggest you use the debugger to investigate where that "presence" pointer comes from, and which code block sets it to NULL. Then you could ask "why purple_stupid_function() returns a NULL pointer" which is much easier to answer.
The last time I looked at LibPurple (years ago) I could only get it working with MinGW, not Cygwin.