Changeset 5711 in /cluster/svnroot


Ignore:
Timestamp:
May 26, 2016 8:35:12 PM (5 years ago)
Author:
skylar
Message:

do matmul on each rank

File:
1 edited

Legend:

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

    r5710 r5711  
    1212    unsigned int start_row,stop_row,stride;
    1313    bool print;
    14     struct matrix m1,m2,local_dst_m;
     14    struct matrix m1,m2,dst_m;
    1515
    1616    MPI_Init(&argc,&argv);
     
    5959
    6060
     61    dst_m.rows = m1.rows;
     62    dst_m.cols = m2.cols;
     63
    6164    m1.matrix       = safe_malloc_int(
    6265            m1.rows*m1.cols,
     
    6669            m2.rows*m2.cols,
    6770            "Allocating second matrix"
     71            );
     72    dst_m.matrix    = safe_malloc_int(
     73            dst_m.rows*dst_m.cols,
     74            "Allocating destination matrix"
    6875            );
    6976
     
    7683        // Declare and allocate full destination matrix
    7784        // Will be populated via MPI_Gather
    78         struct matrix dst_m;
    79         dst_m.rows = m1.rows;
    80         dst_m.cols = m2.cols;
    81         dst_m.matrix    = safe_malloc_int(
    82                 dst_m.rows*dst_m.cols,
    83                 "Allocating destination matrix"
    84                 );
    8585
    8686        if(print) {
     
    119119            rank,stride,start_row,stop_row);
    120120#endif
     121    matmul(&m1,&m2,&dst_m,start_row,stop_row);
    121122
    122123    MPI_Finalize();
Note: See TracChangeset for help on using the changeset viewer.