/* * A simple OpenMP implementation of the Matrix-Vector multiplication * * Author: Petros Anastasiadis(panastas@cslab.ece.ntua.gr) * * For more info about OpenMP programming see http://bisqwit.iki.fi/story/howto/openmp/ */ #include #include #include #include #include #include /* Need to include External_Functions for these */ #include "matrix_op.h" #include "util.h" #include "input.h" int main(int argc, char **argv) { /* Initializations */ int i, j, k, n, m; double timer; if (argc < 3) error("Usage: ./Program N M"); else if ( argc == 3) { /*./Program N M */ n = atoi(argv[1]); m = atoi(argv[2]); } else error("Too many Arguments"); /* Allocate space */ double *x = (double *) malloc(m * sizeof(*x)); double *y = (double *) malloc(n * sizeof(*y)); double **M = (double **) malloc(n * sizeof(*M)); for( i=0 ; i