#include "Matrix_init.h"
#include "Summa.h"
+#include "2.5D_MM.h"
#include "timer.h"
#include <stdlib.h>
#include "xbt/log.h"
size_row, size_col, NB_groups);
// close properly the pragram
-end:
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
return 0;
#include "Matrix_init.h"
#include <math.h>
+#include <stdio.h>
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(MM_init,
"Messages specific for this msg example");
{
double *B_a , *B_b ; //matrix blocks
size_t err;
- double alpha = 1, beta = 1; //C := alpha * a * b + beta * c
+ //double alpha = 1, beta = 1; //C := alpha * a * b + beta * c
size_t B_proc_col, B_proc_row; // Number of bloc(row or col) on one processor
B_proc_col = k_b / Block_size; // Number of block on one processor
B_proc_row = k_a / Block_size; // Number of block on one processor
for(i = 0; i < m; i++)
for(j = 0; j < n; j++)
for(k = 0; k < Block_size; k++)
- c[i*ldc+j] += B_a[j*lda_local+k]*B_b[k*ldb_local+j];
+ c[i*ldc+j] += B_a[i*lda_local+k]*B_b[k*ldb_local+j];
get_time(&end_time_intern);
computation_time += get_timediff(&start_time_intern,&end_time_intern);
XBT_LOG_NEW_DEFAULT_CATEGORY(MM_param,
"Messages specific for this msg example");
+int match(const char *s, char p);
+char** get_list_param(const char* input);
int match(const char *s, char p)
{
int c = 0;
return list_param;
}
-char** get_conf(MPI_Comm comm, char * filename, int mynoderank)
+char** get_conf(MPI_Comm comm, const char * filename, int mynoderank)
{
if(filename == NULL) return NULL;
if(mynoderank == -1){
int len;
MPI_Get_processor_name(name, &len);
if(file == NULL) file = stdout;
- if(default_options == NULL) default_options = "";
MPI_Comm comm_node;
split_comm_intra_node(comm, &comm_node, 0);
if(rank == 0){
fprintf(file, "#processor_name index USER ARGS (like the cpu binding ...)\n");
for(i = 0; i < size; i++){
- fprintf(file, "%s %d %s\n", names[i],index[i],default_options);
+ if(default_options != NULL)
+ fprintf(file, "%s %d %s\n", names[i],index[i],default_options);
+ else
+ fprintf(file, "%s %d\n", names[i],index[i]);
}
}
free(names);
*/
/*! reads a file and returns the specific parameters for the process */
-char** get_conf(MPI_Comm comm, char * filename, int mynoderank);
+char** get_conf(MPI_Comm comm, const char * filename, int mynoderank);
/*! reads a file and returns the parameters of every processes */
char*** get_conf_all(char * filename, int * nb_process);
time = time * 1000000000;
tp->tv_nsec = (long) time;
tp->tv_sec = value ;
+ return 0;
}
double get_timediff(struct timespec *start, struct timespec *end){
*/
# include <sys/time.h>
+inline double get_second(struct timespec *res);
inline double get_microsecond(struct timespec *res);
inline double get_nanosecond(struct timespec *res);