WinAFC is a configurable program for controlling CPU affinities and priority settings of Windows applications on multi-core processor-based systems (both AMD and Intel). It is freeware available from SourceForge.net and currently runs on Vista, WinXP, and Win2K,in both 32 and 64-bit versions.
Introduction
The program is highly configurable and allows the user to control CPU affinity (including core pairing), and process priority for any application. Inspired by Folding@Home, the program is well-suited to getting the most out of complex, multi-client F@H installations.
I have been running tests with WinAFC over the last week or so to determine if it can improve F@H client performance. The results are favorable; dual-SMP output is improved using WinAFC in early testing.
Being that the program will allow detailed control over processes, it can be rather complex to fully understand and configure depending on your installation. However, the author has suggested some fairly simple rules that work great on dual-SMP/dual-GPU quad-core rigs. And best of all, with a bit of testing and analysis, we can use WinAFC to really fine-tune the performance of F@H installations. This will be increasingly important with the upcoming rollout of Intel i7 and other multi-core processors that boast 6+ cores!
Installation
Installation of WinAFC is easy. You simply unzip it into a folder of your choice, configure, and run. It does not update Windows registry, access your network, or manipulate any files outside of a few config and log files in the WinAFC installation folder. For Vista, you can run it with administrator privileges to allow it to control processes running under admin or other users.
The program reads an input file to get the configuration information it needs to control the processes of your choice. There is a help file that covers the program's configuration parameters in great detail, along with several useful examples to illustrate the many flexible features. One real advantage this program has over others of the same variety is the ability to detect which CPU cores are on the same die (in the case of Intel processors) which have shared resources (like L2 cache). This allows you to define configurations to run processes across those "pairs" to optimize their performance.
Once running, it creates a console instance (you can choose to hide this or run in "stealth mode") that provides log-style status information of the activities of WinAFC. It has a user-configurable log verbosity setting to control the level of detail of messages within the log. A nice feature is a "test mode" that you can use to see how WinAFC would alter process attributes (processor affinities, priority, etc) without actually doing it. This feature is also very useful to quickly see how the program will treat different rules you devise.
Configuration
Using the numerous parameters available in WinAFC, you can create simple or very complex rules (or "application profiles" as the author calls them). You can use process metrics such as memory or CPU utilization as input to your rules. WinAFC has several "policies" available to help you build rules that control process behavior without a lot of complex, explicit rules.
I worked with the program author quite a bit to resolve a bug, and to gain a better understanding of the program and it's configuration. He was very helpful and provided me with the configuration rules and CPU masks used in my testing. Attached to this post is the WinAFC config file used for my testing. Feel free to use it to conduct your own testing. I will not attempt to explain the various configuration parameters for WinAFC. Some of them are pretty straight-forward. Others can be quite complex, particularly when used in combination and with multiple processes in your list.
WinAFC can be very useful, since it is so highly configurable. As I mentioned above, a key advantage is being able to put like processes on the same CPU die (or "PAIR" as the author calls them). Another advantage is being able to really fine-tune each process in the F@H rig, and see what the program is doing in real-time. These features should allow us to really take affinity changing to an Xtreme level!
Testing
I ran many test configurations over the course of the last week or so. I am still testing. This will likely continue for quite some time as I play with different scenarios to further optimize F@H on my folding rig. Here is the configuration of that box:
Intel Q6600 3.3GHz, Asus P5KC, 2GB RAM, Vista 64 SP1, EVGA 9800GX2
For F@H clients, I run all beta software:
2 instances of Windows SMP 6.22b2, and 2 instances of GPU 6.20.r1
After trying several different test configs, I found two scenarios were most likely to do as well as my current affinity changer software (FAH SMP AC). So I set up the test rig to run both SMP clients on the same F@H project, and ran them approximately equal number of frames using FAH AC, WinAFC config #1, and WinAFC config #2.
Test Case #1 is FAH SMP Affinity Changer v1.0.5.0. As most of you know, the current version of FAH AC controls only SMP clients, nothing else, and really is not configurable at all, AFAIK. The docs (what little there are) are not available in english, so I really have no idea what the program really does.
Test Case #2 is WinAFC config#1. This profile does the following: put all PIDs from an SMP instance on the two CPUs that share a die ("PAIR") within the Q6600. Put the most cpu-intensive SMP PID and the least cpu-intensive SMP PID together. Put the second and third (middle two) busiest PIDs on the other CPU of the pair. Then put one GPU client with the two middle SMP PIDs. Do everything like this again for the second instance of SMP and GPU onto the other pair of CPUS.
Test Case #3 is WinAFC config#2. This profile does the following: Same setup as config #1, but allow the least expensive SMP PIDs to roam on both cores of the pair, based on how busy the core is.
I'll jump straight to the results first, then do some additional explaining:
Looking at the bottom of the chart, you can see the PPD results from the 3 test scenarios. The first scenario (FAH AC) is the baseline, with 13,864 PPD for all four F@H clients. The second scenario is the WinAFC Config #2, with 13,802, performing just a bit under the FAH AC. The final scenario is running WinAFC config #1, scoring marginally better than the baseline with 14,112 total PPD.
How to interpret the details:
Each process (PID) of the F@H client is a row within each group. The numbers along that row are the CPU affinity assigned to that PID during the test. Avg Frame is the mean average duration of a frame during that test case. The memory and CPU time numbers down the right side are the resource utilization captured near the end of each project for each PID. For GPU clients, this number is an average across the projects during the test period.
During the testing, I used Vista Task Manager to identify PIDs, analyze where they were running, their priority, utilization, etc. Here's a shot during execution of the test:
Summary
WinAFC is highly configurable and provides great activity reporting. You can control every process in your system, not just isolated ones. Early test results show only marginal improvements over FAH SMP AC. However, I have really only scratched the surface on this. Given more time to experiment, I am optimistic I can increase F@H client performance well beyond the marginal gains I have acheived in my preliminary testing.
"[crunching is] a minor service to humanity as a side effect of our collective hardware fetish" - Blauhung
Bookmarks