Changeset 5699 in /cluster/svnroot


Ignore:
Timestamp:
May 23, 2016 8:09:40 PM (5 years ago)
Author:
skylar
Message:

more comments

Location:
bccd-ng/bw-institute/2016/day06/matmul
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/bw-institute/2016/day06/matmul/matmul.c

    r5698 r5699  
    104104    double start_t = omp_get_wtime();
    105105#pragma omp parallel for private(dst_coord,i) collapse(2) schedule(static,1)
     106#else
     107    struct timeval start_t;
    106108#endif
    107109    // Process each cell in the destination matrix, and calculate the result
     
    115117            // Make sure destination matrix is initialized
    116118            dst_m->matrix[dst_coord] = 0;
    117             // The number of rows in m1 is guaranteed to be the number
    118             // of columns in m2, so when we are done processing m1's rows
    119             // we are also done processing m2's columns
    120             // This part is not as amenable to parallelization since the
    121             // multiple threads would have to update the cell in the
    122             // product matrix at the same time
     119            /*
     120             * The number of rows in m1 is guaranteed to be the number
     121             * of columns in m2, so when we are done processing m1's rows
     122             * we are also done processing m2's columns
     123             * This part is not as amenable to parallelization since the
     124             * multiple threads would have to update the cell in the
     125             * product matrix at the same time
     126            */
    123127            for(i=0;i<m1->rows;i++) {
     128                /*
     129                 * The destination matrix cell will accumulate pair-wise
     130                 * multiplication results from every cell in the current
     131                 * row in the first matrix, and every cell in the current
     132                 * column in the second matrix
     133                 */
    124134                dst_m->matrix[dst_coord] +=
    125135                    m1->matrix[coord(m1,dst_row,i)]
  • bccd-ng/bw-institute/2016/day06/matmul/matmul.h

    r5694 r5699  
    2020#else
    2121#define NUM_THREADS 1
     22#include <sys/time.h> // gettimeofday(2)
    2223#endif
    2324
Note: See TracChangeset for help on using the changeset viewer.