-
Notifications
You must be signed in to change notification settings - Fork 2
/
MLSOMA.h
45 lines (42 loc) · 1004 Bytes
/
MLSOMA.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
#pragma once
#include "SOMA_Sequence.h"
#include "mpi.h"
class MLSOMA
{
public:
SOMA_Sequence* SOMAs;
float* SHARED_MEMORY;
int SHARED_MEMORY_size;
//int GRID_N;
float *BOUNDS;
float *BOUNDS_GLOBAL;
int *current_grid_index;
MPI_Win win;
bool is_first_try;
float* GLOBAL_POSITION;
float GLOBAL_VALUE;
//bool IsGirdCompleted_;
public:
MLSOMA();
~MLSOMA();
void Run();
void Run2();
void Allgather();
void SetBounds(float min, float max);
void SetBounds(float xmin, float xmax, float ymin, float ymax);
void SetBounds(int dimension,float min, float max);
void SetBoundsGlobal(float min, float max);
void ShowResults();
private:
void Init_MetaInformation();
void SelfCalcGridIndex(int index);
void WriteResultToSharedMemory();
void SetBound(int *current_grid_index);
bool IsGirdCompleted();
void SetGrid(int);
bool IsGridDone(int id);
int FindAGird();
void Master_Process();
void Slave_Process();
void ConclueResults();
};