cs205-lecture-examples

Example codes used during Harvard CS205 lectures
git clone https://git.0xfab.ch/cs205-lecture-examples.git
Log | Files | Refs | README | LICENSE

README.txt (5624B)


      1 /****************************************************************************
      2 *                                                                           *
      3 *             OpenMP MicroBenchmark Suite - Version 3.1                     *
      4 *                                                                           *
      5 *                            produced by                                    *
      6 *                                                                           *
      7 *             Mark Bull, Fiona Reid and Nix Mc Donnell                      *
      8 *                                                                           *
      9 *                                at                                         *
     10 *                                                                           *
     11 *                Edinburgh Parallel Computing Centre                        *
     12 *                                                                           *
     13 *         email: markb@epcc.ed.ac.uk or fiona@epcc.ed.ac.uk                 *
     14 *                                                                           *
     15 *                                                                           *
     16 *      This version copyright (c) The University of Edinburgh, 2015.        *
     17 *                                                                           *
     18 *                                                                           *
     19 *  Licensed under the Apache License, Version 2.0 (the "License");          *
     20 *  you may not use this file except in compliance with the License.         *
     21 *  You may obtain a copy of the License at                                  *
     22 *                                                                           *
     23 *      http://www.apache.org/licenses/LICENSE-2.0                           *
     24 *                                                                           *
     25 *  Unless required by applicable law or agreed to in writing, software      *
     26 *  distributed under the License is distributed on an "AS IS" BASIS,        *
     27 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
     28 *  See the License for the specific language governing permissions and      *
     29 *  limitations under the License.                                           *
     30 *                                                                           *
     31 ****************************************************************************/
     32 
     33 ===============
     34  Licence
     35 ===============
     36 This software is released under the licence in Licence.txt
     37 
     38 ===============
     39  Introduction
     40 ===============
     41 Overheads due to synchronisation, loop scheduling, array operations and 
     42 task scheduling are an important factor in determining the performance of 
     43 shared memory parallel programs. We have designed a set of microbenchmarks 
     44 to measure these classes of overhead for language constructs in OpenMP. 
     45 
     46 ===============
     47  Installation
     48 ===============
     49  1. Unpack the tar file
     50 
     51  2. Edit the Makefile.defs as follows:
     52     * Set CC to the C compiler you wish to use (e.g. gcc pgcc icc xlc etc)
     53     * Set CFLAGS to any required C compiler flags to enable processing of 
     54       OpenMP directives (e.g. -fopenmp -mp, -omp); standard optimisation is 
     55       also recommended (e.g. -O).
     56     * Set LDFLAGS to any required C linker flags
     57     * Set CPP to the local C-Preprocessor (e.g. /usr/local/bin/cpp) to 
     58       make the C compiler invoke cpp on .c and .h files
     59     * To benchmark OpenMP 2.0 features can be invoked by setting the flag 
     60 	OMPFLAG = -DOMPVER2
     61     * To benchmark OpenMP 2.0 & 3.0 features can be invoked by setting the flag 
     62 	OMPFLAG = -DOMPVER2 -DOMPVER3
     63     * If neither of these flags are set then OpenMP 1.0 compatibility is 
     64       ensured.
     65 
     66 3. Type "make" to build all 4 benchmarks or "make benchmark" where benchmark 
     67     is one of syncbench, taskbench, schedbench. By default "make" will build 
     68     executables with array sizes ranging in powers of 3 from 1 to 59049. To 
     69     build the array benchmark with an array size of arraysize, use 
     70     "make IDA=arraysize prog" where arraysize is a positive integer. 
     71 
     72 
     73 Example Makefile.defs.* files are supplied for several machines and
     74 compiler versions, e.g. 
     75 	 Makefile.defs.hector.* - Cray XE6 
     76 	 Makefile.defs.magny0.* - 48 core AMD Magny Cours machine
     77 	 Makefile.defs.stokes.*	- SGI Altix ICE 8200EX
     78 
     79 
     80 ===============
     81  Running
     82 ===============
     83 
     84 1. Set OMP_NUM_THREADS to the number of OpenMP threads you want to run with, 
     85    e.g. export OMP_NUM_THREADS = 4
     86    OMP_NUM_THREADS should be less than or equal to the number of physical 
     87    cores available to you. 
     88 
     89 2. Run the benchmark with:
     90    ./benchmark 
     91 
     92    The output will go to STDOUT and thus you will probably want to re-direct 
     93    this to a file. ./benchmark --help will give the usage options. 
     94 
     95 
     96 =================
     97 Additional notes
     98 =================
     99 
    100  1. If you encounter problems with the value of innerreps becoming too 
    101     large (an error will be reported) try recompiling with a lower level of 
    102     optimisation, ideally with inlining turned off. 
    103 
    104  2. It is common to observe significant variability between the overhead 
    105     values obtained on different runs of the benchmark programs. Therefore, 
    106     it is advisable to run each benchmark, say, 10-20 times and average the 
    107     results obtained.
    108 
    109  3. You should use whatever mechanisms are at your disposal to ensure that 
    110     threads have exclusive or almost exclusive access to processors. You 
    111     should rejects runs where the standard deviation or number of outliers is 
    112     large: this is a good indication that the benchmark did not have almost 
    113     exclusive access to processors.