-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargs.h
More file actions
139 lines (122 loc) · 3.12 KB
/
args.h
File metadata and controls
139 lines (122 loc) · 3.12 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#ifndef ARGS_H
#define ARGS_H
#include <stdint.h>
#include <stdio.h>
#include <stdatomic.h>
#define DEFAULT_FA_MIN_CC 0
#define DEFAULT_FQ_MIN_CC 32
#define DEFAULT_FA_MAX_CC UINT32_MAX
#define DEFAULT_FQ_MAX_CC UINT32_MAX
#define DEFAULT_SIM_CALC_MODE SET
#define DEFAULT_LCP_LEVEL 5
#define DEFAULT_THREAD_NUMBER 8
#define DEFAULT_VERBOSE 0
#define DEFAULT_WRITE_LCP_CORES 0
#define DEFAULT_PREFIX "gc"
#define DEFAULT_COMPRESSION_RATIO 4
#define MAGIC_LCP_FA_CONSTANT 2.20 // the constant reduction of cores is 2.33 but to be
// safe, it is selected lower than that
#define MAGIC_LCP_FQ_CONSTANT 2.00 // the constant reduction of cores is 1.5 but to be
// more efficient, it is selected higher than that
#define INITIAL_SEQUENCE_SIZE 300000000
#define FASTQ_WORKER_BUFFER_SIZE 10000000
#define SEPERATOR '$'
#define THREAD_EXIT_SIGNAL -2
#define BUFFER_NOT_INITIALIZED -1
#define THREAD_BUSY 0
#define THREAD_AVAILABLE 1
#define SHORT_WAIT_TIME 4096
#define MODERATE_WAIT_TIME 32768
typedef enum {
INFO,
WARN,
ERROR
} LogLevel;
typedef enum {
FA,
FQ,
LOAD
} program_mode;
typedef enum {
SET,
VECTOR
} sim_calculation_type;
typedef enum {
FQT_DIR,
FQT_FILE
} fastq_input_type;
typedef uint64_t simple_core; // first 32 bits are ulabel, last 32 is length of the core
typedef struct {
char *fasta;
char *name;
int length;
int seq_idx;
simple_core *cores;
uint64_t core_count;
double exec_time; // exec. time per thread (including LCP processing)
} seq_t;
typedef struct {
seq_t *seqs;
int seq_count;
int capacity;
long total_seq_len;
int lcp_level;
int verbose;
#if NUMA_AVAILABLE
int numa_node_id;
#endif
} fa_thread_t;
typedef struct {
double lcp;
double merging;
double sorting;
double filtering;
} time_stats_t;
typedef struct {
program_mode mode;
int n_threads;
char *prefix;
int n_genomes;
sim_calculation_type sct;
int lcp_level;
int write_lcpt; // 1: true, 0: false
int verbose; // 1: true, 0: false
} p_args_t;
typedef struct {
int apply_filter;
uint32_t min_cc;
uint32_t max_cc;
char *inFileName;
char *shortName;
char *outFileName;
simple_core *cores;
uint64_t core_count;
double total_len;
// other
sim_calculation_type sct;
int lcp_level;
int write_lcpt; // 1: true, 0: false
int verbose; // 1: true, 0: false
time_stats_t time_stats;
} g_args_t;
typedef struct {
atomic_int *available;
char *buffer;
int buffer_len;
int lcp_level;
simple_core *cores;
uint64_t core_count;
uint64_t estimated_core_count;
time_stats_t time_stats;
} fqw_args_t;
typedef struct {
uint64_t value;
size_t array_index;
uint64_t element_index;
} heap_node;
typedef struct {
heap_node *data;
size_t size;
size_t capacity;
} min_heap;
#endif