From 7cd4b5ba7f6d42d4367b2bccc5b9e61a9601bb22 Mon Sep 17 00:00:00 2001 From: Danilo Horta Date: Fri, 1 Dec 2023 10:49:10 +0000 Subject: [PATCH] organize imports --- c-core/argmax.h | 14 ------ c-core/argmax_avx.h | 6 ++- c-core/argmax_neon.h | 6 ++- c-core/codec.c | 2 +- c-core/database_reader.c | 3 ++ c-core/database_reader.h | 8 +++- c-core/database_writer.c | 5 ++ c-core/database_writer.h | 4 +- c-core/disambiguate.c | 2 - c-core/find.h | 14 ------ c-core/find_avx.h | 3 +- c-core/find_neon.h | 4 +- c-core/fs.c | 3 -- c-core/hmm_reader.c | 2 +- c-core/hmm_reader.h | 2 - c-core/hmmer.c | 4 +- c-core/hmmer_dialer.c | 3 +- c-core/hmmer_result.c | 2 +- c-core/match.c | 3 +- c-core/match.h | 3 +- c-core/match_iter.c | 1 + c-core/model.c | 10 +++- c-core/model.h | 5 +- c-core/model_node.h | 3 +- c-core/model_xnode.h | 3 +- c-core/nuclt_dist.c | 3 +- c-core/nuclt_dist.h | 5 +- c-core/pack.h | 5 +- c-core/partition_size.c | 3 +- c-core/press.c | 1 + c-core/product.c | 1 - c-core/product_thread.c | 2 - c-core/product_thread.h | 1 - c-core/protein.c | 11 ++++- c-core/protein.h | 2 +- c-core/protein_background.c | 1 + c-core/protein_iter.c | 1 - c-core/protein_iter.h | 2 +- c-core/protein_null.c | 3 +- c-core/protein_null.h | 1 + c-core/protein_reader.c | 5 +- c-core/scan.c | 3 +- c-core/sequence.c | 2 +- c-core/sequence.h | 3 +- c-core/state.c | 2 +- c-core/test_massive.c | 3 +- c-core/test_model.c | 6 ++- c-core/test_protein.c | 6 ++- c-core/test_scan.c | 1 - c-core/test_threads.c | 91 ------------------------------------- c-core/test_window.c | 3 +- c-core/thread.c | 3 +- c-core/thread.h | 2 +- c-core/unpack.h | 6 ++- c-core/viterbi.c | 3 +- c-core/viterbi_dump.c | 3 ++ c-core/viterbi_index.h | 2 +- c-core/viterbi_onto.h | 10 +++- c-core/viterbi_path.c | 3 +- c-core/viterbi_struct.h | 1 - c-core/vmax.h | 14 ------ c-core/vmax_avx.h | 2 + c-core/vmax_neon.h | 3 +- c-core/window.c | 2 + c-core/window.h | 1 - c-core/xstatic_assert.h | 2 - c-core/xtrans.c | 3 +- 67 files changed, 129 insertions(+), 213 deletions(-) delete mode 100644 c-core/argmax.h delete mode 100644 c-core/find.h delete mode 100644 c-core/test_threads.c delete mode 100644 c-core/vmax.h diff --git a/c-core/argmax.h b/c-core/argmax.h deleted file mode 100644 index 81a408f..0000000 --- a/c-core/argmax.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef ARGMAX_H -#define ARGMAX_H - -#if __ARM_NEON -#include "argmax_neon.h" -#endif - -#if __AVX__ -#include "argmax_avx.h" -#endif - -#include "argmax_generic.h" - -#endif diff --git a/c-core/argmax_avx.h b/c-core/argmax_avx.h index d613e9f..bcb9e05 100644 --- a/c-core/argmax_avx.h +++ b/c-core/argmax_avx.h @@ -1,10 +1,11 @@ #ifndef ARGMAX_AVX_H #define ARGMAX_AVX_H +#if __AVX__ #include "argmax_generic.h" #include "compiler.h" -#include "find.h" -#include "vmax.h" +#include "find_avx.h" +#include "vmax_avx.h" PURE int argmax2(float *dval, float const x[restrict]) { @@ -42,5 +43,6 @@ PURE int argmax20(float *dval, float const x[restrict]) *dval = val; return i; } +#endif #endif diff --git a/c-core/argmax_neon.h b/c-core/argmax_neon.h index a00647b..1fdb92b 100644 --- a/c-core/argmax_neon.h +++ b/c-core/argmax_neon.h @@ -1,10 +1,11 @@ #ifndef ARGMAX_NEON_H #define ARGMAX_NEON_H +#if __ARM_NEON #include "argmax_generic.h" #include "compiler.h" -#include "find.h" -#include "vmax.h" +#include "find_neon.h" +#include "vmax_neon.h" PURE int argmax2(float *dval, float const x[restrict]) { @@ -42,5 +43,6 @@ PURE int argmax20(float *dval, float const x[restrict]) *dval = val; return i; } +#endif #endif diff --git a/c-core/codec.c b/c-core/codec.c index 6d246c2..add20ae 100644 --- a/c-core/codec.c +++ b/c-core/codec.c @@ -1,5 +1,5 @@ #include "codec.h" -#include "imm/imm.h" +#include "imm/path.h" #include "protein.h" #include "state.h" diff --git a/c-core/database_reader.c b/c-core/database_reader.c index 08e5ddf..dbe4616 100644 --- a/c-core/database_reader.c +++ b/c-core/database_reader.c @@ -3,6 +3,9 @@ #include "defer_return.h" #include "error.h" #include "lip/1darray/1darray.h" +#include "lip/file/read_bool.h" +#include "lip/file/read_float.h" +#include "lip/file/read_int.h" #include "magic_number.h" #include "rc.h" #include "unpack.h" diff --git a/c-core/database_reader.h b/c-core/database_reader.h index c43406c..d0e0a62 100644 --- a/c-core/database_reader.h +++ b/c-core/database_reader.h @@ -2,9 +2,13 @@ #define DATABASE_READER_H #include "entry_dist.h" -#include "imm/imm.h" -#include "lip/lip.h" +#include "imm/amino.h" +#include "imm/nuclt.h" +#include "imm/nuclt_code.h" +#include "lip/file/file.h" #include "model_params.h" +#include +#include struct database_reader { diff --git a/c-core/database_writer.c b/c-core/database_writer.c index b7a9e36..0bf8213 100644 --- a/c-core/database_writer.c +++ b/c-core/database_writer.c @@ -4,6 +4,11 @@ #include "error.h" #include "fs.h" #include "lip/1darray/1darray.h" +#include "lip/file/read_int.h" +#include "lip/file/write_array.h" +#include "lip/file/write_bool.h" +#include "lip/file/write_float.h" +#include "lip/file/write_int.h" #include "magic_number.h" #include "pack.h" #include "protein.h" diff --git a/c-core/database_writer.h b/c-core/database_writer.h index 2561393..365a1ed 100644 --- a/c-core/database_writer.h +++ b/c-core/database_writer.h @@ -1,8 +1,8 @@ #ifndef DATABASE_WRITER_H #define DATABASE_WRITER_H -#include "imm/imm.h" -#include "lip/lip.h" +#include "imm/nuclt_code.h" +#include "lip/file/file.h" #include "model_params.h" #include "xlimits.h" #include diff --git a/c-core/disambiguate.c b/c-core/disambiguate.c index 3ba0e42..9d8d730 100644 --- a/c-core/disambiguate.c +++ b/c-core/disambiguate.c @@ -1,8 +1,6 @@ #include "array_size.h" #include "compiler.h" -#include #include -#include // clang-format off #define ix(x) \ diff --git a/c-core/find.h b/c-core/find.h deleted file mode 100644 index 11ff06b..0000000 --- a/c-core/find.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef FIND_H -#define FIND_H - -#if __ARM_NEON -#include "find_neon.h" -#endif - -#if __AVX__ -#include "find_avx.h" -#endif - -#include "find_generic.h" - -#endif diff --git a/c-core/find_avx.h b/c-core/find_avx.h index 96eb66a..20f0736 100644 --- a/c-core/find_avx.h +++ b/c-core/find_avx.h @@ -1,9 +1,9 @@ #ifndef FIND_AVX_H #define FIND_AVX_H +#if __AVX__ #include "asint.h" #include "compiler.h" -#include "find_generic.h" #include PURE int find2(float const needle, float const stack[restrict]) @@ -76,5 +76,6 @@ PURE int find20(float const needle, float const stack[restrict]) int mask = _mm_movemask_ps(_mm_castsi128_ps(_mm_cmpeq_epi32(zi, ki))); return __builtin_ctz(mask << 16); } +#endif #endif diff --git a/c-core/find_neon.h b/c-core/find_neon.h index fd428c7..e902eea 100644 --- a/c-core/find_neon.h +++ b/c-core/find_neon.h @@ -1,10 +1,9 @@ #ifndef FIND_NEON_H #define FIND_NEON_H +#if __ARM_NEON #include "compiler.h" -#include "find_generic.h" #include -#include PURE uint64_t neon_mask64(int32x2_t const needle, float const stack[restrict]) { @@ -75,5 +74,6 @@ PURE int find20(float const needle, float const stack[restrict]) f = neon_mask128(x, stack + 16); return (__builtin_ctzll(f) >> 4) + 16; } +#endif #endif diff --git a/c-core/fs.c b/c-core/fs.c index 9d58bcb..1d514aa 100644 --- a/c-core/fs.c +++ b/c-core/fs.c @@ -14,15 +14,12 @@ #endif #include "fs.h" -#include "array_size.h" #include "error.h" #include "rc.h" #include "xlimits.h" #include "xstrcpy.h" -#include #include #include -#include #include #include #include diff --git a/c-core/hmm_reader.c b/c-core/hmm_reader.c index 6948c7f..10db514 100644 --- a/c-core/hmm_reader.c +++ b/c-core/hmm_reader.c @@ -1,8 +1,8 @@ #include "hmm_reader.h" -#include "compiler.h" #include "error.h" #include "model.h" #include "rc.h" +#include static void init_null_lprobs(float[IMM_AMINO_SIZE]); diff --git a/c-core/hmm_reader.h b/c-core/hmm_reader.h index 9310105..1339acb 100644 --- a/c-core/hmm_reader.h +++ b/c-core/hmm_reader.h @@ -1,9 +1,7 @@ #ifndef HMM_READER_H #define HMM_READER_H -#include "entry_dist.h" #include "hmmer_reader/hmmer_reader.h" -#include "imm/imm.h" #include "model.h" #include "model_params.h" #include diff --git a/c-core/hmmer.c b/c-core/hmmer.c index cac0de4..6f41454 100644 --- a/c-core/hmmer.c +++ b/c-core/hmmer.c @@ -1,6 +1,8 @@ #include "hmmer.h" #include "error.h" -#include "h3client/h3client.h" +#include "h3client/deadline.h" +#include "h3client/errno.h" +#include "h3client/stream.h" #include "hmmer_dialer.h" #include "hmmer_result.h" #include "rc.h" diff --git a/c-core/hmmer_dialer.c b/c-core/hmmer_dialer.c index 91f9d6a..2f5f5f8 100644 --- a/c-core/hmmer_dialer.c +++ b/c-core/hmmer_dialer.c @@ -1,6 +1,7 @@ #include "hmmer_dialer.h" #include "error.h" -#include "h3client/h3client.h" +#include "h3client/deadline.h" +#include "h3client/dialer.h" #include "hmmer.h" #include "rc.h" #include diff --git a/c-core/hmmer_result.c b/c-core/hmmer_result.c index 5ee93e3..2a9d833 100644 --- a/c-core/hmmer_result.c +++ b/c-core/hmmer_result.c @@ -1,6 +1,6 @@ #include "hmmer_result.h" #include "error.h" -#include "h3client/h3client.h" +#include "h3client/result.h" #include "rc.h" #include #include diff --git a/c-core/match.c b/c-core/match.c index 27edeb7..a284a44 100644 --- a/c-core/match.c +++ b/c-core/match.c @@ -1,7 +1,8 @@ #include "match.h" +#include "imm/gencode.h" +#include "imm/nuclt_code.h" #include "protein.h" #include "state.h" -#include struct match match_init(struct protein const *protein) { diff --git a/c-core/match.h b/c-core/match.h index 3d296fc..7c477fe 100644 --- a/c-core/match.h +++ b/c-core/match.h @@ -1,7 +1,8 @@ #ifndef MATCH_H #define MATCH_H -#include "imm/imm.h" +#include "imm/codon.h" +#include "imm/step.h" #include struct protein; diff --git a/c-core/match_iter.c b/c-core/match_iter.c index 5b561ba..2df39ea 100644 --- a/c-core/match_iter.c +++ b/c-core/match_iter.c @@ -1,4 +1,5 @@ #include "match_iter.h" +#include "imm/path.h" #include "match.h" void match_iter_init(struct match_iter *x, struct imm_seq const *seq, diff --git a/c-core/model.c b/c-core/model.c index b258fa6..d894151 100644 --- a/c-core/model.c +++ b/c-core/model.c @@ -2,14 +2,20 @@ #include "defer_return.h" #include "entry_dist.h" #include "error.h" -#include "imm/imm.h" +#include "imm/amino_lprob.h" +#include "imm/codon_lprob.h" +#include "imm/gencode.h" +#include "imm/hmm.h" +#include "imm/lprob.h" +#include "imm/nuclt_code.h" #include "model.h" -#include "node.h" #include "nuclt_dist.h" #include "rc.h" +#include "state.h" #include "xrealloc.h" #include #include +#include #include #include diff --git a/c-core/model.h b/c-core/model.h index 19071f9..d3efde9 100644 --- a/c-core/model.h +++ b/c-core/model.h @@ -1,14 +1,11 @@ #ifndef MODEL_H #define MODEL_H -#include "entry_dist.h" -#include "imm/imm.h" +#include "imm/amino.h" #include "model_node.h" #include "model_params.h" #include "model_xnode.h" #include "nuclt_dist.h" -#include "rc.h" -#include "state.h" #include "trans.h" #include "xlimits.h" #include "xtrans.h" diff --git a/c-core/model_node.h b/c-core/model_node.h index 9a25b02..bd50bc4 100644 --- a/c-core/model_node.h +++ b/c-core/model_node.h @@ -1,7 +1,8 @@ #ifndef MODEL_NODE_H #define MODEL_NODE_H -#include "imm/imm.h" +#include "imm/frame_state.h" +#include "imm/mute_state.h" #include "nuclt_dist.h" struct model_node diff --git a/c-core/model_xnode.h b/c-core/model_xnode.h index d478171..3f4156c 100644 --- a/c-core/model_xnode.h +++ b/c-core/model_xnode.h @@ -1,7 +1,8 @@ #ifndef MODEL_XNODE_H #define MODEL_XNODE_H -#include "imm/imm.h" +#include "imm/frame_state.h" +#include "imm/mute_state.h" struct model_xnode_null { diff --git a/c-core/nuclt_dist.c b/c-core/nuclt_dist.c index 92a4069..91d27f6 100644 --- a/c-core/nuclt_dist.c +++ b/c-core/nuclt_dist.c @@ -1,6 +1,7 @@ #include "nuclt_dist.h" #include "error.h" -#include "lip/lip.h" +#include "lip/file/read_array.h" +#include "lip/file/write_array.h" #include "rc.h" void nuclt_dist_init(struct nuclt_dist *x, struct imm_nuclt const *nuclt) diff --git a/c-core/nuclt_dist.h b/c-core/nuclt_dist.h index 3e068f1..62b1689 100644 --- a/c-core/nuclt_dist.h +++ b/c-core/nuclt_dist.h @@ -1,7 +1,9 @@ #ifndef NUCLT_DIST_H #define NUCLT_DIST_H -#include "imm/imm.h" +#include "imm/codon_marg.h" +#include "imm/nuclt_lprob.h" +#include struct nuclt_dist { @@ -10,6 +12,7 @@ struct nuclt_dist }; struct lip_file; +struct imm_nuclt; // clang-format off void nuclt_dist_init(struct nuclt_dist *, struct imm_nuclt const *); diff --git a/c-core/pack.h b/c-core/pack.h index 80d61ed..614b656 100644 --- a/c-core/pack.h +++ b/c-core/pack.h @@ -2,9 +2,10 @@ #define PACK_H #include "error.h" -#include "imm/imm.h" +#include "imm/abc.h" #include "lip/1darray/1darray.h" -#include "lip/lip.h" +#include "lip/file/write_cstr.h" +#include "lip/file/write_map.h" #include "rc.h" static inline int pack_key(struct lip_file *stream, char const key[]) diff --git a/c-core/partition_size.c b/c-core/partition_size.c index 11fcf36..3df8048 100644 --- a/c-core/partition_size.c +++ b/c-core/partition_size.c @@ -1,7 +1,6 @@ #include "partition_size.h" -#include "imm/imm.h" #include -#include +#include "imm/max.h" static inline long ceildiv(long x, long y) { diff --git a/c-core/press.c b/c-core/press.c index f45c126..02d385f 100644 --- a/c-core/press.c +++ b/c-core/press.c @@ -5,6 +5,7 @@ #include "error.h" #include "fs.h" #include "hmm_reader.h" +#include "imm/gencode.h" #include "protein.h" #include "rc.h" #include "sizeof_field.h" diff --git a/c-core/product.c b/c-core/product.c index 1b50bcb..9ac1a6b 100644 --- a/c-core/product.c +++ b/c-core/product.c @@ -1,5 +1,4 @@ #include "product.h" -#include "array_size.h" #include "array_size_field.h" #include "defer_return.h" #include "error.h" diff --git a/c-core/product_thread.c b/c-core/product_thread.c index fd2ae37..c1021b2 100644 --- a/c-core/product_thread.c +++ b/c-core/product_thread.c @@ -5,11 +5,9 @@ #include "format.h" #include "fs.h" #include "hmmer_result.h" -#include "imm/imm.h" #include "match.h" #include "match_iter.h" #include "rc.h" -#include #include int product_thread_init(struct product_thread *x, int tid, char const *dir) diff --git a/c-core/product_thread.h b/c-core/product_thread.h index 8ca70ee..9999b7a 100644 --- a/c-core/product_thread.h +++ b/c-core/product_thread.h @@ -2,7 +2,6 @@ #define PRODUCT_THREAD_H #include "product_line.h" -#include struct match; struct match_iter; diff --git a/c-core/protein.c b/c-core/protein.c index 2e056c2..da41b3f 100644 --- a/c-core/protein.c +++ b/c-core/protein.c @@ -2,9 +2,16 @@ #include "array_size_field.h" #include "defer_return.h" #include "error.h" -#include "lip/1darray/1darray.h" +#include "imm/dump.h" +#include "imm/frame_cond.h" +#include "imm/gencode.h" +#include "imm/lprob.h" +#include "imm/min.h" +#include "imm/nuclt_code.h" +#include "imm/rnd.h" #include "lip/file/file.h" -#include "lip/lip.h" +#include "lip/file/read_int.h" +#include "lip/file/write_int.h" #include "model.h" #include "pack.h" #include "protein_background.h" diff --git a/c-core/protein.h b/c-core/protein.h index 8d196e6..f16944d 100644 --- a/c-core/protein.h +++ b/c-core/protein.h @@ -1,7 +1,7 @@ #ifndef PROTEIN_H #define PROTEIN_H -#include "imm/imm.h" +#include "imm/score_table.h" #include "model.h" #include "protein_background.h" #include "protein_null.h" diff --git a/c-core/protein_background.c b/c-core/protein_background.c index 29a4bdf..0ece5da 100644 --- a/c-core/protein_background.c +++ b/c-core/protein_background.c @@ -1,5 +1,6 @@ #include "protein_background.h" #include "array_size.h" +#include "imm/lprob.h" #include "imm/score_table.h" void protein_background_init(struct protein_background *x, diff --git a/c-core/protein_iter.c b/c-core/protein_iter.c index d2a3b5f..5c32c4e 100644 --- a/c-core/protein_iter.c +++ b/c-core/protein_iter.c @@ -1,5 +1,4 @@ #include "protein_iter.h" -#include "database_reader.h" #include "fs.h" #include "protein.h" #include "protein_reader.h" diff --git a/c-core/protein_iter.h b/c-core/protein_iter.h index e97b400..8c7d472 100644 --- a/c-core/protein_iter.h +++ b/c-core/protein_iter.h @@ -1,7 +1,7 @@ #ifndef PROTEIN_ITER_H #define PROTEIN_ITER_H -#include "lip/lip.h" +#include "lip/file/file.h" #include "protein.h" #include diff --git a/c-core/protein_null.c b/c-core/protein_null.c index 126fcba..ba36e94 100644 --- a/c-core/protein_null.c +++ b/c-core/protein_null.c @@ -1,6 +1,7 @@ #include "protein_null.h" #include "array_size.h" -#include "imm/imm.h" +#include "imm/lprob.h" +#include "imm/score_table.h" #include "xtrans.h" void protein_null_init(struct protein_null *x, struct imm_nuclt const *nuclt) diff --git a/c-core/protein_null.h b/c-core/protein_null.h index 1bc56dd..c82f72a 100644 --- a/c-core/protein_null.h +++ b/c-core/protein_null.h @@ -14,6 +14,7 @@ struct protein_null struct imm_score_table; struct xtrans; struct model; +struct imm_state; // clang-format off void protein_null_init(struct protein_null *, struct imm_nuclt const *); diff --git a/c-core/protein_reader.c b/c-core/protein_reader.c index c436a94..953880a 100644 --- a/c-core/protein_reader.c +++ b/c-core/protein_reader.c @@ -1,13 +1,14 @@ #include "protein_reader.h" -#include "array_size_field.h" #include "database_reader.h" #include "defer_return.h" #include "error.h" #include "fs.h" -#include "imm/imm.h" +#include "imm/min.h" +#include "lip/file/read_array.h" #include "partition_size.h" #include "protein_iter.h" #include "rc.h" +#include "sizeof_field.h" #include "unpack.h" #include diff --git a/c-core/scan.c b/c-core/scan.c index e7fe498..5b04365 100644 --- a/c-core/scan.c +++ b/c-core/scan.c @@ -6,8 +6,7 @@ #include "hmmer_dialer.h" #include "product.h" #include "protein_reader.h" -#include "queue.h" -#include "sequence.h" +#include "rc.h" #include "sequence_queue.h" #include "thread.h" #include "thread_params.h" diff --git a/c-core/sequence.c b/c-core/sequence.c index 2d9da42..4a63e21 100644 --- a/c-core/sequence.c +++ b/c-core/sequence.c @@ -2,7 +2,7 @@ #include "defer_return.h" #include "disambiguate.h" #include "error.h" -#include "imm/imm.h" +#include "imm/abc.h" #include "rc.h" #include "xstrdup.h" #include diff --git a/c-core/sequence.h b/c-core/sequence.h index 8c97f23..903dcb3 100644 --- a/c-core/sequence.h +++ b/c-core/sequence.h @@ -1,7 +1,8 @@ #ifndef SEQUENCE_H #define SEQUENCE_H -#include "imm/imm.h" +#include "imm/eseq.h" +#include "imm/range.h" #include "node.h" #include diff --git a/c-core/state.c b/c-core/state.c index a83e609..4432471 100644 --- a/c-core/state.c +++ b/c-core/state.c @@ -1,6 +1,6 @@ #include "state.h" -#include "model.h" #include "xu16toa.h" +#include static inline int id_msb(int id) { return id & (3 << (STATE_ID_BITS - 2)); } diff --git a/c-core/test_massive.c b/c-core/test_massive.c index d3710f1..c462288 100644 --- a/c-core/test_massive.c +++ b/c-core/test_massive.c @@ -1,7 +1,6 @@ #include "fs.h" -#include "imm/imm.h" +#include "imm/rnd.h" #include "params.h" -#include "press.h" #include "scan.h" #include "test_utils.h" #include "vendor/minctest.h" diff --git a/c-core/test_model.c b/c-core/test_model.c index 8b6e447..4c4454c 100644 --- a/c-core/test_model.c +++ b/c-core/test_model.c @@ -1,4 +1,8 @@ -#include "imm/imm.h" +#include "imm/dna.h" +#include "imm/gencode.h" +#include "imm/lprob.h" +#include "imm/nuclt_code.h" +#include "imm/rnd.h" #include "model.h" #include "protein.h" #include "vendor/minctest.h" diff --git a/c-core/test_protein.c b/c-core/test_protein.c index 7c969c6..40f1275 100644 --- a/c-core/test_protein.c +++ b/c-core/test_protein.c @@ -1,5 +1,9 @@ #include "codec.h" -#include "imm/imm.h" +#include "imm/dna.h" +#include "imm/eseq.h" +#include "imm/gencode.h" +#include "imm/nuclt_code.h" +#include "imm/path.h" #include "protein.h" #include "vendor/minctest.h" #include "viterbi.h" diff --git a/c-core/test_scan.c b/c-core/test_scan.c index 76c2c70..6605736 100644 --- a/c-core/test_scan.c +++ b/c-core/test_scan.c @@ -1,6 +1,5 @@ #include "array_size.h" #include "fs.h" -#include "imm/imm.h" #include "params.h" #include "scan.h" #include "test_consensus.h" diff --git a/c-core/test_threads.c b/c-core/test_threads.c deleted file mode 100644 index e38ac93..0000000 --- a/c-core/test_threads.c +++ /dev/null @@ -1,91 +0,0 @@ -#if 0 -#include "c11threads.h" -#include "fs.h" -#include "imm/imm.h" -#include "params.h" -#include "press.h" -#include "scan.h" -#include "test_consensus.h" -#include "test_utils.h" -#include "vendor/minctest.h" -#include - -#define SIZE 50000 -#define HMMFILE "Pfam-A.500.hmm" -#define DBFILE "test_threads.dcp" -#define PRODDIR "test_threads_prod" - -static thrd_t progress_thread = {0}; -static atomic_bool progress_continue = true; - -int progress_entry(void *arg) -{ - struct scan const *scan = arg; - while (progress_continue) - { - fprintf(stderr, "%d%% ", scan_progress(scan)); - thrd_sleep(&(struct timespec){.tv_nsec = 10000000}, NULL); - } - fprintf(stderr, "%d%%\n", scan_progress(scan)); - return 0; -} - -void progress_start(struct scan const *scan) -{ - progress_continue = true; - eq(thrd_create(&progress_thread, &progress_entry, (void *)scan), - thrd_success); -} - -void progress_stop(void) -{ - progress_continue = false; - eq(thrd_join(progress_thread, NULL), thrd_success); -} - -int main(void) -{ - setup_database(1, 0.01, HMMFILE, DBFILE); - fs_rmtree(PRODDIR); - - struct imm_rnd rnd = imm_rnd(591); - static char seq[SIZE + 1]; - for (int i = 0; i < SIZE; ++i) - { - seq[i] = sequences[0].data[i % strlen(sequences[0].data)]; - seq[i] = (i % 10 == 0) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - seq[i] = (i % 10 == 5) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - seq[i] = (i % 10 == 3) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - seq[i] = (i % 10 == 9) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - seq[i] = (i % 10 == 4) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - seq[i] = (i % 10 == 1) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - seq[i] = (i % 10 == 2) ? "ACGT"[imm_rnd_u64(&rnd) % 4] : seq[i]; - } - seq[SIZE] = '\0'; - - struct params params = {}; - struct scan *scan = NULL; - - eq(params_setup(¶ms, 4, true, false), 0); - ok(scan = scan_new(params)); - - eq(scan_open(scan, DBFILE), 0); - progress_start(scan); - - eq(scan_add(scan, sequences[0].id, sequences[0].name, seq), 0); - eq(scan_run(scan, PRODDIR), 0); - - progress_stop(); - eq(scan_close(scan), 0); - - eq(scan_progress(scan), 100); - eq(chksum(PRODDIR "/products.tsv"), 44039); - - scan_del(scan); - fs_rmtree(PRODDIR); - // cleanup_database(DBFILE); - return lfails; -} -#else -int main(void) { return 0; } -#endif diff --git a/c-core/test_window.c b/c-core/test_window.c index 1245496..e3b9ebf 100644 --- a/c-core/test_window.c +++ b/c-core/test_window.c @@ -1,7 +1,6 @@ #include "fs.h" -#include "imm/imm.h" +#include "imm/rnd.h" #include "params.h" -#include "press.h" #include "scan.h" #include "test_consensus.h" #include "test_utils.h" diff --git a/c-core/thread.c b/c-core/thread.c index 43cc7bf..eade495 100644 --- a/c-core/thread.c +++ b/c-core/thread.c @@ -2,13 +2,12 @@ #include "chararray.h" #include "database_reader.h" #include "debug.h" -#include "defer_return.h" #include "hmmer_dialer.h" +#include "imm/lprob.h" #include "infer_amino.h" #include "lrt.h" #include "match.h" #include "match_iter.h" -#include "now.h" #include "product_line.h" #include "product_thread.h" #include "protein_iter.h" diff --git a/c-core/thread.h b/c-core/thread.h index 1155a31..21ebdba 100644 --- a/c-core/thread.h +++ b/c-core/thread.h @@ -3,9 +3,9 @@ #include "chararray.h" #include "hmmer.h" +#include "imm/path.h" #include "protein.h" #include "protein_iter.h" -#include "queue.h" #include "thread_params.h" #include "viterbi.h" #include "viterbi_struct.h" diff --git a/c-core/unpack.h b/c-core/unpack.h index 2e177a1..d850c46 100644 --- a/c-core/unpack.h +++ b/c-core/unpack.h @@ -3,9 +3,11 @@ #include "array_size.h" #include "error.h" -#include "imm/imm.h" +#include "imm/abc.h" #include "lip/1darray/1darray.h" -#include "lip/lip.h" +#include "lip/file/read_cstr.h" +#include "lip/file/read_map.h" +#include "lip/file/read_str.h" #include "rc.h" #include diff --git a/c-core/viterbi.c b/c-core/viterbi.c index 1c1a32e..fd0f8ba 100644 --- a/c-core/viterbi.c +++ b/c-core/viterbi.c @@ -1,4 +1,5 @@ -#include "imm/imm.h" +#include "imm/lprob.h" +#include "imm/path.h" #include "protein.h" #include "protein_node.h" #include "viterbi_dp.h" diff --git a/c-core/viterbi_dump.c b/c-core/viterbi_dump.c index ecac8a5..9876520 100644 --- a/c-core/viterbi_dump.c +++ b/c-core/viterbi_dump.c @@ -1,5 +1,8 @@ #include "viterbi_dump.h" #include "array_size_field.h" +#include "imm/dump.h" +#include "imm/fmt.h" +#include "imm/lprob.h" #include "protein.h" #include "protein_node.h" #include "viterbi_xtrans.h" diff --git a/c-core/viterbi_index.h b/c-core/viterbi_index.h index 390f09c..41f29f6 100644 --- a/c-core/viterbi_index.h +++ b/c-core/viterbi_index.h @@ -2,7 +2,7 @@ #define VITERBI_INDEX_H #include "compiler.h" -#include "imm/imm.h" +#include "imm/eseq.h" #include "xlimits.h" #include diff --git a/c-core/viterbi_onto.h b/c-core/viterbi_onto.h index c6c6316..e764670 100644 --- a/c-core/viterbi_onto.h +++ b/c-core/viterbi_onto.h @@ -1,8 +1,14 @@ #ifndef VITERBI_ONTO_H #define VITERBI_ONTO_H -#include "argmax.h" -#include "array_size.h" +#if __ARM_NEON +#include "argmax_neon.h" +#elif __AVX__ +#include "argmax_avx.h" +#else +#include "argmax_generic.h" +#endif + #include "compiler.h" #include "trellis.h" #include "viterbi_coredp.h" diff --git a/c-core/viterbi_path.c b/c-core/viterbi_path.c index 3ed47be..3e15120 100644 --- a/c-core/viterbi_path.c +++ b/c-core/viterbi_path.c @@ -1,11 +1,10 @@ #include "viterbi_path.h" #include "error.h" -#include "imm/imm.h" +#include "imm/path.h" #include "rc.h" #include "state.h" #include "trellis.h" #include -#include int unzip_path(struct trellis *x, int seq_size, struct imm_path *path) { diff --git a/c-core/viterbi_struct.h b/c-core/viterbi_struct.h index 56414ea..ddec4b7 100644 --- a/c-core/viterbi_struct.h +++ b/c-core/viterbi_struct.h @@ -1,7 +1,6 @@ #ifndef VITERBI_STRUCT_H #define VITERBI_STRUCT_H -#include "imm/imm.h" #include "trellis.h" #include "viterbi_coredp.h" #include "viterbi_dp.h" diff --git a/c-core/vmax.h b/c-core/vmax.h deleted file mode 100644 index 6f45290..0000000 --- a/c-core/vmax.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef VMAX_H -#define VMAX_H - -#if __ARM_NEON -#include "vmax_neon.h" -#endif - -#if __AVX__ -#include "vmax_avx.h" -#endif - -#include "vmax_generic.h" - -#endif diff --git a/c-core/vmax_avx.h b/c-core/vmax_avx.h index 4540ec3..22fc5c9 100644 --- a/c-core/vmax_avx.h +++ b/c-core/vmax_avx.h @@ -1,6 +1,7 @@ #ifndef VMAX_AVX_H #define VMAX_AVX_H +#if __AVX__ #include "compiler.h" #include "maximum.h" #include @@ -55,5 +56,6 @@ PURE float vmax20(float const x[restrict]) __m256 r3 = _mm256_set_m128(_mm_load_ps(x + 16), _mm_load_ps(x + 16)); return m256max(_mm256_max_ps(_mm256_max_ps(r1, r2), r3)); } +#endif #endif diff --git a/c-core/vmax_neon.h b/c-core/vmax_neon.h index e81b3b5..37cde95 100644 --- a/c-core/vmax_neon.h +++ b/c-core/vmax_neon.h @@ -1,10 +1,10 @@ #ifndef VMAX_NEON_H #define VMAX_NEON_H +#if __ARM_NEON #include "compiler.h" #include "maximum.h" #include -#include PURE float vmax2(float const x[restrict]) { return maximum(x[0], x[1]); } @@ -42,5 +42,6 @@ PURE float vmax20(float const x[restrict]) r = vmaxq_f32(t5, r); return vmaxvq_f32(r); } +#endif #endif diff --git a/c-core/window.c b/c-core/window.c index d1bd808..f4d8566 100644 --- a/c-core/window.c +++ b/c-core/window.c @@ -1,5 +1,7 @@ #include "window.h" #include "compiler.h" +#include "imm/max.h" +#include "imm/min.h" #include "sequence.h" // We are respecting HMMER's limit on sequence size: diff --git a/c-core/window.h b/c-core/window.h index 29c9740..db5fbf5 100644 --- a/c-core/window.h +++ b/c-core/window.h @@ -1,7 +1,6 @@ #ifndef WINDOW_H #define WINDOW_H -#include "imm/imm.h" #include "sequence.h" #include diff --git a/c-core/xstatic_assert.h b/c-core/xstatic_assert.h index 594e40e..15b7ae7 100644 --- a/c-core/xstatic_assert.h +++ b/c-core/xstatic_assert.h @@ -1,8 +1,6 @@ #ifndef XSTATIC_ASSERT_H #define XSTATIC_ASSERT_H -#include - #define XSTATIC_ASSERT_XSTR(x) XSTATIC_ASSERT_STR(x) #define XSTATIC_ASSERT_STR(x) #x diff --git a/c-core/xtrans.c b/c-core/xtrans.c index 384872f..29e352c 100644 --- a/c-core/xtrans.c +++ b/c-core/xtrans.c @@ -1,6 +1,7 @@ #include "xtrans.h" #include "array_size.h" -#include "imm/imm.h" +#include "imm/dump.h" +#include "imm/lprob.h" void xtrans_init(struct xtrans *t) {