MVAPICH2 + process spawning - parallel-processing

I use MVAPICH2.3 version to run parallel programs.
On this site (http://mpi.deino.net/mpi_functions/MPI_Comm_spawn_multiple.html) I found out the example of spawning execution via MPI_Comm_Spawn_Multiple().
After successive compiling and execution I've got this error:
MPIDI_Comm_spawn_multiple(140):
MPID_Open_port(70)............: Function not implemented
Do we have any chance to launch MVAPICH with spawning mechanism?
Thanks in advance!

Related

Julia exits when using Pardiso solver on Windows

I installed the Pardiso.jl with instructions on the package webpage. And when I run the test code, Julia just exited with the error message below. When I run from 568-574 it was not a problem. but when I try to use solve!() Julia just crushed. The link directs me to https://code.visualstudio.com/docs/supporting/troubleshoot-terminal-launch
I am not an expert with using external solver so would anyone kindly help me out?
The terminal process "julia.exe '-i', '--banner=no', '--project=C:\Users\catie.julia\environments\v1.6', 'c:\Users\catie.vscode\extensions\julialang.language-julia-1.4.3\scripts\terminalserver\terminalserver.jl', '\.\pipe\vsc-jl-repl-f9a2393d-4e4d-42ec-9aa9-acb076d5bde1', '\.\pipe\vsc-jl-cr-4f79880d-c78a-44bc-858d-92cdce1af703', 'USE_REVISE=true', 'USE_PLOTPANE=true', 'USE_PROGRESS=true', 'DEBUG_MODE=false'" terminated with exit code: 3221226356.
test code on Parsido package website
error message appears

NS3_Can't run vanet-routing-compare.cc

I'm new to NS3. I studied vanet-routing-compair.cc script. I tried to run it by these commands (vanet-routing-compare.cc is in scratch folder).
./waf --run scratch/vanet-routing-compare
./waf --run "vanet-routing-compare --scenario=1 --saveconfig=scenario1.txt"
But I'm getting confused with the results. I get following error messages.
msg="Could not connect callback to /NodeList/*/DeviceList/*/ns3::WifiNetDevice/Phy/PhyTxDrop", file=../src/core/model/config.cc, line=920 terminate called without an active exception
Command ['/home/azra/Desktop/ns-allinone-3.31/ns-3.31/build/scratch/vanet-routing-compare'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --gdb").
And by using the gdb debugger, I see this message.
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/azra/Desktop/ns-allinone-3.31/ns-3.31/build/scratch/vanet-routing- compare --scenario=1 --saveconfig=scenario1.txt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
msg="Could not connect callback to /NodeList/*/DeviceList/*/ns3::WifiNetDevice /Phy/PhyTxDrop", file=../src/core/model/config.cc, line=920
terminate called without an active exception
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig#entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 }
I appreciate who can help me understand why this is happening and how I can solve it.
I got the same error in version 3.31, but the version 3.30 is ok. Maybe you can also try version 3.30.
I believe since version 3.31 the names changed from ns3:: to $ns3::
https://groups.google.com/g/ns-3-users/c/VWTV9ZdY7fs/m/MxRdIoLoAAAJ[Here][1]
The workaround I use is to copy the entire file from here:gitlab of ns3 development branch
As you can see, there were few (more than a few) changes in the code.

"Closing the internet connection" to another computer python 2.7

I need to program in py 2.7 a function that
when active, it closes all connections to the internet of a client (It is a server-client socket connection)
Because I cannot just make the client turn off the internet (Because then we won't be able to communicate with him)
I thought to run a thread. That when active (When the server sends to the client "close_internet") the thread runs a while true function that closes all the browsers (and thus "closing" its internet connection). I will have a list of known browsers (not all) that the thread will actively close.
This line of code closes any process by name:
import os
import threading
def close_internet():
while 1:
try:
os.system('taskkill /f /im MicrosoftEdge.exe')
except:
pass
threading.Thread(target=close_internet, args=()).start()
When I run this code, it does work, closing explorer when I open it (Explorer just for testing, you can change to chrome.exe or firefox.exe)
However, in the console it prints some scary errors, all the time:
ERROR: The process "MicrosoftEdge.exe" not found.
ERROR: The process "MicrosoftEdge.exe" not found.
ERROR: The process "MicrosoftEdge.exe" not found.
ERROR: The process "MicrosoftEdge.exe" not found.
ERROR: The process "MicrosoftEdge.exe" not found.
ERROR: The process "MicrosoftEdge.exe" not found.
What can I do? I only need this program to work in the background, without the user noticing with those errors.
The errors appear (not surprisingly) when I don't have explorer open.
When I do have it open, it works fine and prints:
ERROR: The process "MicrosoftEdge.exe" not found.
ERROR: The process "MicrosoftEdge.exe" not found.
SUCCESS: The process "MicrosoftEdge.exe" with PID 10808 has been terminated. # <-- this line
ERROR: The process "MicrosoftEdge.exe" not found.
The function is programmed on the client-side!
How can I fix it?
And secondly, is this the right way to close a process by its name? is it efficient? or is there a more efficient way to close a process (Maybe using its PID makes it faster...) I'd like to hear your advice.
Thanks!
Try using the subprocess module. I don't think you need Threading for this task.
Here is the code i use to open windows explorer and highlight a file.
subprocess.Popen(r'explorer /select, %s%s'%(self.cwd, ofile))
It should be easy to modify for your task. Also that code is assuming that Edge is open and the name is MicrosoftEdge.exe is the process name. Assume nothing and see if you can get a list of running processes using python, scan through that list and check if the application you want to close is already open. Here is a link with some information on getting the list of processes running on windows.

Jenkins Pipeline: build steps not running concurrently?

I'm having trouble with a Jenkins pipeline.
The thing is, it seems one of the steps is running in parallel with another (not intentionally):
I have something like:
...
step("build"){
bat [Visual Basic 6 compile command - vb6.exe file.vbp /outdir my/directory]
if(fileExists("my/directory/output.dll"){
println "SUCCESS"
}else{
error("error")
}
...
}
Ok, the problem is: it checks if the files exist before it's written by the compile command... If I put a sleep 10 before the condition, it always runs OK (for now), but obviously, I don't want to have a sleep command in my pipeline.
I don't know if I can control better the order os execution or if maybe the fault lies in the vb6.exe that creates a thread to write the output and then the main thread returns success before the output being written... does this make sense? Does anyone know how may I solve this problem?
My solution is to make the VB6 compilation step blocking.
This is what I run when working locally on my machine:
cmd /c VB6.exe /make someproject.vbp
And it is also the approach used by the Jenkins Visual Basic 6 plugin (I am the author). See this.

SBCL: building a standalone executable

How do I build a standalone executable in SBCL? I've tried
; SLIME 2.20
CL-USER> (defun hullo ()
(format t "hullo"))
HULLO
CL-USER> (sb-ext:save-lisp-and-die "hullo" :toplevel #'hullo :executable t)
but that just produces the following error.
Cannot save core with multiple threads running.
Interactive thread (of current session):
#<THREAD "main thread" RUNNING {10019563F3}>
Other threads:
#<THREAD "Swank Sentinel" RUNNING {100329E073}>,
#<THREAD "control-thread" RUNNING {1003423A13}>,
#<THREAD "reader-thread" RUNNING {1003428043}>,
#<THREAD "swank-indentation-cache-thread" RUNNING
{1003428153}>,
#<THREAD "auto-flush-thread" RUNNING {1004047DA3}>,
#<THREAD "repl-thread" RUNNING {1004047FA3}>
[Condition of type SB-IMPL::SAVE-WITH-MULTIPLE-THREADS-ERROR]
What am I doing wrong?
What you are doing wrong is trying to save an image while multiple threads are running. Unlike many errors in Lisp the error message explains exactly what the problem is.
If you look up the function in the sbcl manual here then you find that indeed one may not save an image with multiple threads running. The extra threads come from swank (the CL half of SLIME). The manual says that you may add functions to *save-hooks* which destroy excess threads and functions to *init-hooks* to restore threads.
One way around all this is to not save the image when it is running through slime but instead to start sbcl directly at a terminal (note: no readline support), load your program and save from there.
Working with slime is different. In theory there is a SWANK-BACKEND:SAVE-IMAGE function but I’m not sure if that works. Also as saving an image kills the process you may want to fork (SB-POSIX:FORK) first, unless you are on Windows. But forking causes problems due to not being well specified and file descriptor issues (i.e. if you try fork->close swank connection->save and die then you may find that the connection in the parent process is closed (or worse, corrupted by appearing open but being closed at some lower level)). One can read about such things online. Note that due to the way sbcl threads are implemented, forking clones only the thread that forks and the other threads are not cloned. Thus forking and then saving should work but may cause problems when running the executable due to partial slime state.
You may be interested in buildapp.
If you want to be able to use slime with your saved application you can load swank and start listening on a socket or port (maybe with some command line argument) and then in Emacs you may connect to that swank backend with slime.
You have to run save-lisp-and-die from a new sbcl, not from Slime. Dan Robertson explains more.
It is cumbersome the first time, but you can put it in a Makefile and re-use it. Don't forget to load your dependencies.
build:
sbcl --load cl-torrents.asd \
--eval '(ql:quickload :torrents)' \
--eval '(use-package :torrents)' \ # not mandatory
--eval "(sb-ext:save-lisp-and-die #p\"torrents\" :toplevel #'main :executable t)"
The quickload implies Quicklisp is already loaded, which may be the case if you installed Quicklisp on your machine, because then your ~/.sbclr contains quicklisp loading script ((load quicklisp-init)).
However sb-ext is not portable across implementations. asdf:make is the cross-platform equivalent. Add this in your .asd system definition:
:build-operation "program-op" ;; leave as is
:build-pathname "<binary-name>"
:entry-point "<my-package:main-function>"
and then call asdf:make to build the executable.
You can have a look at buildapp (mentioned above), a still popular app to do just that, for SBCL and CCL. It is in Debian. http://lisp-lang.org/wiki/article/buildapp An example usage looks like
buildapp --output myapp \
--asdf-path . \
--asdf-tree ~/quicklisp/dists \
--load-system my-app \
--entry my-app:main
But see also Roswell, a more general purpose tool, also supposed to build executables, but it is less documented. https://roswell.github.io/
If you want to build an executable on a CI system (like Gitlab CI), you may appreciate a lisp Docker image which has already SBCL, others lisps and Quicklisp installed, and if you want to parse command line arguments, see https://lispcookbook.github.io/cl-cookbook/testing.html#gitlab-ci and (my) tutorial: https://vindarel.github.io/cl-torrents/tutorial.html#org8567d07

Resources