Thomas M. Turner's Tech Ramblings  

  IT blogging from the corn, soybean, & hog state... oink.      Atom formatted XML site feed  

July 18, 2004

Runaffny.exe console app

The problems I previous posted about SPSS syntax files crashing on our new Hyper-Threading Pentium 4 systems led me to write a program to launch a process and then set it to use specific processor: runaffny.exe 
  
Although I do like the THG Task Assignment Manager program, unfortunately it has to be running before the target application is launched.  Showing one or two users how to use it properly is one thing, but rolling it out into a student computer lab, or in a hundred or more faculty offices, doesn't appeal to me.   I also came across a console utility, process.exe, which lets you list or set the affinity of an already running program.
 
I definitely prefer console apps, to use in batch file scripts, but I wanted a utility where I could simply replace the SPSS shortcut with one that would launch the app just the same, but would also automatically set the program to use only one processor. 

So, I copied over my new console app to %SystemRoot% and then created a shortcut as so:
%SystemRoot%\runaffny.exe "c:\program files\spss\spsswin.exe"
   
By default, this will set the affinity to use only CPU0.  (I also changed the icon to use the one in the SPSSWIN.EXE itself, so now, to the user, they don't know there is anything different about running the program.)

Other than adding in command-line argument handling and such, the gist of the app is just calling CreateProcess()  and SetProcessAffinityMask().  
 
Of course, I would rather have SPSS simply make an option within the program itself, to set a default processor affinity each time the application is run.  At the very least, since they know syntax files are crashing on SMP/Hyper-Threading PCs (and Macs), they should at the very least always set the syntax file execution thread to a single processor affinity.  Quite honestly, I shouldn't have to had to spend any time writing a program to work around a bug in their software. 



Archives

03/28/2004 - 04/03/2004   04/25/2004 - 05/01/2004   06/27/2004 - 07/03/2004   07/04/2004 - 07/10/2004   07/11/2004 - 07/17/2004   07/18/2004 - 07/24/2004   07/25/2004 - 07/31/2004   08/01/2004 - 08/07/2004   08/08/2004 - 08/14/2004   09/19/2004 - 09/25/2004   10/03/2004 - 10/09/2004   10/24/2004 - 10/30/2004   02/13/2005 - 02/19/2005   02/20/2005 - 02/26/2005  

This page is powered by Blogger. Isn't yours?