Run MPI program from console on several Windows machines - windows

I'm trying to execute parallel MPI program on several Windows machines (actually I have one Win7 and one WinXP machines, but people with other configurations (WinXP on all machines, for example) have the same problem). I use MPICH2 (1.4.1p1). I can execute program if I use wmpiexec (MPIEXEC wrapper - GUI for MPI) but if I try to execute it from console I catch next error:
Command: mpiexec -hosts 2 locahost 2 192.168.0.102 2 <path to the program>
Error: mpiexec running on <name of my machine> is unable to connect to msmpi service on locahost:8677
I have created rule for the program in Windows firewall.
So where can be a problem?
Thanks in advance.

It's a wierd solution, but when mpiexec.exe and executable MPI-program is in the same directory everything is fine.

Related

Running Cygwin application as a Windows Service

I am working on WinDRBD (https://github.com/LINBIT/windrbd) a port of the Linux DRBD driver to Microsoft Windows.
We want to run the user mode helper as a Windows Service (DRBD sometimes calls user space applications with call_usermodehelper(), which we emulate by a daemon that retrieves those request from the kernel driver, runs them and returns the exit status to the kernel).
When we run the daemon in a cygwin shell, everything works fine. However when running the daemon as a Windows Service it seems that cygwin cannot find its installation directory (which is C:\cygwin64 on my machines).
The registry entry (HKLM/Software/CygWin/setup/rootdir) points to the correct location, but I am not sure if it can also be accessed by the Windows Service?
/bin/sh isn't found by the service, however /cygdrive/c/cygwin64/bin/sh
exists, so when I run the shell with that path it can start
(and also finds the DLLs it requires to run). However shell
complains with:
bash.exe: warning: could not find /tmp, please create!
which definitely exists when running cygwin the normal way.
Has anyone ever tried to run a CygWin compiled EXE as a Windows
Service? Here is the output of sc query windrbdum:
SERVICE_NAME: windrbdum
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
(um is for user mode).
Thanks for any insights,
Johannes
As matzeri pointed out, cygrunsrv is the cygwin tool when it comes to running cygwin binaries as a service under Windows. It serves both as a wrapper (that does the Windows specific service API and event handling) as well as a tool to install, remove, start and stop services (this can still be done with the sc utility like
sc start <servicename>
).
To install a service (I) do:
cygrunsrv.exe -I windrbdlog -p /cygdrive/c/windrbd/usr/sbin/windrbd.exe \
-a log-server \
-1 /cygdrive/c/windrbd/windrbd-kernel.log \
-2 /cygdrive/c/windrbd/windrbd-kernel.log
where windrbdlog is the Windows name of the service, /cygdrive ... is the
full path to the cygwin application (no need to code any Windows Service API
calls there, it's just a Cygwin/POSIX executable), log-server is the argument
to the binary (so what is being started is windrbd log-server) and -1 and -2
are rediects for stdout and stderr. Exactly what I need, thanks to matzeri
for pointing me to cygrunsrv.

Remotely running "vmrun command" on server machine from jenkins

I have windows 7_x64 Virtual Machine on Server machine running on Windows Server 2008 R2. I want to run this VM from jenkins (CI tool which executes batch file, running on same server).
I am using vmrun utility to do so.
When i run
vmrun -T ws -gu *** -gp *** start "vmx file path.vmx"
this executes fine on server command prompt (locally). but when i try to exceute the same from any of the client machine (by visiting jenkins site) I get
Error: There was an error in communication
After some troubleshooting, I can say vmrun command is not responding whenever it is evoked remotely. but it is confusing me, because I have jenkins which is running those commands is installed on same server. i am just running job from thin client. how does that make any difference?
Could anyone help me troubleshooting this issue?
Thanks!
For reference:
*Server machine(host): Windows Server 2008 R2
*Virtual machine(guest): Windows 7 x64
*Jenkins : Installed on same server (host)
*client : remote windows machine, accesses the jenkins instance from browser and triggers the job
*problem/error : vmrun commands dont execute.
Jenkins does not execute anything on "client" (i.e. the machine with the browser from which you accessed Jenkins instance). Jenkins will only execute anything on Master (what you called "server machine") or Slave nodes.
Now, there can be several differences between running the command from your local command prompt (on server) and through Jenkins. The primary difference is that Jenkins runs under a separate session, usually under a separate user, which may have different permissions, however that depends on how you have installed and configured the Jenkins session.
To identify if there are any Environment variable differences, type set on your local command prompt, and then execute Jenkins with just set in the build step. Compare the two. Other than Jenkins specific variables, everything else should be same.
Also, verify that your Jenkins user (the one running the service) has permissions to do whatever your are doing.

Exec a program on client runs a programm on server

First of all I have spent over 4 hours researching this topic..
So I have a Windows 2008 r2 root server at the moment. I connect to it via Remote Desktop.
Now I want to write a program that runs batch files on the server but the program is at client side, I have tried to setup an SSH server on my Windows server with Freesshd.
That seems to work but the programs are not shown. (In Taskmanager are they)
Is there way (prefer SSH) to let them show normally?
The goal is to restart programs (Gameservers).
My Program will work so: if I press restart server it will connect (if SSH) via Putty to the server to exec the batch file.
Or will start another program with parameters something like this:
Clientprogramm -ip 95.25.115.** -user Administrator -p xxxxxx C:\gameserverdir\start.bat
Simple and fine. I have done that already for Linux and there it isn't that hard.
So if you have an idea that can help me would be nice to know.
Both system are Windows!
If you are using SSH, the tool you need is plink. It's putty for command line.
Or, as indicated in comments, you can use psexec, or powershell, or vbscript, or .... BUT started programs are only "visible" in the same session from where they were started.

VS 2013 kernel-mode driver debugging

I'm trying to set up kernel debugging with VS 2013. When I go to Drivers/Add to add a new target machine, it connects to the remote computer and runs through a lot of setup, but it there are always 2 commands that fail.
I looked up the command that is failing in the log and I pasted it into a batch file and ran it on the target machine. I runs just fine. But then when I try to rerun Add Computer from VS, I get the same failure.
RemoteExecute: Binary: $KitRoot$\Testing\Runtimes\TAEF\te.exe
RemoteExecution: Arguments:
"%SystemDrive%\DriverTest\Run\DriverTestTasks.dll"
/select:"#Name='DriverTestTasks::_ConfigureKernelDebugger'"
/p:"DebugTransport=NET" /p:"NetHost=192.168.1.109" /p:"NetPort=50015"
/p:"NetKey=8XD3HYLMVI0D.RKFEA2BPIXO.27JOLNYURED5.MV9OGRF4XR9V"
/p:"StartPolicy=Active" /p:"IgnoreUserModeExceptions=0"
/p:"SuppressReboot=1"
/rebootStateFile:%SystemDrive%\DriverTest\Logs\DriverTestReboot.xml
/enableWttLogging
/wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Logs\Configure_debugger_settings_(x86)_(possible_reboot)_00007.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*"
/runas:Elevated RemoteExecute: Process creation return code: 0
RemoteExecute: Process exit code: 0 Initialize: Computer: w8x86wdk-hp
Result completed Test process exit code: -1
I have tried this both with a VMware VM target and against a physical PC target and I have tried adding the computer in the reverse direction and I always get the same failures. I can ping these machines from each other and all machines are Win8 x86. Network discovery and sharing are on. The Windows firewalls are off. These are virgin OS installations so there's nothing on the machines except the OS, VS2013, and WDK 8.1.
Any tips on how to resolve this?
Had same issue when used ws2012 for TARGET machine.
When installed WIN81 instead, turned off UAC and DID NOT install wdk on TARGET - everything started working. Read carefully how to PROVISION TARGET. (it says: dont' install WDK there:)
HOST and TARGET was in the same home workgroup with same passwords for Administrator and MyUserAcc.
also:
under HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System set EnableLUA=0
I am just testing it so I think you should first check your target computer security issue. Then set your port pipe connection and your network adapter setting in your virtual pc.
After that setting make your computer configuration then works perfectly.

parallel execution of multiple system commands on a single unix host from windows

I need to execute multiple system commands in parallel on a remote unix machine(only through ssh) from my windows machine.
I have used paramiko module to do the ssh to the remote machine. In the same script, I have used python subprocess module to fire the commands in parallel on the remote machine.
But I am unable to do it . Could anyone please let me know how to achieve this scenario using subprocess module? or any other way to look into the problem?
My line of code where it is not working is :
processes.append(Popen(task,shell=True)) ----> task is getting executed on my own windows machine and not getting executed on the remote unix machine. it gives me a error an windows error. Also I don't know whether my subprocess code will work for achieving parallel runs here.
But I am successful in achieving parallel runs with the same piece of code using subprocess module if I copy the code to the unix machine and run the script locally.
Problem comes when I am executing the code from the windows machine and doing ssh to the remote machine.
What about Fabric ? http://docs.fabfile.org/en/1.10/usage/parallel.html
I always use it for such purposes.

Resources