Main_datatypes.h 1.22 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

  double t_op;
  int operations;
  int bytes, real_bytes, my_bytes;
  
  // Variables to represent linear regresion
  // for collective calls.
  double slope, intercept;

  // 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;

typedef struct
{
    int n_resizes, n_stages;
    int actual_resize, actual_stage;
    int granularity, sdr, adr;
    int sm, ss;
    int at;
    double latency_m, bw_m;

    int *iters, *procs, *phy_dist;
    float *factors;

62
    double t_op_comms;
63
64
65
    iter_stage_t *stages;
} configuration;

66
#endif