/*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/ /** \addtogroup examples * @{ * \defgroupmulti_tsr_sym * @{ * \brief Matrix multiplication */ #include using namespace CTF; int multi_tsr_sym(int m, int n, World & dw){ int rank, i, num_pes; int64_t np; double * pairs; int64_t * indices; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &num_pes); #ifndef TEST_SUITE if (rank == 0) printf("m = %d, n = %d, p = %d\n", m,n,num_pes); #endif //* Creates distributed tensors initialized with zeros Matrix<> A(n, m, NS, dw); Matrix<> C_NS(n, n, NS, dw); Matrix<> C_SY(n, n, SY, dw); Matrix<> diff(n, n, NS, dw); srand48(13*rank); //* Writes noise to local data based on global index A.read_local(&np, &indices, &pairs); for (i=0; i