To know which core are running which processes

10 views (last 30 days)
Hi.
I have a multi-core computer and it is running a MATLAB program.
This program uses two toolboxes, Parallel Computing and Symbolic.
When Symbolic toolbox starts to run, a process, mupkern.exe, is created and not killed in the end.
If I do not use the Parallel Computing toolbox, I can type !taskkill /IM mupkern.exe in the MATLAB program and the process will be killed.
However, with Parallel Computing toolbox, the MATLAB program creates n mupkern.exe, with n equals to the number of cores used.
It is safe to do !taskkill /IM mupkern.exe? It will kill the process in such core or it will be random?
There is a command prompt command to identify the processes and the cores where they are running?
For example, if I type tasklist within command prompt, several types of information are available but not what I want.
Thank you in advace.
Best Regards,
Tiago
  1 Comment
Christopher Creutzig
Christopher Creutzig on 21 Sep 2012
Are you sure the mupkern.exe processes are not terminated when you quit MATLAB?
Also, I'd like to point out that on Windows, these processes have not been started for quite a few releases. Assuming they do pose a problem, the easiest solution might be an update.

Sign in to comment.

Answers (1)

Jason Ross
Jason Ross on 10 Sep 2012
When you issue taskkill in that manner it would kill all images with that name. It's not scoped to kill only certain sessions.
To kill certain sessions, you'd need to track the PID and use that to explicitly kill the process that you wanted to. This quickly becomes non-trivial, as it's hard to know exactly which process spawned what.
Were I to be in your situation, I'd likely look at using some kind of wrapper script that makes my life easier. Depending on what your code looks like, you need a way to guarantee uniqueness -- you could use the labIndex, some form of counter, or make one up, and then launch a unique instance that's easily killable.
As a sketch, you could do something like the following:
  1. Make a variable with the code you are going to put in a batch file -- essentially a big string that has the unique information in it, and the call to mupkern.exe
  2. Open a file handle with the generated name, e.g. mupkern_launcher_for_lab1.bat
  3. Write the variable to this file.
  4. Launch that file with system()
  5. When you need to kill the process, you now have a readily available way of killing.
For a simplified version, you could just have batch files called mupkern1, 2, 3, 4, etc that call mupkern, but you call each one and then kill them in turn.
As I said, the generalized way to do this is to track the PID of the executable, but that can get a bit tricky, especially on Windows.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!