22
22
23
23
int main (int argc, char *argv[])
24
24
{
25
- tsp::Semaphore_File *sf = new tsp::Semaphore_File ();
26
- // Parse args: only take the ones we use for now
25
+ tsp::Status_Manager stat;
27
26
int c;
28
27
uint32_t nslots = 1 ;
29
28
bool disappear_output = false ;
30
29
bool do_fork = true ;
31
30
bool separate_stderr = false ;
32
31
33
- if (argc == 1 )
34
- {
35
- // List all jobs we're aware of
36
- std::cout << " ID State Output E-Level Time Command" << std::endl;
37
- for (const auto &entry : std::filesystem::directory_iterator (get_tmp ()))
38
- {
39
- if (entry.path ().filename ().string ().find (STATUS_FILE_TEMPLATE) != std::string::npos)
40
- {
41
- std::ifstream stat_file (entry.path ());
42
-
43
- }
44
- }
45
- }
46
-
32
+ // Parse args: only take the ones we use for now
47
33
while ((c = getopt (argc, argv, " +nfN:E" )) != -1 )
48
34
{
49
35
switch (c)
@@ -64,6 +50,9 @@ int main(int argc, char *argv[])
64
50
}
65
51
}
66
52
53
+ tsp::Run_cmd cmd (argv, optind , argc);
54
+ stat.add_cmd (cmd,nslots);
55
+
67
56
if (do_fork)
68
57
{
69
58
pid_t main_fork_pid;
@@ -83,8 +72,6 @@ int main(int argc, char *argv[])
83
72
std::chrono::duration sleep (std::chrono::milliseconds (JITTER_MS + jitter.get ()));
84
73
std::this_thread::sleep_for (sleep );
85
74
86
- tsp::Run_cmd cmd (argv, optind , argc);
87
- tsp::Status_Manager stat (cmd, nslots);
88
75
tsp::Tsp_Proc me (nslots);
89
76
90
77
cpu_set_t mask;
@@ -96,7 +83,7 @@ int main(int argc, char *argv[])
96
83
me.refresh_allowed_cores ();
97
84
}
98
85
stat.job_start ();
99
- delete sf;
86
+ // delete sf;
100
87
for (uint32_t i = 0 ; i < nslots; i++)
101
88
{
102
89
CPU_SET (me.allowed_cores [i], &mask);
0 commit comments