[18335fall09] pset 1 tip: disabling multiprocessing in Matlab for problem 3

Steven G. Johnson stevenj.mit at gmail.com
Fri Sep 18 15:27:45 EDT 2009


Hi gang,
I forgot a little trick from last year that you need in order to get  
sensible benchmark results from Matlab for problem 3. Matlab may  
parallelize its matrix-multiply routine if you have a multi-core  
machine (which most people do nowadays).  This may lead to distorted  
or confusing results in problem 3 of the pset.

You can turn off multiprocessing in Matlab by using the  
maxNumCompThreads function.  In particular, doing

	maxNumCompThreads(1)

should tell Matlab to use at most one processor.  (Note that you have  
to do this each time you run Matlab, as when you launch it  
automatically uses all available processors by default.)

--SGJ



More information about the 18335fall09 mailing list