-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
71 lines (54 loc) · 1.14 KB
/
main.c
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
/*
* Author: Chris Wailes <[email protected]>
* Project: Parallel Linear Program Solver
* Date: 2011/10/16
* Description: The main driver of our program.
*/
// Standard Incldues
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
// Project Includes
#include "dictionary.h"
#include "input.h"
#include "kernels.h"
#include "output.h"
#include "util.h"
#include "worker.h"
// Global Variables
config_t cfg;
// Functions
int main(int argc, char** argv) {
dict_t* dict;
get_config(argc, argv);
dict = load_lp_file();
if (cfg.mathprog_filename) {
output_glpsol(dict, cfg.mathprog_filename);
exit(0);
}
if (cfg.pmode == PTHREADS) {
workers_setup();
}
if (cfg.verbose) {
printf("Initial Dictionary:\n");
dict_view(dict);
}
// Initialize the dictionary proper.
if (dict_init(&dict)) {
if (cfg.verbose) {
printf("Dictionary after initialization:\n");
dict_view(dict);
}
}
cfg.init_done = TRUE;
dict = kernel_select(dict);
if (cfg.verbose) {
printf("Final Dictionary:\n");
dict_view(dict);
}
printf("Final Values:\n");
dict_view_answer(dict);
printf("\n");
dict_free(dict);
return 0;
}