/src/data_proc.cpp

https://bitbucket.org/xiaobingo/iit.datasys.lanl2 · C++ · 860 lines · 478 code · 235 blank · 147 comment · 102 complexity · a042dbef9d8cf3a9f381c2c327b368e4 MD5 · raw file

  1. #include "data_proc.h"
  2. #include "str_trim.h"
  3. #include "String_Tokenizer.h"
  4. #include "Util.h"
  5. #include <fstream>
  6. #include <vector>
  7. #include <stdlib.h>
  8. #include <algorithm>
  9. #include <stdexcept>
  10. #include <string.h>
  11. #include <stdio.h>
  12. data_proc::data_proc() {
  13. }
  14. data_proc::data_proc(const string& file_all_all) {
  15. init_list(file_all_all);
  16. }
  17. data_proc::~data_proc() {
  18. }
  19. string data_proc::trim(const string& str) {
  20. return str_trim::trim(str);
  21. }
  22. /*
  23. * extract file entry from file_all_all, the output like:
  24. * job.2.ben
  25. * job.4.ben
  26. * job.8.ben
  27. * job.16.ben
  28. * job.32.ben
  29. * ......
  30. *
  31. * */
  32. void data_proc::init_list(const string& file_all_all) {
  33. string line;
  34. ifstream ifs(file_all_all);
  35. while (getline(ifs, line)) {
  36. string file_name = trim(line); //task.512.out, task.256.out...
  37. if (file_name.empty())
  38. continue;
  39. file_list.push_back(file_name);
  40. }
  41. }
  42. /*
  43. * @job_xx_ben_file, like job.4.ben, it contains
  44. job.4.0.out
  45. job.4.1.out
  46. job.4.2.out
  47. job.4.3.out
  48. job.4.4.out
  49. *
  50. * */
  51. double data_proc::process_strict(const string& job_xx_ben_file, int job_scale) {
  52. double timespan_sum;
  53. #ifdef WAY1
  54. timespan_sum = process_internal(job_xx_ben_file, job_scale, false);
  55. #elif WAY2
  56. timespan_sum = process_internal2(job_xx_ben_file, job_scale, false);
  57. #elif WAY3
  58. timespan_sum = process_internal3(job_xx_ben_file, job_scale, false);
  59. #elif WAY4
  60. timespan_sum = process_internal4(job_xx_ben_file, job_scale, false);
  61. #elif WAY5
  62. timespan_sum = process_internal5(job_xx_ben_file, job_scale, false);
  63. #endif
  64. return timespan_sum;
  65. }
  66. /*
  67. * @job_xx_ben_file, like job.4.ben, it contains
  68. job.4.0.out
  69. job.4.1.out
  70. job.4.2.out
  71. job.4.3.out
  72. job.4.4.out
  73. *
  74. * */
  75. double data_proc::process_loose(const string& job_xx_ben_file, int job_scale) {
  76. double timespan_sum;
  77. #ifdef WAY1
  78. timespan_sum = process_internal(job_xx_ben_file, job_scale, true);
  79. #elif WAY2
  80. timespan_sum = process_internal2(job_xx_ben_file, job_scale, true);
  81. #elif WAY3
  82. timespan_sum = process_internal3(job_xx_ben_file, job_scale, true);
  83. #elif WAY4
  84. timespan_sum = process_internal4(job_xx_ben_file, job_scale, true);
  85. #elif WAY5
  86. timespan_sum = process_internal5(job_xx_ben_file, job_scale, true);
  87. #endif
  88. return timespan_sum;
  89. }
  90. /*
  91. * @job_xx_ben_file, like job.4.ben, it contains
  92. job.4.0.out
  93. job.4.1.out
  94. job.4.2.out
  95. job.4.3.out
  96. job.4.4.out
  97. *
  98. * */
  99. double data_proc::process_internal4(const string& job_xx_ben_file,
  100. int job_scale, const bool &loose) {
  101. double timespan_sum = 0;
  102. string job_xx_out_file;
  103. double time_start = 0;
  104. ifstream job_xx_ben_ifs(job_xx_ben_file);
  105. /*time_start/time_end print-out, for 1024 parallel jobs on 1024 cores of 512 nodes*/
  106. int num_lines = 2048;
  107. int i = 0;
  108. while (getline(job_xx_ben_ifs, job_xx_out_file)) {
  109. fprintf(stdout, "[%s][%s]: processing...\n", job_xx_ben_file.c_str(),
  110. job_xx_out_file.c_str());
  111. ifstream job_xx_out_ifs(job_xx_out_file);
  112. /*the first line is job.x.0.out, count the timestamp in it as time start*/
  113. if (loose && i == 0) {
  114. string timestamp_line;
  115. while (getline(job_xx_out_ifs, timestamp_line)) {
  116. time_start = atof(timestamp_line.c_str());
  117. break; /*since there's only one line in job.x.0.out*/
  118. }
  119. }
  120. if (i > 0) { /*count the earliest timestamp in all job.x.x.out(except job.x.0.out) as time start*/
  121. vector<double> vec_start;
  122. vector<double> vec_end;
  123. /* the format, [MPI process number]: [timestamp]
  124. 0163: 1366949424667582.000000
  125. 0163: 1366949424667658.000000
  126. * */
  127. string timestamp_line;
  128. int j = 0; //counter for lines of timestamp in job.xx.out file
  129. int first_proc_num; //the first MPI processor number
  130. int second_proc_num; //the second MPI processor number
  131. while (getline(job_xx_out_ifs, timestamp_line)) {
  132. j++;
  133. if (timestamp_line.empty())
  134. continue;
  135. String_Tokenizer tokens(timestamp_line, ":"); //
  136. string proc_num = trim(tokens.next_token()); //0163, the MPI process number
  137. string timestamp = trim(tokens.next_token()); //1366949424667582.000000, the timestamp
  138. if (j % 2 != 0)
  139. first_proc_num = atoi(proc_num.c_str());
  140. else
  141. second_proc_num = atoi(proc_num.c_str());
  142. if (j % 2 == 0) {
  143. if (first_proc_num != second_proc_num) {
  144. char buf[200];
  145. sprintf(buf,
  146. "[%s][%d][%d]: the timestamp of start and end is not contiguous.",
  147. job_xx_out_file.c_str(), first_proc_num,
  148. second_proc_num);
  149. throw logic_error(buf);
  150. }
  151. }
  152. if (j % 2 != 0)
  153. vec_start.push_back(atof(timestamp.c_str()));
  154. else
  155. vec_end.push_back(atof(timestamp.c_str()));
  156. }
  157. if (j != num_lines) {
  158. throw logic_error(
  159. "less or more than 2048 timestamp lines in job.xx.out file.");
  160. }
  161. sort(vec_start.begin(), vec_start.end());
  162. sort(vec_end.begin(), vec_end.end());
  163. if (!loose)
  164. time_start = vec_start[0];
  165. double timespan = vec_start[vec_start.size() - 1] - time_start;
  166. timespan_sum += timespan;
  167. }
  168. i++;
  169. }
  170. return timespan_sum;
  171. }
  172. /*
  173. * @job_xx_ben_file, like job.4.ben, it contains
  174. job.4.1.out
  175. job.4.2.out
  176. job.4.3.out
  177. job.4.4.out
  178. *
  179. * */
  180. double data_proc::process_internal5(const string& job_xx_ben_file,
  181. int job_scale, const bool &loose) {
  182. string job_xx_out_file;
  183. double time_start = 0;
  184. ifstream job_xx_ben_ifs(job_xx_ben_file);
  185. /*lines of time_start/time_end print-out*/
  186. int num_lines = 2;
  187. vector<double> vec_start;
  188. vector<double> vec_end;
  189. while (getline(job_xx_ben_ifs, job_xx_out_file)) {
  190. fprintf(stdout, "[%s][%s]: processing...\n", job_xx_ben_file.c_str(),
  191. job_xx_out_file.c_str());
  192. ifstream job_xx_out_ifs(job_xx_out_file);
  193. /* the format, [jobid]: [timestamp]
  194. 78: 1366949424667582.000000
  195. 78: 1366949424667658.000000
  196. * */
  197. string timestamp_line;
  198. int j = 0; //counter for lines of timestamp in job.xx.out file
  199. int first_jobid; //the first jobid
  200. int second_jobid; //the second jobid
  201. while (getline(job_xx_out_ifs, timestamp_line)) {
  202. j++;
  203. if (timestamp_line.empty())
  204. continue;
  205. String_Tokenizer tokens(timestamp_line, ":"); //
  206. string jobid = trim(tokens.next_token()); //78, the jobid
  207. string timestamp = trim(tokens.next_token()); //1366949424667582.000000, the timestamp
  208. if (j % 2 != 0)
  209. first_jobid = atoi(jobid.c_str());
  210. else
  211. second_jobid = atoi(jobid.c_str());
  212. if (j % 2 == 0) {
  213. if (first_jobid != second_jobid) {
  214. char buf[200];
  215. sprintf(buf,
  216. "[%s][%d][%d]: the timestamp of start and end is not contiguous.",
  217. job_xx_out_file.c_str(), first_jobid, second_jobid);
  218. throw logic_error(buf);
  219. }
  220. }
  221. if (j % 2 != 0)
  222. vec_start.push_back(atof(timestamp.c_str()));
  223. else
  224. vec_end.push_back(atof(timestamp.c_str()));
  225. }
  226. if (j != num_lines) {
  227. char buf[200];
  228. sprintf(buf,
  229. "[%s][%d][%d]: less or more than %d timestamp lines in job.xx.out file.",
  230. job_xx_out_file.c_str(), first_jobid, second_jobid,
  231. num_lines);
  232. throw logic_error(buf);
  233. }
  234. }
  235. sort(vec_start.begin(), vec_start.end());
  236. sort(vec_end.begin(), vec_end.end());
  237. double timespan_sum = vec_end[vec_end.size() - 1] - vec_start[0];
  238. return timespan_sum;
  239. }
  240. /*
  241. * @job_xx_ben_file, like job.4.ben, it contains
  242. job.4.0.out
  243. job.4.1.out
  244. job.4.2.out
  245. job.4.3.out
  246. job.4.4.out
  247. *
  248. * */
  249. double data_proc::process_internal3(const string& job_xx_ben_file,
  250. int job_scale, const bool &loose) {
  251. double timespan_sum = 0;
  252. string job_xx_out_file;
  253. double time_start = 0;
  254. ifstream job_xx_ben_ifs(job_xx_ben_file);
  255. /*time_start/time_end print-out, for 1024 parallel jobs on 1024 cores of 512 nodes*/
  256. int num_lines = 2048;
  257. int i = 0;
  258. while (getline(job_xx_ben_ifs, job_xx_out_file)) {
  259. fprintf(stdout, "[%s][%s]: processing...\n", job_xx_ben_file.c_str(),
  260. job_xx_out_file.c_str());
  261. ifstream job_xx_out_ifs(job_xx_out_file);
  262. /*the first line is job.x.0.out, count the timestamp in it as time start*/
  263. if (loose && i == 0) {
  264. string timestamp_line;
  265. while (getline(job_xx_out_ifs, timestamp_line)) {
  266. time_start = atof(timestamp_line.c_str());
  267. break; /*since there's only one line in job.x.0.out*/
  268. }
  269. }
  270. if (i > 0) { /*count the earliest timestamp in all job.x.x.out(except job.x.0.out) as time start*/
  271. /* the format, [MPI process number]: [timestamp]
  272. 0163: 1366949424667582.000000
  273. 0163: 1366949424667658.000000
  274. * */
  275. string timestamp_line;
  276. int j = 0; //counter for lines of timestamp in job.xx.out file
  277. int first_proc_num; //the first MPI processor number
  278. int second_proc_num; //the second MPI processor number
  279. double pair_start_time = 0; //the start time of allone
  280. double pair_end_time = 0; //the end time of allone
  281. while (getline(job_xx_out_ifs, timestamp_line)) {
  282. j++;
  283. if (timestamp_line.empty())
  284. continue;
  285. String_Tokenizer tokens(timestamp_line, ":"); //
  286. string proc_num = trim(tokens.next_token()); //0163, the MPI process number
  287. string timestamp = trim(tokens.next_token()); //1366949424667582.000000, the timestamp
  288. if (j % 2 != 0) {
  289. first_proc_num = atoi(proc_num.c_str());
  290. pair_start_time = atof(timestamp.c_str());
  291. } else {
  292. second_proc_num = atoi(proc_num.c_str());
  293. pair_end_time = atof(timestamp.c_str());
  294. }
  295. if (j % 2 == 0) {
  296. if (first_proc_num != second_proc_num) {
  297. char buf[200];
  298. sprintf(buf,
  299. "[%s][%d][%d]: the timestamp of start and end is not contiguous.",
  300. job_xx_out_file.c_str(), first_proc_num,
  301. second_proc_num);
  302. throw logic_error(buf);
  303. }
  304. }
  305. if (j % 2 == 0)
  306. timespan_sum += pair_end_time - pair_start_time;
  307. }
  308. if (j != num_lines) {
  309. throw logic_error(
  310. "less or more than 2048 timestamp lines in job.xx.out file.");
  311. }
  312. }
  313. i++;
  314. }
  315. return timespan_sum;
  316. }
  317. /*
  318. * @job_xx_ben_file, like job.4.ben, it contains
  319. job.4.0.out
  320. job.4.1.out
  321. job.4.2.out
  322. job.4.3.out
  323. job.4.4.out
  324. *
  325. * */
  326. double data_proc::process_internal2(const string& job_xx_ben_file,
  327. int job_scale, const bool &loose) {
  328. double timespan_sum = 0;
  329. string job_xx_out_file;
  330. double time_start = 0;
  331. ifstream job_xx_ben_ifs(job_xx_ben_file);
  332. /*time_start/time_end print-out, for 1024 parallel jobs on 1024 cores of 512 nodes*/
  333. int num_lines = 2048;
  334. int i = 0;
  335. while (getline(job_xx_ben_ifs, job_xx_out_file)) {
  336. fprintf(stdout, "[%s][%s]: processing...\n", job_xx_ben_file.c_str(),
  337. job_xx_out_file.c_str());
  338. ifstream job_xx_out_ifs(job_xx_out_file);
  339. /*the first line is job.x.0.out, count the timestamp in it as time start*/
  340. if (loose && i == 0) {
  341. string timestamp_line;
  342. while (getline(job_xx_out_ifs, timestamp_line)) {
  343. time_start = atof(timestamp_line.c_str());
  344. break; /*since there's only one line in job.x.0.out*/
  345. }
  346. }
  347. if (i > 0) { /*count the earliest timestamp in all job.x.x.out(except job.x.0.out) as time start*/
  348. vector<double> vec_start;
  349. vector<double> vec_end;
  350. /* the format, [MPI process number]: [timestamp]
  351. 0163: 1366949424667582.000000
  352. 0163: 1366949424667658.000000
  353. * */
  354. string timestamp_line;
  355. int j = 0; //counter for lines of timestamp in job.xx.out file
  356. int first_proc_num; //the first MPI processor number
  357. int second_proc_num; //the second MPI processor number
  358. while (getline(job_xx_out_ifs, timestamp_line)) {
  359. j++;
  360. if (timestamp_line.empty())
  361. continue;
  362. String_Tokenizer tokens(timestamp_line, ":"); //
  363. string proc_num = trim(tokens.next_token()); //0163, the MPI process number
  364. string timestamp = trim(tokens.next_token()); //1366949424667582.000000, the timestamp
  365. if (j % 2 != 0)
  366. first_proc_num = atoi(proc_num.c_str());
  367. else
  368. second_proc_num = atoi(proc_num.c_str());
  369. if (j % 2 == 0) {
  370. if (first_proc_num != second_proc_num) {
  371. char buf[200];
  372. sprintf(buf,
  373. "[%s][%d][%d]: the timestamp of start and end is not contiguous.",
  374. job_xx_out_file.c_str(), first_proc_num,
  375. second_proc_num);
  376. throw logic_error(buf);
  377. }
  378. }
  379. if (j % 2 != 0)
  380. vec_start.push_back(atof(timestamp.c_str()));
  381. else
  382. vec_end.push_back(atof(timestamp.c_str()));
  383. }
  384. if (j != num_lines) {
  385. throw logic_error(
  386. "less or more than 2048 timestamp lines in job.xx.out file.");
  387. }
  388. sort(vec_start.begin(), vec_start.end());
  389. sort(vec_end.begin(), vec_end.end());
  390. double timespan = vec_end[vec_end.size() - 1] - vec_start[0];
  391. timespan_sum += timespan;
  392. }
  393. i++;
  394. }
  395. return timespan_sum;
  396. }
  397. /*
  398. * @job_xx_ben_file, like job.4.ben, it contains
  399. job.4.0.out
  400. job.4.1.out
  401. job.4.2.out
  402. job.4.3.out
  403. job.4.4.out
  404. *
  405. * */
  406. double data_proc::process_internal(const string& job_xx_ben_file, int job_scale,
  407. const bool &loose) {
  408. string job_xx_out_file;
  409. double time_start = 0;
  410. ifstream job_xx_ben_ifs(job_xx_ben_file);
  411. /*lines of time_start/time_end print-out, for 1024 parallel jobs on 1024 cores of 512 nodes*/
  412. int num_lines = 2048;
  413. vector<double> vec_start;
  414. vector<double> vec_end;
  415. int i = 0;
  416. while (getline(job_xx_ben_ifs, job_xx_out_file)) {
  417. fprintf(stdout, "[%s][%s]: processing...\n", job_xx_ben_file.c_str(),
  418. job_xx_out_file.c_str());
  419. ifstream job_xx_out_ifs(job_xx_out_file);
  420. /*the first line is job.x.0.out, count the timestamp in it as time start*/
  421. if (loose && i == 0) {
  422. string timestamp_line;
  423. while (getline(job_xx_out_ifs, timestamp_line)) {
  424. time_start = atof(timestamp_line.c_str());
  425. break; /*since there's only one line in job.x.0.out*/
  426. }
  427. }
  428. if (i > 0) { /*count the earliest timestamp in all job.x.x.out(except job.x.0.out) as time start*/
  429. /* the format, [MPI process number]: [timestamp]
  430. 0163: 1366949424667582.000000
  431. 0163: 1366949424667658.000000
  432. * */
  433. string timestamp_line;
  434. int j = 0; //counter for lines of timestamp in job.xx.out file
  435. int first_proc_num; //the first MPI processor number
  436. int second_proc_num; //the second MPI processor number
  437. while (getline(job_xx_out_ifs, timestamp_line)) {
  438. j++;
  439. if (timestamp_line.empty())
  440. continue;
  441. String_Tokenizer tokens(timestamp_line, ":"); //
  442. string proc_num = trim(tokens.next_token()); //0163, the MPI process number
  443. string timestamp = trim(tokens.next_token()); //1366949424667582.000000, the timestamp
  444. if (j % 2 != 0)
  445. first_proc_num = atoi(proc_num.c_str());
  446. else
  447. second_proc_num = atoi(proc_num.c_str());
  448. if (j % 2 == 0) {
  449. if (first_proc_num != second_proc_num) {
  450. char buf[200];
  451. sprintf(buf,
  452. "[%s][%d][%d]: the timestamp of start and end is not contiguous.",
  453. job_xx_out_file.c_str(), first_proc_num,
  454. second_proc_num);
  455. throw logic_error(buf);
  456. }
  457. }
  458. if (j % 2 != 0)
  459. vec_start.push_back(atof(timestamp.c_str()));
  460. else
  461. vec_end.push_back(atof(timestamp.c_str()));
  462. }
  463. if (j != num_lines) {
  464. throw logic_error(
  465. "less or more than 2048 timestamp lines in job.xx.out file.");
  466. }
  467. }
  468. i++;
  469. }
  470. sort(vec_start.begin(), vec_start.end());
  471. sort(vec_end.begin(), vec_end.end());
  472. if (!loose)
  473. time_start = vec_start[0];
  474. double timespan_sum = vec_end[vec_end.size() - 1] - time_start;
  475. return timespan_sum;
  476. }
  477. /*
  478. * @filename, like job.512.ben
  479. * */
  480. int data_proc::extract_job_scale(const string& job_xx_ben_file) {
  481. string job_xx_out_file;
  482. ifstream job_xx_ben_ifs(job_xx_ben_file);
  483. int i = 0;
  484. while (getline(job_xx_ben_ifs, job_xx_out_file)) {
  485. i++;
  486. }
  487. return i;
  488. }
  489. /*
  490. * @filename, like job.512.ben
  491. * */
  492. string extract_job_scale2(const string& job_xx_ben_file) {
  493. string job_scale;
  494. String_Tokenizer tokens(job_xx_ben_file, "."); //job.512.ben
  495. int i = 0;
  496. while (tokens.has_more_tokens()) {
  497. string token = tokens.next_token();
  498. if (i == 1) { //get 512 from job.512.ben
  499. job_scale = token;
  500. break;
  501. }
  502. i++;
  503. }
  504. return job_scale;
  505. }
  506. /*
  507. * file_list's content:
  508. * job.2.ben
  509. * job.4.ben
  510. * job.8.ben
  511. * job.16.ben
  512. * job.32.ben
  513. * ......
  514. *
  515. * */
  516. void data_proc::process() {
  517. string job_agg_rpr = "job.agg.rpr";
  518. string job_avg_rpr = "job.avg.rpr";
  519. string job_thp_rpr = "job.thp.rpr";
  520. string job_agg2_rpr = "job.agg2.rpr";
  521. string job_avg2_rpr = "job.avg2.rpr";
  522. string job_thp2_rpr = "job.thp2.rpr";
  523. ofstream agg_ofs(job_agg_rpr);
  524. ofstream avg_ofs(job_avg_rpr);
  525. ofstream thp_ofs(job_thp_rpr);
  526. ofstream agg2_ofs(job_agg2_rpr);
  527. ofstream avg2_ofs(job_avg2_rpr);
  528. ofstream thp2_ofs(job_thp2_rpr);
  529. CIT it;
  530. for (it = file_list.begin(); it != file_list.end(); it++) {
  531. string job_xx_ben_file = *it;
  532. int job_scale = extract_job_scale(job_xx_ben_file);
  533. double agg = process_strict(job_xx_ben_file, job_scale);
  534. agg /= 1000.0;
  535. double avg = agg / job_scale;
  536. double thp = 1.0 * 1000 / avg;
  537. double agg2 = process_loose(job_xx_ben_file, job_scale);
  538. agg2 /= 1000.0;
  539. double avg2 = agg2 / job_scale;
  540. double thp2 = 1.0 * 1000 / avg2;
  541. char buf[100];
  542. /*memorize aggregation time for strict time computation*/
  543. sprintf(buf, "%f", agg);
  544. agg_ofs << job_scale << "\t" << buf << "\n";
  545. /*memorize average time for strict time computation*/
  546. memset(buf, 0, 100);
  547. sprintf(buf, "%f", avg);
  548. avg_ofs << job_scale << "\t" << buf << "\n";
  549. /*memorize throughput for strict time computation*/
  550. memset(buf, 0, 100);
  551. sprintf(buf, "%f", thp);
  552. thp_ofs << job_scale << "\t" << buf << "\n";
  553. /*memorize aggregation time for loose time computation*/
  554. sprintf(buf, "%f", agg2);
  555. agg2_ofs << job_scale << "\t" << buf << "\n";
  556. /*memorize average time for loose time computation*/
  557. memset(buf, 0, 100);
  558. sprintf(buf, "%f", avg2);
  559. avg2_ofs << job_scale << "\t" << buf << "\n";
  560. /*memorize throughput time for loose time computation*/
  561. memset(buf, 0, 100);
  562. sprintf(buf, "%f", thp2);
  563. thp2_ofs << job_scale << "\t" << buf << "\n";
  564. }
  565. }
  566. /*
  567. * file hierarchy
  568. * job.all.all
  569. * job.2.ben -> time end - time start
  570. * job.2.0.out
  571. * job.2.1.out
  572. * job.2.2.out
  573. * job.4.ben -> time end - time start
  574. * job.4.0.out
  575. * job.4.1.out
  576. * job.4.2.out
  577. * job.4.3.out
  578. * job.4.4.out
  579. * ....
  580. *
  581. * job.agg.rpr
  582. * job.avg.rpr
  583. * job.thp.rpr
  584. *
  585. * job.agg2.rpr
  586. * job.avg2.rpr
  587. * job.thp2.rpr
  588. *
  589. * */
  590. #include <getopt.h>
  591. void printUsage(char *argv_0);
  592. int main(int argc, char **argv) {
  593. extern char *optarg;
  594. string file_all_all;
  595. int printHelp = 0;
  596. int c;
  597. while ((c = getopt(argc, argv, "f:h")) != -1) {
  598. switch (c) {
  599. case 'f':
  600. file_all_all = optarg;
  601. break;
  602. case 'h':
  603. printHelp = 1;
  604. break;
  605. default:
  606. fprintf(stderr, "Illegal argument \"%c\"\n", c);
  607. printUsage(argv[0]);
  608. exit(1);
  609. }
  610. }
  611. if (printHelp) {
  612. printUsage(argv[0]);
  613. exit(1);
  614. }
  615. if (!file_all_all.empty()) {
  616. data_proc proc(file_all_all);
  617. proc.process();
  618. } else {
  619. printUsage(argv[0]);
  620. exit(1);
  621. }
  622. }
  623. void printUsage(char *argv_0) {
  624. fprintf(stdout, "Usage:\n%s %s\n", argv_0, "-f file_all_all [-h(help)]");
  625. }