Main_datatypes.h 1.17 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
15
16
17
18
19
20
21
22
23
24
25


#define ROOT 0

typedef struct {
  int myId;
  int numP;
  int grp;
  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
  double t_stage; // Time to complete the stage
32
33
34
35
36
37
38
39
40
41
42
43
44
45

  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
  //int *counts, *displs;
  struct Counts counts;

} iter_stage_t;

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

53
54
55
56
57
58
59
typedef struct
{
    int n_resizes, n_stages;
    int actual_resize, actual_stage;
    int granularity, sdr, adr;
    double latency_m, bw_m;

60
    double t_op_comms;
61
    iter_stage_t *stages;
62
    group_config_t *groups;
63
64
} configuration;

65
#endif