00001 #ifndef LMO_H_
00002 #define LMO_H_
00003
00004 #include "cpm_model.h"
00005 #include <stdio.h>
00006 #ifdef HAVE_CONFIG_H
00007 #include "MPIBlib/benchmarks/mpib_measurement.h"
00008 #else
00009 #include "mpib_measurement.h"
00010 #endif
00011
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00023 #define LMO_C3(n) (n) * ((n) - 1) * ((n) - 2) / 6
00024
00029 #define LMO_IJK2INDEX(n, i, j, k) (2 * (n) - (i) - 1) * ((i) - 1) * (i) / 4 + (2 * (n) - (i) - (j) + 1) * ((j) - (i)) / 2 + (k) - (j) - 1
00030
00032 typedef struct LMO_model {
00034 CPM_predictor predictor;
00036 int n;
00038 double* C;
00040 double* L;
00042 double* t;
00044 double* b;
00046 int S;
00048 double one2many_small[2];
00050 double one2many_large[2];
00052 int M1;
00054 int M2;
00056 double many2one_small[2];
00058 double many2one_large[2];
00059 } LMO_model;
00060
00066 LMO_model* LMO_alloc(int n);
00067
00072 void LMO_free(LMO_model* model);
00073
00075 void LMO_read(FILE* stream, LMO_model** model);
00076
00078 void LMO_write(FILE* stream, const LMO_model* model);
00079
00141 void LMO_estimate(MPI_Comm comm, MPIB_precision precision, MPIB_msgset msgset, int parallel,
00142 LMO_model** model);
00143
00154 double LMO_predict_p2p(void* _this, int i, int j, int M);
00155
00165 double LMO_predict_scatter_flat(void* _this, int root, int M);
00166
00178 double LMO_predict_gather_flat(void* _this, int root, int M);
00179
00188 void HLMO_estimate(MPI_Comm comm, MPIB_precision precision, MPIB_msgset msgset, LMO_model** model);
00189
00191 double HLMO_predict_p2p(void* _this, int i, int j, int m);
00192
00194 double HLMO_predict_scatter_flat(void* _this, int root, int m, int n);
00195
00196 #ifdef __cplusplus
00197 }
00198 #endif
00199
00203 #endif