Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[examples,smpi] remove warnings and resolve a bug (I hope I amn't sure)
authorjean-noel quintin <jnquintin@dhcp-892b9b4c.ucd.ie>
Tue, 9 Oct 2012 17:40:32 +0000 (18:40 +0100)
committerjean-noel quintin <jnquintin@dhcp-892b9b4c.ucd.ie>
Tue, 9 Oct 2012 17:40:32 +0000 (18:40 +0100)
examples/smpi/MM/2.5D_MM.c
examples/smpi/MM/MM_mpi.c
examples/smpi/MM/Matrix_init.c
examples/smpi/MM/Summa.c
examples/smpi/MM/param.c
examples/smpi/MM/param.h
examples/smpi/MM/timer.c
examples/smpi/MM/timer.h

index 63e4058..514ac43 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "Matrix_init.h"
 #include "Summa.h"
 
 #include "Matrix_init.h"
 #include "Summa.h"
+#include "2.5D_MM.h"
 #include "timer.h"
 #include <stdlib.h>
 #include "xbt/log.h"
 #include "timer.h"
 #include <stdlib.h>
 #include "xbt/log.h"
index 7ab7d14..23d2e2b 100644 (file)
@@ -171,7 +171,6 @@ int main(int argc, char ** argv)
                size_row, size_col,  NB_groups);
 
   // close properly the pragram
                size_row, size_col,  NB_groups);
 
   // close properly the pragram
-end:
   MPI_Barrier(MPI_COMM_WORLD);
   MPI_Finalize();
   return 0;
   MPI_Barrier(MPI_COMM_WORLD);
   MPI_Finalize();
   return 0;
index 9688c4e..7492f43 100644 (file)
@@ -1,5 +1,6 @@
 #include "Matrix_init.h"
 #include <math.h>
 #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");
 #include "xbt/log.h"
  XBT_LOG_NEW_DEFAULT_CATEGORY(MM_init,
                              "Messages specific for this msg example");
index 617bfaa..6b64619 100644 (file)
@@ -23,7 +23,7 @@ inline double Summa(
 {
   double *B_a     , *B_b     ; //matrix blocks
   size_t err;
 {
   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
   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
@@ -137,7 +137,7 @@ inline double Summa(
     for(i = 0; i < m; i++)
       for(j = 0; j < n; j++)
         for(k = 0; k < Block_size; k++)
     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);
 
     get_time(&end_time_intern);
     computation_time += get_timediff(&start_time_intern,&end_time_intern);
index 3cab7f9..a72e75c 100644 (file)
@@ -15,6 +15,8 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(MM_param,
                              "Messages specific for this msg example");
 
 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;
 int match(const char *s, char p)
 {
   int c = 0;
@@ -43,7 +45,7 @@ char** get_list_param(const char* input){
   return list_param;
 }
 
   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){
 {
   if(filename == NULL) return NULL;
   if(mynoderank == -1){
@@ -170,7 +172,6 @@ void print_conf(MPI_Comm comm, int rank, FILE* file, char * default_options){
   int len;
   MPI_Get_processor_name(name, &len);
   if(file == NULL) file = stdout;
   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);
 
   MPI_Comm comm_node;
   split_comm_intra_node(comm, &comm_node, 0);
@@ -184,7 +185,10 @@ void print_conf(MPI_Comm comm, int rank, FILE* file, char * default_options){
   if(rank == 0){
     fprintf(file, "#processor_name index USER ARGS (like the cpu binding ...)\n");
     for(i = 0; i < size; i++){
   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);
     }
   }
   free(names);
index fa29681..86f837b 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 /*! reads a file and returns the specific parameters for the process */
  */
 
 /*! 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);
 
 /*! reads a file and returns the parameters of every processes */
 char*** get_conf_all(char * filename, int * nb_process);
index 4b2e0ad..a647f98 100644 (file)
@@ -28,6 +28,7 @@ inline int get_time(struct timespec *tp){
   time = time * 1000000000;
   tp->tv_nsec = (long) time;
   tp->tv_sec = value ;
   time = time * 1000000000;
   tp->tv_nsec = (long) time;
   tp->tv_sec = value ;
+  return 0;
 }
 
 double get_timediff(struct timespec *start, struct timespec *end){
 }
 
 double get_timediff(struct timespec *start, struct timespec *end){
index 5a59a24..bb45687 100644 (file)
@@ -6,6 +6,7 @@
  */
 # include <sys/time.h>
 
  */
 # 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);
 
 inline double get_microsecond(struct timespec *res);
 inline double get_nanosecond(struct timespec *res);