keylabs_smp_test.txt file for KeyLabs Test Packages =============================================================== About this SMP Test ------------------- The purpose of this test is to verify the CPUs in a test system are working. The test itself is a very small program called loop5d, and it will make each CPU in the system work very hard for a short period of time. The test is currently in various pieces but will be collected into one cohesive chuck of code shortly. The loop programs are from Cameron MacKinnon (email address listed in the code below). These loop programs do the actual work. The SMP_test script program is a way to ease getting the loops working and is not necessary to the test, but can be convienient at times. The xosview program provides the tester with a visual gauge for observing the CPUs at work. This test was assembled from information provided by the SMP-HOWTO: http://www.irisa.fr/prive/dmentre/smp-faq/ Setting up for testing - loop5d program and SMP_test script ----------------------------------------------------------- [Note: The following describes use of the loop5d.c code but the tester can use any of the loop snippets he chooses.] 1. Compile the loop5d.c program with the following command line: gcc -Wall06 -o loop5d loop5d.c This will give you an executable program named loop5d 2. Edit the SMP_test script for number of CPUs on the test system. For each CPU you need one instance of "time loop5d" For example: Two CPUs in test machine: time loop5d & time loop5d Four CPUs in test machine: time loop5d & time loop5d & time loop5d & time loop5d {Note: Yes, I know this is some serious cheese. I'm working on it when time allows.] 3. Check the permissions on both the loop5d program and the SMP_test script for executability. 4. Copy the loop5d program into the path (/usr/local/bin) Setting up for testing - xosview program. ---------------------------------------- 1. Copy the xosview tarball from the floppy to the harddisk: cp /floppy/xosview*.tgz /usr/local/ 2. Change directory to /usr/local/ and Untar the xosview tarball: cd /usr/local/; tar -xvzf xosview*.tgz 3. Enter the xosview directory: cd xosview*/ 4. Configure the xosview program for make: ./configure 5. Make and install the program: make; make install Running the test ---------------- 1. Start xosview in the background: xosview & 2. Start SMP_test: ./SMP_test Monitoring Results ------------------ Watch the CPU indicators, they'll usually peg out on the far right. For every CPU indicator, their should be a solid green line almost to the very end of the indicator. The test loop only runs for a short period of time (usually less than three minutes for the loop5d program.) Don't be concerned with exit errors from the loops -- we're just making sure the CPUs are working. The test is a pass if all CPU indicators show the CPUs are working and working at approximately the same time. Note that not all the test loops found in the /loop directory will make all the CPUs on the machine work at the same time. See Cameron's website (listed above) for detailed info about the various loop tests. Loop5d Test Code ---------------- The test code for loop5d is included here just in case. Instructions for compiling: gcc -Wall06 -o loop5d loop5d.c --- Begin code for loop5d.c --- /* Code by: with (very) minor mods by James C. Williams, KeyLabs Linux Team. Case 10b: Real World(tm) floating point with optimized compile [Note: To get the optimized compile, use the following: gcc (or egcs) -Wall06 loop5d.c -o loop5d. This will make a loop5d program in your directory. This code is identical to loop5c.c without the -Wall06.] Command line for case 10 above: time loop5d; time loop5d & time loop5d */ #define LINE 8 main(){ double buff[1000000]; unsigned long int i; int j; for (j=0; j<43*LINE; j++) for (i=0; i<1000000; i+=LINE/sizeof(double)) buff[i]=buff[i]*3.14+2.71; } --- End code for loop5d.c