read_ini.h 1.18 KB
Newer Older
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
iker_martin's avatar
iker_martin committed
4
#include <mpi.h>
5
6
7

typedef struct
{
8
9
10
11
12
  int pt; // Procedure type
  float t_stage; // Time to complete the stage

  double t_op;
  int operations;
13
  int bytes, real_bytes;
14
15
16
17
  
  // Variables to represent linear regresion
  // for collective calls.
  double slope, intercept;
18

19
  // Arrays to communicate data;
20
21
  char* array, *full_array;
  double* double_array;
22
23
24
  // Arrays to indicate how many bytes are received from each rank
  int *counts, *displs;

25
26
27
28
29
30
} iter_stage_t;

typedef struct
{
    int resizes, iter_stages;
    int actual_resize, actual_iter;
31
    int matrix_tam, sdr, adr;
32
    int css, cst;
33
    int aib;
34
    double latency_m, bw_m;
35
36
37
38

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

39
    iter_stage_t *iter_stage;
40
41
} configuration;

42

43
44
configuration *read_ini_file(char *file_name);
void free_config(configuration *user_config);
45
46
void print_config(configuration *user_config, int grp);
void print_config_group(configuration *user_config, int grp);
iker_martin's avatar
iker_martin committed
47

48
// MPI Intercomm functions
iker_martin's avatar
iker_martin committed
49
void send_config_file(configuration *config_file, int root, MPI_Comm intercomm);
50
void recv_config_file(int root, MPI_Comm intercomm, configuration **config_file_out);