results.h 1.44 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
11
typedef struct {
  // Iters data
12
  double *iters_time, **stage_times;
13
  int iters_async, iter_index, iters_size;
14

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

23
24
void send_results(results_data *results, int root, int resizes, MPI_Comm intercomm);
void recv_results(results_data *results, int root, int resizes, MPI_Comm intercomm);
25

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

29
void compute_results_iter(results_data *results, int myId, int root, MPI_Comm comm);
30
void compute_results_stages(results_data *results, int myId, int root, int n_stages, MPI_Comm comm);
31

32
33
void print_iter_results(results_data results);
void print_stage_results(results_data results, int n_stages);
34
void print_global_results(results_data results, int resizes);
35
36
37
38

void init_results_data(results_data *results, int resizes, int stages, int iters_size);
void realloc_results_iters(results_data *results, int stages, int needed);
void free_results_data(results_data *results, int stages);
39
40

#endif