read_ini.h 1.32 KB
Newer Older
1
2
3
#ifndef READ_INI_H
#define READ_INI_H

4
5
6
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
iker_martin's avatar
iker_martin committed
7
#include <mpi.h>
8
#include "../malleability/distribution_methods/block_distribution.h"
9
10
11

typedef struct
{
12
13
14
15
16
  int pt; // Procedure type
  float t_stage; // Time to complete the stage

  double t_op;
  int operations;
17
  int bytes, real_bytes, my_bytes;
18
19
20
21
  
  // Variables to represent linear regresion
  // for collective calls.
  double slope, intercept;
22

23
  // Arrays to communicate data;
24
25
  char* array, *full_array;
  double* double_array;
26
  // Arrays to indicate how many bytes are received from each rank
27
28
  //int *counts, *displs;
  struct Counts counts;
29

30
31
32
33
} iter_stage_t;

typedef struct
{
34
35
36
37
38
    int n_resizes, n_stages;
    int actual_resize, actual_stage;
    int granularity, sdr, adr;
    int sm, ss;
    int at;
39
    double latency_m, bw_m;
40
41
42
43

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

44
    iter_stage_t *stages;
45
46
} configuration;

47

48
49
configuration *read_ini_file(char *file_name);
void free_config(configuration *user_config);
50
51
void print_config(configuration *user_config, int grp);
void print_config_group(configuration *user_config, int grp);
iker_martin's avatar
iker_martin committed
52

53
// MPI Intercomm functions
iker_martin's avatar
iker_martin committed
54
void send_config_file(configuration *config_file, int root, MPI_Comm intercomm);
55
void recv_config_file(int root, MPI_Comm intercomm, configuration **config_file_out);
56
57

#endif