results.h 1.42 KB
Newer Older
1
2
3
#ifndef RESULTS_H
#define RESULTS_H

4
5
6
7
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>

8
9
#define RESULTS_INIT_DATA_QTY 100

10
enum capture_methods{RESULTS_MAX, RESULTS_MEAN, RESULTS_MEDIAN};
11
12
typedef struct {
  // Iters data
13
  double *iters_time, **stage_times;
14
  size_t iters_async, iter_index, iters_size;
15

16
  // Spawn, Thread, Sync, Async and Exec time
17
  double spawn_start, *spawn_time, *spawn_real_time;
18
19
20
  double sync_end,  *sync_time;
  double async_end, *async_time;
  double malleability_end, *malleability_time;
21
  double exec_start, exec_time;
22
  double wasted_time; // Time spent recalculating iter stages
23
24
} results_data;

25
void comm_results(results_data *results, int root, size_t resizes, MPI_Comm intercomm);
26

27
void set_results_post_reconfig(results_data *results, int grp, int sdr, int adr);
28
void reset_results_index(results_data *results);
29

30
void compute_results_iter(results_data *results, int myId, int numP, int root, size_t n_stages, int capture_method, MPI_Comm comm);
31

32
void print_iter_results(results_data results);
33
34
void print_stage_results(results_data results, size_t n_stages);
void print_global_results(results_data results, size_t resizes);
35

36
void init_results_data(results_data *results, size_t resizes, size_t stages, size_t iters_size);
37
38
void realloc_results_iters(results_data *results, size_t stages, size_t needed);
void free_results_data(results_data *results, size_t stages);
39
40

#endif