| 1 | #ifndef PPAM_TYPES_H |
| 2 | #define PPAM_TYPES_H |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | |
| 6 | // types of work given to a slave |
| 7 | #define WORKTAG 1 |
| 8 | #define DIETAG 2 |
| 9 | |
| 10 | // 256 characters for file name should be enough |
| 11 | #define NCHAR_FNAME 256 |
| 12 | |
| 13 | typedef unsigned char Byte; |
| 14 | |
| 15 | typedef double Real; |
| 16 | |
| 17 | // Type to describe a job to be done in a node |
| 18 | //TODO: merge with packed version to avoid extra copy by MPI |
| 19 | typedef struct Work_t { |
| 20 | // "structural" parameters: |
| 21 | char* inputFileName; |
| 22 | uint32_t nbSeries; |
| 23 | uint32_t* ranks; |
| 24 | // clustering parameters [to be completed]: |
| 25 | uint32_t nbClusters; |
| 26 | uint32_t clustOnMedoids; //a boolean, but 1 byte storage would be inefficient |
| 27 | uint32_t p_for_dissims; |
| 28 | } Work_t; |
| 29 | |
| 30 | // Type returned by a worker (clusters labels and medoids) |
| 31 | //TODO: merge with packed version to avoid extra copy by MPI |
| 32 | typedef struct Result_t { |
| 33 | // parameters describing sizes |
| 34 | uint32_t nbClusters; |
| 35 | // informative parameters: |
| 36 | uint32_t* medoids_ID; |
| 37 | uint32_t* medoids_ranks; |
| 38 | } Result_t; |
| 39 | |
| 40 | // data structure to store a customer ID + [time-]serie |
| 41 | typedef struct PowerCurve { |
| 42 | uint32_t ID; |
| 43 | Real* values; |
| 44 | } PowerCurve; |
| 45 | |
| 46 | #endif |