-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtache.h
90 lines (79 loc) · 2.09 KB
/
tache.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* File: tache.h
* Author: alex
*
* Created on 21 gennaio 2013, 12.35
*/
#ifndef TACHE_H
#define TACHE_H
# include <vector>
# include "mpi.h"
# include <string>
# include <map>
# include <utility>
# include <deque>
# include <vector>
# include <vector>
# include <cstdlib>
# include <mpi/mpi.h>
# include <cmath>
# include <ios>
# include <fstream>
# include <ctime>
# include <iostream>
# include <istream>
# include <deque>
# include <ostream>
# include <fstream>
# include <iostream>
# include <iterator>
# include <unistd.h>
# include <sstream>
#define ID_SEND 0
#define COMMAND_SEND 1
#define NDEP_SEND 2
#define DEP_SEND 3
#define END 4
#define RESULT 5
#define DIE 6
#define NAME_SEND 7
class tache {
public:
bool init;
bool done;
tache(const tache& orig);
virtual ~tache();
long getId();
void setId();
std::string name;
static tache* createNewTache(std::string firstLine,std::string secondLine);
static long getNewId();
bool testTacheDeps();
bool run(int id);
static bool testSingleDep(std::string filename);
bool operator < (const tache other);
bool operator ==(const tache other);
tache& operator =(const tache& cSource);
bool receiveTache(long target_host, bool results, long id);
bool completed;
void savefile(char* content,std::string name);
std::string command;
void sendData(std::string data, int dest, int tag);
bool sendTache(long toRun, bool results);
static std::string toString(long i);
static std::string convertFile(std::string name);
static void ResultDemultiplexing(const int tag, int *id, int *real_tag);
static int ResultMultiplexing(const int id,const int real_tag);
int TobeTaches;
std::vector<std::string> dependencies;
std::vector<std::string> dependant;
tache();
protected:
static std::vector<std::string> tokenize(const std::string & str, const std::string & delim);
std::vector<tache> subTaches; // n° subTaches
int nTaches; // n° subtaches
long id;
static long tID;
};
//typedef std::pair<std::string,tache> TachePair;
#endif /* TACHE_H */