Main_datatypes.h 1.48 KB
Newer Older
1
2
3
#ifndef MAIN_DATATYPES_H
#define MAIN_DATATYPES_H

4
5
6
#include <stdlib.h>
#include <stdio.h>
#include <mpi.h>
7
#include "../malleability/distribution_methods/block_distribution.h"
8
9
10
11
12
13
14


#define ROOT 0

typedef struct {
  int myId;
  int numP;
15
  unsigned int grp;
16
17
  int iter_start;
  int argc;
18
  size_t sync_data_groups, async_data_groups;
19
20
21
22
23

  MPI_Comm children, parents;

  char *compute_comm_array, *compute_comm_recv;
  char **argv;
24
25
  char **sync_array, **async_array;
  int *sync_qty, *async_qty;
26
} group_data;
27

28
29
30

typedef struct
{
31
32
  int pt; // Procedure type to execute
  int id; // Stage identifier
33
34
35
  // Wether the stage completes after "operations" iterations (0)
  // or after "t_stage" time has passed (1).
  int t_capped; 
36
  double t_stage; // Time to complete the stage
37
38
39
40
41
42
43
44

  double t_op;
  int operations;
  int bytes, real_bytes, my_bytes;
  
  // Arrays to communicate data;
  char* array, *full_array;
  double* double_array;
45
46
  int req_count;
  MPI_Request *reqs;
47
48
49
50
51
  // Arrays to indicate how many bytes are received from each rank
  struct Counts counts;

} iter_stage_t;

52
53
54
typedef struct
{
  int iters, procs;
55
  int sm, ss, phy_dist, rm, rs;
56
57
58
  float factor;
} group_config_t;

59
60
typedef struct
{
61
62
    size_t n_groups, n_resizes, n_stages; // n_groups==n_resizes+1
    size_t actual_group, actual_stage;
63
    int rigid_times, capture_method;
64
65
    int granularity;
    size_t sdr, adr;
66

67
    MPI_Datatype config_type, group_type, iter_stage_type;
68
    iter_stage_t *stages;
69
    group_config_t *groups;
70
71
} configuration;

72
#endif