1 #include <stdio.h> // printf, fopen
6 #include <malloc/malloc.h>
9 const char *argp_program_version
= "fstBC transCorrd demo 0.1 @" __TIME__
"," __DATE__
;
10 const char *argp_program_bug_address
= "huxs@salus-bio.com";
12 /* Program documentation. */
14 "fstBC transCorrd single threaded"
24 /* Global Var for "common.h" */
25 parameters_t Parameters
= {
29 // static_assert(VARTYPE(Parameters.jobDataState)==1, "It is not uint8_t");
30 workerArray_t
*workerArray
;
32 int main(int argc
, char *argv
[]) {
34 fprintf(stderr
, "====== %s ======\n[i]Usage: %s <fstBC.fq[.gz]> <spatial.txt>\n", doc
, argv
[0]);
37 printf("[i]%s %s %s\n", argv
[0], argv
[1], argv
[2]);
38 Parameters
.inFastqFilename
= argv
[1];
39 // 没printf拖时间就得加 barrier
40 Parameters
.outSpatialFilename
= argv
[2];
41 errno
= 0; /* extern int, but do not declare errno manually */
42 Parameters
.outfp
= fopen(Parameters
.outSpatialFilename
, "w");
44 fprintf(stderr
, "[x]Error on opening output file [%s]: %s.\n", Parameters
.outSpatialFilename
, strerror(errno
));
47 // defLoop_p = uv_default_loop();
49 int_least16_t n_threads
= 1;
50 workerArray_t
*workerArray
= (workerArray_t
*)calloc(n_threads
, sizeof(workerArray_t
));
53 #if __has_builtin(__builtin_dump_struct)
54 #pragma GCC diagnostic push
55 #pragma GCC diagnostic ignored "-Wformat-pedantic"
56 __builtin_dump_struct(&Parameters
, &printf
);
57 #pragma GCC diagnostic pop
62 fclose(Parameters
.outfp
);
63 fprintf(stderr
, "[i]Run to the end.\n");