Unexpected speedup when running script in barebones matlab

1 visualización (últimos 30 días)
Nelis
Nelis el 15 de Jul. de 2014
Comentada: Nelis el 9 de Sept. de 2014
I have a function I've been running for the last several months, which typically takes around 2 hours to run. In order to run it on our cluster I'm now calling the same function in a headless matlab, using the following command from a terminal:
matlab -nosplash -nojvm -singleCompThread -nodesktop -r "myFunc(1,20)"
where I would otherwise use this command from within matlab:
myFunc(1,20)
While I expected this to run slightly faster (~10%) due to removing the overhead of the matlab GUI, the code is now running in under 15 minutes, about 8x faster than normal. This speedup is consistent accross several computers, including the linux cluster and two windows desktops.
My question is: are there any known reasons the same code should run this much faster, and is can I be confident that the results from running the code this way are the same as before?
For a little more detail, my function is effectively shuffling a 2d matrix of 1's and 0's, attempting to match particular distribution requirements. Most of the runtime is spent in Matlabs conv2 function, followed by find and randi.
  4 comentarios
Titus Edelhofer
Titus Edelhofer el 3 de Sept. de 2014
Interesting observation... Have you tried to run your desktop MATLAB with singleCompThread flag as well?
Nelis
Nelis el 9 de Sept. de 2014
I haven't tried running the desktop with any of those flags, only the exact command above both in a unix terminal, and cmd on my windows desktop, with similair results. I think I've just had the same effect in an entirely different program (also with a lot of calls to conv2), I'll try and build a minimal working example from that and try a few different scenarios.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by