Main_datatypes.h 1.2 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
  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
typedef struct
{
55
56
    size_t n_resizes, n_stages;
    size_t actual_resize, actual_stage;
57
    int rigid_times;
58
59
60
    int granularity, sdr, adr;
    double latency_m, bw_m;

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

66
#endif