Changeset 5723 in /cluster/svnroot


Ignore:
Timestamp:
Jun 5, 2016 9:42:48 PM (4 years ago)
Author:
skylar
Message:

comments

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

Legend:

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

    r5722 r5723  
    11# $Id$
    22
    3 CC                      = gcc
     3CC                      = cc
    44MPICC           = cc
    55ifeq ($(NON_BW),1)
    6         MPICC   = mpicc
     6        CC                      = gcc
     7        MPICC           = mpicc
     8        OMP_FLAGS       = -fopenmp
    79endif
    810CFLAGS          =
     
    1719        CFLAGS  +=      -pg
    1820endif
    19 OMP_FLAGS       = -fopenmp
    2021
    2122EXPENDABLES     = serial openmp mpi-serial matmul-serial.o matmul-omp.o
  • bccd-ng/bw-institute/2016/day06/matmul/mpi.c

    r5721 r5723  
    99
    1010int main(int argc,char **argv) {
    11     int rank,num_ranks,c,*row_counts,*recv_counts,*displs;
    12     unsigned int i,start_row,stop_row,row_stride,local_cells,dst_cells;
    13     bool print = false;
    14     struct matrix m1,m2,local_dst_m,dst_m;
     11    int
     12        rank, // Local rank ID
     13        num_ranks, // Total number of ranks
     14        c, // Command line switch from getopt
     15        *row_counts, // Per-rank count of rows to process
     16        *recv_counts, // Per-rank count of cells to process
     17        *displs; // Cumulative per-rank cell displacement in destination matrix
     18    unsigned int
     19        i, // Loop index
     20        start_row, // Local row to start at
     21        stop_row, // Local row to end at
     22        row_stride, // Number of rows between start and stop row
     23        local_cells, // Number of cells between start and stop row
     24        dst_cells; // Total number of cells in destination matrix
     25    bool print = false; // Controls whether to print matrices to STDERR
     26    struct matrix
     27        m1, // Local copy of matrix 1
     28        m2, // Local copy of matrix 2
     29        local_dst_m, // Local copy of destination matrix
     30        dst_m; // Final copy of destination matrix
    1531
    1632    // Initiailize MPI
     
    158174    MPI_Bcast(row_counts,num_ranks,MPI_UNSIGNED,FIRST_RANK,MPI_COMM_WORLD);
    159175    MPI_Bcast(recv_counts,num_ranks,MPI_UNSIGNED,FIRST_RANK,MPI_COMM_WORLD);
     176
     177   
    160178
    161179    // Calculate row offset in product matrix to start and stop calculation
Note: See TracChangeset for help on using the changeset viewer.