kdahlquist / GRNmap

Gene Regulatory Network modeling and parameter estimation
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

Parallel MATLAB execution on multi-core Windows machines #391

Closed bengfitzpatrick closed 5 years ago

bengfitzpatrick commented 6 years ago

The steps are as follows.

  1. Find out how many CPUs are available. a. Press control-alt-del b. Select “Start Task Manager” c. Click the “Performance” Tab d. The number of “CPU Usage History” graphs is the number of available processors (see Fig 1) e. Do not close the task manager: you will need it again later.
  2. Decide how many instances of MATLAB you want to run. Max should be # available processors minus 1, so the OS and windows tasks have some room to work. Personal experience suggests if you use more than half the available processors, performance decreases somewhat.
  3. For each instance you want to run, create a separate folder with the GRNMAP software and input workbook of interest. This step is necessary to keep the multiple instances from interfering with each other’s execution.
  4. Open a command window a. Click the “windows start button” b. In the search box, type “cmd” without the quotes c. A command window (black background and a c:\users\> prompt) appears (see Fig 2)
  5. Start a MATLAB instance. a. Type “matlab –automation &” without the quotes b. There will be a delay until the MATLAB instance starts
  6. In the MATLAB window, change to the folder of your desired GRNMAP run a. The MATLAB command looks like cd(‘c:\users\bfitz\documents\GRNMAP_run_01’) but requires the folder name you are using b. Once the directory is set, type GRNmodel to start the run
  7. Return to the Task Manager to assign the run to a CPU a. Click the “Processes” tab on the Task Manager b. Search the “Image Name” column for MATLAB (see Fig3) c. Right-click on MATLAB.exe d. Select “Set affinity…” e. Click the “” check box to clear. f. Now check “CPU 1” and click “OK” (see Fig 4)
  8. Return to Steps 5-7 as needed a. You don’t have to retype “matlab –automation &” – use the up arrow and hit return b. In Step 6, navigate to the appropriate copy c. In Step 7c, you will have multiple instances of MATLAB. Having started previous instances, the one with the smallest number in the “Memory” column should be the new one d. In Step 7f, check the next usused processor e. We are leaving CPU 0 open to take the Windows processing load.
kdahlquist commented 5 years ago

Moved these instructions over to the wiki here: https://github.com/kdahlquist/GRNmap/wiki/Parallel-MATLAB-execution-on-multi-core-Windows-machines