Main_datatypes.h 1.34 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
18
19
20
21
22
23
24
25
  int iter_start;
  int argc;

  int numS; // Cantidad de procesos hijos
  MPI_Comm children, parents;

  char *compute_comm_array, *compute_comm_recv;
  char **argv;
  char *sync_array, *async_array;
} group_data;
26

27
28
29
30

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

  double t_op;
  int operations;
  int bytes, real_bytes, my_bytes;
  
  // Arrays to communicate data;
  char* array, *full_array;
  double* double_array;
  // Arrays to indicate how many bytes are received from each rank
  struct Counts counts;

} iter_stage_t;

48
49
50
51
52
53
54
typedef struct
{
  int iters, procs;
  int sm, ss, phy_dist, at;
  float factor;
} group_config_t;

55
56
typedef struct
{
57
58
    size_t n_groups, n_resizes, n_stages; // n_groups==n_resizes+1
    size_t actual_group, actual_stage;
59
    int rigid_times;
60
61
    int granularity, sdr, adr;

62
    MPI_Datatype config_type, group_type, iter_stage_type;
63
    iter_stage_t *stages;
64
    group_config_t *groups;
65
66
} configuration;

67
#endif