00001 #ifndef FUPERMOD_PARTITION_H_
00002 #define FUPERMOD_PARTITION_H_
00003
00004 #include "fupermod_model.h"
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00015 typedef struct fupermod_part {
00017 long long int d;
00019 double t;
00021 int i;
00023 long long int x;
00024 } fupermod_part;
00025
00027 typedef struct fupermod_dist {
00029 long long int D;
00031 int size;
00033 fupermod_part* parts;
00034 } fupermod_dist;
00035
00037 fupermod_dist* fupermod_dist_alloc(long long int D, int size);
00038
00040 void fupermod_dist_free(fupermod_dist* dist);
00041
00043 int fupermod_dist_read(FILE* stream, fupermod_dist* dist, fupermod_process_conf* confs, int maxsize);
00044
00046 int fupermod_dist_write(FILE* stream, fupermod_dist* dist, fupermod_library* library, fupermod_process_conf* confs);
00047
00053 long long int fupermod_dist_total(fupermod_dist* dist);
00054
00060 int fupermod_dist_test_total(fupermod_dist* dist);
00061
00069 int fupermod_dist_test_times(fupermod_point* points, int size, double eps);
00070
00078 int fupermod_dist_scatter(fupermod_dist* dist, long long int* d, int root, MPI_Comm comm);
00079
00086 typedef int (*fupermod_partition)(fupermod_dist* dist, int size, fupermod_model** models);
00087
00091 int fupermod_partition_homogeneous(fupermod_dist* dist, int size, fupermod_model** models);
00097 int fupermod_partition_basic(fupermod_dist* dist, int size, fupermod_model** models);
00098
00103 int fupermod_partition_geometric(fupermod_dist* dist, int size, fupermod_model** models);
00104
00115 int fupermod_partition_multiroot(fupermod_dist* dist, int size, fupermod_model** models);
00116
00117 #ifdef HAVE_LIBNLOPT_CXX
00118
00119 int fupermod_partition_nlopt(fupermod_dist* dist, int size, fupermod_model** models);
00120
00122 int fupermod_partition_nlopt_minmax(fupermod_dist* dist, int size, fupermod_model** models);
00123 #endif
00124
00126 typedef struct fupermod_partitioner {
00128 fupermod_partition partition;
00130 fupermod_model_alloc model_alloc;
00132 fupermod_model_free model_free;
00134 int arg;
00135 } fupermod_partitioner;
00136
00145 fupermod_partitioner partitioner_switch(int algorithm, int smooth, int benchsize);
00146
00147
00148
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155
00156 #endif