malleabilityDataStructures.h 1.58 KB
Newer Older
iker_martin's avatar
iker_martin committed
1
2
3
4
5
6
#ifndef MALLEABILITY_DATA_STRUCTURES_H
#define MALLEABILITY_DATA_STRUCTURES_H

/*
 * Shows available data structures for inner ussage.
 */
7
8
#include <stdlib.h>
#include <stdio.h>
iker_martin's avatar
iker_martin committed
9
#include <mpi.h>
10
11
#include <pthread.h>
#include "malleabilityStates.h"
iker_martin's avatar
iker_martin committed
12

13
#define DEBUG_FUNC(debug_string, rank, numP) printf("MaM [P%d/%d]: %s -- %s:%s:%d\n", rank, numP, debug_string, __FILE__, __func__, __LINE__)
iker_martin's avatar
iker_martin committed
14

15
/* --- TIME CAPTURE STRUCTURE --- */
iker_martin's avatar
iker_martin committed
16
typedef struct {
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  // Spawn, Sync and Async time
  double spawn_start, spawn_time;
  double sync_start,  sync_end;
  double async_start, async_end;
  double malleability_start, malleability_end;

  MPI_Datatype times_type;
} malleability_times_t;

/* --- GLOBAL STRUCTURES --- */
typedef struct {
  unsigned int spawn_method;
  unsigned int spawn_dist;
  unsigned int spawn_strategies;
  unsigned int red_method;
  unsigned int red_strategies;

  malleability_times_t *times;
} malleability_config_t;

typedef struct { 
  int myId, numP, numC, zombie;
  int root, root_collectives;
  int num_parents, root_parents;
  pthread_t async_thread;
  MPI_Comm comm, thread_comm;
  MPI_Comm intercomm, tmp_comm;
  MPI_Comm *user_comm;
  MPI_Datatype struct_type;

  // Specific vars for Wait_targets strat
  int wait_targets_posted;
  MPI_Request wait_targets;
  
  char *name_exec, *nodelist;
  int num_cpus, num_nodes, nodelist_len;
} malleability_t;

/* --- VARIABLES --- */
malleability_config_t *mall_conf;
malleability_t *mall;
extern int state;

/* --- FUNCTIONS --- */
void MAM_Def_main_datatype();
void MAM_Free_main_datatype();
void MAM_Comm_main_structures(int rootBcast);

iker_martin's avatar
iker_martin committed
65
66

#endif