author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
8,483
16.05.2018 16:04:20
-7,200
b434e8d69bffcee5340b034a9763642499790761
Add a genius in the peeling decoder to set as wrong values the unknown ones
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "@@ -222,9 +222,9 @@ module::Decoder_SIHO<B,Q>* Decoder_LDPC::parameters\n{\nif (this->implem == \"GALA\") return new module::Decoder_LDPC_BP_flooding_GALA<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\n- else if (this->type == \"BP_PEELING\")\n+ else if (this->type == \"BP_PEELING\" && encoder != nullptr)\n{\n- if (this->implem == \"STD\") return new module::Decoder_LDPC_BP_peeling<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ if (this->implem == \"STD\") return new module::Decoder_LDPC_BP_peeling<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, *encoder, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\nreturn build_siso<B,Q>(H, info_bits_pos);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/LDPC/Codec_LDPC.cpp", "new_path": "src/Module/Codec/LDPC/Codec_LDPC.cpp", "diff": "@@ -148,6 +148,9 @@ Codec_LDPC<B,Q>\n}\n}\n+ if (dec_params.type == \"BP_PEELING\")\n+ this->get_encoder()->set_memorizing(true);\n+\ntry\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "diff": "@@ -11,13 +11,16 @@ template<typename B, typename R>\nDecoder_LDPC_BP_peeling<B,R>::Decoder_LDPC_BP_peeling(const int K, const int N, const int n_ite,\nconst tools::Sparse_matrix &_H,\nconst std::vector<unsigned> &info_bits_pos,\n+ Encoder<B> &encoder,\nconst bool enable_syndrome, const int syndrome_depth,\nconst int n_frames)\n: Decoder (K, N, n_frames, 1),\nDecoder_LDPC_BP<B,R> (K, N, n_ite, _H, enable_syndrome, syndrome_depth, n_frames, 1),\n+\ninfo_bits_pos (info_bits_pos),\n+ encoder (encoder),\nvar_nodes (n_frames, std::vector<B>(N)),\n- check_nodes (n_frames, std::vector<B>(this->H.get_n_cols()) )\n+ check_nodes (this->H.get_n_cols())\n{\nconst std::string name = \"Decoder_LDPC_BP_peeling\";\nthis->set_name(name);\n@@ -34,20 +37,25 @@ void Decoder_LDPC_BP_peeling<B,R>\n}\ntemplate <typename B, typename R>\n-void Decoder_LDPC_BP_peeling<B,R>\n+bool Decoder_LDPC_BP_peeling<B,R>\n::_decode(const int frame_id)\n{\nauto links = this->H;\n- std::fill(this->check_nodes[frame_id].begin(), this->check_nodes[frame_id].end(), (B)0);\n+ auto& CN = this->check_nodes;\n+ auto& VN = this->var_nodes[frame_id];\n+ std::fill(CN.begin(), CN.end(), (B)0);\n+//\n+// unsigned display_max = 32;\n+//\n// std::cout << \"(L) var_nodes : \" << std::endl;\n- // for (unsigned i = 0; i < this->var_nodes[frame_id].size(); i++)\n- // std::cout << this->var_nodes[frame_id][i] << \" \";\n+// for (unsigned i = 0; i < VN.size() && i < display_max; i++)\n+// std::cout << VN[i] << \" \";\n// std::cout << std::endl;\n// std::cout << \"(L) check_nodes : \" << std::endl;\n- // for (unsigned i = 0; i < this->check_nodes[frame_id].size(); i++)\n- // std::cout << this->check_nodes[frame_id][i] << \" \";\n+// for (unsigned i = 0; i < CN.size() && i < display_max; i++)\n+// std::cout << CN[i] << \" \";\n// std::cout << std::endl;\n// std::cout << \"(L) links : \" << std::endl;\n@@ -56,7 +64,7 @@ void Decoder_LDPC_BP_peeling<B,R>\n// first forward known values\nfor (unsigned i = 0; i < links.get_n_rows(); i++)\n{\n- auto cur_state = this->var_nodes[frame_id][i];\n+ auto cur_state = VN[i];\nif (cur_state != tools::erased_symbol_val<B>())\n{\nauto& cn_list = links.get_cols_from_row(i);\n@@ -64,40 +72,44 @@ void Decoder_LDPC_BP_peeling<B,R>\n{\nauto& cn_pos = cn_list.front();\n- this->check_nodes[frame_id][cn_pos] ^= cur_state;\n+ CN[cn_pos] ^= cur_state;\nlinks.rm_connection(i, cn_pos);\n}\n}\n}\n// std::cout << \"(I) var_nodes : \" << std::endl;\n- // for (unsigned i = 0; i < this->var_nodes[frame_id].size(); i++)\n- // std::cout << this->var_nodes[frame_id][i] << \" \";\n+// for (unsigned i = 0; i < VN.size() && i < display_max; i++)\n+// std::cout << VN[i] << \" \";\n// std::cout << std::endl;\n// std::cout << \"(I) check_nodes : \" << std::endl;\n- // for (unsigned i = 0; i < this->check_nodes[frame_id].size(); i++)\n- // std::cout << this->check_nodes[frame_id][i] << \" \";\n+// for (unsigned i = 0; i < CN.size() && i < display_max; i++)\n+// std::cout << CN[i] << \" \";\n// std::cout << std::endl;\n// std::cout << \"(I) links : \" << std::endl;\n// links.print(true);\n+ bool all_check_nodes_done = false;\n+\nfor (auto ite = 0; ite < this->n_ite; ite++)\n{\n- bool all_check_nodes_done = true, no_modification = true;\n+ bool no_modification = true;\n+ all_check_nodes_done = true;\n// find degree-1 check nodes\nfor (unsigned i = 0; i < links.get_n_cols(); i++)\n{\n- if (links.get_rows_from_col(i).size() == 1)\n+ auto& vn_list = links.get_rows_from_col(i);\n+ if (vn_list.size() == 1)\n{\nno_modification = false;\n// then forward the belief\n- auto& vn_pos = links.get_rows_from_col(i).front();\n- auto cur_state = this->check_nodes[frame_id][i];\n- this->var_nodes [frame_id][vn_pos] = cur_state;\n- this->check_nodes[frame_id][ i] = 0;\n+ auto& vn_pos = vn_list.front();\n+ auto cur_state = CN[i];\n+ VN[vn_pos] = cur_state;\n+ CN[ i] = 0;\nlinks.rm_connection(vn_pos, i);\n// and propagate it\n@@ -106,22 +118,28 @@ void Decoder_LDPC_BP_peeling<B,R>\n{\nauto& cn_pos = cn_list.front();\n- this->check_nodes[frame_id][cn_pos] ^= cur_state;\n+ CN[cn_pos] ^= cur_state;\nlinks.rm_connection(vn_pos, cn_pos);\n}\n}\nelse\n- all_check_nodes_done &= links.get_rows_from_col(i).size() == 0;\n+ all_check_nodes_done &= vn_list.size() == 0;\n}\n// std::cout << \"(\" << ite << \") var_nodes : \" << std::endl;\n- // for (unsigned i = 0; i < this->var_nodes[frame_id].size(); i++)\n- // std::cout << this->var_nodes[frame_id][i] << \" \";\n+// for (unsigned i = 0; i < VN.size() && i < display_max; i++)\n+// {\n+// std::cout << VN[i] << \" \";\n+// }\n// std::cout << std::endl;\n// std::cout << \"(\" << ite << \") check_nodes : \" << std::endl;\n- // for (unsigned i = 0; i < this->check_nodes[frame_id].size(); i++)\n- // std::cout << this->check_nodes[frame_id][i] << \" \";\n+// for (unsigned i = 0; i < CN.size() && i < display_max; i++)\n+// {\n+// std::cout << CN[i] << \" \";\n+// }\n// std::cout << std::endl;\n+// std::cout << \"all_check_nodes_done : \" << all_check_nodes_done << std::endl;\n+// std::cout << \"no_modification : \" << no_modification << std::endl;\nif (this->enable_syndrome && (all_check_nodes_done || no_modification))\n{\n@@ -132,6 +150,8 @@ void Decoder_LDPC_BP_peeling<B,R>\nelse\nthis->cur_syndrome_depth = 0;\n}\n+\n+ return all_check_nodes_done;\n};\ntemplate <typename B, typename R>\n@@ -143,11 +163,11 @@ void Decoder_LDPC_BP_peeling<B,R>\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- this->_decode(frame_id);\n+ auto syndrome = this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store(V_K, frame_id);\n+ _store(V_K, syndrome, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_hiho].update_timer(dec::tm::decode_hiho::decode, d_decod);\n@@ -163,11 +183,11 @@ void Decoder_LDPC_BP_peeling<B,R>\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- this->_decode(frame_id);\n+ auto syndrome = this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store_cw(V_N, frame_id);\n+ _store_cw(V_N, syndrome, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_hiho_cw].update_timer(dec::tm::decode_hiho_cw::decode, d_decod);\n@@ -183,11 +203,11 @@ void Decoder_LDPC_BP_peeling<B,R>\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- this->_decode(frame_id);\n+ auto syndrome = this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store(V_K, frame_id);\n+ _store(V_K, syndrome, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::load, d_load);\n@@ -204,11 +224,11 @@ void Decoder_LDPC_BP_peeling<B,R>\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- this->_decode(frame_id);\n+ auto syndrome = this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store_cw(V_N, frame_id);\n+ _store_cw(V_N, syndrome, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::load, d_load);\n@@ -217,16 +237,37 @@ void Decoder_LDPC_BP_peeling<B,R>\n}\ntemplate<typename B, typename R>\n-void Decoder_LDPC_BP_peeling<B, R>::_store(B *V_K, const int frame_id)\n+void Decoder_LDPC_BP_peeling<B,R>::_store(B *V_K, bool syndrome, const int frame_id)\n+{\n+ auto& VN = this->var_nodes[frame_id];\n+\n+ if (syndrome)\n+ for (auto i = 0; i < this->K; i++)\n+ V_K[i] = VN[this->info_bits_pos[i]];\n+ else\n{\n+ auto& X_N = encoder.get_X_N(frame_id);\nfor (auto i = 0; i < this->K; i++)\n- V_K[i] = this->var_nodes[frame_id][this->info_bits_pos[i]];\n+ {\n+ auto ibp = this->info_bits_pos[i];\n+ V_K[i] = VN[ibp] == tools::erased_symbol_val<B>() ? !X_N[ibp] : VN[ibp];\n+ }\n+ }\n}\ntemplate<typename B, typename R>\n-void Decoder_LDPC_BP_peeling<B, R>::_store_cw(B *V_N, const int frame_id)\n+void Decoder_LDPC_BP_peeling<B,R>::_store_cw(B *V_N, bool syndrome, const int frame_id)\n+{\n+ auto& VN = this->var_nodes[frame_id];\n+\n+ if (syndrome)\n+ std::copy(VN.begin(), VN.end(), V_N);\n+ else\n{\n- std::copy(this->var_nodes[frame_id].begin(), this->var_nodes[frame_id].end(), V_N);\n+ auto& X_N = encoder.get_X_N(frame_id);\n+ for (auto i = 0; i < this->N; i++)\n+ V_N[i] = VN[i] == tools::erased_symbol_val<B>() ? !X_N[i] : VN[i];\n+ }\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp", "diff": "#ifndef DECODER_LDPC_BP_PEELING_HPP\n#define DECODER_LDPC_BP_PEELING_HPP\n+#include \"Module/Encoder/Encoder.hpp\"\n#include \"../Decoder_LDPC_BP.hpp\"\nnamespace aff3ct\n@@ -13,15 +14,17 @@ class Decoder_LDPC_BP_peeling : public Decoder_LDPC_BP<B,R>\n{\nprotected:\nconst std::vector<unsigned> &info_bits_pos;\n+ Encoder<B> &encoder;\n// data structures for iterative decoding\nstd::vector<std::vector<B>> var_nodes;\n- std::vector<std::vector<B>> check_nodes;\n+ std::vector<B> check_nodes;\npublic:\nDecoder_LDPC_BP_peeling(const int K, const int N, const int n_ite,\nconst tools::Sparse_matrix &H,\nconst std::vector<unsigned> &info_bits_pos,\n+ Encoder<B> &encoder,\nconst bool enable_syndrome = true,\nconst int syndrome_depth = 1,\nconst int n_frames = 1);\n@@ -30,14 +33,16 @@ public:\nprotected:\nvoid _load (const R *Y_N, const int frame_id);\n- void _store (B *V_K, const int frame_id);\n- void _store_cw (B *V_N, const int frame_id);\n+ void _store (B *V_K, bool syndrome,const int frame_id);\n+ void _store_cw (B *V_N, bool syndrome,const int frame_id);\nvoid _decode_hiho (const B *Y_N, B *V_K, const int frame_id);\nvoid _decode_hiho_cw(const B *Y_N, B *V_N, const int frame_id);\nvoid _decode_siho (const R *Y_N, B *V_K, const int frame_id);\nvoid _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n- virtual void _decode( const int frame_id);\n+\n+ // return true if the syndrome is valid\n+ virtual bool _decode( const int frame_id);\n};\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a genius in the peeling decoder to set as wrong values the unknown ones
8,483
16.05.2018 16:07:26
-7,200
482ae2d05d5610f9d99f26e0f09d47d85e1d3087
Renaming erased_symbol/llr to unknown_symbol/llr
[ { "change_type": "MODIFY", "old_path": "src/Module/Channel/Binary_erasure/Channel_binary_erasure.cpp", "new_path": "src/Module/Channel/Binary_erasure/Channel_binary_erasure.cpp", "diff": "@@ -30,7 +30,7 @@ void Channel_binary_erasure<R>\nconst auto event_probability = this->n->get_noise();\nevent_generator->generate(this->event_draw.data(), (unsigned)this->N, event_probability);\n- const mipp::Reg<R> r_erased = tools::erased_symbol_val<R>();\n+ const mipp::Reg<R> r_erased = tools::unknown_symbol_val<R>();\nconst mipp::Reg<E> r_false = (E)false;\nconst auto vec_loop_size = (this->N / mipp::nElReg<R>()) * mipp::nElReg<R>();\n@@ -44,7 +44,7 @@ void Channel_binary_erasure<R>\n}\nfor (auto i = vec_loop_size; i < this->N; i++)\n- Y_N[i] = this->event_draw[i] ? tools::erased_symbol_val<R>() : X_N[i];\n+ Y_N[i] = this->event_draw[i] ? tools::unknown_symbol_val<R>() : X_N[i];\n}\ntemplate<typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "diff": "@@ -32,8 +32,8 @@ void Decoder_LDPC_BP_peeling<B,R>\n{\ntools::hard_decide(Y_N, var_nodes[frame_id].data(), this->N);\nfor (auto i = 0; i < this->N; i++)\n- if (Y_N[i] <= tools::erased_llr_val<R>() && Y_N[i] >= -tools::erased_llr_val<R>())\n- var_nodes[frame_id][i] = tools::erased_symbol_val<B>();\n+ if (Y_N[i] <= tools::unknown_llr_val<R>() && Y_N[i] >= -tools::unknown_llr_val<R>())\n+ var_nodes[frame_id][i] = tools::unknown_symbol_val<B>();\n}\ntemplate <typename B, typename R>\n@@ -65,7 +65,7 @@ bool Decoder_LDPC_BP_peeling<B,R>\nfor (unsigned i = 0; i < links.get_n_rows(); i++)\n{\nauto cur_state = VN[i];\n- if (cur_state != tools::erased_symbol_val<B>())\n+ if (cur_state != tools::unknown_symbol_val<B>())\n{\nauto& cn_list = links.get_cols_from_row(i);\nwhile (cn_list.size())\n@@ -250,7 +250,7 @@ void Decoder_LDPC_BP_peeling<B,R>::_store(B *V_K, bool syndrome, const int frame\nfor (auto i = 0; i < this->K; i++)\n{\nauto ibp = this->info_bits_pos[i];\n- V_K[i] = VN[ibp] == tools::erased_symbol_val<B>() ? !X_N[ibp] : VN[ibp];\n+ V_K[i] = VN[ibp] == tools::unknown_symbol_val<B>() ? !X_N[ibp] : VN[ibp];\n}\n}\n}\n@@ -266,7 +266,7 @@ void Decoder_LDPC_BP_peeling<B,R>::_store_cw(B *V_N, bool syndrome, const int fr\n{\nauto& X_N = encoder.get_X_N(frame_id);\nfor (auto i = 0; i < this->N; i++)\n- V_N[i] = VN[i] == tools::erased_symbol_val<B>() ? !X_N[i] : VN[i];\n+ V_N[i] = VN[i] == tools::unknown_symbol_val<B>() ? !X_N[i] : VN[i];\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Modem/OOK/Modem_OOK_BEC.cpp", "new_path": "src/Module/Modem/OOK/Modem_OOK_BEC.cpp", "diff": "@@ -30,9 +30,9 @@ template <typename B, typename R, typename Q>\nvoid Modem_OOK_BEC<B,R,Q>\n::_demodulate(const Q *Y_N1, Q *Y_N2, const int frame_id)\n{\n- auto sign = tools::erased_llr_val<Q>();\n+ auto sign = tools::unknown_llr_val<Q>();\nfor (auto i = 0; i < this->N_fil; i++)\n- if (Y_N1[i] == tools::erased_symbol_val<Q>())\n+ if (Y_N1[i] == tools::unknown_symbol_val<Q>())\n{\nY_N2[i] = sign;\nsign *= (Q)-1;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Noise/noise_utils.h", "new_path": "src/Tools/Noise/noise_utils.h", "diff": "@@ -47,9 +47,9 @@ inline Noise<T>* cast(const Noise<R>& n)\ntemplate <typename R>\n-constexpr R erased_symbol_val() { return tools::sat_val<R>(); }\n+constexpr R unknown_symbol_val() { return tools::sat_val<R>(); }\ntemplate <typename R>\n-constexpr R erased_llr_val() { return (R)1e-5; }\n+constexpr R unknown_llr_val() { return (R)1e-5; }\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Renaming erased_symbol/llr to unknown_symbol/llr
8,483
16.05.2018 17:13:51
-7,200
48bc94a1d0cd26c615ae1f3c74647f61095db755
Taking into account the unknown values in hard_decide and hamming_distance functions; Remove the genius encoder in decoder peelin
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "@@ -222,9 +222,9 @@ module::Decoder_SIHO<B,Q>* Decoder_LDPC::parameters\n{\nif (this->implem == \"GALA\") return new module::Decoder_LDPC_BP_flooding_GALA<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\n- else if (this->type == \"BP_PEELING\" && encoder != nullptr)\n+ else if (this->type == \"BP_PEELING\")\n{\n- if (this->implem == \"STD\") return new module::Decoder_LDPC_BP_peeling<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, *encoder, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ if (this->implem == \"STD\") return new module::Decoder_LDPC_BP_peeling<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\nreturn build_siso<B,Q>(H, info_bits_pos);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/LDPC/Codec_LDPC.cpp", "new_path": "src/Module/Codec/LDPC/Codec_LDPC.cpp", "diff": "@@ -148,9 +148,6 @@ Codec_LDPC<B,Q>\n}\n}\n- if (dec_params.type == \"BP_PEELING\")\n- this->get_encoder()->set_memorizing(true);\n-\ntry\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "diff": "@@ -11,31 +11,19 @@ template<typename B, typename R>\nDecoder_LDPC_BP_peeling<B,R>::Decoder_LDPC_BP_peeling(const int K, const int N, const int n_ite,\nconst tools::Sparse_matrix &_H,\nconst std::vector<unsigned> &info_bits_pos,\n- Encoder<B> &encoder,\nconst bool enable_syndrome, const int syndrome_depth,\nconst int n_frames)\n: Decoder (K, N, n_frames, 1),\nDecoder_LDPC_BP<B,R> (K, N, n_ite, _H, enable_syndrome, syndrome_depth, n_frames, 1),\ninfo_bits_pos (info_bits_pos ),\n- encoder (encoder),\n- var_nodes (n_frames, std::vector<B>(N)),\n+ var_nodes (N ),\ncheck_nodes (this->H.get_n_cols())\n{\nconst std::string name = \"Decoder_LDPC_BP_peeling\";\nthis->set_name(name);\n}\n-template <typename B, typename R>\n-void Decoder_LDPC_BP_peeling<B,R>\n-::_load(const R *Y_N, const int frame_id)\n-{\n- tools::hard_decide(Y_N, var_nodes[frame_id].data(), this->N);\n- for (auto i = 0; i < this->N; i++)\n- if (Y_N[i] <= tools::unknown_llr_val<R>() && Y_N[i] >= -tools::unknown_llr_val<R>())\n- var_nodes[frame_id][i] = tools::unknown_symbol_val<B>();\n-}\n-\ntemplate <typename B, typename R>\nbool Decoder_LDPC_BP_peeling<B,R>\n::_decode(const int frame_id)\n@@ -43,7 +31,7 @@ bool Decoder_LDPC_BP_peeling<B,R>\nauto links = this->H;\nauto& CN = this->check_nodes;\n- auto& VN = this->var_nodes[frame_id];\n+ auto& VN = this->var_nodes;\nstd::fill(CN.begin(), CN.end(), (B)0);\n//\n@@ -159,15 +147,15 @@ void Decoder_LDPC_BP_peeling<B,R>\n::_decode_hiho(const B *Y_N, B *V_K, const int frame_id)\n{\n// auto t_load = std::chrono::steady_clock::now(); // ---------------------------------------------------------- LOAD\n- std::copy(Y_N, Y_N + this->N, var_nodes[frame_id].data());\n+ std::copy(Y_N, Y_N + this->N, var_nodes.data());\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- auto syndrome = this->_decode(frame_id);\n+ this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store(V_K, syndrome, frame_id);\n+ _store(V_K, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_hiho].update_timer(dec::tm::decode_hiho::decode, d_decod);\n@@ -179,15 +167,15 @@ void Decoder_LDPC_BP_peeling<B,R>\n::_decode_hiho_cw(const B *Y_N, B *V_N, const int frame_id)\n{\n// auto t_load = std::chrono::steady_clock::now(); // ---------------------------------------------------------- LOAD\n- std::copy(Y_N, Y_N + this->N, var_nodes[frame_id].data());\n+ std::copy(Y_N, Y_N + this->N, var_nodes.data());\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- auto syndrome = this->_decode(frame_id);\n+ this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store_cw(V_N, syndrome, frame_id);\n+ _store_cw(V_N, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_hiho_cw].update_timer(dec::tm::decode_hiho_cw::decode, d_decod);\n@@ -199,15 +187,15 @@ void Decoder_LDPC_BP_peeling<B,R>\n::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n{\n// auto t_load = std::chrono::steady_clock::now(); // ---------------------------------------------------------- LOAD\n- this->_load(Y_N, frame_id);\n+ tools::hard_decide(Y_N, var_nodes.data(), this->N);\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- auto syndrome = this->_decode(frame_id);\n+ this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store(V_K, syndrome, frame_id);\n+ _store(V_K, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::load, d_load);\n@@ -220,15 +208,15 @@ void Decoder_LDPC_BP_peeling<B,R>\n::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n{\n// auto t_load = std::chrono::steady_clock::now(); // ---------------------------------------------------------- LOAD\n- this->_load(Y_N, frame_id);\n+ tools::hard_decide(Y_N, var_nodes.data(), this->N);\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- auto syndrome = this->_decode(frame_id);\n+ this->_decode(frame_id);\n// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- _store_cw(V_N, syndrome, frame_id);\n+ _store_cw(V_N, frame_id);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::load, d_load);\n@@ -237,37 +225,16 @@ void Decoder_LDPC_BP_peeling<B,R>\n}\ntemplate<typename B, typename R>\n-void Decoder_LDPC_BP_peeling<B,R>::_store(B *V_K, bool syndrome, const int frame_id)\n-{\n- auto& VN = this->var_nodes[frame_id];\n-\n- if (syndrome)\n- for (auto i = 0; i < this->K; i++)\n- V_K[i] = VN[this->info_bits_pos[i]];\n- else\n+void Decoder_LDPC_BP_peeling<B,R>::_store(B *V_K, const int frame_id)\n{\n- auto& X_N = encoder.get_X_N(frame_id);\nfor (auto i = 0; i < this->K; i++)\n- {\n- auto ibp = this->info_bits_pos[i];\n- V_K[i] = VN[ibp] == tools::unknown_symbol_val<B>() ? !X_N[ibp] : VN[ibp];\n- }\n- }\n+ V_K[i] = this->var_nodes[this->info_bits_pos[i]];\n}\ntemplate<typename B, typename R>\n-void Decoder_LDPC_BP_peeling<B,R>::_store_cw(B *V_N, bool syndrome, const int frame_id)\n+void Decoder_LDPC_BP_peeling<B,R>::_store_cw(B *V_N, const int frame_id)\n{\n- auto& VN = this->var_nodes[frame_id];\n-\n- if (syndrome)\n- std::copy(VN.begin(), VN.end(), V_N);\n- else\n- {\n- auto& X_N = encoder.get_X_N(frame_id);\n- for (auto i = 0; i < this->N; i++)\n- V_N[i] = VN[i] == tools::unknown_symbol_val<B>() ? !X_N[i] : VN[i];\n- }\n+ std::copy(this->var_nodes.begin(), this->var_nodes.end(), V_N);\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp", "diff": "@@ -14,27 +14,23 @@ class Decoder_LDPC_BP_peeling : public Decoder_LDPC_BP<B,R>\n{\nprotected:\nconst std::vector<unsigned> &info_bits_pos;\n- Encoder<B> &encoder;\n// data structures for iterative decoding\n- std::vector<std::vector<B>> var_nodes;\n+ std::vector<B> var_nodes;\nstd::vector<B> check_nodes;\npublic:\nDecoder_LDPC_BP_peeling(const int K, const int N, const int n_ite,\nconst tools::Sparse_matrix &H,\nconst std::vector<unsigned> &info_bits_pos,\n- Encoder<B> &encoder,\nconst bool enable_syndrome = true,\nconst int syndrome_depth = 1,\nconst int n_frames = 1);\nvirtual ~Decoder_LDPC_BP_peeling() = default;\nprotected:\n- void _load (const R *Y_N, const int frame_id);\n-\n- void _store (B *V_K, bool syndrome,const int frame_id);\n- void _store_cw (B *V_N, bool syndrome,const int frame_id);\n+ void _store (B *V_K, const int frame_id);\n+ void _store_cw (B *V_N, const int frame_id);\nvoid _decode_hiho (const B *Y_N, B *V_K, const int frame_id);\nvoid _decode_hiho_cw(const B *Y_N, B *V_N, const int frame_id);\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Display/Statistics/Statistics.hpp\"\n#include \"Tools/Display/Terminal/BFER/Terminal_BFER.hpp\"\n-//#include \"Tools/Algo/Histogram.hpp\"\n#ifdef ENABLE_MPI\n#include \"Module/Monitor/BFER/Monitor_BFER_reduction_mpi.hpp\"\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hamming_distance.cpp", "new_path": "src/Tools/Perf/common/hamming_distance.cpp", "diff": "@@ -124,9 +124,8 @@ template <typename B>\ninline mipp::Reg<B> popcnt(const mipp::Reg<B>& q_in1, const mipp::Reg<B>& q_in2)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- const auto m_in1 = q_in1 != zeros;\n- const auto m_in2 = q_in2 != zeros;\n- return mipp::blend(ones, zeros, m_in1 ^ m_in2);\n+ const auto m_in = q_in1 != q_in2;\n+ return mipp::blend(ones, zeros, m_in);\n}\ntemplate <typename B>\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hard_decide.cpp", "new_path": "src/Tools/Perf/common/hard_decide.cpp", "diff": "#include <limits>\n+#include \"Tools/Noise/noise_utils.h\"\n#include \"hard_decide.h\"\ntemplate <typename B, typename Q>\nvoid aff3ct::tools::hard_decide_seq(const Q *in, B *out, const unsigned size)\n{\nfor (unsigned i = 0; i < size; i++)\n+ if (in[i] <= tools::unknown_llr_val<Q>() && in[i] >= -tools::unknown_llr_val<Q>())\n+ out[i] = tools::unknown_symbol_val<B>();\n+ else\nout[i] = in[i] < 0;\n}\ntemplate <typename B, typename Q>\nvoid aff3ct::tools::hard_decide(const Q *in, B *out, const unsigned size)\n{\n+ const mipp::Reg<Q> r_unk = tools::unknown_llr_val<Q>();\n+ const mipp::Reg<Q> r_unkm = -tools::unknown_llr_val<Q>();\n+ const mipp::Reg<B> r_unks = tools::unknown_symbol_val<B>();\n+\nconst auto vec_loop_size = (size / (unsigned)mipp::nElReg<Q>()) * (unsigned)mipp::nElReg<Q>();\nif (mipp::isAligned(in) && mipp::isAligned(out))\n{\nfor (unsigned i = 0; i < vec_loop_size; i += mipp::nElReg<Q>())\n{\nconst auto q_in = mipp::Reg<Q>(&in[i]);\n- const auto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\n+ const auto m_unk = (q_in <= r_unk) & (q_in >= r_unkm);\n+ auto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\n+ q_out = mipp::blend(r_unks, q_out, m_unk);\nq_out.store(&out[i]);\n}\n}\n@@ -28,7 +38,9 @@ void aff3ct::tools::hard_decide(const Q *in, B *out, const unsigned size)\n{\nmipp::Reg<Q> q_in;\nq_in.loadu(&in[i]);\n- const auto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\n+ const auto m_unk = (q_in <= r_unk) & (q_in >= r_unkm);\n+ auto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\n+ q_out = mipp::blend(r_unks, q_out, m_unk);\nq_out.storeu(&out[i]);\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Taking into account the unknown values in hard_decide and hamming_distance functions; Remove the genius encoder in decoder peelin
8,483
16.05.2018 17:44:14
-7,200
2979d0dca0ea1093064020cf6d939ae3898dac6b
Add is_unknown_symbol and is_unknown_llr functions to easily check these cases in standard and mipp functions
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "diff": "@@ -53,7 +53,7 @@ bool Decoder_LDPC_BP_peeling<B,R>\nfor (unsigned i = 0; i < links.get_n_rows(); i++)\n{\nauto cur_state = VN[i];\n- if (cur_state != tools::unknown_symbol_val<B>())\n+ if (!tools::is_unknown_symbol<B>(cur_state))\n{\nauto& cn_list = links.get_cols_from_row(i);\nwhile (cn_list.size())\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Modem/OOK/Modem_OOK_BEC.cpp", "new_path": "src/Module/Modem/OOK/Modem_OOK_BEC.cpp", "diff": "@@ -32,7 +32,7 @@ void Modem_OOK_BEC<B,R,Q>\n{\nauto sign = tools::unknown_llr_val<Q>();\nfor (auto i = 0; i < this->N_fil; i++)\n- if (Y_N1[i] == tools::unknown_symbol_val<Q>())\n+ if (tools::is_unknown_symbol<Q>(Y_N1[i]))\n{\nY_N2[i] = sign;\nsign *= (Q)-1;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Noise/noise_utils.h", "new_path": "src/Tools/Noise/noise_utils.h", "diff": "#ifndef NOISE_UTILS_HPP__\n#define NOISE_UTILS_HPP__\n+#include <mipp.h>\n#include \"Tools/Math/utils.h\"\n#include \"Sigma.hpp\"\n@@ -51,6 +52,32 @@ constexpr R unknown_symbol_val() { return tools::sat_val<R>(); }\ntemplate <typename R>\nconstexpr R unknown_llr_val() { return (R)1e-5; }\n+template <typename R>\n+inline bool is_unknown_symbol(const R& v)\n+{\n+ return v == tools::unknown_symbol_val<R>();\n+}\n+\n+template <typename R>\n+inline mipp::Msk<mipp::N<R>()> is_unknown_symbol(const mipp::Reg<R>& q_in)\n+{\n+ const mipp::Reg<R> r_unks = tools::unknown_symbol_val<R>();\n+ return q_in == tools::unknown_symbol_val<R>();\n+}\n+\n+template <typename R>\n+inline bool is_unknown_llr(const R& v)\n+{\n+ return (v <= tools::unknown_llr_val<R>() && v >= -tools::unknown_llr_val<R>());\n+}\n+\n+template <typename R>\n+inline mipp::Msk<mipp::N<R>()> is_unknown_llr(const mipp::Reg<R>& q_in)\n+{\n+ const mipp::Reg<R> r_unk = tools::unknown_llr_val<R>();\n+ const mipp::Reg<R> r_unkm = -tools::unknown_llr_val<R>();\n+ return (q_in <= r_unk) & (q_in >= r_unkm);\n+}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hamming_distance.cpp", "new_path": "src/Tools/Perf/common/hamming_distance.cpp", "diff": "#include <limits>\n#include <cmath>\n+#include \"Tools/Noise/noise_utils.h\"\n#include \"hamming_distance.h\"\n//*************************************************************************************** hamming_distance_seq(in1, in2)\n@@ -11,7 +12,10 @@ inline size_t aff3ct::tools::hamming_distance_seq(const B *in1, const B *in2, co\nsize_t ham_dist = 0;\nfor (unsigned i = 0; i < size; i++)\n- ham_dist += (!in1[i] != !in2[i])? (size_t)1 : (size_t)0;\n+ ham_dist += (in1[i] != in2[i])\n+ || aff3ct::tools::is_unknown_symbol<B>(in1[i])\n+ || aff3ct::tools::is_unknown_symbol<B>(in2[i])\n+ ? (size_t)1 : (size_t)0;\nreturn ham_dist;\n}\n@@ -22,7 +26,10 @@ inline size_t hamming_distance_seq_real(const B *in1, const B *in2, const unsign\nsize_t ham_dist = 0;\nfor (unsigned i = 0; i < size; i++)\n- ham_dist += std::signbit(in1[i]) ^ std::signbit(in2[i]) ? (size_t)1 : (size_t)0;\n+ ham_dist += std::signbit(in1[i]) ^ std::signbit(in2[i])\n+ || aff3ct::tools::is_unknown_symbol<B>(in1[i])\n+ || aff3ct::tools::is_unknown_symbol<B>(in2[i])\n+ ? (size_t)1 : (size_t)0;\nreturn ham_dist;\n}\n@@ -57,7 +64,7 @@ inline size_t aff3ct::tools::hamming_distance_seq(const B *in, const unsigned si\nsize_t ham_dist = 0;\nfor (unsigned i = 0; i < size; i++)\n- ham_dist += !in[i] ? (size_t)0 : (size_t)1;\n+ ham_dist += in[i] || aff3ct::tools::is_unknown_symbol<B>(in[i]) ? (size_t)1 : (size_t)0;\nreturn ham_dist;\n}\n@@ -69,7 +76,7 @@ inline size_t hamming_distance_seq_real(const B *in, const unsigned size)\nsize_t ham_dist = 0;\nfor (unsigned i = 0; i < size; i++)\n- ham_dist += std::signbit(in[i]) ? (size_t)1 : (size_t)0;\n+ ham_dist += std::signbit(in[i]) || aff3ct::tools::is_unknown_symbol<B>(in[i]) ? (size_t)1 : (size_t)0;\nreturn ham_dist;\n}\n@@ -124,7 +131,8 @@ template <typename B>\ninline mipp::Reg<B> popcnt(const mipp::Reg<B>& q_in1, const mipp::Reg<B>& q_in2)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- const auto m_in = q_in1 != q_in2;\n+ auto m_in = q_in1 != q_in2;\n+ m_in |= aff3ct::tools::is_unknown_symbol<B>(q_in1) | aff3ct::tools::is_unknown_symbol<B>(q_in2);\nreturn mipp::blend(ones, zeros, m_in);\n}\n@@ -132,7 +140,7 @@ template <typename B>\ninline mipp::Reg<B> popcnt(const mipp::Reg<B>& q_in)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- const auto m_in = q_in != zeros;\n+ const auto m_in = (q_in != zeros) | aff3ct::tools::is_unknown_symbol<B>(q_in);\nreturn mipp::blend(ones, zeros, m_in);\n}\n@@ -140,7 +148,7 @@ template <typename B>\ninline mipp::Reg<B> popcnt_real(const mipp::Reg<B>& q_in)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- const auto m_in = q_in < zeros;\n+ const auto m_in = (q_in < zeros) | aff3ct::tools::is_unknown_symbol<B>(q_in);\nreturn mipp::blend(ones, zeros, m_in);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hard_decide.cpp", "new_path": "src/Tools/Perf/common/hard_decide.cpp", "diff": "@@ -7,17 +7,12 @@ template <typename B, typename Q>\nvoid aff3ct::tools::hard_decide_seq(const Q *in, B *out, const unsigned size)\n{\nfor (unsigned i = 0; i < size; i++)\n- if (in[i] <= tools::unknown_llr_val<Q>() && in[i] >= -tools::unknown_llr_val<Q>())\n- out[i] = tools::unknown_symbol_val<B>();\n- else\n- out[i] = in[i] < 0;\n+ out[i] = tools::is_unknown_llr<Q>(in[i]) ? tools::unknown_symbol_val<B>() : (in[i] < 0);\n}\ntemplate <typename B, typename Q>\nvoid aff3ct::tools::hard_decide(const Q *in, B *out, const unsigned size)\n{\n- const mipp::Reg<Q> r_unk = tools::unknown_llr_val<Q>();\n- const mipp::Reg<Q> r_unkm = -tools::unknown_llr_val<Q>();\nconst mipp::Reg<B> r_unks = tools::unknown_symbol_val<B>();\nconst auto vec_loop_size = (size / (unsigned)mipp::nElReg<Q>()) * (unsigned)mipp::nElReg<Q>();\n@@ -26,7 +21,7 @@ void aff3ct::tools::hard_decide(const Q *in, B *out, const unsigned size)\nfor (unsigned i = 0; i < vec_loop_size; i += mipp::nElReg<Q>())\n{\nconst auto q_in = mipp::Reg<Q>(&in[i]);\n- const auto m_unk = (q_in <= r_unk) & (q_in >= r_unkm);\n+ const auto m_unk = tools::is_unknown_llr<Q>(q_in);\nauto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\nq_out = mipp::blend(r_unks, q_out, m_unk);\nq_out.store(&out[i]);\n@@ -38,7 +33,7 @@ void aff3ct::tools::hard_decide(const Q *in, B *out, const unsigned size)\n{\nmipp::Reg<Q> q_in;\nq_in.loadu(&in[i]);\n- const auto m_unk = (q_in <= r_unk) & (q_in >= r_unkm);\n+ const auto m_unk = tools::is_unknown_llr<Q>(q_in);\nauto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\nq_out = mipp::blend(r_unks, q_out, m_unk);\nq_out.storeu(&out[i]);\n" } ]
C++
MIT License
aff3ct/aff3ct
Add is_unknown_symbol and is_unknown_llr functions to easily check these cases in standard and mipp functions
8,483
17.05.2018 10:27:39
-7,200
0bfbfe0f38fa2fd4d58f986ca49c9b711867d4f7
Fix hard_decide by keeping two different functions: one checking the unknown llr values
[ { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 39f26d2d698c8d463dc77595327aa88ab1ac80b2\n+Subproject commit 28668b72ca0abfe88c26a399006dd903b7a418a3\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/BCH/Standard/Decoder_BCH_std.cpp", "new_path": "src/Module/Decoder/BCH/Standard/Decoder_BCH_std.cpp", "diff": "@@ -36,8 +36,6 @@ Decoder_BCH_std<B, R>\n{\n}\n-#include <assert.h>\n-\ntemplate <typename B, typename R>\nvoid Decoder_BCH_std<B, R>\n::_decode(B *Y_N, const int frame_id)\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp", "diff": "@@ -146,7 +146,7 @@ void Decoder_LDPC_BP_peeling<B,R>\n::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n{\n// auto t_load = std::chrono::steady_clock::now(); // ---------------------------------------------------------- LOAD\n- tools::hard_decide(Y_N, var_nodes.data(), this->N);\n+ tools::hard_decide_unk(Y_N, var_nodes.data(), this->N);\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n@@ -167,7 +167,7 @@ void Decoder_LDPC_BP_peeling<B,R>\n::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n{\n// auto t_load = std::chrono::steady_clock::now(); // ---------------------------------------------------------- LOAD\n- tools::hard_decide(Y_N, var_nodes.data(), this->N);\n+ tools::hard_decide_unk(Y_N, var_nodes.data(), this->N);\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/NO/Decoder_NO.cpp", "new_path": "src/Module/Decoder/NO/Decoder_NO.cpp", "diff": "@@ -42,7 +42,7 @@ void Decoder_NO<B,R>\n::_decode_siho(const R *Y_K, B *V_K, const int frame_id)\n{\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- tools::hard_decide(Y_K, V_K, this->K);\n+ tools::hard_decide_unk(Y_K, V_K, this->K);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::store, d_store);\n@@ -53,7 +53,7 @@ void Decoder_NO<B,R>\n::_decode_siho_cw(const R *Y_K, B *V_K, const int frame_id)\n{\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- tools::hard_decide(Y_K, V_K, this->K);\n+ tools::hard_decide_unk(Y_K, V_K, this->K);\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::store, d_store);\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hard_decide.cpp", "new_path": "src/Tools/Perf/common/hard_decide.cpp", "diff": "@@ -7,11 +7,47 @@ template <typename B, typename Q>\nvoid aff3ct::tools::hard_decide_seq(const Q *in, B *out, const unsigned size)\n{\nfor (unsigned i = 0; i < size; i++)\n- out[i] = tools::is_unknown_llr<Q>(in[i]) ? tools::unknown_symbol_val<B>() : (in[i] < 0);\n+ out[i] = in[i] < 0;\n}\ntemplate <typename B, typename Q>\nvoid aff3ct::tools::hard_decide(const Q *in, B *out, const unsigned size)\n+{\n+ const auto vec_loop_size = (size / (unsigned)mipp::nElReg<Q>()) * (unsigned)mipp::nElReg<Q>();\n+ if (mipp::isAligned(in) && mipp::isAligned(out))\n+ {\n+ for (unsigned i = 0; i < vec_loop_size; i += mipp::nElReg<Q>())\n+ {\n+ const auto q_in = mipp::Reg<Q>(&in[i]);\n+ const auto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\n+ q_out.store(&out[i]);\n+ }\n+ }\n+ else\n+ {\n+ for (unsigned i = 0; i < vec_loop_size; i += mipp::nElReg<Q>())\n+ {\n+ mipp::Reg<Q> q_in;\n+ q_in.loadu(&in[i]);\n+ const auto q_out = mipp::cast<Q,B>(q_in) >> (sizeof(B) * 8 - 1);\n+ q_out.storeu(&out[i]);\n+ }\n+ }\n+\n+ tools::hard_decide_seq(in + vec_loop_size, out + vec_loop_size, size - vec_loop_size);\n+}\n+\n+\n+\n+template <typename B, typename Q>\n+void aff3ct::tools::hard_decide_unk_seq(const Q *in, B *out, const unsigned size)\n+{\n+ for (unsigned i = 0; i < size; i++)\n+ out[i] = tools::is_unknown_llr<Q>(in[i]) ? tools::unknown_symbol_val<B>() : (in[i] < 0);\n+}\n+\n+template <typename B, typename Q>\n+void aff3ct::tools::hard_decide_unk(const Q *in, B *out, const unsigned size)\n{\nconst mipp::Reg<B> r_unks = tools::unknown_symbol_val<B>();\n@@ -51,11 +87,25 @@ template void aff3ct::tools::hard_decide<B_16, Q_16>(const Q_16*, B_16*, const u\ntemplate void aff3ct::tools::hard_decide<B_32, Q_32>(const Q_32*, B_32*, const unsigned);\ntemplate void aff3ct::tools::hard_decide<B_64, Q_64>(const Q_64*, B_64*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk<B_8, Q_8 >(const Q_8*, B_8*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk<B_16, Q_16>(const Q_16*, B_16*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk<B_32, Q_32>(const Q_32*, B_32*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk<B_64, Q_64>(const Q_64*, B_64*, const unsigned);\n+\ntemplate void aff3ct::tools::hard_decide_seq<B_8, Q_8 >(const Q_8*, B_8*, const unsigned);\ntemplate void aff3ct::tools::hard_decide_seq<B_16, Q_16>(const Q_16*, B_16*, const unsigned);\ntemplate void aff3ct::tools::hard_decide_seq<B_32, Q_32>(const Q_32*, B_32*, const unsigned);\ntemplate void aff3ct::tools::hard_decide_seq<B_64, Q_64>(const Q_64*, B_64*, const unsigned);\n+\n+template void aff3ct::tools::hard_decide_unk_seq<B_8, Q_8 >(const Q_8*, B_8*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk_seq<B_16, Q_16>(const Q_16*, B_16*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk_seq<B_32, Q_32>(const Q_32*, B_32*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk_seq<B_64, Q_64>(const Q_64*, B_64*, const unsigned);\n#else\n+template void aff3ct::tools::hard_decide_seq <B, Q>(const Q*, B*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk_seq<B, Q>(const Q*, B*, const unsigned);\n+\ntemplate void aff3ct::tools::hard_decide <B, Q>(const Q*, B*, const unsigned);\n+template void aff3ct::tools::hard_decide_unk<B, Q>(const Q*, B*, const unsigned);\n#endif\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hard_decide.h", "new_path": "src/Tools/Perf/common/hard_decide.h", "diff": "@@ -8,18 +8,35 @@ namespace aff3ct\nnamespace tools\n{\n/*\n- * take the hard decision on the array 'in' and fill 'out', both of length 'size'\n+ * Take the hard decision on the array 'in' and fill 'out', both of length 'size'\n*/\ntemplate <typename B = int, typename Q = float>\nvoid hard_decide_seq(const Q *in, B *out, const unsigned size);\n/*\n- * take the hard decision on the array 'in' and fill 'out', both of length 'size'\n+ * Take the hard decision on the array 'in' and fill 'out', both of length 'size'\n+ * Check if 'in' values are unknown llr (tools::is_unknown_llr<Q>(in[i]))\n+ * and then set them as unknown symbol tools::unknown_symbol_val<B>()\n+ */\n+template <typename B = int, typename Q = float>\n+void hard_decide_unk_seq(const Q *in, B *out, const unsigned size);\n+\n+/*\n+ * Take the hard decision on the array 'in' and fill 'out', both of length 'size'\n* Operations are optimized with MIPP\n*/\ntemplate <typename B = int, typename Q = float>\nvoid hard_decide(const Q *in, B *out, const unsigned size);\n+/*\n+ * Take the hard decision on the array 'in' and fill 'out', both of length 'size'\n+ * Check if 'in' values are unknown llr (tools::is_unknown_llr<Q>(in[i]))\n+ * and then set them as unknown symbol tools::unknown_symbol_val<B>().\n+ * Operations are optimized with MIPP\n+ */\n+template <typename B = int, typename Q = float>\n+void hard_decide_unk(const Q *in, B *out, const unsigned size);\n+\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix hard_decide by keeping two different functions: one checking the unknown llr values
8,483
17.05.2018 10:54:21
-7,200
376e111dc612886880301529cab62e9bf9f76ff5
Update refs and aff3ct.hpp
[ { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 28668b72ca0abfe88c26a399006dd903b7a418a3\n+Subproject commit ac2a526f51314fccca6bc269bb555f64645d0c31\n" }, { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#include <Module/Channel/Channel.hpp>\n#include <Module/Channel/NO/Channel_NO.hpp>\n#include <Module/Channel/Optical/Channel_optical.hpp>\n-#include <Module/Channel/PDF/Channel_pdf.hpp>\n#include <Module/Channel/Rayleigh/Channel_Rayleigh_LLR.hpp>\n#include <Module/Channel/Rayleigh/Channel_Rayleigh_LLR_user.hpp>\n#include <Module/Channel/User/Channel_user.hpp>\n#include <Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_offset_normalize_min_sum.hpp>\n#include <Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.hpp>\n#include <Module/Decoder/LDPC/BP/Layered/SPA/Decoder_LDPC_BP_layered_sum_product.hpp>\n+#include <Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp>\n#include <Module/Decoder/NO/Decoder_NO.hpp>\n#include <Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_fast_CA_sys.hpp>\n#include <Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_MEM_fast_CA_sys.hpp>\n#include <Module/Encoder/LDPC/Encoder_LDPC.hpp>\n#include <Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp>\n#include <Module/Encoder/LDPC/From_QC/Encoder_LDPC_from_QC.hpp>\n+#include <Module/Encoder/LDPC/From_SeIRA/Encoder_LDPC_from_SeIRA.hpp>\n#include <Module/Encoder/NO/Encoder_NO.hpp>\n#include <Module/Encoder/Polar/Encoder_polar.hpp>\n#include <Module/Encoder/Polar/Encoder_polar_sys.hpp>\n" } ]
C++
MIT License
aff3ct/aff3ct
Update refs and aff3ct.hpp
8,483
17.05.2018 12:30:25
-7,200
25db3fba7ac27d059599cd5ad5cc2fcc9fa6b190
Mode noise-type argument from BFER to Simulation
[ { "change_type": "MODIFY", "old_path": "src/Factory/Simulation/BFER/BFER.cpp", "new_path": "src/Factory/Simulation/BFER/BFER.cpp", "diff": "@@ -97,12 +97,6 @@ void BFER::parameters\nauto p = this->get_prefix();\n- args.add(\n- {p+\"-noise-type\", \"E\"},\n- tools::Text(tools::Including_set(\"ESN0\", \"EBN0\", \"ROP\", \"EP\")),\n- \"select the type of NOISE: SNR per Symbol / SNR per information Bit\"\n- \" / Received Optical Power / Erasure Probability.\");\n-\nargs.add(\n{p+\"-coset\", \"c\"},\ntools::None(),\n@@ -149,7 +143,6 @@ void BFER::parameters\nauto p = this->get_prefix();\n- if(vals.exist({p+\"-noise-type\", \"E\"})) this->noise_type = vals.at ({p+\"-noise-type\", \"E\"});\nif(vals.exist({p+\"-err-trk-path\" })) this->err_track_path = vals.at ({p+\"-err-trk-path\" });\nif(vals.exist({p+\"-err-trk-thold\" })) this->err_track_threshold = vals.to_int({p+\"-err-trk-thold\" });\nif(vals.exist({p+\"-err-trk-rev\" })) this->err_track_revert = true;\n@@ -171,7 +164,6 @@ void BFER::parameters\nauto p = this->get_prefix();\n- headers[p].push_back(std::make_pair(\"NOISE type (E)\", this->noise_type));\nheaders[p].push_back(std::make_pair(\"Coset approach (c)\", this->coset ? \"yes\" : \"no\"));\nheaders[p].push_back(std::make_pair(\"Coded monitoring\", this->coded_monitoring ? \"yes\" : \"no\"));\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Simulation/BFER/BFER.hpp", "new_path": "src/Factory/Simulation/BFER/BFER.hpp", "diff": "@@ -27,7 +27,6 @@ struct BFER : Simulation\npublic:\n// ------------------------------------------------------------------------------------------------- PARAMETERS\n// optional parameters\n- std::string noise_type = \"EBN0\";\nstd::string err_track_path = \"error_tracker\";\nint err_track_threshold = 0;\nbool err_track_revert = false;\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Simulation/Simulation.cpp", "new_path": "src/Factory/Simulation/Simulation.cpp", "diff": "@@ -75,6 +75,12 @@ void Simulation::parameters\nargs.add_link({p+\"-pdf-path\" }, {p+\"-noise-max\", \"M\"});\n+ args.add(\n+ {p+\"-noise-type\", \"E\"},\n+ tools::Text(tools::Including_set(\"ESN0\", \"EBN0\", \"ROP\", \"EP\")),\n+ \"select the type of NOISE: SNR per Symbol / SNR per information Bit\"\n+ \" / Received Optical Power / Erasure Probability.\");\n+\nargs.add(\n{p+\"-pyber\"},\ntools::Text(),\n@@ -209,6 +215,7 @@ void Simulation::parameters\n}\n}\n+ if(vals.exist({p+\"-noise-type\", \"E\"})) this->noise_type = vals.at ({p+\"-noise-type\", \"E\"});\nif(vals.exist({p+\"-pyber\" })) this->pyber = vals.at ({p+\"-pyber\" });\nif(vals.exist({p+\"-stop-time\" })) this->stop_time = seconds(vals.to_int ({p+\"-stop-time\"}));\nif(vals.exist({p+\"-max-frame\" })) this->max_frame = vals.to_int ({p+\"-max-frame\"});\n@@ -282,6 +289,7 @@ void Simulation::parameters\nnoise_range_str << this->noise_range.front() << \" -> \" << this->noise_range.back() << \" dB\";\nheaders[p].push_back(std::make_pair(\"Noise range\", noise_range_str.str()));\n}\n+ headers[p].push_back(std::make_pair(\"Noise type (E)\", this->noise_type));\nheaders[p].push_back(std::make_pair(\"Seed\", std::to_string(this->global_seed)));\nheaders[p].push_back(std::make_pair(\"Statistics\", this->statistics ? \"on\" : \"off\"));\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Simulation/Simulation.hpp", "new_path": "src/Factory/Simulation/Simulation.hpp", "diff": "@@ -33,6 +33,7 @@ struct Simulation : Launcher\nint mpi_size = 1;\n#endif\nstd::chrono::seconds stop_time = std::chrono::seconds(0);\n+ std::string noise_type = \"EBN0\";\nstd::string pyber = \"\";\nunsigned max_frame = 0;\nbool debug = false;\n" } ]
C++
MIT License
aff3ct/aff3ct
Mode noise-type argument from BFER to Simulation
8,483
17.05.2018 12:31:36
-7,200
44fe92bbfb8f1694cbda555c94088cafe0999813
Add help_required return function in Command parser
[ { "change_type": "MODIFY", "old_path": "src/Factory/Command_parser.cpp", "new_path": "src/Factory/Command_parser.cpp", "diff": "@@ -90,6 +90,12 @@ void Command_parser\nerr_stream << rang::tag::warning << warnings[w] << std::endl;\n}\n+bool Command_parser\n+::help_required()\n+{\n+ return help_asked;\n+}\n+\nbool Command_parser\n::parsing_failed()\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Command_parser.hpp", "new_path": "src/Factory/Command_parser.hpp", "diff": "@@ -42,6 +42,7 @@ public:\nvoid print_errors ();\nvoid print_warnings();\n+ bool help_required (); // return true if the help tag is set\nbool parsing_failed (); // return true if there are errors\nbool parsing_succeeded(); // return true if no errors\n" } ]
C++
MIT License
aff3ct/aff3ct
Add help_required return function in Command parser
8,483
17.05.2018 15:51:00
-7,200
77e07d7e9c744819b833b37357301c63b9d5fc43
Add a noise factory to build noise object and gather their arguments
[ { "change_type": "MODIFY", "old_path": "src/Factory/Simulation/Simulation.cpp", "new_path": "src/Factory/Simulation/Simulation.cpp", "diff": "#include <rang.hpp>\n#include \"Tools/Exception/exception.hpp\"\n-#include \"Tools/Math/Distribution/Distributions.hpp\"\n-#include \"Tools/general_utils.h\"\n#include \"Simulation.hpp\"\n@@ -16,19 +14,25 @@ const std::string aff3ct::factory::Simulation_prefix = \"sim\";\nSimulation::parameters\n::parameters(const std::string &name, const std::string &prefix)\n-: Launcher::parameters(name, Simulation_name, prefix)\n+: Launcher::parameters(name, Simulation_name, prefix),\n+ noise(new factory::Noise::parameters(prefix))\n{\n}\n-Simulation::parameters* Simulation::parameters\n-::clone() const\n+Simulation::parameters\n+::~parameters()\n{\n- return new Simulation::parameters(*this);\n+ if (noise != nullptr) { delete noise; noise = nullptr; }\n}\n-Simulation::parameters\n-::~parameters()\n+Simulation::parameters* Simulation::parameters\n+::clone() const\n{\n+ auto clone = new Simulation::parameters(*this);\n+\n+ if (noise != nullptr) {clone->noise = noise->clone(); }\n+\n+ return clone;\n}\nvoid Simulation::parameters\n@@ -36,50 +40,9 @@ void Simulation::parameters\n{\nLauncher::parameters::get_description(args);\n- auto p = this->get_prefix();\n-\n- args.add(\n- {p+\"-noise-range\", \"R\"},\n- tools::Matlab_vector<float>(tools::Real(), std::make_tuple(tools::Length(1)), std::make_tuple(tools::Length(1,3))),\n- \"noise energy range to run (Matlab style: \\\"0.5:2.5,2.55,2.6:0.05:3\\\" with a default step of 0.1).\",\n- tools::arg_rank::REQ);\n-\n- args.add(\n- {p+\"-noise-min\", \"m\"},\n- tools::Real(),\n- \"minimal noise energy to simulate.\",\n- tools::arg_rank::REQ);\n-\n- args.add(\n- {p+\"-noise-max\", \"M\"},\n- tools::Real(),\n- \"maximal noise energy to simulate.\",\n- tools::arg_rank::REQ);\n-\n- args.add(\n- {p+\"-noise-step\", \"s\"},\n- tools::Real(tools::Positive(), tools::Non_zero()),\n- \"noise energy step between each simulation iteration.\");\n-\n- args.add(\n- {p+\"-pdf-path\"},\n- tools::File(tools::openmode::read),\n- \"A file that contains PDF for different SNR. Set the SNR range from the given ones. \"\n- \"Overwritten by -R or limited by -m and -M with a minimum step of -s\");\n-\n-\n- args.add_link({p+\"-noise-range\", \"R\"}, {p+\"-noise-min\", \"m\"});\n- args.add_link({p+\"-noise-range\", \"R\"}, {p+\"-noise-max\", \"M\"});\n- args.add_link({p+\"-pdf-path\" }, {p+\"-noise-range\", \"R\"});\n- args.add_link({p+\"-pdf-path\" }, {p+\"-noise-min\", \"m\"});\n- args.add_link({p+\"-pdf-path\" }, {p+\"-noise-max\", \"M\"});\n+ noise->get_description(args);\n-\n- args.add(\n- {p+\"-noise-type\", \"E\"},\n- tools::Text(tools::Including_set(\"ESN0\", \"EBN0\", \"ROP\", \"EP\")),\n- \"select the type of NOISE: SNR per Symbol / SNR per information Bit\"\n- \" / Received Optical Power / Erasure Probability.\");\n+ auto p = this->get_prefix();\nargs.add(\n{p+\"-pyber\"},\n@@ -155,67 +118,10 @@ void Simulation::parameters\nLauncher::parameters::store(vals);\n- auto p = this->get_prefix();\n+ noise->store(vals);\n- if (vals.exist({p+\"-pdf-path\"}))\n- {\n- this->pdf_path = vals.at({p+\"-pdf-path\"});\n- this->noise_range = tools::Distributions<>(this->pdf_path).get_noise_range();\n-\n- if(vals.exist({p+\"-noise-range\", \"R\"}))\n- {\n- this->noise_range = tools::generate_range(vals.to_list<std::vector<float>>({p+\"-noise-range\", \"R\"}), 0.1f);\n- }\n- else\n- {\n- if (vals.exist({p+\"-noise-min\", \"m\"}))\n- {\n- auto it = std::lower_bound(this->noise_range.begin(), this->noise_range.end(), vals.to_float({p+\"-noise-min\", \"m\"}));\n- this->noise_range.erase(this->noise_range.begin(), it);\n- }\n-\n- if (vals.exist({p+\"-noise-max\", \"M\"}))\n- {\n- auto it = std::upper_bound(this->noise_range.begin(), this->noise_range.end(), vals.to_float({p+\"-noise-max\", \"M\"}));\n- this->noise_range.erase(it, this->noise_range.end());\n- }\n-\n- if (vals.exist({p+\"-noise-step\", \"s\"}))\n- {\n- float step = vals.to_float({p+\"-noise-step\", \"s\"});\n-\n- auto it = this->noise_range.begin();\n- float start_val = *it++;\n-\n- while(it != this->noise_range.end())\n- {\n- if ((start_val + step) > *it) // then original step is too short\n- it = this->noise_range.erase(it);\n- else\n- start_val = *it++; // step large enough, take this new val as new comparative point\n- }\n- }\n- }\n- }\n- else\n- {\n- if(vals.exist({p+\"-noise-range\", \"R\"}))\n- {\n- this->noise_range = tools::generate_range(vals.to_list<std::vector<float>>({p+\"-noise-range\", \"R\"}), 0.1f);\n- }\n- else if(vals.exist({p+\"-noise-min\", \"m\"}) && vals.exist({p+\"-noise-max\", \"M\"}))\n- {\n- float noise_min = vals.to_float({p+\"-noise-min\", \"m\"});\n- float noise_max = vals.to_float({p+\"-noise-max\", \"M\"});\n- float noise_step = 0.1f;\n-\n- if(vals.exist({p+\"-noise-step\", \"s\"})) noise_step = vals.to_float({p+\"-noise-step\", \"s\"});\n-\n- this->noise_range = tools::generate_range({{noise_min, noise_max}}, noise_step);\n- }\n- }\n+ auto p = this->get_prefix();\n- if(vals.exist({p+\"-noise-type\", \"E\"})) this->noise_type = vals.at ({p+\"-noise-type\", \"E\"});\nif(vals.exist({p+\"-pyber\" })) this->pyber = vals.at ({p+\"-pyber\" });\nif(vals.exist({p+\"-stop-time\" })) this->stop_time = seconds(vals.to_int ({p+\"-stop-time\"}));\nif(vals.exist({p+\"-max-frame\" })) this->max_frame = vals.to_int ({p+\"-max-frame\"});\n@@ -281,15 +187,9 @@ void Simulation::parameters\n{\nLauncher::parameters::get_headers(headers);\n- auto p = this->get_prefix();\n+ noise->get_headers(headers, full);\n- if (this->noise_range.size())\n- {\n- std::stringstream noise_range_str;\n- noise_range_str << this->noise_range.front() << \" -> \" << this->noise_range.back() << \" dB\";\n- headers[p].push_back(std::make_pair(\"Noise range\", noise_range_str.str()));\n- }\n- headers[p].push_back(std::make_pair(\"Noise type (E)\", this->noise_type));\n+ auto p = this->get_prefix();\nheaders[p].push_back(std::make_pair(\"Seed\", std::to_string(this->global_seed)));\nheaders[p].push_back(std::make_pair(\"Statistics\", this->statistics ? \"on\" : \"off\"));\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Simulation/Simulation.hpp", "new_path": "src/Factory/Simulation/Simulation.hpp", "diff": "#include <vector>\n#include \"Factory/Launcher/Launcher.hpp\"\n+#include \"Factory/Tools/Noise/Noise.hpp\"\nnamespace aff3ct\n{\n@@ -24,7 +25,7 @@ struct Simulation : Launcher\npublic:\n// ------------------------------------------------------------------------------------------------- PARAMETERS\n// required arg\n- std::vector<float> noise_range;\n+ Noise::parameters *noise;\n// optional parameters\n#ifdef ENABLE_MPI\n@@ -33,7 +34,6 @@ struct Simulation : Launcher\nint mpi_size = 1;\n#endif\nstd::chrono::seconds stop_time = std::chrono::seconds(0);\n- std::string noise_type = \"EBN0\";\nstd::string pyber = \"\";\nunsigned max_frame = 0;\nbool debug = false;\n@@ -46,8 +46,6 @@ struct Simulation : Launcher\nint debug_limit = 0;\nint debug_precision = 2;\n- std::string pdf_path = \"\";\n-\n// ---------------------------------------------------------------------------------------------------- METHODS\nvirtual ~parameters();\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Factory/Tools/Noise/Noise.cpp", "diff": "+#include <sstream>\n+\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Math/Distribution/Distributions.hpp\"\n+#include \"Tools/general_utils.h\"\n+#include \"Tools/Noise/noise_utils.h\"\n+\n+#include \"Noise.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::factory;\n+\n+const std::string aff3ct::factory::Noise_name = \"Noise\";\n+const std::string aff3ct::factory::Noise_prefix = \"sim\";\n+\n+Noise::parameters\n+::parameters(const std::string &prefix)\n+: Factory::parameters(Noise_name, Noise_name, prefix)\n+{\n+}\n+\n+Noise::parameters\n+::~parameters()\n+{\n+}\n+\n+Noise::parameters* Noise::parameters\n+::clone() const\n+{\n+ return new Noise::parameters(*this);\n+}\n+\n+void Noise::parameters\n+::get_description(tools::Argument_map_info &args) const\n+{\n+ auto p = this->get_prefix();\n+\n+ args.add(\n+ {p+\"-noise-range\", \"R\"},\n+ tools::Matlab_vector<float>(tools::Real(), std::make_tuple(tools::Length(1)), std::make_tuple(tools::Length(1,3))),\n+ \"noise energy range to run (Matlab style: \\\"0.5:2.5,2.55,2.6:0.05:3\\\" with a default step of 0.1).\",\n+ tools::arg_rank::REQ);\n+\n+ args.add(\n+ {p+\"-noise-min\", \"m\"},\n+ tools::Real(),\n+ \"minimal noise energy to simulate.\",\n+ tools::arg_rank::REQ);\n+\n+ args.add(\n+ {p+\"-noise-max\", \"M\"},\n+ tools::Real(),\n+ \"maximal noise energy to simulate.\",\n+ tools::arg_rank::REQ);\n+\n+ args.add(\n+ {p+\"-noise-step\", \"s\"},\n+ tools::Real(tools::Positive(), tools::Non_zero()),\n+ \"noise energy step between each simulation iteration.\");\n+\n+ args.add(\n+ {p+\"-pdf-path\"},\n+ tools::File(tools::openmode::read),\n+ \"A file that contains PDF for different SNR. Set the SNR range from the given ones. \"\n+ \"Overwritten by -R or limited by -m and -M with a minimum step of -s\");\n+\n+\n+ args.add_link({p+\"-noise-range\", \"R\"}, {p+\"-noise-min\", \"m\"});\n+ args.add_link({p+\"-noise-range\", \"R\"}, {p+\"-noise-max\", \"M\"});\n+ args.add_link({p+\"-pdf-path\" }, {p+\"-noise-range\", \"R\"});\n+ args.add_link({p+\"-pdf-path\" }, {p+\"-noise-min\", \"m\"});\n+ args.add_link({p+\"-pdf-path\" }, {p+\"-noise-max\", \"M\"});\n+\n+\n+ args.add(\n+ {p+\"-noise-type\", \"E\"},\n+ tools::Text(tools::Including_set(\"ESN0\", \"EBN0\", \"ROP\", \"EP\")),\n+ \"select the type of NOISE: SNR per Symbol / SNR per information Bit\"\n+ \" / Received Optical Power / Erasure Probability.\");\n+\n+}\n+\n+void Noise::parameters\n+::store(const tools::Argument_map_value &vals)\n+{\n+ auto p = this->get_prefix();\n+\n+ if (vals.exist({p+\"-pdf-path\"}))\n+ {\n+ this->pdf_path = vals.at({p+\"-pdf-path\"});\n+ this->range = tools::Distributions<>(this->pdf_path).get_noise_range();\n+\n+ if(vals.exist({p+\"-noise-range\", \"R\"}))\n+ {\n+ this->range = tools::generate_range(vals.to_list<std::vector<float>>({p+\"-noise-range\", \"R\"}), 0.1f);\n+ }\n+ else\n+ {\n+ if (vals.exist({p+\"-noise-min\", \"m\"}))\n+ {\n+ auto it = std::lower_bound(this->range.begin(), this->range.end(), vals.to_float({p+\"-noise-min\", \"m\"}));\n+ this->range.erase(this->range.begin(), it);\n+ }\n+\n+ if (vals.exist({p+\"-noise-max\", \"M\"}))\n+ {\n+ auto it = std::upper_bound(this->range.begin(), this->range.end(), vals.to_float({p+\"-noise-max\", \"M\"}));\n+ this->range.erase(it, this->range.end());\n+ }\n+\n+ if (vals.exist({p+\"-noise-step\", \"s\"}))\n+ {\n+ float step = vals.to_float({p+\"-noise-step\", \"s\"});\n+\n+ auto it = this->range.begin();\n+ float start_val = *it++;\n+\n+ while(it != this->range.end())\n+ {\n+ if ((start_val + step) > *it) // then original step is too short\n+ it = this->range.erase(it);\n+ else\n+ start_val = *it++; // step large enough, take this new val as new comparative point\n+ }\n+ }\n+ }\n+ }\n+ else\n+ {\n+ if(vals.exist({p+\"-noise-range\", \"R\"}))\n+ {\n+ this->range = tools::generate_range(vals.to_list<std::vector<float>>({p+\"-noise-range\", \"R\"}), 0.1f);\n+ }\n+ else if(vals.exist({p+\"-noise-min\", \"m\"}) && vals.exist({p+\"-noise-max\", \"M\"}))\n+ {\n+ float noise_min = vals.to_float({p+\"-noise-min\", \"m\"});\n+ float noise_max = vals.to_float({p+\"-noise-max\", \"M\"});\n+ float noise_step = 0.1f;\n+\n+ if(vals.exist({p+\"-noise-step\", \"s\"})) noise_step = vals.to_float({p+\"-noise-step\", \"s\"});\n+\n+ this->range = tools::generate_range({{noise_min, noise_max}}, noise_step);\n+ }\n+ }\n+\n+ if(vals.exist({p+\"-noise-type\", \"E\"})) this->type = vals.at({p+\"-noise-type\", \"E\"});\n+}\n+\n+void Noise::parameters\n+::get_headers(std::map<std::string,header_list>& headers, const bool full) const\n+{\n+ auto p = this->get_prefix();\n+\n+ if (!this->range.empty())\n+ {\n+ std::stringstream range_str;\n+ range_str << this->range.front() << \" -> \" << this->range.back() << \" dB\";\n+ headers[p].push_back(std::make_pair(\"Noise range\", range_str.str()));\n+ }\n+\n+ headers[p].push_back(std::make_pair(\"Noise type (E)\", this->type));\n+\n+ if (!this->pdf_path.empty())\n+ headers[p].push_back(std::make_pair(\"PDF path\", this->pdf_path));\n+}\n+\n+template <typename R>\n+tools::Noise<R>* Noise::parameters\n+::build(R noise_val, R bit_rate, int bps, int upf) const\n+{\n+ if (this->type == \"EBN0\" || this->type == \"ESN0\")\n+ {\n+ R esn0, ebn0;\n+ if (this->type == \"EBN0\")\n+ {\n+ ebn0 = noise_val;\n+ esn0 = tools::ebn0_to_esn0(ebn0, bit_rate, bps);\n+ }\n+ else // (this->type == \"ESN0\")\n+ {\n+ esn0 = noise_val;\n+ ebn0 = tools::esn0_to_ebn0(esn0, bit_rate, bps);\n+ }\n+\n+ auto sigma = tools::esn0_to_sigma(esn0, upf);\n+\n+ return new tools::Sigma<R>(sigma, ebn0, esn0);\n+ }\n+ else if (this->type == \"ROP\") return new tools::Received_optical_power<R>(noise_val);\n+ else if (this->type == \"EP\" ) return new tools::Event_probability <R>(noise_val);\n+\n+ std::stringstream message;\n+ message << \"Unknown noise type ('noise_type' = \" << this->type << \").\";\n+ throw tools::cannot_allocate(__FILE__, __LINE__, __func__, message.str());\n+}\n+\n+template <typename R>\n+tools::Noise<R>* Noise\n+::build(const aff3ct::factory::Noise::parameters& params, R noise_val, R bit_rate, int bps, int upf)\n+{\n+ return params.template build<R>(noise_val, bit_rate, bps, upf);\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+template aff3ct::tools::Noise<float>* aff3ct::factory::Noise::parameters::build<float>(float, float, int, int) const;\n+template aff3ct::tools::Noise<float>* aff3ct::factory::Noise::build<float>(const aff3ct::factory::Noise::parameters&, float, float, int, int);\n+\n+template aff3ct::tools::Noise<double>* aff3ct::factory::Noise::parameters::build<double>(double, double, int, int) const;\n+template aff3ct::tools::Noise<double>* aff3ct::factory::Noise::build<double>(const aff3ct::factory::Noise::parameters&, double, double, int, int);\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Factory/Tools/Noise/Noise.hpp", "diff": "+#ifndef FACTORY_NOISE_HPP\n+#define FACTORY_NOISE_HPP\n+\n+#include <string>\n+#include <vector>\n+\n+#include \"Tools/Noise/Noise.hpp\"\n+\n+#include \"../../Factory.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace factory\n+{\n+extern const std::string Noise_name;\n+extern const std::string Noise_prefix;\n+struct Noise : public Factory\n+{\n+ class parameters : public Factory::parameters\n+ {\n+ public:\n+ // ------------------------------------------------------------------------------------------------- PARAMETERS\n+ // required parameters\n+ std::vector<float> range;\n+\n+ // optional parameters\n+ std::string type = \"EBN0\";\n+ std::string pdf_path = \"\";\n+\n+ // ---------------------------------------------------------------------------------------------------- METHODS\n+ explicit parameters(const std::string &p = Noise_prefix);\n+ virtual ~parameters();\n+ Noise::parameters* clone() const;\n+\n+ // parameters construction\n+ void get_description(tools::Argument_map_info &args) const;\n+ void store (const tools::Argument_map_value &vals);\n+ void get_headers (std::map<std::string,header_list>& headers, const bool full = true) const;\n+\n+ // builder\n+ template <typename R = float>\n+ tools::Noise<R>* build(R noise_val, R bit_rate = 1., int bps = 1, int upf = 1) const;\n+ };\n+\n+ template <typename R = float>\n+ static tools::Noise<R>* build(const aff3ct::factory::Noise::parameters& params, R noise_val, R bit_rate = 1., int bps = 1, int upf = 1);\n+};\n+}\n+}\n+\n+#endif /* FACTORY_NOISE_HPP */\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Simulation/BFER_std.cpp", "new_path": "src/Launcher/Simulation/BFER_std.cpp", "diff": "@@ -118,9 +118,9 @@ void BFER_std<B,R,Q>\nif (!this->arg_vals.exist({psim+\"-noise-type\", \"E\"}))\n{\nif (params.chn->type == \"OPTICAL\")\n- params.noise_type = \"ROP\";\n+ params.noise->type = \"ROP\";\nelse if (params.chn->type == \"BEC\" || params.chn->type == \"BSC\")\n- params.noise_type = \"EP\";\n+ params.noise->type = \"EP\";\n// else let the default value EBN0 or ESNO\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -79,8 +79,8 @@ BFER<B,R,Q>\nthis->monitor_red = new module::Monitor_BFER_reduction<B,R>(this->monitor);\n#endif\n- if (!params_BFER.pdf_path.empty())\n- distributions = new tools::Distributions<R>(params_BFER.pdf_path);\n+ if (!params_BFER.noise->pdf_path.empty())\n+ distributions = new tools::Distributions<R>(params_BFER.noise->pdf_path);\n}\ntemplate <typename B, typename R, typename Q>\n@@ -136,47 +136,23 @@ void BFER<B,R,Q>\n}\n}\n- // for each NOISE to be simulated\n- for (unsigned noise_idx = 0; noise_idx < params_BFER.noise_range.size(); noise_idx ++)\n- {\n- auto n = params_BFER.noise_range[noise_idx];\n-\n- if (this->noise != nullptr) delete noise;\n-\n- if (params_BFER.noise_type == \"EBN0\" || params_BFER.noise_type == \"ESN0\")\n- {\n- float esn0, ebn0;\n- if (params_BFER.noise_type == \"EBN0\")\n+ int noise_begin = 0;\n+ int noise_end = params_BFER.noise->range.size();\n+ int noise_step = 1;\n+ if (params_BFER.noise->type == \"EP\")\n{\n- ebn0 = n;\n- esn0 = tools::ebn0_to_esn0(ebn0, bit_rate, params_BFER.mdm->bps);\n+ noise_begin = params_BFER.noise->range.size()-1;\n+ noise_end = -1;\n+ noise_step = -1;\n}\n- else // if (params_BFER.sim->noise_type == \"ESN0\")\n- {\n- esn0 = n;\n- ebn0 = tools::esn0_to_ebn0(esn0, bit_rate, params_BFER.mdm->bps);\n- }\n-\n- auto sigma = tools::esn0_to_sigma(esn0, params_BFER.mdm->upf);\n- this->noise = new tools::Sigma<R>(sigma, ebn0, esn0);\n- }\n- else if (params_BFER.noise_type == \"ROP\")\n- {\n- this->noise = new tools::Received_optical_power<R>(n);\n- }\n- else if (params_BFER.noise_type == \"EP\")\n+ // for each NOISE to be simulated\n+ for (auto noise_idx = noise_begin; noise_idx != noise_end; noise_idx += noise_step)\n{\n- n = params_BFER.noise_range[params_BFER.noise_range.size() - noise_idx -1];\n+ if (this->noise != nullptr) delete noise;\n- this->noise = new tools::Event_probability<R>(n);\n- }\n- else\n- {\n- std::stringstream message;\n- message << \"Unknown noise type ('noise_type' = \" << params_BFER.noise_type << \").\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+ this->noise = params_BFER.noise->template build<R>(params_BFER.noise->range[noise_idx], bit_rate,\n+ params_BFER.mdm->bps, params_BFER.mdm->upf);\nthis->terminal->set_noise(*this->noise);\n@@ -185,7 +161,6 @@ void BFER<B,R,Q>\nthis->distributions->read_distribution(this->noise->get_noise());\n-\nif (this->params_BFER.err_track_revert)\n{\nthis->release_objects();\n@@ -228,10 +203,10 @@ void BFER<B,R,Q>\nif (params_BFER.display_legend)\n#ifdef ENABLE_MPI\n- if (((!params_BFER.ter->disabled && noise_idx == 0 && !params_BFER.debug) ||\n+ if (((!params_BFER.ter->disabled && noise_idx == noise_begin && !params_BFER.debug) ||\n(params_BFER.statistics && !params_BFER.debug)) && params_BFER.mpi_rank == 0)\n#else\n- if (((!params_BFER.ter->disabled && noise_idx == 0 && !params_BFER.debug) ||\n+ if (((!params_BFER.ter->disabled && noise_idx == noise_begin && !params_BFER.debug) ||\n(params_BFER.statistics && !params_BFER.debug)))\n#endif\nterminal->legend(std::cout);\n@@ -296,7 +271,7 @@ void BFER<B,R,Q>\nswitch (this->noise->get_type())\n{\ncase tools::Noise_type::SIGMA:\n- if (params_BFER.noise_type == \"EBN0\")\n+ if (params_BFER.noise->type == \"EBN0\")\nnoise_value = std::to_string(dynamic_cast<tools::Sigma<>*>(this->noise)->get_ebn0());\nelse //(params_BFER.noise_type == \"ESN0\")\nnoise_value = std::to_string(dynamic_cast<tools::Sigma<>*>(this->noise)->get_esn0());\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/EXIT/EXIT.cpp", "new_path": "src/Simulation/EXIT/EXIT.cpp", "diff": "@@ -35,6 +35,14 @@ EXIT<B,R>\n\"on each MPI processes.\" << std::endl;\n#endif\n+ if (params_EXIT.noise->type != \"EBN0\" && params_EXIT.noise->type != \"ESN0\")\n+ {\n+ std::stringstream message;\n+ message << \"Wrong noise type, must be gaussian noise EBN0 or ESN0 ('params_EXIT.noise->typ' = \"\n+ << params_EXIT.noise->type << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nif (params_EXIT.n_threads > 1)\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, \"EXIT simu does not support the multi-threading.\");\n@@ -106,10 +114,12 @@ void EXIT<B,R>\nthis->build_communication_chain();\nthis->sockets_binding();\n+\n+\n// for each channel NOISE to be simulated\n- for (unsigned noise_idx = 0; noise_idx < params_EXIT.noise_range.size(); noise_idx ++)\n+ for (unsigned noise_idx = 0; noise_idx < params_EXIT.noise->range.size(); noise_idx ++)\n{\n- float ebn0 = params_EXIT.noise_range[noise_idx];\n+ float ebn0 = params_EXIT.noise->range[noise_idx];\n// For EXIT simulation, NOISE is considered as Es/N0\nconst auto bit_rate = 1.f;\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a noise factory to build noise object and gather their arguments
8,483
18.05.2018 08:28:08
-7,200
335796471095e114a44f051ca66ea7943bc1f756
Split hamming distance computation functions into ones that count that take into account the unknown symbols as false (noise EP) and those that don't
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -104,31 +104,31 @@ void Monitor_BFER::parameters\ntemplate <typename B, typename R>\nmodule::Monitor_BFER<B,R>* Monitor_BFER::parameters\n-::build() const\n+::build(bool count_unknown_values) const\n{\n- if (this->type == \"STD\") return new module::Monitor_BFER<B,R>(this->K, this->N, this->n_frame_errors, this->n_frames);\n+ if (this->type == \"STD\") return new module::Monitor_BFER<B,R>(this->K, this->N, this->n_frame_errors, count_unknown_values, this->n_frames);\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n}\ntemplate <typename B, typename R>\nmodule::Monitor_BFER<B,R>* Monitor_BFER\n-::build(const parameters& params)\n+::build(const parameters& params, bool count_unknown_values)\n{\n- return params.template build<B,R>();\n+ return params.template build<B,R>(count_unknown_values);\n}\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n-template aff3ct::module::Monitor_BFER<B_8 ,R_8 >* aff3ct::factory::Monitor_BFER::parameters::build<B_8, R_8 >() const;\n-template aff3ct::module::Monitor_BFER<B_16,R_16>* aff3ct::factory::Monitor_BFER::parameters::build<B_16,R_16>() const;\n-template aff3ct::module::Monitor_BFER<B_32,R_32>* aff3ct::factory::Monitor_BFER::parameters::build<B_32,R_32>() const;\n-template aff3ct::module::Monitor_BFER<B_64,R_64>* aff3ct::factory::Monitor_BFER::parameters::build<B_64,R_64>() const;\n-template aff3ct::module::Monitor_BFER<B_8 ,R_8 >* aff3ct::factory::Monitor_BFER::build<B_8, R_8 >(const aff3ct::factory::Monitor_BFER::parameters&);\n-template aff3ct::module::Monitor_BFER<B_16,R_16>* aff3ct::factory::Monitor_BFER::build<B_16,R_16>(const aff3ct::factory::Monitor_BFER::parameters&);\n-template aff3ct::module::Monitor_BFER<B_32,R_32>* aff3ct::factory::Monitor_BFER::build<B_32,R_32>(const aff3ct::factory::Monitor_BFER::parameters&);\n-template aff3ct::module::Monitor_BFER<B_64,R_64>* aff3ct::factory::Monitor_BFER::build<B_64,R_64>(const aff3ct::factory::Monitor_BFER::parameters&);\n+template aff3ct::module::Monitor_BFER<B_8 ,R_8 >* aff3ct::factory::Monitor_BFER::parameters::build<B_8, R_8 >(bool) const;\n+template aff3ct::module::Monitor_BFER<B_16,R_16>* aff3ct::factory::Monitor_BFER::parameters::build<B_16,R_16>(bool) const;\n+template aff3ct::module::Monitor_BFER<B_32,R_32>* aff3ct::factory::Monitor_BFER::parameters::build<B_32,R_32>(bool) const;\n+template aff3ct::module::Monitor_BFER<B_64,R_64>* aff3ct::factory::Monitor_BFER::parameters::build<B_64,R_64>(bool) const;\n+template aff3ct::module::Monitor_BFER<B_8 ,R_8 >* aff3ct::factory::Monitor_BFER::build<B_8, R_8 >(const aff3ct::factory::Monitor_BFER::parameters&, bool);\n+template aff3ct::module::Monitor_BFER<B_16,R_16>* aff3ct::factory::Monitor_BFER::build<B_16,R_16>(const aff3ct::factory::Monitor_BFER::parameters&, bool);\n+template aff3ct::module::Monitor_BFER<B_32,R_32>* aff3ct::factory::Monitor_BFER::build<B_32,R_32>(const aff3ct::factory::Monitor_BFER::parameters&, bool);\n+template aff3ct::module::Monitor_BFER<B_64,R_64>* aff3ct::factory::Monitor_BFER::build<B_64,R_64>(const aff3ct::factory::Monitor_BFER::parameters&, bool);\n#else\ntemplate aff3ct::module::Monitor_BFER<B,R>* aff3ct::factory::Monitor_BFER::parameters::build<B,R>() const;\ntemplate aff3ct::module::Monitor_BFER<B,R>* aff3ct::factory::Monitor_BFER::build<B,R>(const aff3ct::factory::Monitor_BFER::parameters&);\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.hpp", "new_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.hpp", "diff": "@@ -43,11 +43,11 @@ struct Monitor_BFER : public Factory\n// builder\ntemplate <typename B = int, typename R = float>\n- module::Monitor_BFER<B,R>* build() const;\n+ module::Monitor_BFER<B,R>* build(bool count_unknown_values = false) const;\n};\ntemplate <typename B = int, typename R = float>\n- static module::Monitor_BFER<B,R>* build(const parameters& params);\n+ static module::Monitor_BFER<B,R>* build(const parameters& params, bool count_unknown_values = false);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -12,9 +12,10 @@ using namespace aff3ct::module;\ntemplate <typename B, typename R>\nMonitor_BFER<B,R>\n-::Monitor_BFER(const int K, const int N, const unsigned max_fe, const int n_frames)\n+::Monitor_BFER(const int K, const int N, const unsigned max_fe, const bool count_unknown_values, const int n_frames)\n: Monitor(K, N, n_frames),\nmax_fe(max_fe),\n+ count_unknown_values(count_unknown_values),\nn_bit_errors(0),\nn_frame_errors(0),\nn_analyzed_frames(0),\n@@ -79,7 +80,12 @@ template <typename B, typename R>\nint Monitor_BFER<B,R>\n::_check_errors(const B *U, const B *V, const int frame_id)\n{\n- int bit_errors_count = tools::hamming_distance(U, V, this->K);\n+ int bit_errors_count;\n+\n+ if (count_unknown_values)\n+ bit_errors_count = tools::hamming_distance_unk(U, V, this->K);\n+ else\n+ bit_errors_count = tools::hamming_distance(U, V, this->K);\nif (bit_errors_count)\n{\n@@ -271,6 +277,13 @@ tools::Histogram<int> Monitor_BFER<B, R>::get_err_hist() const\nreturn err_hist;\n}\n+template<typename B, typename R>\n+bool Monitor_BFER<B, R>\n+::get_count_unknown_values() const\n+{\n+ return count_unknown_values;\n+}\n+\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "diff": "@@ -22,6 +22,7 @@ public:\nprotected:\nconst unsigned max_fe;\n+ const bool count_unknown_values;\nunsigned long long n_bit_errors;\nunsigned long long n_frame_errors;\n@@ -35,7 +36,7 @@ protected:\ntools::Histogram<int> err_hist;\npublic:\n- Monitor_BFER(const int K, const int N, const unsigned max_fe, const int n_frames = 1);\n+ Monitor_BFER(const int K, const int N, const unsigned max_fe, const bool count_unknown_values = false, const int n_frames = 1);\nvirtual ~Monitor_BFER() = default;\n/*!\n@@ -112,6 +113,8 @@ public:\nvirtual bool fe_limit_achieved();\nunsigned get_fe_limit() const;\n+ bool get_count_unknown_values() const;\n+\nvirtual unsigned long long get_n_analyzed_fra() const;\nvirtual unsigned long long get_n_fe () const;\nvirtual unsigned long long get_n_be () const;\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction.cpp", "diff": "@@ -18,6 +18,7 @@ Monitor_BFER_reduction<B,R>\n: Monitor_BFER<B,R>((monitors.size() && monitors[0]) ? monitors[0]->get_K() : 1,\n(monitors.size() && monitors[0]) ? monitors[0]->get_N() : 1,\n(monitors.size() && monitors[0]) ? monitors[0]->get_fe_limit() : 1,\n+ (monitors.size() && monitors[0]) ? monitors[0]->get_count_unknown_values() : false,\n(monitors.size() && monitors[0]) ? monitors[0]->get_n_frames() : 1),\nn_analyzed_frames_historic(0),\nmonitors(monitors)\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -360,7 +360,9 @@ template <typename B, typename R, typename Q>\nmodule::Monitor_BFER<B,R>* BFER<B,R,Q>\n::build_monitor(const int tid)\n{\n- return factory::Monitor_BFER::build<B,R>(*params_BFER.mnt);\n+ bool count_unknown_values = params_BFER.noise_type == \"EP\";\n+\n+ return factory::Monitor_BFER::build<B,R>(*params_BFER.mnt, count_unknown_values);\n}\ntemplate <typename B, typename R, typename Q>\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hamming_distance.cpp", "new_path": "src/Tools/Perf/common/hamming_distance.cpp", "diff": "@@ -11,6 +11,28 @@ inline size_t aff3ct::tools::hamming_distance_seq(const B *in1, const B *in2, co\n{\nsize_t ham_dist = 0;\n+ for (unsigned i = 0; i < size; i++)\n+ ham_dist += (!in1[i] != !in2[i])? (size_t)1 : (size_t)0;\n+\n+ return ham_dist;\n+}\n+\n+template <typename B>\n+inline size_t hamming_distance_seq_real(const B *in1, const B *in2, const unsigned size)\n+{\n+ size_t ham_dist = 0;\n+\n+ for (unsigned i = 0; i < size; i++)\n+ ham_dist += std::signbit(in1[i]) ^ std::signbit(in2[i]) ? (size_t)1 : (size_t)0;\n+\n+ return ham_dist;\n+}\n+\n+template <typename B>\n+inline size_t aff3ct::tools::hamming_distance_unk_seq(const B *in1, const B *in2, const unsigned size)\n+{\n+ size_t ham_dist = 0;\n+\nfor (unsigned i = 0; i < size; i++)\nham_dist += (in1[i] != in2[i])\n|| aff3ct::tools::is_unknown_symbol<B>(in1[i])\n@@ -21,7 +43,7 @@ inline size_t aff3ct::tools::hamming_distance_seq(const B *in1, const B *in2, co\n}\ntemplate <typename B>\n-inline size_t hamming_distance_seq_real(const B *in1, const B *in2, const unsigned size)\n+inline size_t hamming_distance_unk_seq_real(const B *in1, const B *in2, const unsigned size)\n{\nsize_t ham_dist = 0;\n@@ -51,6 +73,18 @@ inline size_t hamming_distance_seq(const double *in1, const double *in2, const u\nreturn hamming_distance_seq_real(in1, in2, size);\n}\n+template <>\n+inline size_t hamming_distance_unk_seq(const float *in1, const float *in2, const unsigned size)\n+{\n+ return hamming_distance_unk_seq_real(in1, in2, size);\n+}\n+\n+template <>\n+inline size_t hamming_distance_unk_seq(const double *in1, const double *in2, const unsigned size)\n+{\n+ return hamming_distance_unk_seq_real(in1, in2, size);\n+}\n+\n}\n}\n@@ -64,7 +98,7 @@ inline size_t aff3ct::tools::hamming_distance_seq(const B *in, const unsigned si\nsize_t ham_dist = 0;\nfor (unsigned i = 0; i < size; i++)\n- ham_dist += in[i] || aff3ct::tools::is_unknown_symbol<B>(in[i]) ? (size_t)1 : (size_t)0;\n+ ham_dist += in[i] ? (size_t)1 : (size_t)0;\nreturn ham_dist;\n}\n@@ -75,6 +109,29 @@ inline size_t hamming_distance_seq_real(const B *in, const unsigned size)\n{\nsize_t ham_dist = 0;\n+ for (unsigned i = 0; i < size; i++)\n+ ham_dist += std::signbit(in[i]) ? (size_t)1 : (size_t)0;\n+\n+ return ham_dist;\n+}\n+\n+template <typename B>\n+inline size_t aff3ct::tools::hamming_distance_unk_seq(const B *in, const unsigned size)\n+{\n+ size_t ham_dist = 0;\n+\n+ for (unsigned i = 0; i < size; i++)\n+ ham_dist += in[i] || aff3ct::tools::is_unknown_symbol<B>(in[i]) ? (size_t)1 : (size_t)0;\n+\n+ return ham_dist;\n+}\n+\n+\n+template <typename B>\n+inline size_t hamming_distance_unk_seq_real(const B *in, const unsigned size)\n+{\n+ size_t ham_dist = 0;\n+\nfor (unsigned i = 0; i < size; i++)\nham_dist += std::signbit(in[i]) || aff3ct::tools::is_unknown_symbol<B>(in[i]) ? (size_t)1 : (size_t)0;\n@@ -99,6 +156,18 @@ inline size_t hamming_distance_seq(const double *in, const unsigned size)\nreturn hamming_distance_seq_real(in, size);\n}\n+template <>\n+inline size_t hamming_distance_unk_seq(const float *in, const unsigned size)\n+{\n+ return hamming_distance_unk_seq_real(in, size);\n+}\n+\n+template <>\n+inline size_t hamming_distance_unk_seq(const double *in, const unsigned size)\n+{\n+ return hamming_distance_unk_seq_real(in, size);\n+}\n+\n}\n}\n@@ -120,6 +189,18 @@ size_t aff3ct::tools::hamming_distance(const B *in, const unsigned size)\nreturn hamming_distance_seq(in, size);\n}\n+template <typename B>\n+size_t aff3ct::tools::hamming_distance_unk(const B *in1, const B *in2, const unsigned size)\n+{\n+ return hamming_distance_unk_seq(in1, in2, size);\n+}\n+\n+template <typename B>\n+size_t aff3ct::tools::hamming_distance_unk(const B *in, const unsigned size)\n+{\n+ return hamming_distance_unk_seq(in, size);\n+}\n+\n@@ -127,86 +208,178 @@ size_t aff3ct::tools::hamming_distance(const B *in, const unsigned size)\n-template <typename B>\n-inline mipp::Reg<B> popcnt(const mipp::Reg<B>& q_in1, const mipp::Reg<B>& q_in2)\n+\n+template <typename R>\n+inline mipp::Reg<R> popcnt_real(const mipp::Reg<R>& q_in)\n+{\n+ const mipp::Reg<R> zeros = (R)0, ones = (R)1;\n+ return mipp::blend(ones, zeros, mipp::sign(q_in));\n+}\n+\n+template <typename R>\n+inline mipp::Reg<R> popcnt_unk_real(const mipp::Reg<R>& q_in)\n+{\n+ const mipp::Reg<R> zeros = (R)0, ones = (R)1;\n+ const auto m_in = mipp::sign(q_in) | aff3ct::tools::is_unknown_symbol<R>(q_in);\n+ return mipp::blend(ones, zeros, m_in);\n+}\n+\n+template <typename R>\n+inline mipp::Reg<R> popcnt_real(const mipp::Reg<R>& q_in1, const mipp::Reg<R>& q_in2)\n+{\n+ const mipp::Reg<R> zeros = (R)0, ones = (R)1;\n+ const auto m_in = mipp::sign(q_in1) ^ mipp::sign(q_in2);\n+ return mipp::blend(ones, zeros, m_in);\n+}\n+\n+template <typename R>\n+inline mipp::Reg<R> popcnt_unk_real(const mipp::Reg<R>& q_in1, const mipp::Reg<R>& q_in2)\n+{\n+ const mipp::Reg<R> zeros = (R)0, ones = (R)1;\n+ const auto m_in = (mipp::sign(q_in1) ^ mipp::sign(q_in2))\n+ | aff3ct::tools::is_unknown_symbol<R>(q_in1)\n+ | aff3ct::tools::is_unknown_symbol<R>(q_in2);\n+ return mipp::blend(ones, zeros, m_in);\n+}\n+\n+\n+template<typename B, bool count_unknown_symbols>\n+struct Popcnt\n+{\n+ static inline mipp::Reg<B> apply(const mipp::Reg<B>& q_in1, const mipp::Reg<B>& q_in2)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- auto m_in = q_in1 != q_in2;\n- m_in |= aff3ct::tools::is_unknown_symbol<B>(q_in1) | aff3ct::tools::is_unknown_symbol<B>(q_in2);\n+ const auto m_in1 = q_in1 != zeros;\n+ const auto m_in2 = q_in2 != zeros;\n+ return mipp::blend(ones, zeros, m_in1 ^ m_in2);\n+ }\n+\n+ static inline mipp::Reg<B> apply(const mipp::Reg<B>& q_in)\n+ {\n+ const mipp::Reg<B> zeros = (B)0, ones = (B)1;\n+ const auto m_in = q_in != zeros;\nreturn mipp::blend(ones, zeros, m_in);\n}\n+};\ntemplate<typename B>\n-inline mipp::Reg<B> popcnt(const mipp::Reg<B>& q_in)\n+struct Popcnt<B,true>\n+{\n+ static inline mipp::Reg<B> apply(const mipp::Reg<B>& q_in1, const mipp::Reg<B>& q_in2)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- const auto m_in = (q_in != zeros) | aff3ct::tools::is_unknown_symbol<B>(q_in);\n+ auto m_in = q_in1 != q_in2;\n+ m_in |= aff3ct::tools::is_unknown_symbol<B>(q_in1) | aff3ct::tools::is_unknown_symbol<B>(q_in2);\nreturn mipp::blend(ones, zeros, m_in);\n}\n-template <typename B>\n-inline mipp::Reg<B> popcnt_real(const mipp::Reg<B>& q_in)\n+ static inline mipp::Reg<B> apply(const mipp::Reg<B>& q_in)\n{\nconst mipp::Reg<B> zeros = (B)0, ones = (B)1;\n- const auto m_in = (q_in < zeros) | aff3ct::tools::is_unknown_symbol<B>(q_in);\n+ const auto m_in = (q_in != zeros) | aff3ct::tools::is_unknown_symbol<B>(q_in);\nreturn mipp::blend(ones, zeros, m_in);\n}\n+};\ntemplate<>\n-inline mipp::Reg<float> popcnt(const mipp::Reg<float>& q_in)\n+struct Popcnt<double,false>\n+{\n+ static inline mipp::Reg<double> apply(const mipp::Reg<double>& q_in1, const mipp::Reg<double>& q_in2)\n+ {\n+ return popcnt_real(q_in1, q_in2);\n+ }\n+\n+ static inline mipp::Reg<double> apply(const mipp::Reg<double>& q_in)\n{\nreturn popcnt_real(q_in);\n}\n+};\ntemplate<>\n-inline mipp::Reg<double> popcnt(const mipp::Reg<double>& q_in)\n+struct Popcnt<float,false>\n+{\n+ static inline mipp::Reg<float> apply(const mipp::Reg<float>& q_in1, const mipp::Reg<float>& q_in2)\n+ {\n+ return popcnt_real(q_in1, q_in2);\n+ }\n+\n+ static inline mipp::Reg<float> apply(const mipp::Reg<float>& q_in)\n{\nreturn popcnt_real(q_in);\n}\n+};\n+\n+template<>\n+struct Popcnt<double,true>\n+{\n+ static inline mipp::Reg<double> apply(const mipp::Reg<double>& q_in1, const mipp::Reg<double>& q_in2)\n+ {\n+ return popcnt_unk_real(q_in1, q_in2);\n+ }\n+\n+ static inline mipp::Reg<double> apply(const mipp::Reg<double>& q_in)\n+ {\n+ return popcnt_unk_real(q_in);\n+ }\n+};\n+template<>\n+struct Popcnt<float,true>\n+{\n+ static inline mipp::Reg<float> apply(const mipp::Reg<float>& q_in1, const mipp::Reg<float>& q_in2)\n+ {\n+ return popcnt_unk_real(q_in1, q_in2);\n+ }\n+ static inline mipp::Reg<float> apply(const mipp::Reg<float>& q_in)\n+ {\n+ return popcnt_unk_real(q_in);\n+ }\n+};\n-template <typename B>\n-size_t aff3ct::tools::hamming_distance(const B *in1, const B *in2, const unsigned size)\n+\n+template <typename B, class Fpopcnt>\n+struct Hamming_distance\n+{\n+ static inline size_t apply(const B *in1, const B *in2, const unsigned size)\n{\nmipp::Reg<B> counter = (B)0;\nconst auto vec_loop_size = (size / mipp::N<B>()) * mipp::N<B>();\nfor (unsigned i = 0; i < vec_loop_size; i += mipp::N<B>())\n- counter += popcnt<B>(in1 + i, in2 + i);\n+ counter += Fpopcnt::apply(in1 + i, in2 + i);\n- size_t ham_dist = (size_t)mipp::hadd(counter);\n+ auto ham_dist = (size_t)mipp::hadd(counter);\n- ham_dist += tools::hamming_distance_seq(in1 + vec_loop_size, in2 + vec_loop_size, size - vec_loop_size);\n+ ham_dist += aff3ct::tools::hamming_distance_seq(in1 + vec_loop_size, in2 + vec_loop_size, size - vec_loop_size);\nreturn ham_dist;\n}\n-template <typename B>\n-size_t aff3ct::tools::hamming_distance(const B *in, const unsigned size)\n+ static inline size_t apply(const B *in, const unsigned size)\n{\nmipp::Reg<B> counter = (B)0;\nconst auto vec_loop_size = (size / mipp::N<B>()) * mipp::N<B>();\nfor (unsigned i = 0; i < vec_loop_size; i += mipp::N<B>())\n- counter += popcnt<B>(in + i);\n+ counter += Fpopcnt::apply(in + i);\n- size_t ham_dist = (size_t)mipp::hadd(counter);\n+ auto ham_dist = (size_t)mipp::hadd(counter);\n- ham_dist += tools::hamming_distance_seq(in + vec_loop_size, size - vec_loop_size);\n+ ham_dist += aff3ct::tools::hamming_distance_seq(in + vec_loop_size, size - vec_loop_size);\nreturn ham_dist;\n}\n+};\n-namespace aff3ct\n-{\n-namespace tools\n+\n+template <class Fpopcnt>\n+struct Hamming_distance<int16_t, Fpopcnt>\n{\n-template <>\n-size_t hamming_distance<int16_t>(const int16_t *in1, const int16_t *in2, const unsigned size)\n+ static inline size_t apply(const int16_t *in1, const int16_t *in2, const unsigned size)\n{\n#ifdef MIPP_BW\nmipp::Reg<int32_t> counter32 = (int32_t)0;\n@@ -218,93 +391,94 @@ size_t hamming_distance<int16_t>(const int16_t *in1, const int16_t *in2, const u\nmipp::Reg<int16_t> counter16 = (int16_t)0;\nconst auto vec_loop_size2 = std::min(vec_loop_size, ii + stride);\nfor (unsigned i = ii; i < vec_loop_size2; i += mipp::N<int16_t>())\n- counter16 += popcnt<int16_t>(in1 + i, in2 + i);\n+ counter16 += Fpopcnt::apply(in1 + i, in2 + i);\ncounter32 += mipp::cvt<int16_t,int32_t>(counter16.low ());\ncounter32 += mipp::cvt<int16_t,int32_t>(counter16.high());\n}\n- size_t ham_dist = (size_t)mipp::hadd(counter32);\n+ auto ham_dist = (size_t)mipp::hadd(counter32);\n#else\nconst auto vec_loop_size = 0;\nsize_t ham_dist = 0;\n#endif\n- ham_dist += tools::hamming_distance_seq<int16_t>(in1 + vec_loop_size, in2 + vec_loop_size, size - vec_loop_size);\n+ ham_dist += aff3ct::tools::hamming_distance_seq<int16_t>(in1 + vec_loop_size, in2 + vec_loop_size, size - vec_loop_size);\nreturn ham_dist;\n}\n-template <>\n-size_t hamming_distance<int8_t>(const int8_t *in1, const int8_t *in2, const unsigned size)\n+ static inline size_t apply(const int16_t *in, const unsigned size)\n{\n#ifdef MIPP_BW\n- const mipp::Reg<int8_t> zeros = (int8_t)0, ones = (int8_t)1;\nmipp::Reg<int32_t> counter32 = (int32_t)0;\n- const auto vec_loop_size = mipp::N<int8_t>() < 4 ? 0 : (size / mipp::N<int8_t>()) * mipp::N<int8_t>();\n- constexpr auto stride = std::numeric_limits<int8_t>::max() * mipp::N<int8_t>();\n+ const auto vec_loop_size = mipp::N<int16_t>() < 2 ? 0 : (size / mipp::N<int16_t>()) * mipp::N<int16_t>();\n+ constexpr auto stride = std::numeric_limits<int16_t>::max() * mipp::N<int16_t>();\nfor (unsigned ii = 0; ii < vec_loop_size; ii += stride)\n{\n- mipp::Reg<int8_t> counter8 = (int8_t)0;\n+ mipp::Reg<int16_t> counter16 = (int16_t)0;\nconst auto vec_loop_size2 = std::min(vec_loop_size, ii + stride);\n- for (unsigned i = ii; i < vec_loop_size2; i += mipp::N<int8_t>())\n- counter8 += popcnt<int8_t>(in1 + i, in2 + i);\n-\n- const auto low = mipp::cvt<int8_t,int16_t>(counter8.low());\n- counter32 += mipp::cvt<int16_t,int32_t>(low.low ());\n- counter32 += mipp::cvt<int16_t,int32_t>(low.high());\n+ for (unsigned i = ii; i < vec_loop_size2; i += mipp::N<int16_t>())\n+ counter16 += Fpopcnt::apply(in + i);\n- const auto high = mipp::cvt<int8_t,int16_t>(counter8.high());\n- counter32 += mipp::cvt<int16_t,int32_t>(high.low ());\n- counter32 += mipp::cvt<int16_t,int32_t>(high.high());\n+ counter32 += mipp::cvt<int16_t,int32_t>(counter16.low ());\n+ counter32 += mipp::cvt<int16_t,int32_t>(counter16.high());\n}\n- size_t ham_dist = (size_t)mipp::hadd(counter32);\n-\n+ auto ham_dist = (size_t)mipp::hadd(counter32);\n#else\nconst auto vec_loop_size = 0;\nsize_t ham_dist = 0;\n#endif\n- ham_dist += tools::hamming_distance_seq<int8_t>(in1 + vec_loop_size, in2 + vec_loop_size, size - vec_loop_size);\n+ ham_dist += aff3ct::tools::hamming_distance_seq<int16_t>(in + vec_loop_size, size - vec_loop_size);\nreturn ham_dist;\n}\n+};\n-template <>\n-size_t hamming_distance<int16_t>(const int16_t *in, const unsigned size)\n+template <class Fpopcnt>\n+struct Hamming_distance<int8_t, Fpopcnt>\n+{\n+ static inline size_t apply(const int8_t *in1, const int8_t *in2, const unsigned size)\n{\n#ifdef MIPP_BW\n+ const mipp::Reg<int8_t> zeros = (int8_t)0, ones = (int8_t)1;\nmipp::Reg<int32_t> counter32 = (int32_t)0;\n- const auto vec_loop_size = mipp::N<int16_t>() < 2 ? 0 : (size / mipp::N<int16_t>()) * mipp::N<int16_t>();\n- constexpr auto stride = std::numeric_limits<int16_t>::max() * mipp::N<int16_t>();\n+ const auto vec_loop_size = mipp::N<int8_t>() < 4 ? 0 : (size / mipp::N<int8_t>()) * mipp::N<int8_t>();\n+ constexpr auto stride = std::numeric_limits<int8_t>::max() * mipp::N<int8_t>();\nfor (unsigned ii = 0; ii < vec_loop_size; ii += stride)\n{\n- mipp::Reg<int16_t> counter16 = (int16_t)0;\n+ mipp::Reg<int8_t> counter8 = (int8_t)0;\nconst auto vec_loop_size2 = std::min(vec_loop_size, ii + stride);\n- for (unsigned i = ii; i < vec_loop_size2; i += mipp::N<int16_t>())\n- counter16 += popcnt<int16_t>(in + i);\n+ for (unsigned i = ii; i < vec_loop_size2; i += mipp::N<int8_t>())\n+ counter8 += Fpopcnt::apply(in1 + i, in2 + i);\n- counter32 += mipp::cvt<int16_t,int32_t>(counter16.low ());\n- counter32 += mipp::cvt<int16_t,int32_t>(counter16.high());\n+ const auto low = mipp::cvt<int8_t,int16_t>(counter8.low());\n+ counter32 += mipp::cvt<int16_t,int32_t>(low.low ());\n+ counter32 += mipp::cvt<int16_t,int32_t>(low.high());\n+\n+ const auto high = mipp::cvt<int8_t,int16_t>(counter8.high());\n+ counter32 += mipp::cvt<int16_t,int32_t>(high.low ());\n+ counter32 += mipp::cvt<int16_t,int32_t>(high.high());\n}\n- size_t ham_dist = (size_t)mipp::hadd(counter32);\n+ auto ham_dist = (size_t)mipp::hadd(counter32);\n+\n#else\nconst auto vec_loop_size = 0;\nsize_t ham_dist = 0;\n#endif\n- ham_dist += tools::hamming_distance_seq<int16_t>(in + vec_loop_size, size - vec_loop_size);\n+ ham_dist += aff3ct::tools::hamming_distance_seq<int8_t>(in1 + vec_loop_size, in2 + vec_loop_size, size - vec_loop_size);\nreturn ham_dist;\n}\n-template <>\n-size_t hamming_distance<int8_t>(const int8_t *in, const unsigned size)\n+ static inline size_t apply(const int8_t *in, const unsigned size)\n{\n#ifdef MIPP_BW\nconst mipp::Reg<int8_t> zeros = (int8_t)0, ones = (int8_t)1;\n@@ -317,7 +491,7 @@ size_t hamming_distance<int8_t>(const int8_t *in, const unsigned size)\nmipp::Reg<int8_t> counter8 = (int8_t)0;\nconst auto vec_loop_size2 = std::min(vec_loop_size, ii + stride);\nfor (unsigned i = ii; i < vec_loop_size2; i += mipp::N<int8_t>())\n- counter8 += popcnt<int8_t>(in + i);\n+ counter8 += Fpopcnt::apply(in + i);\nconst auto low = mipp::cvt<int8_t,int16_t>(counter8.low());\ncounter32 += mipp::cvt<int16_t,int32_t>(low.low ());\n@@ -328,20 +502,46 @@ size_t hamming_distance<int8_t>(const int8_t *in, const unsigned size)\ncounter32 += mipp::cvt<int16_t,int32_t>(high.high());\n}\n- size_t ham_dist = (size_t)mipp::hadd(counter32);\n+ auto ham_dist = (size_t)mipp::hadd(counter32);\n#else\nconst auto vec_loop_size = 0;\nsize_t ham_dist = 0;\n#endif\n- ham_dist += tools::hamming_distance_seq<int8_t>(in + vec_loop_size, size - vec_loop_size);\n+ ham_dist += aff3ct::tools::hamming_distance_seq<int8_t>(in + vec_loop_size, size - vec_loop_size);\nreturn ham_dist;\n}\n+};\n+\n+\n+template <typename B>\n+size_t aff3ct::tools::hamming_distance(const B *in1, const B *in2, const unsigned size)\n+{\n+ return Hamming_distance<B,Popcnt<B,false>>::apply(in1, in2, size);\n}\n+\n+template <typename B>\n+size_t aff3ct::tools::hamming_distance(const B *in, const unsigned size)\n+{\n+ return Hamming_distance<B,Popcnt<B,false>>::apply(in, size);\n}\n+template <typename B>\n+size_t aff3ct::tools::hamming_distance_unk(const B *in1, const B *in2, const unsigned size)\n+{\n+ return Hamming_distance<B,Popcnt<B,true>>::apply(in1, in2, size);\n+}\n+\n+template <typename B>\n+size_t aff3ct::tools::hamming_distance_unk(const B *in, const unsigned size)\n+{\n+ return Hamming_distance<B,Popcnt<B,true>>::apply(in, size);\n+}\n+\n+\n+\n#endif // #ifdef MIPP_AVX\n// ==================================================================================== explicit template instantiation\n@@ -351,33 +551,55 @@ template size_t aff3ct::tools::hamming_distance<B_8 >(const B_8*, const B_8*, c\ntemplate size_t aff3ct::tools::hamming_distance<B_16>(const B_16*, const B_16*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<B_32>(const B_32*, const B_32*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<B_64>(const B_64*, const B_64*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_8 >(const B_8*, const B_8*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_16>(const B_16*, const B_16*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_32>(const B_32*, const B_32*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_64>(const B_64*, const B_64*, const unsigned);\n#else\ntemplate size_t aff3ct::tools::hamming_distance<B>(const B*, const B*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B>(const B*, const B*, const unsigned);\n#endif\ntemplate size_t aff3ct::tools::hamming_distance<float>(const float*, const float*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<double>(const double*, const double*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<float>(const float*, const float*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<double>(const double*, const double*, const unsigned);\n+\n#ifdef MULTI_PREC\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_8 >(const B_8*, const B_8*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_16>(const B_16*, const B_16*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_32>(const B_32*, const B_32*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_64>(const B_64*, const B_64*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_8 >(const B_8*, const B_8*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_16>(const B_16*, const B_16*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_32>(const B_32*, const B_32*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_64>(const B_64*, const B_64*, const unsigned);\n#else\ntemplate size_t aff3ct::tools::hamming_distance_seq<B>(const B*, const B*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B>(const B*, const B*, const unsigned);\n#endif\ntemplate size_t aff3ct::tools::hamming_distance_seq<float>(const float*, const float*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<double>(const double*, const double*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<float>(const float*, const float*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<double>(const double*, const double*, const unsigned);\n#ifdef MULTI_PREC\ntemplate size_t aff3ct::tools::hamming_distance<B_8 >(const B_8*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<B_16>(const B_16*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<B_32>(const B_32*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<B_64>(const B_64*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_8 >(const B_8*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_16>(const B_16*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_32>(const B_32*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B_64>(const B_64*, const unsigned);\n#else\ntemplate size_t aff3ct::tools::hamming_distance<B>(const B*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<B>(const B*, const unsigned);\n#endif\ntemplate size_t aff3ct::tools::hamming_distance<float>(const float*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance<double>(const double*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<float>(const float*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk<double>(const double*, const unsigned);\n#ifdef MULTI_PREC\n@@ -385,11 +607,18 @@ template size_t aff3ct::tools::hamming_distance_seq<B_8 >(const B_8*, const uns\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_16>(const B_16*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_32>(const B_32*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<B_64>(const B_64*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_8 >(const B_8*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_16>(const B_16*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_32>(const B_32*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B_64>(const B_64*, const unsigned);\n#else\n-template size_t aff3ct::tools::hamming_distance_seq<B>(const B*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B>(const B*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<B>(const B*, const unsigned);\n#endif\ntemplate size_t aff3ct::tools::hamming_distance_seq<float>(const float*, const unsigned);\ntemplate size_t aff3ct::tools::hamming_distance_seq<double>(const double*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<float>(const float*, const unsigned);\n+template size_t aff3ct::tools::hamming_distance_unk_seq<double>(const double*, const unsigned);\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Perf/common/hamming_distance.h", "new_path": "src/Tools/Perf/common/hamming_distance.h", "diff": "@@ -36,6 +36,43 @@ size_t hamming_distance_seq(const B *in, const unsigned size);\n*/\ntemplate <typename B = int32_t>\nsize_t hamming_distance(const B *in, const unsigned size);\n+\n+\n+\n+\n+/*\n+ * compute the Hamming distance between the arrays 'in1' and 'in2' of length 'size'\n+ * when B is a floating point type then compute the hamming distance from their sign\n+ * Check if 'in' values are unknown symbol (tools::is_unknown_symbol<B>(in[i])) and then count as different\n+ */\n+template <typename B = int32_t>\n+size_t hamming_distance_unk_seq(const B *in1, const B *in2, const unsigned size);\n+\n+/*\n+ * compute the Hamming distance between the arrays 'in1' and 'in2' of length 'size'\n+ * Operations are optimized with MIPP except for AVX architecture that call hamming_distance_seq.\n+ * when B is a floating point type then compute the hamming distance from their sign\n+ * Check if 'in' values are unknown symbol (tools::is_unknown_symbol<B>(in[i])) and then count as different\n+ */\n+template <typename B = int32_t>\n+size_t hamming_distance_unk(const B *in1, const B *in2, const unsigned size);\n+\n+/*\n+ * compute the Hamming distance between the arrays 'in' and a all zero word of length 'size'\n+ * when B is a floating point type then compute the hamming distance from the sign\n+ * Check if 'in' values are unknown symbol (tools::is_unknown_symbol<B>(in[i])) and then count as different\n+ */\n+template <typename B = int32_t>\n+size_t hamming_distance_unk_seq(const B *in, const unsigned size);\n+\n+/*\n+ * compute the Hamming distance between the arrays 'in' and a all zero word of length 'size'\n+ * Operations are optimized with MIPP except for AVX architecture that call hamming_distance_seq.\n+ * when B is a floating point type then compute the hamming distance from the sign\n+ * Check if 'in' values are unknown symbol (tools::is_unknown_symbol<B>(in[i])) and then count as different\n+ */\n+template <typename B = int32_t>\n+size_t hamming_distance_unk(const B *in, const unsigned size);\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Split hamming distance computation functions into ones that count that take into account the unknown symbols as false (noise EP) and those that don't
8,483
18.05.2018 09:10:43
-7,200
a9e57ca043392e39de714b7759a856082d32c01b
Fix simple precision compilation error in Monitor factory
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -130,7 +130,7 @@ template aff3ct::module::Monitor_BFER<B_16,R_16>* aff3ct::factory::Monitor_BFER:\ntemplate aff3ct::module::Monitor_BFER<B_32,R_32>* aff3ct::factory::Monitor_BFER::build<B_32,R_32>(const aff3ct::factory::Monitor_BFER::parameters&, bool);\ntemplate aff3ct::module::Monitor_BFER<B_64,R_64>* aff3ct::factory::Monitor_BFER::build<B_64,R_64>(const aff3ct::factory::Monitor_BFER::parameters&, bool);\n#else\n-template aff3ct::module::Monitor_BFER<B,R>* aff3ct::factory::Monitor_BFER::parameters::build<B,R>() const;\n-template aff3ct::module::Monitor_BFER<B,R>* aff3ct::factory::Monitor_BFER::build<B,R>(const aff3ct::factory::Monitor_BFER::parameters&);\n+template aff3ct::module::Monitor_BFER<B,R>* aff3ct::factory::Monitor_BFER::parameters::build<B,R>(bool) const;\n+template aff3ct::module::Monitor_BFER<B,R>* aff3ct::factory::Monitor_BFER::build<B,R>(const aff3ct::factory::Monitor_BFER::parameters&, bool);\n#endif\n// ==================================================================================== explicit template instantiation\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix simple precision compilation error in Monitor factory
8,490
18.05.2018 11:22:27
-7,200
12920b8dc126e8feb80f6bfdedefd6e1f3d49bdc
Update refs + improve the regression script display.
[ { "change_type": "MODIFY", "old_path": "ci/test-regression.py", "new_path": "ci/test-regression.py", "diff": "@@ -369,22 +369,21 @@ class compStats:\nmessage += \"----\" + d.name.rjust(7) + \" \"\nmessage += \"| [\" + (format_e(d.tableCur[0])).rjust(10) + \",\" + (format_e(d.tableCur[len(d.tableCur) -1])).rjust(10) + \"] \"\nmessage += \"| \" + (str(d.valid) + \"/\" + str(d.nData)).rjust(12) + \" \"\n- message += \"| [ \" + (\"%.3f\" % d.avgSensibility + \", %.2f\" % d.minSensibility + \", %.2f\" % d.maxSensibility + \", \" + (\"%.2f\" % d.rateSensibility).rjust(6) + \"%\") + \" ] \"\n+ message += \"| [ \" + (\"%.2f\" % d.avgSensibility + \", %.2f\" % d.minSensibility + \", %.2f\" % d.maxSensibility + \", \" + (\"%.2f\" % d.rateSensibility).rjust(6) + \"%\") + \" ] \"\nmessage += \"\\n\"\nif self.hasError():\n- message += \"---- -------|----------------------------------------------------------------------- \\n\"\n+ message += \"---- -------|------------------------------------------------------------------------- \\n\"\nmessage += \"---- name | errors list {noise: new -> ref} \\n\"\n- message += \"---- -------|----------------------------------------------------------------------- \\n\"\n+ message += \"---- -------|------------------------------------------------------------------------- \\n\"\nfor d in self.dataList:\nif d.hasError():\nmessage += \"----\" + d.name.rjust(7) + \" | \"\nel = 0\nfor e in d.errorsList:\n- if el != 0 and (el % 3) == 0 :\n+ if el != 0 and (el % 2) == 0 :\nmessage += \"\\n---- | \"\n-\nmessage += \"{\" + format_e(self.dataCur.Noise[d.errorsPos[el]]) + \": \" + format_e(e[0]) + \" -> \" + format_e(e[1]) + \"}\"\nel += 1\n" }, { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 609c05a759602b69096a53f5f8d47308e43e0189\n+Subproject commit 1c395931d199ebafd89e699911da2468f2036b3e\n" } ]
C++
MIT License
aff3ct/aff3ct
Update refs + improve the regression script display.
8,490
18.05.2018 14:00:46
-7,200
7dc07f362100abe551b7f5e25ab2a8e053555cbb
Add missing implementations in headers.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Quantizer/Quantizer.cpp", "new_path": "src/Factory/Module/Quantizer/Quantizer.cpp", "diff": "@@ -100,6 +100,7 @@ void Quantizer::parameters\nquantif = \"{\"+std::to_string(this->n_bits)+\", \"+std::to_string(this->n_decimals)+\"}\";\nheaders[p].push_back(std::make_pair(\"Type\", this->type));\n+ headers[p].push_back(std::make_pair(\"Implementation\", this->implem));\nif (full) headers[p].push_back(std::make_pair(\"Frame size (N)\", std::to_string(this->size)));\nif (full) headers[p].push_back(std::make_pair(\"Inter frame level\", std::to_string(this->n_frames)));\nheaders[p].push_back(std::make_pair(\"Fixed-point config.\", quantif));\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Source/Source.cpp", "new_path": "src/Factory/Module/Source/Source.cpp", "diff": "@@ -86,11 +86,12 @@ void Source::parameters\nauto p = this->get_prefix();\nheaders[p].push_back(std::make_pair(\"Type\", this->type));\n+ headers[p].push_back(std::make_pair(\"Implementation\", this->implem));\nheaders[p].push_back(std::make_pair(\"Info. bits (K_info)\", std::to_string(this->K)));\nif (full) headers[p].push_back(std::make_pair(\"Inter frame level\", std::to_string(this->n_frames)));\nif (this->type == \"USER\")\nheaders[p].push_back(std::make_pair(\"Path\", this->path));\n- if ((this->type == \"RAND\" || this->type == \"RAND_FAST\") && full)\n+ if (this->type == \"RAND\" && full)\nheaders[p].push_back(std::make_pair(\"Seed\", std::to_string(this->seed)));\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Add missing implementations in headers.
8,490
18.05.2018 14:01:09
-7,200
7f2392d0a50261daab5ebaab7cc6b9493f7bb64c
Put back 'Trace:' when --sim-pyber.
[ { "change_type": "MODIFY", "old_path": "src/Launcher/Launcher.cpp", "new_path": "src/Launcher/Launcher.cpp", "diff": "@@ -157,6 +157,7 @@ int Launcher::launch()\nstream << cmd_line << std::endl;\nstream << \"Curve name:\" << std::endl;\nstream << this->params_common.pyber << std::endl;\n+ stream << \"Trace:\" << std::endl;\n}\nif (this->params_common.display_legend)\n" } ]
C++
MIT License
aff3ct/aff3ct
Put back 'Trace:' when --sim-pyber.
8,483
22.05.2018 09:54:10
-7,200
87ec91fd94146f8cb2b3d9b653eebe70bddfe055
Rename Encoder SeIRA to IRA
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Encoder/LDPC/Encoder_LDPC.cpp", "new_path": "src/Factory/Module/Encoder/LDPC/Encoder_LDPC.cpp", "diff": "#include \"Module/Encoder/LDPC/Encoder_LDPC.hpp\"\n#include \"Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp\"\n#include \"Module/Encoder/LDPC/From_QC/Encoder_LDPC_from_QC.hpp\"\n-#include \"Module/Encoder/LDPC/From_SeIRA/Encoder_LDPC_from_SeIRA.hpp\"\n+#include \"Module/Encoder/LDPC/From_IRA/Encoder_LDPC_from_IRA.hpp\"\n#include \"Module/Encoder/LDPC/DVBS2/Encoder_LDPC_DVBS2.hpp\"\n#include \"Encoder_LDPC.hpp\"\n@@ -40,7 +40,7 @@ void Encoder_LDPC::parameters\nauto p = this->get_prefix();\n- tools::add_options(args.at({p+\"-type\"}), 0, \"LDPC\", \"LDPC_H\", \"LDPC_DVBS2\", \"LDPC_QC\", \"LDPC_SEIRA\");\n+ tools::add_options(args.at({p+\"-type\"}), 0, \"LDPC\", \"LDPC_H\", \"LDPC_DVBS2\", \"LDPC_QC\", \"LDPC_IRA\");\nargs.add(\n{p+\"-h-path\"},\n@@ -113,7 +113,7 @@ module::Encoder_LDPC<B>* Encoder_LDPC::parameters\nif (this->type == \"LDPC\" ) return new module::Encoder_LDPC <B>(this->K, this->N_cw, G, this->n_frames);\nelse if (this->type == \"LDPC_H\" ) return new module::Encoder_LDPC_from_H <B>(this->K, this->N_cw, H, this->n_frames);\nelse if (this->type == \"LDPC_QC\" ) return new module::Encoder_LDPC_from_QC <B>(this->K, this->N_cw, H, this->n_frames);\n- else if (this->type == \"LDPC_SEIRA\") return new module::Encoder_LDPC_from_SeIRA<B>(this->K, this->N_cw, H, this->n_frames);\n+ else if (this->type == \"LDPC_IRA\") return new module::Encoder_LDPC_from_IRA<B>(this->K, this->N_cw, H, this->n_frames);\nelse if (this->type == \"LDPC_DVBS2\" && dvbs2 != nullptr)\nreturn new module::Encoder_LDPC_DVBS2 <B>(*dvbs2, this->n_frames);\n" }, { "change_type": "RENAME", "old_path": "src/Module/Encoder/LDPC/From_SeIRA/Encoder_LDPC_from_SeIRA.cpp", "new_path": "src/Module/Encoder/LDPC/From_IRA/Encoder_LDPC_from_IRA.cpp", "diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/matrix.h\"\n-#include \"Encoder_LDPC_from_SeIRA.hpp\"\n+#include \"Encoder_LDPC_from_IRA.hpp\"\nusing namespace aff3ct;\nusing namespace aff3ct::module;\ntemplate <typename B>\n-Encoder_LDPC_from_SeIRA<B>\n-::Encoder_LDPC_from_SeIRA(const int K, const int N, const tools::Sparse_matrix &_H, const int n_frames)\n+Encoder_LDPC_from_IRA<B>\n+::Encoder_LDPC_from_IRA(const int K, const int N, const tools::Sparse_matrix &_H, const int n_frames)\n: Encoder_LDPC<B>(K, N, n_frames)\n{\n- const std::string name = \"Encoder_LDPC_from_SeIRA\";\n+ const std::string name = \"Encoder_LDPC_from_IRA\";\nthis->set_name(name);\nthis->H = _H;\n@@ -26,7 +26,7 @@ Encoder_LDPC_from_SeIRA<B>\n}\ntemplate <typename B>\n-void Encoder_LDPC_from_SeIRA<B>\n+void Encoder_LDPC_from_IRA<B>\n::_encode(const B *U_K, B *X_N, const int frame_id)\n{\nint M = this->N - this->K;\n@@ -55,21 +55,21 @@ void Encoder_LDPC_from_SeIRA<B>\n}\ntemplate <typename B>\n-const std::vector<uint32_t>& Encoder_LDPC_from_SeIRA<B>\n+const std::vector<uint32_t>& Encoder_LDPC_from_IRA<B>\n::get_info_bits_pos() const\n{\nreturn Encoder<B>::get_info_bits_pos();\n}\ntemplate <typename B>\n-bool Encoder_LDPC_from_SeIRA<B>\n+bool Encoder_LDPC_from_IRA<B>\n::is_sys() const\n{\nreturn Encoder<B>::is_sys();\n}\ntemplate <typename B>\n-void Encoder_LDPC_from_SeIRA<B>\n+void Encoder_LDPC_from_IRA<B>\n::_check_H_dimensions()\n{\nEncoder_LDPC<B>::_check_H_dimensions();\n@@ -86,11 +86,11 @@ void Encoder_LDPC_from_SeIRA<B>\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n-template class aff3ct::module::Encoder_LDPC_from_SeIRA<B_8>;\n-template class aff3ct::module::Encoder_LDPC_from_SeIRA<B_16>;\n-template class aff3ct::module::Encoder_LDPC_from_SeIRA<B_32>;\n-template class aff3ct::module::Encoder_LDPC_from_SeIRA<B_64>;\n+template class aff3ct::module::Encoder_LDPC_from_IRA<B_8>;\n+template class aff3ct::module::Encoder_LDPC_from_IRA<B_16>;\n+template class aff3ct::module::Encoder_LDPC_from_IRA<B_32>;\n+template class aff3ct::module::Encoder_LDPC_from_IRA<B_64>;\n#else\n-template class aff3ct::module::Encoder_LDPC_from_SeIRA<B>;\n+template class aff3ct::module::Encoder_LDPC_from_IRA<B>;\n#endif\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "RENAME", "old_path": "src/Module/Encoder/LDPC/From_SeIRA/Encoder_LDPC_from_SeIRA.hpp", "new_path": "src/Module/Encoder/LDPC/From_IRA/Encoder_LDPC_from_IRA.hpp", "diff": "-#ifndef ENCODER_LDPC_FROM_SEIRA_HPP_\n-#define ENCODER_LDPC_FROM_SEIRA_HPP_\n+#ifndef ENCODER_LDPC_FROM_IRA_HPP_\n+#define ENCODER_LDPC_FROM_IRA_HPP_\n#include <vector>\n@@ -14,11 +14,11 @@ namespace module\n{\ntemplate <typename B = int>\n-class Encoder_LDPC_from_SeIRA : public Encoder_LDPC<B>\n+class Encoder_LDPC_from_IRA : public Encoder_LDPC<B>\n{\npublic:\n- Encoder_LDPC_from_SeIRA(const int K, const int N, const tools::Sparse_matrix &H, const int n_frames = 1);\n- virtual ~Encoder_LDPC_from_SeIRA() = default;\n+ Encoder_LDPC_from_IRA(const int K, const int N, const tools::Sparse_matrix &H, const int n_frames = 1);\n+ virtual ~Encoder_LDPC_from_IRA() = default;\nconst std::vector<uint32_t>& get_info_bits_pos() const;\n@@ -32,4 +32,4 @@ protected:\n}\n}\n-#endif /* ENCODER_LDPC_FROM_SEIRA_HPP_ */\n+#endif /* ENCODER_LDPC_FROM_IRA_HPP_ */\n" }, { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#include <Module/Encoder/LDPC/DVBS2/Encoder_LDPC_DVBS2.hpp>\n#include <Module/Encoder/LDPC/Encoder_LDPC.hpp>\n#include <Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp>\n+#include <Module/Encoder/LDPC/From_IRA/Encoder_LDPC_from_IRA.hpp>\n#include <Module/Encoder/LDPC/From_QC/Encoder_LDPC_from_QC.hpp>\n-#include <Module/Encoder/LDPC/From_SeIRA/Encoder_LDPC_from_SeIRA.hpp>\n#include <Module/Encoder/NO/Encoder_NO.hpp>\n#include <Module/Encoder/Polar/Encoder_polar.hpp>\n#include <Module/Encoder/Polar/Encoder_polar_sys.hpp>\n" } ]
C++
MIT License
aff3ct/aff3ct
Rename Encoder SeIRA to IRA
8,483
22.05.2018 11:12:26
-7,200
b42cb65f7fe45daf27f6f9b2c40a5c9b4e6ed7da
Exception message cosmetics
[ { "change_type": "MODIFY", "old_path": "src/Tools/Noise/Noise.cpp", "new_path": "src/Tools/Noise/Noise.cpp", "diff": "@@ -159,7 +159,8 @@ void Noise<R>\nif (!is_of_type(t))\n{\nstd::stringstream message;\n- message << \"The given noise value does not represent a '\" << type2str(get_type()) << \"' noise type.\";\n+ message << \"This noise type ('\" << type2str(get_type()) << \"') is not same as the given checked one ('\"\n+ << type2str(t) << \"').\";\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Exception message cosmetics
8,483
22.05.2018 11:29:04
-7,200
e5396fd086b6cf60464a87c63bc1b0a9c022017b
Fix the execution counter 'n_calls' in Task in fast mode
[ { "change_type": "MODIFY", "old_path": "src/Module/Task.cpp", "new_path": "src/Module/Task.cpp", "diff": "@@ -182,7 +182,11 @@ static inline void display_data(const T *data,\nint Task::exec()\n{\nif (fast)\n- return this->codelet();\n+ {\n+ auto exec_status = this->codelet();\n+ this->n_calls++;\n+ return exec_status;\n+ }\nif (can_exec())\n{\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the execution counter 'n_calls' in Task in fast mode
8,483
23.05.2018 14:20:00
-7,200
ade43af651e91d26d7ec56cc09474a7b3a4c2455
Remove compilation warnings from Update_rule_LSPA's and Update_rule_SPA's asserts
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/LDPC/Update_rule/LSPA/Update_rule_LSPA.hpp", "new_path": "src/Tools/Code/LDPC/Update_rule/LSPA/Update_rule_LSPA.hpp", "diff": "@@ -59,7 +59,7 @@ public:\n// incoming values from the variable nodes into the check nodes\ninline void begin_chk_node_in(const int chk_id, const int chk_degree)\n{\n- assert(chk_degree <= values.size());\n+ assert(chk_degree <= (int)values.size());\nthis->sign = 0;\nthis->sum = 0;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/LDPC/Update_rule/SPA/Update_rule_SPA.hpp", "new_path": "src/Tools/Code/LDPC/Update_rule/SPA/Update_rule_SPA.hpp", "diff": "@@ -59,7 +59,7 @@ public:\n// incoming values from the variable nodes into the check nodes\ninline void begin_chk_node_in(const int chk_id, const int chk_degree)\n{\n- assert(chk_degree <= values.size());\n+ assert(chk_degree <= (int)values.size());\nthis->sign = 0;\nthis->product = 1;\n" } ]
C++
MIT License
aff3ct/aff3ct
Remove compilation warnings from Update_rule_LSPA's and Update_rule_SPA's asserts
8,483
23.05.2018 14:23:33
-7,200
badac916c674b38bb316d106f27ae0ffff890db3
Make the BER FER colonnes deactivable when displaying legends and reports
[ { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "new_path": "src/Factory/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "diff": "@@ -58,32 +58,32 @@ void Terminal_BFER::parameters\ntemplate <typename B, typename R>\ntools::Terminal_BFER<B,R>* Terminal_BFER::parameters\n-::build(const module::Monitor_BFER<B,R> &monitor, const bool display_mutinfo) const\n+::build(const module::Monitor_BFER<B,R> &monitor, bool display_mutinfo, bool display_bfer) const\n{\n- if (this->type == \"STD\") return new tools::Terminal_BFER<B,R>(monitor, display_mutinfo);\n+ if (this->type == \"STD\") return new tools::Terminal_BFER<B,R>(monitor, display_mutinfo, display_bfer);\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n}\ntemplate <typename B, typename R>\ntools::Terminal_BFER<B,R>* Terminal_BFER\n-::build(const parameters &params, const module::Monitor_BFER<B,R> &monitor, const bool display_mutinfo)\n+::build(const parameters &params, const module::Monitor_BFER<B,R> &monitor, bool display_mutinfo, bool display_bfer)\n{\n- return params.template build<B,R>(monitor, display_mutinfo);\n+ return params.template build<B,R>(monitor, display_mutinfo, display_bfer);\n}\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n-template aff3ct::tools::Terminal_BFER<B_8 ,R_8 >* aff3ct::factory::Terminal_BFER::parameters::build<B_8 ,R_8 >(const aff3ct::module::Monitor_BFER<B_8 ,R_8 >&, const bool) const;\n-template aff3ct::tools::Terminal_BFER<B_16,R_16>* aff3ct::factory::Terminal_BFER::parameters::build<B_16,R_16>(const aff3ct::module::Monitor_BFER<B_16,R_16>&, const bool) const;\n-template aff3ct::tools::Terminal_BFER<B_32,R_32>* aff3ct::factory::Terminal_BFER::parameters::build<B_32,R_32>(const aff3ct::module::Monitor_BFER<B_32,R_32>&, const bool) const;\n-template aff3ct::tools::Terminal_BFER<B_64,R_64>* aff3ct::factory::Terminal_BFER::parameters::build<B_64,R_64>(const aff3ct::module::Monitor_BFER<B_64,R_64>&, const bool) const;\n-template aff3ct::tools::Terminal_BFER<B_8 ,R_8 >* aff3ct::factory::Terminal_BFER::build<B_8 ,R_8 >(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_8 ,R_8 >&, const bool);\n-template aff3ct::tools::Terminal_BFER<B_16,R_16>* aff3ct::factory::Terminal_BFER::build<B_16,R_16>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_16,R_16>&, const bool);\n-template aff3ct::tools::Terminal_BFER<B_32,R_32>* aff3ct::factory::Terminal_BFER::build<B_32,R_32>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_32,R_32>&, const bool);\n-template aff3ct::tools::Terminal_BFER<B_64,R_64>* aff3ct::factory::Terminal_BFER::build<B_64,R_64>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_64,R_64>&, const bool);\n+template aff3ct::tools::Terminal_BFER<B_8 ,R_8 >* aff3ct::factory::Terminal_BFER::parameters::build<B_8 ,R_8 >(const aff3ct::module::Monitor_BFER<B_8 ,R_8 >&, bool, bool) const;\n+template aff3ct::tools::Terminal_BFER<B_16,R_16>* aff3ct::factory::Terminal_BFER::parameters::build<B_16,R_16>(const aff3ct::module::Monitor_BFER<B_16,R_16>&, bool, bool) const;\n+template aff3ct::tools::Terminal_BFER<B_32,R_32>* aff3ct::factory::Terminal_BFER::parameters::build<B_32,R_32>(const aff3ct::module::Monitor_BFER<B_32,R_32>&, bool, bool) const;\n+template aff3ct::tools::Terminal_BFER<B_64,R_64>* aff3ct::factory::Terminal_BFER::parameters::build<B_64,R_64>(const aff3ct::module::Monitor_BFER<B_64,R_64>&, bool, bool) const;\n+template aff3ct::tools::Terminal_BFER<B_8 ,R_8 >* aff3ct::factory::Terminal_BFER::build<B_8 ,R_8 >(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_8 ,R_8 >&, bool, bool);\n+template aff3ct::tools::Terminal_BFER<B_16,R_16>* aff3ct::factory::Terminal_BFER::build<B_16,R_16>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_16,R_16>&, bool, bool);\n+template aff3ct::tools::Terminal_BFER<B_32,R_32>* aff3ct::factory::Terminal_BFER::build<B_32,R_32>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_32,R_32>&, bool, bool);\n+template aff3ct::tools::Terminal_BFER<B_64,R_64>* aff3ct::factory::Terminal_BFER::build<B_64,R_64>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B_64,R_64>&, bool, bool);\n#else\n-template aff3ct::tools::Terminal_BFER<B,R>* aff3ct::factory::Terminal_BFER::parameters::build<B,R>(const aff3ct::module::Monitor_BFER<B,R>&, const bool) const;\n-template aff3ct::tools::Terminal_BFER<B,R>* aff3ct::factory::Terminal_BFER::build<B,R>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B,R>&, const bool);\n+template aff3ct::tools::Terminal_BFER<B,R>* aff3ct::factory::Terminal_BFER::parameters::build<B,R>(const aff3ct::module::Monitor_BFER<B,R>&, bool, bool) const;\n+template aff3ct::tools::Terminal_BFER<B,R>* aff3ct::factory::Terminal_BFER::build<B,R>(const aff3ct::factory::Terminal_BFER::parameters&, const aff3ct::module::Monitor_BFER<B,R>&, bool, bool);\n#endif\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Display/Terminal/BFER/Terminal_BFER.hpp", "new_path": "src/Factory/Tools/Display/Terminal/BFER/Terminal_BFER.hpp", "diff": "@@ -37,12 +37,13 @@ struct Terminal_BFER : Terminal\n// builder\ntemplate <typename B = int, typename R = float>\n- tools::Terminal_BFER<B,R>* build(const module::Monitor_BFER<B,R> &monitor, const bool display_mutinfo) const;\n+ tools::Terminal_BFER<B,R>* build(const module::Monitor_BFER<B,R> &monitor,\n+ bool display_mutinfo, bool display_bfer) const;\n};\ntemplate <typename B = int, typename R = float>\nstatic tools::Terminal_BFER<B,R>* build(const parameters &params, const module::Monitor_BFER<B,R> &monitor,\n- const bool display_mutinfo);\n+ bool display_mutinfo, bool display_bfer);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -19,6 +19,7 @@ Monitor_BFER<B,R>\nn_bit_errors(0),\nn_frame_errors(0),\nn_analyzed_frames(0),\n+ n_MI_trials(0),\nMI_sum(0),\nerr_hist(0)\n{\n@@ -130,6 +131,7 @@ Q_32 Monitor_BFER<B_32,Q_32>\n{\nauto mi = tools::mutual_info_histo(X, Y, this->N);\nMI_sum += mi;\n+ n_MI_trials++;\nreturn mi;\n}\n}\n@@ -147,6 +149,7 @@ Q_64 Monitor_BFER<B_64,Q_64>\n{\nauto mi = tools::mutual_info_histo(X, Y, this->N);\nMI_sum += mi;\n+ n_MI_trials++;\nreturn mi;\n}\n}\n@@ -218,7 +221,7 @@ template <typename B, typename R>\nR Monitor_BFER<B,R>\n::get_MI() const\n{\n- return this->MI_sum / (R)this->n_analyzed_frames;\n+ return this->MI_sum / (R)this->n_MI_trials;\n}\ntemplate <typename B, typename R>\n@@ -259,6 +262,7 @@ void Monitor_BFER<B,R>\nthis->n_frame_errors = 0;\nthis->n_analyzed_frames = 0;\nthis->MI_sum = 0;\n+ this->n_MI_trials = 0;\nthis->err_hist.reset();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "diff": "@@ -27,6 +27,7 @@ protected:\nunsigned long long n_bit_errors;\nunsigned long long n_frame_errors;\nunsigned long long n_analyzed_frames;\n+ unsigned long long n_MI_trials;\nR MI_sum;\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -344,7 +344,7 @@ template <typename B, typename R, typename Q>\ntools::Terminal_BFER<B,R>* BFER<B,R,Q>\n::build_terminal()\n{\n- return factory::Terminal_BFER::build<B,R>(*params_BFER.ter, *this->monitor_red, params_BFER.mnt->mutinfo);\n+ return factory::Terminal_BFER::build<B,R>(*params_BFER.ter, *this->monitor_red, params_BFER.mnt->mutinfo, true);\n}\ntemplate <typename B, typename R, typename Q>\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "new_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "diff": "@@ -14,13 +14,14 @@ using namespace aff3ct::tools;\ntemplate <typename B, typename R>\nTerminal_BFER<B,R>\n-::Terminal_BFER(const module::Monitor_BFER<B,R> &monitor, bool display_mutinfo)\n+::Terminal_BFER(const module::Monitor_BFER<B,R> &monitor, bool display_mutinfo, bool display_bfer)\n: Terminal ( ),\nmonitor (monitor ),\nt_snr (std::chrono::steady_clock::now()),\nreal_time_state(0 ),\nn (nullptr ),\n- display_mutinfo(display_mutinfo )\n+ display_mutinfo(display_mutinfo ),\n+ display_bfer (display_bfer )\n{\n}\n@@ -95,11 +96,14 @@ void Terminal_BFER<B,R>\nbfer_cols.push_back(std::make_pair(\"MI\", \"\"));\n}\n+ if (display_bfer)\n+ {\nbfer_cols.push_back(std::make_pair(\"FRA\", \"\"));\nbfer_cols.push_back(std::make_pair(\"BE\", \"\"));\nbfer_cols.push_back(std::make_pair(\"FE\", \"\"));\nbfer_cols.push_back(std::make_pair(\"BER\", \"\"));\nbfer_cols.push_back(std::make_pair(\"FER\", \"\"));\n+ }\nthroughput_title = std::make_pair(\"Global throughput\", \"and elapsed time\");\nthroughput_cols.clear();\n@@ -184,9 +188,14 @@ void Terminal_BFER<B,R>\nif (display_mutinfo)\nstream << str_MI.str() << report_style << spaced_scol_separator << rang::style::reset;\n+\n+ if (display_bfer)\n+ {\nstream << setprecision((fra > l) ? 2 : 0) << ((fra > l) ? scientific : fixed) << setw(column_width - 1) << ((fra > l) ? (float) fra : fra) << report_style << spaced_scol_separator << rang::style::reset;\nstream << setprecision((be > l) ? 2 : 0) << ((be > l) ? scientific : fixed) << setw(column_width - 1) << ((be > l) ? (float) be : be ) << report_style << spaced_scol_separator << rang::style::reset;\nstream << setprecision((fe > l) ? 2 : 0) << ((fe > l) ? scientific : fixed) << setw(column_width - 1) << ((fe > l) ? (float) fe : fe ) << report_style << spaced_scol_separator << rang::style::reset;\n+ }\n+\nstream << str_ber.str() << report_style << spaced_scol_separator << rang::style::reset;\nstream << str_fer.str() << report_style << spaced_dcol_separator << rang::style::reset;\nstream << setprecision(2) << fixed << setw(column_width-1) << simu_cthr;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.hpp", "new_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.hpp", "diff": "@@ -22,9 +22,10 @@ protected:\nunsigned short real_time_state;\nNoise<float>* n;\nconst bool display_mutinfo;\n+ const bool display_bfer;\npublic:\n- explicit Terminal_BFER(const module::Monitor_BFER<B,R> &monitor, bool display_mutinfo = false);\n+ explicit Terminal_BFER(const module::Monitor_BFER<B,R> &monitor, bool display_mutinfo = false, bool display_bfer = true);\nvirtual ~Terminal_BFER();\n" } ]
C++
MIT License
aff3ct/aff3ct
Make the BER FER colonnes deactivable when displaying legends and reports
8,483
23.05.2018 16:11:47
-7,200
5b04ca0cc04577901a8f783441704d2514c7a6fd
Enhance Terminal to handle legend titles longer than the number of columns
[ { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "new_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "diff": "@@ -63,7 +63,17 @@ void Terminal_BFER<B,R>\nauto& throughput_title = this->cols_groups[1].first;\nauto& throughput_cols = this->cols_groups[1].second;\n- bfer_title = std::make_pair(\"Bit Error Rate (BER) and Frame Error Rate (FER)\", \"\");\n+ if (display_mutinfo)\n+ bfer_title.first = \"MutInfo (MI)\";\n+\n+ if (display_bfer)\n+ {\n+ if (!bfer_title.first.empty())\n+ bfer_title.first += \", \";\n+\n+ bfer_title.first += \"Bit Error Rate (BER) and Frame Error Rate (FER)\";\n+ }\n+\nbfer_cols.clear();\nif (this->n == nullptr)\n@@ -91,10 +101,7 @@ void Terminal_BFER<B,R>\n}\nif (display_mutinfo)\n- {\n- bfer_title.first = \"MutInfo (MI), \" + bfer_title.first;\nbfer_cols.push_back(std::make_pair(\"MI\", \"\"));\n- }\nif (display_bfer)\n{\n@@ -154,30 +161,30 @@ void Terminal_BFER<B,R>\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+ stream << std::string(extra_spaces(cols_groups[0]), ' ');\n+\nswitch (this->n->get_type())\n{\ncase Noise_type::SIGMA :\n{\nauto sig = dynamic_cast<const tools::Sigma<>*>(this->n);\n- stream << setprecision(2) << fixed << setw(column_width - 1) << sig->get_esn0() << report_style\n- << spaced_scol_separator << rang::style::reset;\n- stream << setprecision(2) << fixed << setw(column_width - 1) << sig->get_ebn0() << report_style\n- << spaced_scol_separator << rang::style::reset;\n+ stream << setprecision(2) << fixed << setw(column_width - 1) << sig->get_esn0() << report_style << spaced_scol_separator << rang::style::reset;\n+ stream << setprecision(2) << fixed << setw(column_width - 1) << sig->get_ebn0();\nbreak;\n}\ncase Noise_type::ROP :\n{\n- stream << setprecision(2) << fixed << setw(column_width - 1) << this->n->get_noise() << report_style\n- << spaced_scol_separator << rang::style::reset;\n+ stream << setprecision(2) << fixed << setw(column_width - 1) << this->n->get_noise();;\nbreak;\n}\ncase Noise_type::EP :\n{\n- stream << setprecision(4) << fixed << setw(column_width - 1) << this->n->get_noise() << report_style\n- << spaced_scol_separator << rang::style::reset;\n+ stream << setprecision(4) << fixed << setw(column_width - 1) << this->n->get_noise();;\nbreak;\n}\n}\n+ stream << report_style << ((display_bfer || display_mutinfo) ? spaced_scol_separator : spaced_dcol_separator) << rang::style::reset;\n+\nstringstream str_ber, str_fer, str_MI;\nstr_ber << setprecision(2) << scientific << setw(column_width-1) << ber;\n@@ -187,17 +194,19 @@ void Terminal_BFER<B,R>\nconst unsigned long long l = 99999999; // limit 0\nif (display_mutinfo)\n- stream << str_MI.str() << report_style << spaced_scol_separator << rang::style::reset;\n+ stream << str_MI.str() << report_style << (display_bfer ? spaced_scol_separator : spaced_dcol_separator) << rang::style::reset;\nif (display_bfer)\n{\nstream << setprecision((fra > l) ? 2 : 0) << ((fra > l) ? scientific : fixed) << setw(column_width - 1) << ((fra > l) ? (float) fra : fra) << report_style << spaced_scol_separator << rang::style::reset;\nstream << setprecision((be > l) ? 2 : 0) << ((be > l) ? scientific : fixed) << setw(column_width - 1) << ((be > l) ? (float) be : be ) << report_style << spaced_scol_separator << rang::style::reset;\nstream << setprecision((fe > l) ? 2 : 0) << ((fe > l) ? scientific : fixed) << setw(column_width - 1) << ((fe > l) ? (float) fe : fe ) << report_style << spaced_scol_separator << rang::style::reset;\n- }\nstream << str_ber.str() << report_style << spaced_scol_separator << rang::style::reset;\nstream << str_fer.str() << report_style << spaced_dcol_separator << rang::style::reset;\n+ }\n+\n+ stream << std::string(extra_spaces(cols_groups[1]), ' ');\nstream << setprecision(2) << fixed << setw(column_width-1) << simu_cthr;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/Terminal.cpp", "new_path": "src/Tools/Display/Terminal/Terminal.cpp", "diff": "+#include <cassert>\n#include \"Terminal.hpp\"\nusing namespace aff3ct;\nusing namespace aff3ct::tools;\n-const char aff3ct::tools::Terminal::col_separator = '|';\nconst char aff3ct::tools::Terminal::line_separator = '-';\n+const std::string aff3ct::tools::Terminal::col_separator = \"|\";\n+const std::string aff3ct::tools::Terminal::group_separator = \"||\" ;\nconst std::string aff3ct::tools::Terminal::spaced_scol_separator = \" |\" ;\nconst std::string aff3ct::tools::Terminal::spaced_dcol_separator = \" ||\";\nconst std::string aff3ct::tools::Terminal::data_tag = \" \";\n@@ -30,6 +32,26 @@ Terminal\nstop_temp_report(); // try to join the thread if this is not been done by the user\n}\n+// get extra spaces if text is too long for the given group width\n+unsigned Terminal\n+::extra_spaces(const title_t& text, const unsigned group_width)\n+{\n+ const unsigned longest_text = std::max(text.first.size(), text.second.size());\n+ return (longest_text > group_width) ? longest_text - group_width : 0;\n+}\n+\n+unsigned Terminal\n+::extra_spaces(const group_t& group)\n+{\n+ return extra_spaces(group.first, get_group_width(group));\n+}\n+\n+unsigned Terminal\n+::get_group_width(const group_t& group)\n+{\n+ return group.second.size() * (column_width + 1) -1; // add a col separator between each except for the last\n+}\n+\nvoid Terminal\n::legend(std::ostream &stream)\n{\n@@ -43,30 +65,36 @@ void Terminal\n// stream << \"# \" << \" (1.1) | (2.1) | (3.1) | (4.1) || (5.1) | (6.1) | (7.1) \" << std::endl; // line 6\n// stream << \"# \" << \" (1.2) | (2.2) | (3.2) | (4.2) || (5.2) | (6.2) | (7.2) \" << std::endl; // line 7\n// stream << \"# \" << \"----------|-----------|-----------|-----------||----------|----------|-----------\" << std::endl; // line 8\n- // indice (1.1) is \"cols_groups[0].second[0].first\"\n- // indice (1.2) is \"cols_groups[0].second[0].second\"\n- // indice (2.1) is \"cols_groups[0].second[1].first\"\n- // indice (2.2) is \"cols_groups[0].second[1].second\"\n- // indice (3.1) is \"cols_groups[0].second[2].first\"\n- // indice (3.2) is \"cols_groups[0].second[2].second\"\n- // indice (4.1) is \"cols_groups[0].second[3].first\"\n- // indice (4.2) is \"cols_groups[0].second[3].second\"\n- // indice (5.1) is \"cols_groups[1].second[0].first\"\n- // indice (5.2) is \"cols_groups[1].second[0].second\"\n- // indice (6.1) is \"cols_groups[1].second[1].first\"\n- // indice (6.2) is \"cols_groups[1].second[1].second\"\n- // indice (7.1) is \"cols_groups[1].second[2].first\"\n- // indice (7.2) is \"cols_groups[1].second[2].second\"\n+ // note (1.1) is \"cols_groups[0].second[0].first\"\n+ // note (1.2) is \"cols_groups[0].second[0].second\"\n+ // note (2.1) is \"cols_groups[0].second[1].first\"\n+ // note (2.2) is \"cols_groups[0].second[1].second\"\n+ // note (3.1) is \"cols_groups[0].second[2].first\"\n+ // note (3.2) is \"cols_groups[0].second[2].second\"\n+ // note (4.1) is \"cols_groups[0].second[3].first\"\n+ // note (4.2) is \"cols_groups[0].second[3].second\"\n+ // note (5.1) is \"cols_groups[1].second[0].first\"\n+ // note (5.2) is \"cols_groups[1].second[0].second\"\n+ // note (6.1) is \"cols_groups[1].second[1].first\"\n+ // note (6.2) is \"cols_groups[1].second[1].second\"\n+ // note (7.1) is \"cols_groups[1].second[2].first\"\n+ // note (7.2) is \"cols_groups[1].second[2].second\"\n+\n+ assert(!cols_groups.empty());\n// print line 1 of the table\nstream << rang::tag::comment;\nfor (unsigned i = 0; i < cols_groups.size(); i++)\n{\n- const unsigned group_width = cols_groups[i].second.size()*(column_width+1)-1; // add a col separator between each exept for the last\n- stream << legend_style << std::string(group_width, line_separator) << rang::style::reset ;\n+ assert(!cols_groups[i].second.empty());\n+\n+ const unsigned group_width = get_group_width(cols_groups[i]);\n+ const auto n_separators = group_width + extra_spaces(cols_groups[i].first, group_width);\n+\n+ stream << legend_style << std::string(n_separators, line_separator) << rang::style::reset ;\nif (i < (cols_groups.size() -1)) // print group separator except for last\n- stream << legend_style << std::string(2, col_separator) << rang::style::reset ;\n+ stream << legend_style << group_separator << rang::style::reset ;\n}\nstream << std::endl;\n@@ -78,16 +106,22 @@ void Terminal\n{\nconst auto& text = l == 0 ? cols_groups[i].first.first : cols_groups[i].first.second;\n- const unsigned group_width = cols_groups[i].second.size()*(column_width+1)-1; // add a col separator between each exept for the last\n- const int n_spaces = (int)group_width - (int)text.size();\n- const int n_spaces_left = n_spaces/2;\n- const int n_spaces_right = n_spaces - n_spaces_left; // can be different than n_spaces/2 if odd size\n+ const unsigned group_width = get_group_width(cols_groups[i]);\n+ int n_spaces = (int)group_width - (int)text.size();\n+\n+ if (text.size() != std::max(cols_groups[i].first.first.size(), cols_groups[i].first.second.size()))\n+ n_spaces += extra_spaces(cols_groups[i].first, group_width);\n+\n+\n+ const unsigned n_spaces_left = (n_spaces >= 0) ? (unsigned)n_spaces/2 : 0;\n+ const unsigned n_spaces_right = (n_spaces >= 0) ? n_spaces - n_spaces_left : 0;\n+\nstream << legend_style << std::string(n_spaces_left, ' ') << rang::style::reset;\nstream << legend_style << text << rang::style::reset;\nstream << legend_style << std::string(n_spaces_right, ' ') << rang::style::reset;\nif (i < (cols_groups.size() -1)) // print group separator except for last\n- stream << legend_style << std::string(2, col_separator) << rang::style::reset;\n+ stream << legend_style << group_separator << rang::style::reset;\n}\nstream << std::endl;\n}\n@@ -96,11 +130,13 @@ void Terminal\nstream << rang::tag::comment;\nfor (unsigned i = 0; i < cols_groups.size(); i++)\n{\n- const unsigned group_width = cols_groups[i].second.size()*(column_width+1)-1; // add a col separator between each exept for the last\n- stream << legend_style << std::string(group_width, line_separator) << rang::style::reset;\n+ const unsigned group_width = get_group_width(cols_groups[i]);\n+ const auto n_separators = group_width + extra_spaces(cols_groups[i].first, group_width);\n+\n+ stream << legend_style << std::string(n_separators, line_separator) << rang::style::reset;\nif (i < (cols_groups.size() -1)) // print group separator except for last\n- stream << legend_style << std::string(2, col_separator) << rang::style::reset;\n+ stream << legend_style << group_separator << rang::style::reset;\n}\nstream << std::endl;\n@@ -108,15 +144,22 @@ void Terminal\nstream << rang::tag::comment;\nfor (unsigned i = 0; i < cols_groups.size(); i++)\n{\n+ const unsigned group_width = get_group_width(cols_groups[i]);\n+ const auto n_extra = extra_spaces(cols_groups[i].first, group_width);\n+\nfor (unsigned j = 0; j < cols_groups[i].second.size(); j++)\n{\n- stream << legend_style << std::string(column_width, line_separator) << rang::style::reset;\n+ auto n_separators = column_width;\n+ if (j == 0)\n+ n_separators += n_extra;\n+\n+ stream << legend_style << std::string(n_separators, line_separator) << rang::style::reset;\nif (j < (cols_groups[i].second.size() -1)) // print column separator except for last\n- stream << legend_style << std::string(1, col_separator) << rang::style::reset;\n+ stream << legend_style << col_separator << rang::style::reset;\n}\nif (i < (cols_groups.size() -1)) // print group separator except for last\n- stream << legend_style << std::string(2, col_separator) << rang::style::reset;\n+ stream << legend_style << group_separator << rang::style::reset;\n}\nstream << std::endl;\n@@ -126,19 +169,28 @@ void Terminal\nstream << rang::tag::comment;\nfor (unsigned i = 0; i < cols_groups.size(); i++)\n{\n+ const unsigned group_width = get_group_width(cols_groups[i]);\n+ const auto n_extra = extra_spaces(cols_groups[i].first, group_width);\n+\nfor (unsigned j = 0; j < cols_groups[i].second.size(); j++)\n{\nconst auto& text = l == 0 ? cols_groups[i].second[j].first : cols_groups[i].second[j].second;\n- const int n_spaces = (int)column_width - (int)text.size() -1;\n+ int n_spaces = (int)column_width - (int)text.size() -1;\n+\n+ if (j == 0)\n+ n_spaces += n_extra;\n+\n+ if (n_spaces > 0)\nstream << legend_style << std::string(n_spaces, ' ') << rang::style::reset;\n+\nstream << legend_style << text + \" \" << rang::style::reset;\nif (j < (cols_groups[i].second.size() -1)) // print column separator except for last\n- stream << legend_style << std::string(1, col_separator) << rang::style::reset;\n+ stream << legend_style << col_separator << rang::style::reset;\n}\nif (i < (cols_groups.size() -1)) // print group separator except for last\n- stream << legend_style << std::string(2, col_separator) << rang::style::reset;\n+ stream << legend_style << group_separator << rang::style::reset;\n}\nstream << std::endl;\n}\n@@ -147,15 +199,22 @@ void Terminal\nstream << rang::tag::comment;\nfor (unsigned i = 0; i < cols_groups.size(); i++)\n{\n+ const unsigned group_width = get_group_width(cols_groups[i]);\n+ const auto n_extra = extra_spaces(cols_groups[i].first, group_width);\n+\nfor (unsigned j = 0; j < cols_groups[i].second.size(); j++)\n{\n- stream << legend_style << std::string(column_width, line_separator) << rang::style::reset;\n+ auto n_separators = column_width;\n+ if (j == 0)\n+ n_separators += n_extra;\n+\n+ stream << legend_style << std::string(n_separators, line_separator) << rang::style::reset;\nif (j < (cols_groups[i].second.size() -1)) // print column separator except for last\n- stream << legend_style << std::string(1, col_separator) << rang::style::reset;\n+ stream << legend_style << col_separator << rang::style::reset;\n}\nif (i < (cols_groups.size() -1)) // print group separator except for last\n- stream << legend_style << std::string(2, col_separator) << rang::style::reset;\n+ stream << legend_style << group_separator << rang::style::reset;\n}\nstream << std::endl;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/Terminal.hpp", "new_path": "src/Tools/Display/Terminal/Terminal.hpp", "diff": "@@ -31,8 +31,9 @@ namespace tools\nclass Terminal\n{\npublic:\n- static const char col_separator;\nstatic const char line_separator;\n+ static const std::string col_separator;\n+ static const std::string group_separator;\nstatic const std::string spaced_scol_separator;\nstatic const std::string spaced_dcol_separator;\nstatic const std::string data_tag;\n@@ -48,10 +49,12 @@ private:\nbool stop_terminal;\nprotected:\n- // vector of pairs {group title, columns titles}\n- // group title is a pair {first line, second line}\n- // columns titles is a vector of pair {first line, second line}\n- std::vector<std::pair<std::pair<std::string, std::string>, std::vector<std::pair<std::string, std::string>>>> cols_groups;\n+ using title_t = std::pair<std::string, std::string>;\n+ using group_title_t = title_t;\n+ using column_title_t = std::vector<title_t>;\n+ using group_t = std::pair<group_title_t, column_title_t>;\n+\n+ std::vector<group_t> cols_groups;\npublic:\n@@ -92,6 +95,11 @@ public:\nstatic std::string get_time_format(float secondes);\n+protected:\n+ static unsigned extra_spaces(const title_t& text, const unsigned group_width);\n+ static unsigned extra_spaces(const group_t& group);\n+ static unsigned get_group_width(const group_t& group);\n+\nprivate:\nstatic void start_thread_terminal(Terminal *terminal, const std::chrono::milliseconds freq);\n};\n" } ]
C++
MIT License
aff3ct/aff3ct
Enhance Terminal to handle legend titles longer than the number of columns
8,483
23.05.2018 16:19:16
-7,200
95cfaea405ce53a868ae7630f9aac8853096d30c
Fix addr_to_line function by calling the right system function
[ { "change_type": "MODIFY", "old_path": "src/Tools/system_functions.cpp", "new_path": "src/Tools/system_functions.cpp", "diff": "@@ -156,7 +156,7 @@ std::string aff3ct::tools::addr_to_line(const std::string& backtrace)\nauto function = stack[i].substr(pos_beg_func, pos_off - pos_beg_func );\nauto address = stack[i].substr(pos_beg_addr +1, pos_end_addr - pos_beg_addr -1);\n- std::string cmd = \"addr_to_line -e \" + program + \" \" + address;\n+ std::string cmd = \"addr2line -e \" + program + \" \" + address;\nstd::string filename_and_line = run_system_command(cmd);\nfilename_and_line = filename_and_line.substr(0, filename_and_line.size() -1); // remove the '\\n'\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix addr_to_line function by calling the right system function
8,483
25.05.2018 16:04:44
-7,200
7fe6b9f922927f4cf95ecc750119babce04d5c2e
Fix the if condition statements
[ { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Sparse_matrix/Sparse_matrix.cpp", "new_path": "src/Tools/Algo/Sparse_matrix/Sparse_matrix.cpp", "diff": "@@ -91,7 +91,7 @@ void Sparse_matrix::rm_connection(const size_t row_index, const size_t col_index\n// delete the link in the row_to_cols vector\nbool row_found = false;\nauto itr = std::find(this->row_to_cols[row_index].begin(), this->row_to_cols[row_index].end(), col_index);\n- if (itr != this->row_to_cols[row_index].end());\n+ if (itr != this->row_to_cols[row_index].end())\n{\nrow_found = true;\nitr = this->row_to_cols[row_index].erase(itr);\n@@ -115,7 +115,7 @@ void Sparse_matrix::rm_connection(const size_t row_index, const size_t col_index\n// delete the link in the col_to_rows vector\nbool col_found = false;\nauto itc = std::find(this->col_to_rows[col_index].begin(), this->col_to_rows[col_index].end(), row_index);\n- if (itc != this->col_to_rows[col_index].end());\n+ if (itc != this->col_to_rows[col_index].end())\n{\ncol_found = true;\nthis->col_to_rows[col_index].erase(itc);\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the if condition statements
8,483
25.05.2018 16:06:12
-7,200
9ba296d330fe40f8d60b392906567cf0e47f396b
Fix the tellg function issue (end of line character issue) when reading distributions files on windows by reading them in binary modes.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Math/Distribution/Distributions.cpp", "new_path": "src/Tools/Math/Distribution/Distributions.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::tools;\ntemplate<typename R>\n-const int aff3ct::tools::Distributions<R>::saved_noise_precision = 1e6;\n+const int aff3ct::tools::Distributions<R>::saved_noise_precision = (int)1e6;\ntemplate<typename R>\nDistributions<R>::\nDistributions(const std::string& filename, Distribution_mode mode, bool read_all_at_init)\n-: f_distributions(filename), mode(mode)\n+: f_distributions(filename, std::ios::binary), mode(mode)\n{\nif (f_distributions.fail())\n{\n@@ -50,6 +50,28 @@ get_noise_range() const\nreturn nr;\n}\n+\n+void my_getline(std::istream &is, std::string &line)\n+{\n+ line.clear();\n+ char c;\n+\n+ while(is.get(c))\n+ {\n+ if (c != '\\r')\n+ {\n+ if (c != '\\n')\n+ line.push_back(c);\n+ else\n+ break;\n+ }\n+ else\n+ {\n+ std::cout << \"got \\r\" << std::endl;\n+ }\n+ }\n+}\n+\ntemplate<typename R>\nvoid Distributions<R>::\nread_noise_range()\n@@ -57,7 +79,7 @@ read_noise_range()\nfile_go_to_pos(); // set the stream at the beginning of the file\nstd::string line;\n- std::getline(f_distributions, line);\n+ my_getline(f_distributions, line);\nthis->desc = tools::Splitter::split(line, \"\", \"\", \" \");\n@@ -84,13 +106,14 @@ read_noise_range()\n{\nauto pos = f_distributions.tellg();\nthis->noise_file_index.push_back(pos);\n+ this->noise_file_index.back();\nfor (unsigned i = 0; i < this->desc.size(); i++)\n{\nif (f_distributions.eof())\nbreak;\n- std::getline(f_distributions, line);\n+ my_getline(f_distributions, line);\nif (line.empty())\n{\ni--;\n@@ -98,7 +121,7 @@ read_noise_range()\n}\nif (i == ROP_pos)\n- this->noise_range.push_back((R) stof(line));\n+ this->noise_range.push_back((R)std::stof(line));\n}\n}\n@@ -211,7 +234,7 @@ read_distribution_from_file(unsigned index)\nif (f_distributions.eof())\nthrow runtime_error(__FILE__, __LINE__, __func__, \"The file stream is at the end while reading it.\");\n- std::getline(f_distributions, line);\n+ my_getline(f_distributions, line);\nif (line.empty())\n{\n@@ -240,9 +263,18 @@ read_distribution_from_file(unsigned index)\nthrow invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+ R ROP_R;\n+\ntry\n{\n- auto ROP_R = (R)stof(ROP);\n+ ROP_R = (R)std::stof(ROP);\n+ }\n+ catch (...)\n+ {\n+ std::stringstream message;\n+ message << \"'ROP' value does not represent a float (ROP = \" << ROP << \")\";\n+ throw runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\nif (ROP_R != this->noise_range[index])\n{\n@@ -257,22 +289,26 @@ read_distribution_from_file(unsigned index)\nfor(auto& v : v_y_R)\nv.resize(v_x.size());\n+ size_t j = 0;\n+ try\n+ {\n// convert string vector to 'R' vector\n- for(unsigned j = 0; j < v_x_R.size(); j++)\n+ for(; j < v_x_R.size(); j++)\n{\n- v_x_R [j] = (R)stof(v_x [j]);\n- v_y_R[0][j] = (R)stof(v_y0[j]);\n- v_y_R[1][j] = (R)stof(v_y1[j]);\n+ v_x_R [j] = (R)std::stof(v_x [j]);\n+ v_y_R[0][j] = (R)std::stof(v_y0[j]);\n+ v_y_R[1][j] = (R)std::stof(v_y1[j]);\n}\n-\n- add_distribution(ROP_R, new Distribution<R>(std::move(v_x_R), std::move(v_y_R)));\n}\ncatch(...)\n{\nstd::stringstream message;\n- message << \"A value does not represent a float\";\n+ message << \"A value does not represent a float (ROP = \" << ROP << \", ROP_R = \" << ROP_R\n+ << \", j = \" << j << \", v_x[j] = \" << v_x[j] << \", v_y0[j] = \" << v_y0[j] << \", v_y1[j] = \" << v_y1[j] << \")\";\nthrow runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n+\n+ add_distribution(ROP_R, new Distribution<R>(std::move(v_x_R), std::move(v_y_R)));\n}\ntemplate<typename R>\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the tellg function issue (end of line character issue) when reading distributions files on windows by reading them in binary modes.
8,483
29.05.2018 10:38:23
-7,200
ff7d30446d36cbb67e156de96f4445ba4f77096e
Cosmetics, remove unused commented code in Modem OOK optical
[ { "change_type": "MODIFY", "old_path": "src/Module/Modem/OOK/Modem_OOK_optical.cpp", "new_path": "src/Module/Modem/OOK/Modem_OOK_optical.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::module;\n-//std::vector<std::vector<float>> llrs;\n-//size_t llr_idx;\n-\ntemplate <typename B, typename R, typename Q>\nModem_OOK_optical<B,R,Q>\n::Modem_OOK_optical(const int N, const tools::Distributions<R>& dist, const tools::Noise<R>& noise, const int n_frames)\n@@ -20,23 +17,6 @@ Modem_OOK_optical<B,R,Q>\n{\nconst std::string name = \"Modem_OOK_optical\";\nthis->set_name(name);\n-\n-// std::ifstream file(\"/media/ohartmann/DATA/Documents/Projets/CNES_AIRBUS/matrices/2018_05_03/vectorTestIMS/TestVec ROP -32/AFF3CT/LLR.txt\");\n-//\n-// if (!file.is_open())\n-// throw tools::runtime_error();\n-//\n-// unsigned length, n_llrs;\n-// file >> n_llrs >> length;\n-//\n-// llrs.resize(n_llrs, std::vector<float>(length));\n-//\n-// for (unsigned i = 0; i < n_llrs; i++)\n-// {\n-// for (unsigned j = 0; j < length; j++)\n-// file >> llrs[i][j];\n-// }\n-// llr_idx = 0;\n}\ntemplate <typename B, typename R, typename Q>\n@@ -95,14 +75,6 @@ void Modem_OOK_optical<B,R,Q>\n}\n}\n-//template <typename B, typename R, typename Q>\n-//void Modem_optical<B,R,Q>\n-//::_demodulate(const Q *Y_N1, Q *Y_N2, const int frame_id)\n-//{\n-// std::copy(llrs[llr_idx].begin(), llrs[llr_idx].end(), Y_N2);\n-// llr_idx = (llr_idx + 1) % llrs.size();\n-//};\n-\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n" } ]
C++
MIT License
aff3ct/aff3ct
Cosmetics, remove unused commented code in Modem OOK optical
8,483
29.05.2018 10:39:24
-7,200
969873752410ecb74d91b4f1ca3fb2337cbbdcd2
Add cumulative values option in histogram
[ { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -293,7 +293,7 @@ void BFER<B,R,Q>\nelse\nmax = params_BFER.mnt->err_hist;\n- err_hist.dump(file_err_hist, 0, max, 0, false, false, \"; \");\n+ err_hist.dump(file_err_hist, 0, max, 0, false, false, false, \"; \");\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Histogram.hpp", "new_path": "src/Tools/Algo/Histogram.hpp", "diff": "@@ -85,10 +85,10 @@ public:\n/*\n* call dump by setting the hist_min and hist_max values as, respectively, get_hist_min() and get_hist_max()\n*/\n- int dump(std::ofstream& hist_file, unsigned n_rung = 0, bool norm_sum_to_1 = false, bool cumul_borders = false,\n- const std::string& data_separator = \"; \") const\n+ int dump(std::ofstream& hist_file, unsigned n_rung = 0, bool norm_sum_to_1 = false, bool cumul_vals = false,\n+ bool cumul_borders = false, const std::string& data_separator = \"; \") const\n{\n- return dump(hist_file, get_hist_min(), get_hist_max(), n_rung, norm_sum_to_1, cumul_borders, data_separator);\n+ return dump(hist_file, get_hist_min(), get_hist_max(), n_rung, norm_sum_to_1, cumul_vals, cumul_borders, data_separator);\n}\n/*\n@@ -97,20 +97,21 @@ public:\n* @hist_max is the right border of the dump\n* @n_rung is the number of values plotted on the abscissa in the asked range (if 0 then dump directly the values)\n* @norm_sum_to_1 is to normalize the values to a cumulative integration to 1.\n++ * @cumul_vals option accumulates values rung after rung as for a CDF\n* @cumul_borders is to accumulate the values over the given range [hist_min, hist_max] on those border values\n* @data_separator is the tag used to separate x from y when dumping them\n* @return 1 when there is an error in given limits\n*/\nint dump(std::ofstream& hist_file, R hist_min, R hist_max, unsigned n_rung = 0, bool norm_sum_to_1 = false,\n- bool cumul_borders = false, const std::string& data_separator = \"; \") const\n+ bool cumul_vals = false, bool cumul_borders = false, const std::string& data_separator = \"; \") const\n{\nif (hist_min >= hist_max)\nreturn 1;\nif (n_rung == 0)\n- return dump_all_values(hist_file, hist_min, hist_max, norm_sum_to_1, cumul_borders, data_separator);\n+ return dump_all_values(hist_file, hist_min, hist_max, norm_sum_to_1, cumul_vals, cumul_borders, data_separator);\nelse\n- return dump_intervals (hist_file, hist_min, hist_max, n_rung, norm_sum_to_1, cumul_borders, data_separator);\n+ return dump_intervals (hist_file, hist_min, hist_max, n_rung, norm_sum_to_1, cumul_vals, cumul_borders, data_separator);\n}\ninline void reset()\n@@ -160,7 +161,7 @@ public:\nprivate:\nint dump_all_values(std::ofstream& hist_file, R hist_min, R hist_max, bool norm_sum_to_1 = false,\n- bool cumul_borders = false, const std::string& data_separator = \"; \") const\n+ bool cumul_vals = false, bool cumul_borders = false, const std::string& data_separator = \"; \") const\n{\nR factor = 1;\nif (norm_sum_to_1)\n@@ -181,11 +182,15 @@ private:\nif (!dumped_hist_min)\n{ // then end of the cumul border on the left\nhist_file << hist_min << data_separator << std::scientific << (R)cumul * factor << std::endl;\n- cumul = 0;\ndumped_hist_min = true;\n}\n- hist_file << uncalibrate_val(it->first) << data_separator << std::scientific << (R)it->second * factor << std::endl;\n+ if (cumul_vals)\n+ cumul += it->second;\n+ else\n+ cumul = it->second;\n+\n+ hist_file << uncalibrate_val(it->first) << data_separator << std::scientific << (R)cumul * factor << std::endl;\n}\nelse if (cumul_borders || it->first == cal_hist_min || it->first == cal_hist_max)\n{\n@@ -200,7 +205,7 @@ private:\n}\nint dump_intervals(std::ofstream& hist_file, R hist_min, R hist_max, unsigned n_rung, bool norm_sum_to_1 = false,\n- bool cumul_borders = false, const std::string& data_separator = \"; \") const\n+ bool cumul_vals = false, bool cumul_borders = false, const std::string& data_separator = \"; \") const\n{\nR factor = 1;\nif (norm_sum_to_1)\n@@ -228,11 +233,18 @@ private:\n}\nR _dump_step = (R)1/dump_step;\n+ size_t cumul = 0;\nfor (unsigned i = 0; i <= n_rung; ++i)\n- hist_file << ((R)i * _dump_step + hist_min) << data_separator << std::scientific << (R)dump_hist[i] * factor\n- << std::endl;\n+ {\n+ if (cumul_vals)\n+ cumul += dump_hist[i];\n+ else\n+ cumul = dump_hist[i];\n+ hist_file << ((R) i * _dump_step + hist_min) << data_separator << std::scientific\n+ << (R) cumul * factor << std::endl;\n+ }\nreturn 0;\n}\n};\n" } ]
C++
MIT License
aff3ct/aff3ct
Add cumulative values option in histogram
8,483
29.05.2018 10:40:56
-7,200
172e82712dd3f4adf08188601eff2ea6df57c2c8
Add a mutual_sort function that sort an abscissa and move its ordinates in the same way
[ { "change_type": "MODIFY", "old_path": "src/Tools/Math/Distribution/Distribution.cpp", "new_path": "src/Tools/Math/Distribution/Distribution.cpp", "diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/numerical_integration.h\"\n#include \"Tools/Math/interpolation.h\"\n+#include \"Tools/general_utils.h\"\n#include \"Distribution.hpp\"\n@@ -56,19 +57,6 @@ Distribution<R>\n{\n}\n-template <typename R>\n-void Distribution<R>\n-::sort_pdf()\n-{\n- for (unsigned i = 1; i < this->pdf_x.size(); i++)\n- for (unsigned j = i; j > 0 && this->pdf_x[j] < this->pdf_x[j-1]; j--)\n- {\n- std::swap(this->pdf_x[j], this->pdf_x[j-1]); // order the x position\n-\n- for (unsigned k = 0; k < this->pdf_y.size(); k++)\n- std::swap(this->pdf_y[k][j], this->pdf_y[k][j-1]); // the y follow their x moving the same way\n- }\n-}\ntemplate <typename R>\nvoid Distribution<R>\n::compute_cdf(Distribution_mode mode)\n@@ -91,7 +79,7 @@ void Distribution<R>\n}\n}\n- sort_pdf(); // first make sure x values are sorted in ascending order\n+ tools::mutual_sort(this->pdf_x, this->pdf_y); // first make sure x values are sorted in ascending order\nthis->cdf_x.resize(this->pdf_y.size());\nthis->cdf_y.resize(this->pdf_y.size());\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Math/Distribution/Distribution.hpp", "new_path": "src/Tools/Math/Distribution/Distribution.hpp", "diff": "@@ -40,7 +40,6 @@ protected:\nvoid compute_cdf(Distribution_mode mode);\nvoid compute_cdf_interpolation();\nvoid compute_cdf_summation();\n- void sort_pdf();\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/general_utils.h", "new_path": "src/Tools/general_utils.h", "diff": "@@ -48,6 +48,14 @@ inline BidirectionalIterator get_closest(BidirectionalIterator first, Bidirectio\ntemplate <typename BidirectionalIterator, typename T>\ninline std::size_t get_closest_index(BidirectionalIterator first, BidirectionalIterator last, const T & value);\n+/*\n+ * Sort 'vec_abscissa' in ascending order and move the matching ordinate of 'vec_ordinate' by the same time.\n+ */\n+template <typename Ta, typename To>\n+inline void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordinate);\n+\n+template <typename Ta, typename To>\n+inline void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& vec_ordinate);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/general_utils.hxx", "new_path": "src/Tools/general_utils.hxx", "diff": "@@ -30,6 +30,30 @@ std::size_t get_closest_index(BidirectionalIterator first, BidirectionalIterator\nreturn std::distance(first, get_closest(first, last, value));\n}\n+template <typename Ta, typename To>\n+void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordinate)\n+{\n+ for (unsigned i = 1; i < vec_abscissa.size(); i++)\n+ for (unsigned j = i; j > 0 && vec_abscissa[j] < vec_abscissa[j-1]; j--)\n+ {\n+ std::swap(vec_abscissa[j], vec_abscissa[j-1]); // order the x position\n+ std::swap(vec_ordinate[j], vec_ordinate[j-1]); // the y follow their x, moving the same way\n+ }\n+}\n+\n+template <typename Ta, typename To>\n+void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& vec_ordinate)\n+{\n+ for (unsigned i = 1; i < vec_abscissa.size(); i++)\n+ for (unsigned j = i; j > 0 && vec_abscissa[j] < vec_abscissa[j-1]; j--)\n+ {\n+ std::swap(vec_abscissa[j], vec_abscissa[j-1]); // order the x position\n+\n+ for (unsigned k = 0; k < vec_ordinate.size(); k++)\n+ std::swap(vec_ordinate[k][j], vec_ordinate[k][j-1]); // the y follow their x, moving the same way\n+ }\n+}\n+\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a mutual_sort function that sort an abscissa and move its ordinates in the same way
8,483
29.05.2018 11:01:24
-7,200
c4f87c2e6dc8a4dbaa56e68bdf16858fd7ffa98f
Display the number of played frames and the passed simulation time when playing only the MI
[ { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "new_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "diff": "@@ -103,9 +103,10 @@ void Terminal_BFER<B,R>\nif (display_mutinfo)\nbfer_cols.push_back(std::make_pair(\"MI\", \"\"));\n+ bfer_cols.push_back(std::make_pair(\"FRA\", \"\"));\n+\nif (display_bfer)\n{\n- bfer_cols.push_back(std::make_pair(\"FRA\", \"\"));\nbfer_cols.push_back(std::make_pair(\"BE\", \"\"));\nbfer_cols.push_back(std::make_pair(\"FE\", \"\"));\nbfer_cols.push_back(std::make_pair(\"BER\", \"\"));\n@@ -144,7 +145,16 @@ void Terminal_BFER<B,R>\nauto MI = monitor.get_MI ();\nauto simu_time = (float)duration_cast<nanoseconds>(steady_clock::now() - t_snr).count() * 0.000000001f;\n- auto simu_cthr = ((float)monitor.get_K() * (float)monitor.get_n_analyzed_fra()) / simu_time ; // = bps\n+ float simu_cthr = 0;\n+\n+ if (display_bfer)\n+ simu_cthr = ((float)monitor.get_K() * (float)monitor.get_n_analyzed_fra()) / simu_time ; // = bps\n+ else if (display_mutinfo)\n+ {\n+ fra = monitor.get_n_MI_trials();\n+ simu_cthr = ((float) monitor.get_N() * (float) monitor.get_n_MI_trials()) / simu_time; // = bps\n+ }\n+\nsimu_cthr /= 1000.f; // = kbps\nsimu_cthr /= 1000.f; // = mbps\n@@ -191,16 +201,20 @@ void Terminal_BFER<B,R>\nstr_fer << setprecision(2) << scientific << setw(column_width-1) << fer;\nstr_MI << setprecision(2) << scientific << setw(column_width-1) << MI;\n- const unsigned long long l = 99999999; // limit 0\n+ const auto l = (unsigned long long)(1e8 -1);\nif (display_mutinfo)\n- stream << str_MI.str() << report_style << (display_bfer ? spaced_scol_separator : spaced_dcol_separator) << rang::style::reset;\n+ stream << str_MI.str() << report_style << spaced_scol_separator << rang::style::reset;\n+\n+ stream << setprecision((fra > l) ? 2 : 0) << ((fra > l) ? scientific : fixed) << setw(column_width - 1) << ((fra > l) ? (float) fra : fra)\n+ << report_style << (display_bfer ? spaced_scol_separator : spaced_dcol_separator) << rang::style::reset;\nif (display_bfer)\n{\n- stream << setprecision((fra > l) ? 2 : 0) << ((fra > l) ? scientific : fixed) << setw(column_width - 1) << ((fra > l) ? (float) fra : fra) << report_style << spaced_scol_separator << rang::style::reset;\n- stream << setprecision((be > l) ? 2 : 0) << ((be > l) ? scientific : fixed) << setw(column_width - 1) << ((be > l) ? (float) be : be ) << report_style << spaced_scol_separator << rang::style::reset;\n- stream << setprecision((fe > l) ? 2 : 0) << ((fe > l) ? scientific : fixed) << setw(column_width - 1) << ((fe > l) ? (float) fe : fe ) << report_style << spaced_scol_separator << rang::style::reset;\n+ stream << setprecision((be > l) ? 2 : 0) << ((be > l) ? scientific : fixed) << setw(column_width - 1) << ((be > l) ? (float) be : be )\n+ << report_style << spaced_scol_separator << rang::style::reset;\n+ stream << setprecision((fe > l) ? 2 : 0) << ((fe > l) ? scientific : fixed) << setw(column_width - 1) << ((fe > l) ? (float) fe : fe )\n+ << report_style << spaced_scol_separator << rang::style::reset;\nstream << str_ber.str() << report_style << spaced_scol_separator << rang::style::reset;\nstream << str_fer.str() << report_style << spaced_dcol_separator << rang::style::reset;\n@@ -221,8 +235,12 @@ void Terminal_BFER<B,R>\n_report(stream);\nauto et = duration_cast<milliseconds>(steady_clock::now() - t_snr).count() / 1000.f;\n- auto tr = et * ((float)monitor.get_fe_limit() / (float)monitor.get_n_fe()) - et;\n- auto tr_format = get_time_format((monitor.get_n_fe() == 0) ? 0 : tr);\n+ std::string tr_format;\n+\n+ if (display_bfer)\n+ tr_format = get_time_format((monitor.get_n_fe() == 0) ? 0 : et * ((float)monitor.get_fe_limit() / (float)monitor.get_n_fe() -1));\n+ else\n+ tr_format = get_time_format(et);\nstream << rang::style::bold << spaced_scol_separator << rang::style::reset << std::setprecision(0) << std::fixed\n<< std::setw(column_width-1) << tr_format;\n" } ]
C++
MIT License
aff3ct/aff3ct
Display the number of played frames and the passed simulation time when playing only the MI
8,483
29.05.2018 11:02:20
-7,200
44ae12908bcc32b495211e6da8798197a75657d1
Fix the mutual information reduction when there is a long simulation and a lot of played frames by computing weight instead of summing MI
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -20,8 +20,9 @@ Monitor_BFER<B,R>\nn_frame_errors(0),\nn_analyzed_frames(0),\nn_MI_trials(0),\n- MI_sum(0),\n- err_hist(0)\n+ MI(0),\n+ err_hist(0),\n+ mutinfo_hist(3)\n{\nconst std::string name = \"Monitor_BFER\";\nthis->set_name(name);\n@@ -130,8 +131,7 @@ Q_32 Monitor_BFER<B_32,Q_32>\n::_get_mutual_info(const B_32 *X, const Q_32 *Y, const int frame_id)\n{\nauto mi = tools::mutual_info_histo(X, Y, this->N);\n- MI_sum += mi;\n- n_MI_trials++;\n+ this->add_MI_value(mi);\nreturn mi;\n}\n}\n@@ -148,14 +148,26 @@ Q_64 Monitor_BFER<B_64,Q_64>\n::_get_mutual_info(const B_64 *X, const Q_64 *Y, const int frame_id)\n{\nauto mi = tools::mutual_info_histo(X, Y, this->N);\n- MI_sum += mi;\n- n_MI_trials++;\n+ this->add_MI_value(mi);\nreturn mi;\n}\n}\n}\n#endif\n+template <typename B, typename R>\n+void Monitor_BFER<B,R>\n+::add_MI_value(const R mi)\n+{\n+ auto weight = (R)this->n_MI_trials;\n+ this->n_MI_trials++;\n+ weight /= (R)this->n_MI_trials;\n+\n+ this->MI = this->MI * weight + mi / (R)this->n_MI_trials;\n+\n+ this->mutinfo_hist.add_value(mi);\n+}\n+\ntemplate <typename B, typename R>\nbool Monitor_BFER<B,R>\n::fe_limit_achieved()\n@@ -221,14 +233,14 @@ template <typename B, typename R>\nR Monitor_BFER<B,R>\n::get_MI() const\n{\n- return get_MI_sum() / (R)this->n_MI_trials;\n+ return this->MI;\n}\ntemplate <typename B, typename R>\n-R Monitor_BFER<B,R>\n-::get_MI_sum() const\n+unsigned long long Monitor_BFER<B,R>\n+::get_n_MI_trials() const\n{\n- return this->MI_sum;\n+ return this->n_MI_trials;\n}\ntemplate <typename B, typename R>\n@@ -261,7 +273,7 @@ void Monitor_BFER<B,R>\nthis->n_bit_errors = 0;\nthis->n_frame_errors = 0;\nthis->n_analyzed_frames = 0;\n- this->MI_sum = 0;\n+ this->MI = 0;\nthis->n_MI_trials = 0;\nthis->err_hist.reset();\n}\n@@ -281,6 +293,13 @@ tools::Histogram<int> Monitor_BFER<B, R>::get_err_hist() const\nreturn err_hist;\n}\n+template<typename B, typename R>\n+tools::Histogram<R> Monitor_BFER<B,R>::get_mutinfo_hist() const\n+{\n+ return mutinfo_hist;\n+}\n+\n+\ntemplate<typename B, typename R>\nbool Monitor_BFER<B,R>\n::get_count_unknown_values() const\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "diff": "@@ -29,12 +29,13 @@ protected:\nunsigned long long n_analyzed_frames;\nunsigned long long n_MI_trials;\n- R MI_sum;\n+ R MI;\nstd::vector<std::function<void(unsigned, int )>> callbacks_fe;\nstd::vector<std::function<void( void)>> callbacks_check;\nstd::vector<std::function<void( void)>> callbacks_fe_limit_achieved;\ntools::Histogram<int> err_hist;\n+ tools::Histogram<R > mutinfo_hist;\npublic:\nMonitor_BFER(const int K, const int N, const unsigned max_fe, const bool count_unknown_values = false, const int n_frames = 1);\n@@ -119,9 +120,12 @@ public:\nvirtual unsigned long long get_n_analyzed_fra() const;\nvirtual unsigned long long get_n_fe () const;\nvirtual unsigned long long get_n_be () const;\n+\n+ virtual unsigned long long get_n_MI_trials () const;\nvirtual R get_MI () const;\n- virtual R get_MI_sum () const;\n+\nvirtual tools::Histogram<int> get_err_hist () const;\n+ virtual tools::Histogram<R> get_mutinfo_hist() const;\nfloat get_fer () const;\nfloat get_ber () const;\n@@ -136,6 +140,8 @@ public:\nprotected:\nvirtual R _get_mutual_info(const B *X, const R *Y, const int frame_id);\nvirtual int _check_errors (const B *U, const B *Y, const int frame_id);\n+\n+ void add_MI_value(const R mi);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction.cpp", "diff": "@@ -124,21 +124,27 @@ template <typename B, typename R>\nR Monitor_BFER_reduction<B,R>\n::get_MI() const\n{\n- if (this->get_n_analyzed_fra() == 0)\n- return 0;\n+ auto tot_n_trials = (R)this->get_n_MI_trials();\n- return this->get_MI_sum() / (R)this->get_n_analyzed_fra();\n+ if (tot_n_trials == (R)0)\n+ return (R)0;\n+\n+ auto cur_MI = this->MI * ((R)this->n_MI_trials / tot_n_trials);\n+ for (unsigned i = 0; i < monitors.size(); i++)\n+ cur_MI += monitors[i]->get_MI() * ((R) monitors[i]->get_n_MI_trials() / tot_n_trials);\n+\n+ return cur_MI;\n}\ntemplate <typename B, typename R>\n-R Monitor_BFER_reduction<B,R>\n-::get_MI_sum() const\n+unsigned long long Monitor_BFER_reduction<B,R>\n+::get_n_MI_trials() const\n{\n- auto cur_mi = this->MI_sum;\n+ auto cur_n_trials = this->n_MI_trials;\nfor (unsigned i = 0; i < monitors.size(); i++)\n- cur_mi += monitors[i]->get_MI_sum();\n+ cur_n_trials += monitors[i]->get_n_MI_trials();\n- return cur_mi;\n+ return cur_n_trials;\n}\ntemplate <typename B, typename R>\n@@ -161,7 +167,8 @@ void Monitor_BFER_reduction<B,R>\n}\ntemplate<typename B, typename R>\n-tools::Histogram<int> Monitor_BFER_reduction<B, R>::get_err_hist() const\n+tools::Histogram<int> Monitor_BFER_reduction<B, R>\n+::get_err_hist() const\n{\nauto err_hist_copy = this->err_hist;\nfor (unsigned i = 0; i < monitors.size(); i++)\n@@ -170,6 +177,17 @@ tools::Histogram<int> Monitor_BFER_reduction<B, R>::get_err_hist() const\nreturn err_hist_copy;\n}\n+template<typename B, typename R>\n+tools::Histogram<R> Monitor_BFER_reduction<B, R>\n+::get_mutinfo_hist() const\n+{\n+ auto mut_hist_copy = this->mutinfo_hist;\n+ for (unsigned i = 0; i < monitors.size(); i++)\n+ mut_hist_copy.add_values(monitors[i]->get_mutinfo_hist());\n+\n+ return mut_hist_copy;\n+}\n+\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction.hpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction.hpp", "diff": "@@ -25,10 +25,12 @@ public:\nunsigned long long get_n_analyzed_fra () const;\nunsigned long long get_n_fe () const;\nunsigned long long get_n_be () const;\n- virtual tools::Histogram<int> get_err_hist() const;\n+ unsigned long long get_n_MI_trials() const;\nR get_MI () const;\n- R get_MI_sum() const;\n+\n+ tools::Histogram<int> get_err_hist () const;\n+ tools::Histogram<R> get_mutinfo_hist() const;\nvirtual void reset();\nvirtual void clear_callbacks();\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction_mpi.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction_mpi.cpp", "diff": "@@ -15,7 +15,8 @@ struct monitor_vals\nunsigned long long n_be;\nunsigned long long n_fe;\nunsigned long long n_fra;\n- float MI_sum;\n+ unsigned long long n_tri;\n+// float MI_sum;\n};\nvoid MPI_SUM_monitor_vals_func(void *in, void *inout, int *len, MPI_Datatype *datatype)\n@@ -29,7 +30,8 @@ void MPI_SUM_monitor_vals_func(void *in, void *inout, int *len, MPI_Datatype *da\ninout_cvt[i].n_fe += in_cvt[i].n_fe;\ninout_cvt[i].n_fra += in_cvt[i].n_fra;\n- inout_cvt[i].MI_sum+= inout_cvt[i].MI_sum;\n+ inout_cvt[i].n_tri += in_cvt[i].n_tri;\n+// inout_cvt[i].MI += in_cvt[i].MI;\n}\n}\n@@ -47,16 +49,18 @@ Monitor_BFER_reduction_mpi<B,R>\nconst std::string name = \"Monitor_BFER_reduction_mpi\";\nthis->set_name(name);\n- int blen[4];\n- MPI_Aint displacements[4];\n- MPI_Datatype oldtypes[4];\n+ constexpr n_vals = 4;\n+ int blen[n_vals];\n+ MPI_Aint displacements[n_vals];\n+ MPI_Datatype oldtypes[n_vals];\nblen[0] = 1; displacements[0] = offsetof(monitor_vals, n_be ); oldtypes[0] = MPI_UNSIGNED_LONG_LONG;\nblen[1] = 1; displacements[1] = offsetof(monitor_vals, n_fe ); oldtypes[1] = MPI_UNSIGNED_LONG_LONG;\nblen[2] = 1; displacements[2] = offsetof(monitor_vals, n_fra ); oldtypes[2] = MPI_UNSIGNED_LONG_LONG;\n- blen[3] = 1; displacements[3] = offsetof(monitor_vals, MI_sum); oldtypes[3] = MPI_FLOAT;\n+ blen[3] = 1; displacements[3] = offsetof(monitor_vals, n_tri ); oldtypes[3] = MPI_UNSIGNED_LONG_LONG;\n+ // blen[4] = 1; displacements[4] = offsetof(monitor_vals, MI ); oldtypes[4] = MPI_FLOAT;\n- if (auto ret = MPI_Type_create_struct(4, blen, displacements, oldtypes, &MPI_monitor_vals))\n+ if (auto ret = MPI_Type_create_struct(n_vals, blen, displacements, oldtypes, &MPI_monitor_vals))\n{\nstd::stringstream message;\nmessage << \"'MPI_Type_create_struct' returned '\" << ret << \"' error code.\";\n@@ -96,14 +100,16 @@ bool Monitor_BFER_reduction_mpi<B,R>\nmonitor_vals mvals_send = { this->get_n_be() - this->n_bit_errors,\nthis->get_n_fe() - this->n_frame_errors,\nthis->get_n_analyzed_fra() - this->n_analyzed_frames,\n- (float)(this->get_MI_sum() - this->MI_sum) };\n+ this->get_n_MI_trials() - this->n_MI_trials};\n+ //(float)(this->get_MI() - this->MI) };\nMPI_Allreduce(&mvals_send, &mvals_recv, 1, MPI_monitor_vals, MPI_SUM_monitor_vals, MPI_COMM_WORLD);\nthis->n_bit_errors = mvals_recv.n_be - mvals_send.n_be;\nthis->n_frame_errors = mvals_recv.n_fe - mvals_send.n_fe;\nthis->n_analyzed_frames = mvals_recv.n_fra - mvals_send.n_fra;\n- this->MI_sum = mvals_recv.MI_sum - mvals_send.MI_sum;\n+ this->n_MI_trials = mvals_recv.n_tri - mvals_send.n_tri;\n+ //this->MI = mvals_recv.MI - mvals_send.MI;\nt_last_mpi_comm = std::chrono::steady_clock::now();\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the mutual information reduction when there is a long simulation and a lot of played frames by computing weight instead of summing MI
8,483
29.05.2018 12:05:06
-7,200
147fe2bcff1aeed42b78c49b520b7d865ba24d06
Update Monitor_BFER_reduction_mpi.cpp
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction_mpi.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER_reduction_mpi.cpp", "diff": "@@ -49,7 +49,7 @@ Monitor_BFER_reduction_mpi<B,R>\nconst std::string name = \"Monitor_BFER_reduction_mpi\";\nthis->set_name(name);\n- constexpr n_vals = 4;\n+ constexpr int n_vals = 4;\nint blen[n_vals];\nMPI_Aint displacements[n_vals];\nMPI_Datatype oldtypes[n_vals];\n" } ]
C++
MIT License
aff3ct/aff3ct
Update Monitor_BFER_reduction_mpi.cpp
8,483
30.05.2018 11:52:03
-7,200
8c422f881dd8446543314a979fda4252d5073d12
Add a mutual unique algorithm
[ { "change_type": "MODIFY", "old_path": "src/Tools/general_utils.h", "new_path": "src/Tools/general_utils.h", "diff": "@@ -56,6 +56,17 @@ inline void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordi\ntemplate <typename Ta, typename To>\ninline void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& vec_ordinate);\n+\n+/*\n+ * Eliminates all but the first element from every consecutive group of equivalent elements from the 'vec_abscissa' vector\n+ * and remove the matching ordinate of 'vec_ordinate' by the same time.\n+ * 'vec_abscissa' and 'vec_ordinate' are resized to their new length.\n+ */\n+template <typename Ta, typename To>\n+inline void mutual_unique(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordinate);\n+\n+template <typename Ta, typename To>\n+inline void mutual_unique(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& vec_ordinate);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/general_utils.hxx", "new_path": "src/Tools/general_utils.hxx", "diff": "#define GENERAL_UTILS_HXX\n#include <algorithm>\n+#include <cassert>\n#include \"general_utils.h\"\nnamespace aff3ct\n@@ -33,6 +34,8 @@ std::size_t get_closest_index(BidirectionalIterator first, BidirectionalIterator\ntemplate <typename Ta, typename To>\nvoid mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordinate)\n{\n+ assert(vec_abscissa.size() == vec_ordinate.size());\n+\nfor (unsigned i = 1; i < vec_abscissa.size(); i++)\nfor (unsigned j = i; j > 0 && vec_abscissa[j] < vec_abscissa[j-1]; j--)\n{\n@@ -44,6 +47,13 @@ void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordinate)\ntemplate <typename Ta, typename To>\nvoid mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& vec_ordinate)\n{\n+#ifndef NDEBUG\n+ bool good = true;\n+ for (unsigned k = 0; k < vec_ordinate.size(); k++)\n+ good &= vec_abscissa.size() == vec_ordinate[k].size();\n+ assert(good);\n+#endif\n+\nfor (unsigned i = 1; i < vec_abscissa.size(); i++)\nfor (unsigned j = i; j > 0 && vec_abscissa[j] < vec_abscissa[j-1]; j--)\n{\n@@ -54,6 +64,50 @@ void mutual_sort(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& ve\n}\n}\n+template <typename Ta, typename To>\n+void mutual_unique(std::vector<Ta>& vec_abscissa, std::vector<To>& vec_ordinate)\n+{\n+ assert(vec_abscissa.size() == vec_ordinate.size());\n+\n+ unsigned r = 0;\n+\n+ for (unsigned i = 1; i < vec_abscissa.size(); i++)\n+ {\n+ if ((vec_abscissa[r] != vec_abscissa[i]) && (++r != i))\n+ {\n+ vec_abscissa[r] = std::move(vec_abscissa[i]);\n+ vec_ordinate[r] = std::move(vec_ordinate[i]);\n+ }\n+ }\n+\n+ vec_abscissa.resize(r);\n+ vec_ordinate.resize(r);\n+}\n+\n+template <typename Ta, typename To>\n+void mutual_unique(std::vector<Ta>& vec_abscissa, std::vector<std::vector<To>>& vec_ordinate)\n+{\n+#ifndef NDEBUG\n+ bool good = true;\n+ for (unsigned k = 0; k < vec_ordinate.size(); k++)\n+ good &= vec_abscissa.size() == vec_ordinate[k].size();\n+ assert(good);\n+#endif\n+\n+ unsigned r = 0;\n+\n+ for (unsigned i = 1; i < vec_abscissa.size(); i++)\n+ {\n+ if ((vec_abscissa[r] != vec_abscissa[i]) && (++r != i))\n+ {\n+ vec_abscissa[r] = std::move(vec_abscissa[i]);\n+ for (unsigned k = 0; k < vec_ordinate.size(); k++)\n+ vec_ordinate[k][r] = std::move(vec_ordinate[k][i]);\n+ }\n+ }\n+}\n+\n+\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a mutual unique algorithm
8,483
30.05.2018 14:58:09
-7,200
ae18578d0b2cddcb823bd712f99e0f97dbf3d30e
Modify 'Distributions::get_noise_range' to return a reference to an internal noise range vector already sorted.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Math/Distribution/Distributions.cpp", "new_path": "src/Tools/Math/Distribution/Distributions.cpp", "diff": "@@ -41,13 +41,10 @@ Distributions<R>::\n}\ntemplate<typename R>\n-std::vector<R> Distributions<R>::\n+const std::vector<R>& Distributions<R>::\nget_noise_range() const\n{\n- auto nr = this->noise_range;\n- std::sort(nr.begin(), nr.end());\n-\n- return nr;\n+ return this->noise_range_sorted;\n}\n@@ -126,6 +123,9 @@ read_noise_range()\n}\nthis->noise_file_index.resize(this->noise_range.size()); // delete the extra noise positions if any\n+\n+ this->noise_range_sorted = this->noise_range;\n+ std::sort(this->noise_range_sorted.begin(), this->noise_range_sorted.end());\n}\ntemplate<typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Math/Distribution/Distributions.hpp", "new_path": "src/Tools/Math/Distribution/Distributions.hpp", "diff": "@@ -28,6 +28,7 @@ protected:\nDistribution_mode mode;\nstd::vector<R> noise_range;\n+ std::vector<R> noise_range_sorted;\nstd::vector<std::streampos> noise_file_index;\n// the data description\n@@ -46,7 +47,7 @@ public:\nconst Distribution<R>& get_distribution(R noise) const;\nvoid read_distribution(R noise);\n- std::vector<R> get_noise_range() const;\n+ const std::vector<R>& get_noise_range() const;\nprotected:\n/*\n" } ]
C++
MIT License
aff3ct/aff3ct
Modify 'Distributions::get_noise_range' to return a reference to an internal noise range vector already sorted.
8,483
31.05.2018 16:51:57
-7,200
474fdc346d66715235a603bf2155f40cdfaaa467
Fix help display issue by returning 1 in greatest_common_divisor when there is an error and by not throwing in Codec_LDPC::store when K or N is wrong
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Codec/LDPC/Codec_LDPC.cpp", "new_path": "src/Factory/Module/Codec/LDPC/Codec_LDPC.cpp", "diff": "@@ -106,14 +106,14 @@ void Codec_LDPC::parameters\nelse\nthis->enc->K = this->dec->K; // then the decoder knows the K\n- if (this->dec->K == 0 || this->dec->N_cw == 0 || this->enc->K == 0 || this->enc->N_cw == 0)\n- {\n- std::stringstream message;\n- message << \"Error while initializing decoder and encoder dimensions ('this->dec->K' = \" << this->dec->K\n- << \", 'this->dec->N_cw' = \" << this->dec->N_cw << \", 'this->enc->K' = \" << this->enc->K\n- << \", 'this->enc->N_cw' = \" << this->enc->N_cw << \").\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+ // if (this->dec->K == 0 || this->dec->N_cw == 0 || this->enc->K == 0 || this->enc->N_cw == 0)\n+ // {\n+ // std::stringstream message;\n+ // message << \"Error while initializing decoder and encoder dimensions ('this->dec->K' = \" << this->dec->K\n+ // << \", 'this->dec->N_cw' = \" << this->dec->N_cw << \", 'this->enc->K' = \" << this->enc->K\n+ // << \", 'this->enc->N_cw' = \" << this->enc->N_cw << \").\";\n+ // throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ // }\nthis->dec->n_frames = this->enc->n_frames;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Math/utils.h", "new_path": "src/Tools/Math/utils.h", "diff": "@@ -97,7 +97,7 @@ template <typename T>\nT greatest_common_divisor(T a, T b)\n{\nif (b == (T)0)\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, \"b is null!\");\n+ return 1;\nT r;\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix help display issue by returning 1 in greatest_common_divisor when there is an error and by not throwing in Codec_LDPC::store when K or N is wrong
8,483
01.06.2018 10:32:03
-7,200
943077dc0e5025dced1574d863f56837dca7c0a3
Add LDPC PureIRA peeling decoder 2400x3000 matrix and reference curve
[ { "change_type": "MODIFY", "old_path": "conf", "new_path": "conf", "diff": "-Subproject commit 07bcef453d50d82b816811d7a2530bc966a08b70\n+Subproject commit 1a235468ab507b08eb9513ec62a5f4646bc97953\n" }, { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit a8b3d7ce2a795e31a9ee294ef206114919f2220e\n+Subproject commit a2c38972864c5534bc7bc04d5c7bfd37337f30dc\n" } ]
C++
MIT License
aff3ct/aff3ct
Add LDPC PureIRA peeling decoder 2400x3000 matrix and reference curve
8,483
01.06.2018 15:15:50
-7,200
237f3f25de02f3685387ab8cb7be0064df5028f5
Cosmetics in Terminal BFER
[ { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "new_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "diff": "@@ -95,7 +95,7 @@ void Terminal_BFER<B,R>\nbfer_cols.push_back(std::make_pair(\"ROP\", \"(dB)\"));\nbreak;\ncase Noise_type::EP :\n- bfer_title.second = \"depending on the Erasure Probability (EP)\";\n+ bfer_title.second = \"depending on the Event Probability (EP)\";\nbfer_cols.push_back(std::make_pair(\"EP\", \"\"));\nbreak;\n}\n@@ -120,7 +120,7 @@ void Terminal_BFER<B,R>\n// stream << \"# \" << \"---------------------------------------------------------------------||---------------------\" << std::endl;\n// stream << \"# \" << \" Bit Error Rate (BER) and Frame Error Rate (FER) depending || Global throughput \" << std::endl;\n- // stream << \"# \" << \" on the Erasure Probability (EP) || and elapsed time \" << std::endl;\n+ // stream << \"# \" << \" on the Event Probability (EP) || and elapsed time \" << std::endl;\n// stream << \"# \" << \"---------------------------------------------------------------------||---------------------\" << std::endl;\n// stream << \"# \" << \"---------|-----------|-----------|-----------|-----------|-----------||----------|----------\" << std::endl;\n// stream << \"# \" << \" EP | FRA | BE | FE | BER | FER || SIM_THR | ET/RT \" << std::endl;\n@@ -171,7 +171,8 @@ void Terminal_BFER<B,R>\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- stream << std::string(extra_spaces(cols_groups[0]), ' ');\n+ if (!this->cols_groups.empty())\n+ stream << std::string(extra_spaces(this->cols_groups.front()), ' ');\nswitch (this->n->get_type())\n{\n" } ]
C++
MIT License
aff3ct/aff3ct
Cosmetics in Terminal BFER
8,490
04.06.2018 12:00:34
-7,200
673edfa4c11c4e55e0ab4b706face846d9f171e8
Fix a MSVC warning.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/Fast/User_pdf_noise_generator_fast.cpp", "new_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/Fast/User_pdf_noise_generator_fast.cpp", "diff": "@@ -112,7 +112,7 @@ void User_pdf_noise_generator_fast<float>\n{\nconst auto& cdf_y = signal[i] ? dis.get_cdf_y()[1] : dis.get_cdf_y()[0];\nconst auto& cdf_x = signal[i] ? dis.get_cdf_x()[1] : dis.get_cdf_x()[0];\n- draw[i] = interp_function(cdf_y.data(), cdf_x.data(), cdf_x.size(), draw[i]);\n+ draw[i] = interp_function(cdf_y.data(), cdf_x.data(), (unsigned)cdf_x.size(), draw[i]);\n}\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix a MSVC warning.
8,490
04.06.2018 17:00:00
-7,200
e388c3d9901d8cc095befdfd317f8e03a4618e48
Add dev branch to sonarqube.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -28,6 +28,7 @@ analysis-sonarqube:\n- sonarqube\nonly:\n- master\n+ - development\nscript:\n- ./ci/analysis-sonarqube.sh\n" }, { "change_type": "MODIFY", "old_path": "ci/analysis-sonarqube.sh", "new_path": "ci/analysis-sonarqube.sh", "diff": "@@ -16,8 +16,9 @@ cppcheck --language=c++ --suppress=missingIncludeSystem --force --enable=all --s\n#cd ..\n# Create the sonar config file on the fly\n+BRANCH=$(git branch | grep \"*\" | cut -d \" \" -f2-)\nVERSION=$(git tag | tail -n 1 | cut -d $'v' -f2-)\n-echo \"sonar.projectKey=storm:aff3ct:gitlab:master\" > sonar-project.properties\n+echo \"sonar.projectKey=storm:aff3ct:gitlab:$BRANCH\" > sonar-project.properties\n#echo \"sonar.projectName=AFF3CT\" >> sonar-project.properties\necho \"sonar.projectVersion=$VERSION\" >> sonar-project.properties\necho \"sonar.login=c6ab3ccd4dd7a8d9aa3e90d5766c74e0c9889947\" >> sonar-project.properties\n" } ]
C++
MIT License
aff3ct/aff3ct
Add dev branch to sonarqube.
8,490
04.06.2018 17:04:41
-7,200
8d6de028fe21cb5768868b8775397a285653ff59
Fix prev. commit...
[ { "change_type": "MODIFY", "old_path": "ci/analysis-sonarqube.sh", "new_path": "ci/analysis-sonarqube.sh", "diff": "@@ -16,7 +16,7 @@ cppcheck --language=c++ --suppress=missingIncludeSystem --force --enable=all --s\n#cd ..\n# Create the sonar config file on the fly\n-BRANCH=$(git branch | grep \"*\" | cut -d \" \" -f2-)\n+BRANCH=$(git for-each-ref --format='%(objectname) %(refname:short)' refs/heads | awk \"/^$(git rev-parse HEAD)/ {print \\$2}\")\nVERSION=$(git tag | tail -n 1 | cut -d $'v' -f2-)\necho \"sonar.projectKey=storm:aff3ct:gitlab:$BRANCH\" > sonar-project.properties\n#echo \"sonar.projectName=AFF3CT\" >> sonar-project.properties\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix prev. commit...
8,490
06.06.2018 16:50:57
-7,200
cd4d15adaa96fd1d0a0e88123e26ec793c00d917
New worker tags.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -36,6 +36,7 @@ build-linux-gcc:\nstage: build\ntags:\n- linux\n+ - gcc\nscript:\n- ./ci/build-linux-gcc.sh\n@@ -43,6 +44,8 @@ build-linux-gcc-8-bit:\nstage: build\ntags:\n- linux\n+ - gcc\n+ - arm32\nscript:\n- ./ci/build-linux-gcc-8-bit.sh\n@@ -50,6 +53,8 @@ build-linux-gcc-mpi:\nstage: build\ntags:\n- linux\n+ - gcc\n+ - mpi\nscript:\n- ./ci/build-linux-gcc-mpi.sh\n@@ -57,6 +62,8 @@ build-linux-gcc-systemc:\nstage: build\ntags:\n- linux\n+ - gcc\n+ - systemc\nscript:\n- ./ci/build-linux-gcc-systemc.sh\n@@ -64,6 +71,7 @@ build-linux-clang:\nstage: build\ntags:\n- linux\n+ - clang\nscript:\n- ./ci/build-linux-clang.sh\n@@ -71,6 +79,7 @@ build-linux-gcc-4.8:\nstage: build\ntags:\n- linux\n+ - gcc-4.8\nscript:\n- ./ci/build-linux-gcc-4.8.sh\n@@ -78,6 +87,7 @@ build-linux-icpc:\nstage: build\ntags:\n- linux\n+ - icpc\nscript:\n- ./ci/build-linux-icpc.sh\n@@ -85,6 +95,7 @@ build-windows-gcc:\nstage: build\ntags:\n- windows\n+ - gcc\nscript:\n- ./ci/build-windows-gcc.bat\n@@ -92,6 +103,7 @@ build-windows-msvc:\nstage: build\ntags:\n- windows\n+ - msvc\nscript:\n- ./ci/build-windows-msvc.bat\n@@ -99,14 +111,16 @@ build-mac-osx-clang:\nstage: build\ntags:\n- mac-osx\n+ - apple-clang\nscript:\n- ./ci/build-mac-osx-clang.sh\ntest-regression:\nstage: test\n- retry: 2\n+ retry: 1\ntags:\n- - test\n+ - linux\n+ - powerful\nartifacts:\nname: test-regression-results\nwhen: always\n@@ -119,6 +133,8 @@ test-regression:\ncoverage-linux-gcc:\nstage: coverage\ntags:\n+ - linux\n+ - gcc\n- coverage\ncoverage: '/.*lines\\.*: (\\d+.\\d+\\%)/'\nartifacts:\n" } ]
C++
MIT License
aff3ct/aff3ct
New worker tags.
8,490
06.06.2018 21:06:18
-7,200
aea0f2adc9dfa3e50ba64ab4bfcccfd551b28bac
Add the powerful tag to the coverage stage.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -27,6 +27,7 @@ analysis-sonarqube:\nstage: analysis\ntags:\n- sonarqube\n+ - cppcheck\nonly:\n- master\nscript:\n@@ -137,6 +138,7 @@ coverage-linux-gcc:\n- linux\n- gcc\n- coverage\n+ - powerful\ncoverage: '/.*lines\\.*: (\\d+.\\d+\\%)/'\nartifacts:\nname: code_coverage_report\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the powerful tag to the coverage stage.
8,483
07.06.2018 09:17:13
-7,200
9fda32752aa70a2495e175c996c976d09c632cc0
Fix Monitor_MI_BFER and add Reporter Throughput independant
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.hpp", "new_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.hpp", "diff": "@@ -118,9 +118,6 @@ public:\nvirtual void collect(const Monitor& m);\nvirtual void collect(const Monitor_MI_BFER<B,R>& m);\n-\n-protected:\n- virtual R _get_mutual_info(const B *X, const R *Y, const int frame_id);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -42,6 +42,7 @@ BFER<B,R,Q>\nrep_er (nullptr),\nrep_mi (nullptr),\nrep_noise(nullptr),\n+ rep_throughput(nullptr),\nterminal (nullptr),\ndistributions(nullptr)\n@@ -76,12 +77,12 @@ BFER<B,R,Q>\n#ifdef ENABLE_MPI\n// build a monitor to compute BER/FER (reduce the other monitors)\n- this->monitor_red = new module::Monitor_reduction_mpi<module::Monitor_MI_BFER<B,R>>(this->monitor,\n+ this->monitor_red = new module::Monitor_reduction_mpi<Monitor_type>(this->monitor,\nstd::this_thread::get_id(),\nparams_BFER.mpi_comm_freq);\n#else\n// build a monitor to compute BER/FER (reduce the other monitors)\n- this->monitor_red = new module::Monitor_reduction<module::Monitor_MI_BFER<B,R>>(this->monitor);\n+ this->monitor_red = new Monitor_reduction_type(this->monitor);\n#endif\nif (!params_BFER.noise->pdf_path.empty())\n@@ -92,15 +93,19 @@ BFER<B,R,Q>\nthis->noise = params_BFER.noise->template build<R>(0);\nrep_noise = new tools::Reporter_noise<R>(this->noise);\n- rep_er = new tools::Reporter_BFER <B>(*this->monitor_red, true);\n+ reporters.push_back(rep_noise);\n+\nif (params_BFER.mnt->mutinfo)\n{\nrep_mi = new tools::Reporter_MI<B,R>(*this->monitor_red);\n- reporters = {rep_noise, rep_mi, rep_er};\n+ reporters.push_back(rep_mi);\n}\n- else\n- reporters = {rep_noise, rep_er};\n+ rep_er = new tools::Reporter_BFER <B>(*this->monitor_red);\n+ reporters.push_back(rep_er);\n+\n+ rep_throughput = new tools::Reporter_throughput(std::bind(&Monitor_reduction_type::get_n_fe, *this->monitor_red), this->monitor_red->get_fe_limit());\n+ reporters.push_back(rep_throughput);\n}\ntemplate <typename B, typename R, typename Q>\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.hpp", "new_path": "src/Simulation/BFER/BFER.hpp", "diff": "#include \"Tools/Display/Reporter/BFER/Reporter_BFER.hpp\"\n#include \"Tools/Display/Reporter/MI/Reporter_MI.hpp\"\n#include \"Tools/Display/Reporter/Noise/Reporter_noise.hpp\"\n+#include \"Tools/Display/Reporter/Throughput/Reporter_throughput.hpp\"\n#include \"Tools/Display/Terminal/Terminal.hpp\"\n#include \"Tools/Display/Dumper/Dumper.hpp\"\n@@ -50,8 +51,11 @@ protected:\ntools::Noise<R>* noise; // current noise simulated\n// the monitors of the the BFER simulation\n- std::vector<module::Monitor_MI_BFER<B,R>*> monitor;\n- module::Monitor_reduction<module::Monitor_MI_BFER<B,R> >* monitor_red;\n+ using Monitor_type = module::Monitor_MI_BFER<B,R>;\n+ using Monitor_reduction_type = module::Monitor_reduction<Monitor_type>;\n+\n+ std::vector<Monitor_type*> monitor;\n+ Monitor_reduction_type* monitor_red;\n// dump frames into files\nstd::vector<tools::Dumper *> dumper;\n@@ -61,6 +65,7 @@ protected:\ntools::Reporter_BFER <B>* rep_er;\ntools::Reporter_MI <B,R>* rep_mi;\ntools::Reporter_noise<R>* rep_noise;\n+ tools::Reporter_throughput* rep_throughput;\nstd::vector<tools::Reporter*> reporters;\ntools::Terminal* terminal;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.cpp", "new_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.cpp", "diff": "@@ -14,11 +14,9 @@ using namespace aff3ct::tools;\ntemplate <typename B>\nReporter_BFER<B>\n-::Reporter_BFER(const module::Monitor_BFER<B> &monitor, const bool display_throughput)\n+::Reporter_BFER(const module::Monitor_BFER<B> &monitor)\n: Reporter(),\n- monitor(monitor),\n- display_throughput(display_throughput),\n- t_report(std::chrono::steady_clock::now())\n+ monitor(monitor)\n{\nauto& BFER_title = BFER_group.first;\nauto& BFER_cols = BFER_group.second;\n@@ -30,19 +28,6 @@ Reporter_BFER<B>\nBFER_cols.push_back(std::make_pair(\"FER\", \"\"));\nthis->cols_groups.push_back(BFER_group);\n-\n- if (display_throughput)\n- {\n- auto& throughput_title = throughput_group.first;\n- auto& throughput_cols = throughput_group.second;\n-\n- throughput_title = std::make_pair(\"Global throughput\", \"and elapsed time\");\n- throughput_cols.clear();\n- throughput_cols.push_back(std::make_pair(\"SIM_THR\", \"(Mb/s)\"));\n- throughput_cols.push_back(std::make_pair(\"ET/RT\", \"(hhmmss)\"));\n-\n- this->cols_groups.push_back(throughput_group);\n- }\n}\ntemplate <typename B>\n@@ -68,29 +53,6 @@ void Reporter_BFER<B>\nstream << str_ber.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\nstream << str_fer.str() << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n-\n- if (display_throughput)\n- {\n- auto simu_time = (float)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - t_report).count(); // usec\n- auto simu_cthr = ((float)monitor.get_K() * (float)monitor.get_n_analyzed_fra()) / simu_time; // = Mbps\n-\n- auto displayed_time = (monitor.get_n_analyzed_fra() == 0) ? 0.f : simu_time * 1e-6f;\n-\n- if (!final)\n- displayed_time *= (float)monitor.get_n_fe() / (float)monitor.get_n_analyzed_fra() - 1.f;\n-\n- auto str_time = get_time_format(displayed_time);\n-\n- stream << std::string(extra_spaces(throughput_group), ' ');\n-\n-\n- std::stringstream str_cthr;\n- str_cthr << std::setprecision(3) << std::fixed << std::setw(Reporter_stream::column_width-1) << simu_cthr;\n-\n- stream << str_cthr.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << str_time << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n- }\n-\nstream.flags(f);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.hpp", "new_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.hpp", "diff": "@@ -17,14 +17,11 @@ class Reporter_BFER : public Reporter\n{\nprotected:\nconst module::Monitor_BFER<B> &monitor;\n- const bool display_throughput;\n- std::chrono::time_point<std::chrono::steady_clock> t_report;\ngroup_t BFER_group;\n- group_t throughput_group;\npublic:\n- explicit Reporter_BFER(const module::Monitor_BFER<B> &monitor, const bool display_throughput = false);\n+ explicit Reporter_BFER(const module::Monitor_BFER<B> &monitor);\nvirtual ~Reporter_BFER() = default;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/MI/Reporter_MI.cpp", "new_path": "src/Tools/Display/Reporter/MI/Reporter_MI.cpp", "diff": "@@ -8,35 +8,20 @@ using namespace aff3ct::tools;\ntemplate <typename B, typename R>\nReporter_MI<B,R>\n-::Reporter_MI(const module::Monitor_MI<B,R> &monitor, const bool display_throughput)\n+::Reporter_MI(const module::Monitor_MI<B,R> &monitor)\n: Reporter(),\n- monitor(monitor),\n- display_throughput(display_throughput),\n- t_report(std::chrono::steady_clock::now())\n+ monitor(monitor)\n{\nauto& MI_title = MI_group.first;\nauto& MI_cols = MI_group.second;\nMI_title = {\"Mutual Information (MI)\", \"\"};\n- MI_cols.push_back(std::make_pair(\"FRA\", \"\"));\n+ MI_cols.push_back(std::make_pair(\"TRIALS\", \"\"));\n+ MI_cols.push_back(std::make_pair(\"MI\", \"\"));\nMI_cols.push_back(std::make_pair(\"MIN\", \"\"));\nMI_cols.push_back(std::make_pair(\"MAX\", \"\"));\n- MI_cols.push_back(std::make_pair(\"AVG\", \"\"));\nthis->cols_groups.push_back(MI_group);\n-\n- if (display_throughput)\n- {\n- auto& throughput_title = throughput_group.first;\n- auto& throughput_cols = throughput_group.second;\n-\n- throughput_title = std::make_pair(\"Global throughput\", \"and elapsed time\");\n- throughput_cols.clear();\n- throughput_cols.push_back(std::make_pair(\"SIM_THR\", \"(Mb/s)\"));\n- throughput_cols.push_back(std::make_pair(\"ET/RT\", \"(hhmmss)\"));\n-\n- this->cols_groups.push_back(throughput_group);\n- }\n}\ntemplate <typename B, typename R>\n@@ -58,33 +43,10 @@ void Reporter_MI<B,R>\nstr_MI_min << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI_min();\nstr_MI_max << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI_max();\n- stream << str_MI_min.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\nstream << str_MI.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n+ stream << str_MI_min.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\nstream << str_MI_max.str() << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n-\n- if (display_throughput)\n- {\n- auto simu_time = (float)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - t_report).count(); // usec\n- auto simu_cthr = ((float)monitor.get_N() * (float)monitor.get_n_trials_fra()) / simu_time; // = Mbps\n-\n- auto displayed_time = (monitor.get_n_trials_fra() == 0) ? 0.f : simu_time * 1e-6f;\n-\n- if (!final)\n- displayed_time *= (float)monitor.get_n_trials_limit() / (float)monitor.get_n_trials_fra() - 1.f;\n-\n- auto str_time = get_time_format(displayed_time);\n-\n- stream << std::string(extra_spaces(throughput_group), ' ');\n-\n-\n- std::stringstream str_cthr;\n- str_cthr << std::setprecision(3) << std::fixed << std::setw(Reporter_stream::column_width-1) << simu_cthr;\n-\n- stream << str_cthr.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << str_time << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n- }\n-\nstream.flags(f);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/MI/Reporter_MI.hpp", "new_path": "src/Tools/Display/Reporter/MI/Reporter_MI.hpp", "diff": "@@ -16,14 +16,11 @@ class Reporter_MI : public Reporter\n{\nprotected:\nconst module::Monitor_MI<B,R> &monitor;\n- const bool display_throughput;\n- std::chrono::time_point<std::chrono::steady_clock> t_report;\ngroup_t MI_group;\n- group_t throughput_group;\npublic:\n- explicit Reporter_MI(const module::Monitor_MI<B,R> &monitor, const bool display_throughput = false);\n+ explicit Reporter_MI(const module::Monitor_MI<B,R> &monitor);\nvirtual ~Reporter_MI() = default;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Reporter.cpp", "new_path": "src/Tools/Display/Reporter/Reporter.cpp", "diff": "@@ -45,3 +45,10 @@ std::string Reporter\nreturn time_format2;\n}\n+\n+\n+void Reporter\n+::init()\n+{\n+\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Reporter.hpp", "new_path": "src/Tools/Display/Reporter/Reporter.hpp", "diff": "@@ -34,6 +34,9 @@ public:\nvirtual void report(std::ostream &stream = std::cout, bool final = false) = 0;\n+ virtual void init(); // do nothing by default\n+\n+\nstatic std::string get_time_format(float secondes);\nstatic unsigned extra_spaces (const title_t& text, const unsigned group_width);\nstatic unsigned extra_spaces (const group_t& group);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.cpp", "diff": "+#include <ios>\n+\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Reporter_throughput.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::tools;\n+\n+Reporter_throughput\n+::Reporter_throughput(PF_t progress_function, const unsigned long long limit)\n+: Reporter(),\n+ progress_function(progress_function),\n+ limit(limit),\n+ t_report(std::chrono::steady_clock::now())\n+{\n+ auto& throughput_title = throughput_group.first;\n+ auto& throughput_cols = throughput_group.second;\n+\n+ throughput_title = std::make_pair(\"Global throughput\", \"and elapsed time\");\n+ throughput_cols.clear();\n+ throughput_cols.push_back(std::make_pair(\"SIM_THR\", \"(Mb/s)\"));\n+ throughput_cols.push_back(std::make_pair(\"ET/RT\", \"(hhmmss)\"));\n+\n+ this->cols_groups.push_back(throughput_group);\n+}\n+\n+void Reporter_throughput\n+::report(std::ostream &stream, bool final)\n+{\n+ std::ios::fmtflags f(stream.flags());\n+\n+ const auto report_style = Reporter_stream::report_style;\n+\n+ auto progress = progress_function();\n+\n+ auto simu_time = (double)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - t_report).count(); // usec\n+ auto simu_cthr = ((double)progress) / simu_time; // = Mbps\n+\n+\n+ auto displayed_time = (progress == 0) ? 0.f : simu_time * 1e-6f; // sec\n+\n+ if (!final)\n+ displayed_time *= (double)limit / (double)progress - 1.;\n+ else\n+ t_report = std::chrono::steady_clock::now();\n+\n+\n+ auto str_time = get_time_format(displayed_time);\n+\n+ stream << std::string(extra_spaces(throughput_group), ' ');\n+\n+\n+ std::stringstream str_cthr;\n+ str_cthr << std::setprecision(3) << std::fixed << std::setw(Reporter_stream::column_width-1) << simu_cthr;\n+\n+ stream << str_cthr.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n+ stream << str_time << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n+\n+ stream.flags(f);\n+}\n+\n+\n+void Reporter_throughput\n+::init()\n+{\n+ t_report = std::chrono::steady_clock::now();\n+}\n+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "diff": "+#ifndef REPORTER_THROUGHPUT_HPP_\n+#define REPORTER_THROUGHPUT_HPP_\n+\n+#include <string>\n+#include <chrono>\n+#include <functional>\n+\n+#include \"Module/Monitor/MI/Monitor_MI.hpp\"\n+#include \"../Reporter.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+class Reporter_throughput : public Reporter\n+{\n+public:\n+ using PF_t = std::function<unsigned long long(void)>;\n+\n+protected:\n+ PF_t progress_function;\n+ const unsigned long long limit;\n+\n+ std::chrono::time_point<std::chrono::steady_clock> t_report;\n+\n+ group_t throughput_group;\n+\n+public:\n+ explicit Reporter_throughput(PF_t progress_function, const unsigned long long limit = 0);\n+\n+ virtual ~Reporter_throughput() = default;\n+\n+ void report(std::ostream &stream = std::cout, bool final = false);\n+\n+ void init();\n+};\n+}\n+}\n+\n+#endif /* REPORTER_THROUGHPUT_HPP_ */\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix Monitor_MI_BFER and add Reporter Throughput independant
8,483
07.06.2018 11:34:21
-7,200
4f5897e17a2787330013d1a847f893f653c440c1
Fix the codelet creation in monitors and the Reporter throughput instantiation
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -13,6 +13,13 @@ using namespace aff3ct::module;\ntemplate <typename B>\nMonitor_BFER<B>\n::Monitor_BFER(const int K, const unsigned max_fe, const bool count_unknown_values, const int n_frames)\n+: Monitor_BFER(true, K, max_fe, count_unknown_values, n_frames)\n+{\n+}\n+\n+template <typename B>\n+Monitor_BFER<B>\n+::Monitor_BFER(const bool create_task, const int K, const unsigned max_fe, const bool count_unknown_values, const int n_frames)\n: Monitor(n_frames), K(K),\nmax_fe(max_fe),\ncount_unknown_values(count_unknown_values),\n@@ -28,7 +35,9 @@ Monitor_BFER<B>\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- auto &p = this->create_task(\"check_errors\", (int)mnt_er::tsk::check_errors);\n+ if (create_task)\n+ {\n+ auto &p = this->create_task(\"check_errors\");\nauto &ps_U = this->template create_socket_in<B>(p, \"U\", this->K * this->n_frames);\nauto &ps_V = this->template create_socket_in<B>(p, \"V\", this->K * this->n_frames);\nthis->create_codelet(p, [this, &ps_U, &ps_V]() -> int\n@@ -37,6 +46,7 @@ Monitor_BFER<B>\nstatic_cast<B*>(ps_V.get_dataptr()));\n});\n}\n+}\ntemplate <typename B>\nMonitor_BFER<B>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "diff": "@@ -153,6 +153,7 @@ public:\nprotected:\nvirtual int _check_errors(const B *U, const B *Y, const int frame_id);\n+ Monitor_BFER(const bool create_task, const int K, const unsigned max_fe, const bool count_unknown_values, const int n_frames);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "diff": "@@ -13,6 +13,13 @@ using namespace aff3ct::module;\ntemplate <typename B, typename R>\nMonitor_MI<B,R>\n::Monitor_MI(const int N, const unsigned max_n_trials, const int n_frames)\n+: Monitor_MI(true, N, max_n_trials, n_frames)\n+{\n+}\n+\n+template <typename B, typename R>\n+Monitor_MI<B,R>\n+::Monitor_MI(const bool create_task, const int N, const unsigned max_n_trials, const int n_frames)\n: Monitor(n_frames), N(N),\nmax_n_trials(max_n_trials)\n{\n@@ -26,7 +33,9 @@ Monitor_MI<B,R>\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- auto &p = this->create_task(\"get_mutual_info\", (int)mnt_mi::tsk::get_mutual_info);\n+ if (create_task)\n+ {\n+ auto &p = this->create_task(\"get_mutual_info\");\nauto &ps_X = this->template create_socket_in<B>(p, \"X\", this->N * this->n_frames);\nauto &ps_Y = this->template create_socket_in<R>(p, \"Y\", this->N * this->n_frames);\nthis->create_codelet(p, [this, &ps_X, &ps_Y]() -> int\n@@ -35,6 +44,7 @@ Monitor_MI<B,R>\nstatic_cast<R*>(ps_Y.get_dataptr()));\n});\n}\n+}\ntemplate <typename B, typename R>\nMonitor_MI<B,R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "diff": "@@ -150,6 +150,9 @@ protected:\nvirtual R _get_mutual_info(const B *X, const R *Y, const int frame_id);\nvoid add_MI_value(const R mi);\n+\n+ Monitor_MI(const bool create_task, const int N, const unsigned max_n_trials, const int n_frames);\n+\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.cpp", "new_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.cpp", "diff": "@@ -16,31 +16,44 @@ Monitor_MI_BFER<B,R>\nconst unsigned mi_max_n_cf,\nconst unsigned er_max_fe, const bool er_count_unknown_values,\nconst int n_frames)\n+: Monitor_MI_BFER(true, K, N, mi_max_n_cf, er_max_fe, er_count_unknown_values, n_frames)\n+{\n+}\n+\n+template <typename B, typename R>\n+Monitor_MI_BFER<B,R>\n+::Monitor_MI_BFER(const bool create_task, const int K, const int N,\n+ const unsigned mi_max_n_cf,\n+ const unsigned er_max_fe, const bool er_count_unknown_values,\n+ const int n_frames)\n: Monitor ( n_frames),\n- Monitor_MI<B,R>(N, mi_max_n_cf, n_frames),\n- Monitor_BFER<B>(K, er_max_fe, er_count_unknown_values, n_frames),\n+ Monitor_MI<B,R>(false, N, mi_max_n_cf, n_frames),\n+ Monitor_BFER<B>(false, K, er_max_fe, er_count_unknown_values, n_frames),\nvals(Monitor_MI<B,R>::vals, Monitor_BFER<B>::vals)\n{\nconst std::string name = \"Monitor_MI_BFER\";\nthis->set_name(name);\n- // auto &p1 = this->create_task(\"check_errors\", (int)mnt::tsk::check_errors);\n- // auto &ps1_U = this->template create_socket_in<B>(p1, \"U\", this->K * this->n_frames);\n- // auto &ps1_V = this->template create_socket_in<B>(p1, \"V\", this->K * this->n_frames);\n- // this->create_codelet(p1, [this, &ps1_U, &ps1_V]() -> int\n- // {\n- // return this->check_errors(static_cast<B*>(ps1_U.get_dataptr()),\n- // static_cast<B*>(ps1_V.get_dataptr()));\n- // });\n+ if (create_task)\n+ {\n+ auto &p1 = this->create_task(\"check_errors\");\n+ auto &ps1_U = this->template create_socket_in<B>(p1, \"U\", this->K * this->n_frames);\n+ auto &ps1_V = this->template create_socket_in<B>(p1, \"V\", this->K * this->n_frames);\n+ this->create_codelet(p1, [this, &ps1_U, &ps1_V]() -> int\n+ {\n+ return this->check_errors(static_cast<B*>(ps1_U.get_dataptr()),\n+ static_cast<B*>(ps1_V.get_dataptr()));\n+ });\n- // auto &p2 = this->create_task(\"get_mutual_info\", (int)mnt_mi::tsk::get_mutual_info);\n- // auto &ps2_X = this->template create_socket_in<B>(p2, \"X\", this->N * this->n_frames);\n- // auto &ps2_Y = this->template create_socket_in<R>(p2, \"Y\", this->N * this->n_frames);\n- // this->create_codelet(p2, [this, &ps2_X, &ps2_Y]() -> int\n- // {\n- // return this->get_mutual_info(static_cast<B*>(ps2_X.get_dataptr()),\n- // static_cast<R*>(ps2_Y.get_dataptr()));\n- // });\n+ auto &p2 = this->create_task(\"get_mutual_info\");\n+ auto &ps2_X = this->template create_socket_in<B>(p2, \"X\", this->N * this->n_frames);\n+ auto &ps2_Y = this->template create_socket_in<R>(p2, \"Y\", this->N * this->n_frames);\n+ this->create_codelet(p2, [this, &ps2_X, &ps2_Y]() -> int\n+ {\n+ return this->get_mutual_info(static_cast<B*>(ps2_X.get_dataptr()),\n+ static_cast<R*>(ps2_Y.get_dataptr()));\n+ });\n+ }\n}\ntemplate <typename B, typename R>\n@@ -55,8 +68,8 @@ template <typename B, typename R>\nMonitor_MI_BFER<B,R>\n::Monitor_MI_BFER()\n: Monitor ( 1),\n- Monitor_MI<B,R>(0, 0, 1),\n- Monitor_BFER<B>(0, 0, 0, 1),\n+ Monitor_MI<B,R>(false, 0, 0, 1),\n+ Monitor_BFER<B>(false, 0, 0, 0, 1),\nvals(Monitor_MI<B,R>::vals, Monitor_BFER<B>::vals)\n{\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.hpp", "new_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.hpp", "diff": "@@ -27,26 +27,30 @@ template <typename B = int, typename R = float>\nclass Monitor_MI_BFER : public Monitor_MI<B,R>, public Monitor_BFER<B>\n{\npublic:\n- inline Task& operator[](const mnt::tsk t)\n- {\n- switch(t)\n- {\n- case mnt::tsk::check_errors : return Monitor_BFER<B>::operator[](mnt_er::tsk::check_errors );\n- case mnt::tsk::get_mutual_info : return Monitor_MI<B,R>::operator[](mnt_mi::tsk::get_mutual_info);\n- default : break;\n- }\n- return Monitor_MI<B,R>::operator[](mnt_mi::tsk::SIZE);\n- }\n-\n- inline Socket& operator[](const mnt::sck::check_errors s)\n- {\n- return Monitor_BFER<B>::operator[](mnt_er::tsk::check_errors)[(int)s];\n- }\n-\n- inline Socket& operator[](const mnt::sck::get_mutual_info s)\n- {\n- return Monitor_MI<B,R>::operator[](mnt_mi::tsk::get_mutual_info)[(int)s];\n- }\n+ inline Task& operator[](const mnt::tsk t) { return Module::operator[]((int)t); }\n+ inline Socket& operator[](const mnt::sck::get_mutual_info s) { return Module::operator[]((int)mnt::tsk::get_mutual_info)[(int)s]; }\n+ inline Socket& operator[](const mnt::sck::check_errors s) { return Module::operator[]((int)mnt::tsk::check_errors )[(int)s]; }\n+\n+ // inline Task& operator[](const mnt::tsk t)\n+ // {\n+ // switch(t)\n+ // {\n+ // case mnt::tsk::check_errors : return Monitor_BFER<B>::operator[](mnt_er::tsk::check_errors );\n+ // case mnt::tsk::get_mutual_info : return Monitor_MI<B,R>::operator[](mnt_mi::tsk::get_mutual_info);\n+ // default : break;\n+ // }\n+ // return Monitor_MI<B,R>::operator[](mnt_mi::tsk::SIZE);\n+ // }\n+\n+ // inline Socket& operator[](const mnt::sck::check_errors s)\n+ // {\n+ // return Monitor_BFER<B>::operator[](mnt_er::tsk::check_errors)[(int)s];\n+ // }\n+\n+ // inline Socket& operator[](const mnt::sck::get_mutual_info s)\n+ // {\n+ // return Monitor_MI<B,R>::operator[](mnt_mi::tsk::get_mutual_info)[(int)s];\n+ // }\nstruct Values_t\n{\n@@ -118,6 +122,12 @@ public:\nvirtual void collect(const Monitor& m);\nvirtual void collect(const Monitor_MI_BFER<B,R>& m);\n+\n+protected:\n+ Monitor_MI_BFER(const bool create_task, const int K, const int N,\n+ const unsigned mi_max_n_cf,\n+ const unsigned er_max_fe, const bool er_count_unknown_values,\n+ const int n_frames);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -104,7 +104,7 @@ BFER<B,R,Q>\nrep_er = new tools::Reporter_BFER<B>(*this->monitor_red);\nreporters.push_back(rep_er);\n- rep_throughput = new tools::Reporter_throughput(std::bind(&Monitor_reduction_type::get_n_fe, *this->monitor_red), this->monitor_red->get_fe_limit());\n+ rep_throughput = new tools::Reporter_throughput<uint64_t>(std::bind(&Monitor_reduction_type::get_n_fe, this->monitor_red), this->monitor_red->get_fe_limit());\nreporters.push_back(rep_throughput);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.hpp", "new_path": "src/Simulation/BFER/BFER.hpp", "diff": "@@ -65,7 +65,7 @@ protected:\ntools::Reporter_BFER <B>* rep_er;\ntools::Reporter_MI <B,R>* rep_mi;\ntools::Reporter_noise<R>* rep_noise;\n- tools::Reporter_throughput* rep_throughput;\n+ tools::Reporter_throughput<uint64_t>* rep_throughput;\nstd::vector<tools::Reporter*> reporters;\ntools::Terminal* terminal;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "diff": "#include <string>\n#include <chrono>\n#include <functional>\n+#include <cassert>\n+#include <type_traits>\n#include \"Module/Monitor/MI/Monitor_MI.hpp\"\n#include \"../Reporter.hpp\"\n@@ -12,10 +14,13 @@ namespace aff3ct\n{\nnamespace tools\n{\n+template <typename T>\nclass Reporter_throughput : public Reporter\n{\n+ static_assert(std::is_convertible<T, double>::value, \"T type must be convertible to a double.\");\n+\npublic:\n- using PF_t = std::function<unsigned long long(void)>;\n+ using PF_t = std::function<T(void)>;\nprotected:\nPF_t progress_function;\n@@ -26,7 +31,7 @@ protected:\ngroup_t throughput_group;\npublic:\n- explicit Reporter_throughput(PF_t progress_function, const unsigned long long limit = 0);\n+ explicit Reporter_throughput(std::function<T(void)> progress_function, const unsigned long long limit = 0);\nvirtual ~Reporter_throughput() = default;\n@@ -37,4 +42,6 @@ public:\n}\n}\n+#include \"Reporter_throughput.hxx\"\n+\n#endif /* REPORTER_THROUGHPUT_HPP_ */\n" }, { "change_type": "RENAME", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.cpp", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "diff": "+#ifndef REPORTER_THROUGHPUT_HXX_\n+#define REPORTER_THROUGHPUT_HXX_\n+\n#include <ios>\n#include \"Tools/Exception/exception.hpp\"\n#include \"Reporter_throughput.hpp\"\n-using namespace aff3ct;\n-using namespace aff3ct::tools;\n-\n-Reporter_throughput\n-::Reporter_throughput(PF_t progress_function, const unsigned long long limit)\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+template <typename T>\n+Reporter_throughput<T>\n+::Reporter_throughput(std::function<T(void)> progress_function, const unsigned long long limit)\n: Reporter(),\nprogress_function(progress_function),\nlimit(limit),\n@@ -24,7 +29,8 @@ Reporter_throughput\nthis->cols_groups.push_back(throughput_group);\n}\n-void Reporter_throughput\n+template <typename T>\n+void Reporter_throughput<T>\n::report(std::ostream &stream, bool final)\n{\nstd::ios::fmtflags f(stream.flags());\n@@ -60,9 +66,14 @@ void Reporter_throughput\n}\n-void Reporter_throughput\n+template <typename T>\n+void Reporter_throughput<T>\n::init()\n{\nt_report = std::chrono::steady_clock::now();\n}\n+}\n+}\n+\n+#endif /* REPORTER_THROUGHPUT_HXX_ */\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the codelet creation in monitors and the Reporter throughput instantiation
8,483
07.06.2018 12:30:53
-7,200
13908659c7333aaf8ca014e6d4108f5320df03ac
Create a generic terminal::report function to display reports from Reporters that return only vector of data
[ { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.cpp", "new_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.cpp", "diff": "@@ -22,6 +22,7 @@ Reporter_BFER<B>\nauto& BFER_cols = BFER_group.second;\nBFER_title = {\"Bit Error Rate (BER) and Frame Error Rate (FER)\", \"\"};\n+ BFER_cols.push_back(std::make_pair(\"FRA\", \"\"));\nBFER_cols.push_back(std::make_pair(\"BE\", \"\"));\nBFER_cols.push_back(std::make_pair(\"FE\", \"\"));\nBFER_cols.push_back(std::make_pair(\"BER\", \"\"));\n@@ -31,29 +32,28 @@ Reporter_BFER<B>\n}\ntemplate <typename B>\n-void Reporter_BFER<B>\n-::report(std::ostream &stream, bool final)\n+Reporter::report_t Reporter_BFER<B>\n+::report(bool final)\n{\n- std::ios::fmtflags f(stream.flags());\n+ assert(this->cols_groups.size() == 1);\n- const auto report_style = Reporter_stream::report_style;\n+ report_t report(this->cols_groups.size());\n- stream << report_style << Reporter_stream::spaced_scol_separator << std::string(extra_spaces(BFER_group), ' ') << rang::style::reset;\n+ auto& bfer_report = report[0];\n-\n- stream << Reporter_stream::format(monitor.get_n_analyzed_fra()) << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << Reporter_stream::format(monitor.get_n_be() ) << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << Reporter_stream::format(monitor.get_n_fe() ) << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n+ bfer_report.push_back(Reporter_stream::format(monitor.get_n_analyzed_fra()) + \" \");\n+ bfer_report.push_back(Reporter_stream::format(monitor.get_n_be ()) + \" \");\n+ bfer_report.push_back(Reporter_stream::format(monitor.get_n_fe ()) + \" \");\nstd::stringstream str_ber, str_fer;\n- str_ber << std::setprecision(2) << std::scientific << std::setw(Reporter_stream::column_width-1) << monitor.get_ber();\n- str_fer << std::setprecision(2) << std::scientific << std::setw(Reporter_stream::column_width-1) << monitor.get_fer();\n+ str_ber << std::setprecision(2) << std::scientific << std::setw(Reporter_stream::column_width-1) << monitor.get_ber() << \" \";\n+ str_fer << std::setprecision(2) << std::scientific << std::setw(Reporter_stream::column_width-1) << monitor.get_fer() << \" \";\n- stream << str_ber.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << str_fer.str() << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n+ bfer_report.push_back(str_ber.str());\n+ bfer_report.push_back(str_fer.str());\n- stream.flags(f);\n+ return report;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.hpp", "new_path": "src/Tools/Display/Reporter/BFER/Reporter_BFER.hpp", "diff": "@@ -25,7 +25,7 @@ public:\nvirtual ~Reporter_BFER() = default;\n- void report(std::ostream &stream = std::cout, bool final = false);\n+ report_t report(bool final = false);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/MI/Reporter_MI.cpp", "new_path": "src/Tools/Display/Reporter/MI/Reporter_MI.cpp", "diff": "@@ -25,29 +25,27 @@ Reporter_MI<B,R>\n}\ntemplate <typename B, typename R>\n-void Reporter_MI<B,R>\n-::report(std::ostream &stream, bool final)\n+Reporter::report_t Reporter_MI<B,R>\n+::report(bool final)\n{\n- std::ios::fmtflags f(stream.flags());\n+ assert(this->cols_groups.size() == 1);\n- const auto report_style = Reporter_stream::report_style;\n+ report_t report(this->cols_groups.size());\n- stream << report_style << Reporter_stream::spaced_scol_separator << std::string(extra_spaces(MI_group), ' ') << rang::style::reset;\n-\n-\n- stream << Reporter_stream::format(monitor.get_n_trials_fra()) << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n+ auto& mi_report = report[0];\n+ mi_report.push_back(Reporter_stream::format(monitor.get_n_trials_fra()) + \" \");\nstd::stringstream str_MI, str_MI_min, str_MI_max;\n- str_MI << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI ();\n- str_MI_min << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI_min();\n- str_MI_max << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI_max();\n+ str_MI << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI () << \" \";\n+ str_MI_min << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI_min() << \" \";\n+ str_MI_max << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI_max() << \" \";\n- stream << str_MI.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << str_MI_min.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << str_MI_max.str() << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n+ mi_report.push_back(str_MI .str());\n+ mi_report.push_back(str_MI_min.str());\n+ mi_report.push_back(str_MI_max.str());\n- stream.flags(f);\n+ return report;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/MI/Reporter_MI.hpp", "new_path": "src/Tools/Display/Reporter/MI/Reporter_MI.hpp", "diff": "@@ -24,7 +24,7 @@ public:\nvirtual ~Reporter_MI() = default;\n- void report(std::ostream &stream = std::cout, bool final = false);\n+ report_t report(bool final = false);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Noise/Reporter_noise.cpp", "new_path": "src/Tools/Display/Reporter/Noise/Reporter_noise.cpp", "diff": "@@ -47,8 +47,8 @@ Reporter_noise<R>\n}\ntemplate <typename R>\n-void Reporter_noise<R>\n-::report(std::ostream &stream, bool final)\n+Reporter::report_t Reporter_noise<R>\n+::report(bool final)\n{\nif (this->saved_noise_type != this->noise->get_type())\n{\n@@ -59,38 +59,45 @@ void Reporter_noise<R>\nthrow invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- std::ios::fmtflags f(stream.flags());\n+ assert(this->cols_groups.size() == 1);\n- const auto report_style = Reporter_stream::report_style;\n+ report_t report(this->cols_groups.size());\n- stream << report_style << Reporter_stream::spaced_scol_separator << std::string(extra_spaces(noise_group), ' ') << rang::style::reset;\n+ auto& noise_report = report[0];\n+\n+ std::stringstream stream;\n+\nswitch (this->noise->get_type())\n{\ncase Noise_type::SIGMA :\n{\nauto sig = dynamic_cast<const tools::Sigma<>*>(this->noise);\n- stream << std::setprecision(2) << std::fixed << std::setw(Reporter_stream::column_width - 1) << sig->get_esn0()\n- << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << std::setprecision(2) << std::fixed << std::setw(Reporter_stream::column_width - 1) << sig->get_ebn0();\n+\n+ stream << std::setprecision(2) << std::fixed << std::setw(Reporter_stream::column_width - 1) << sig->get_esn0() << \" \";\n+ noise_report.push_back(stream.str());\n+ stream.str(\"\");\n+\n+ stream << std::setprecision(2) << std::fixed << std::setw(Reporter_stream::column_width - 1) << sig->get_ebn0() << \" \";\nbreak;\n}\ncase Noise_type::ROP :\n{\n- stream << std::setprecision(2) << std::fixed << std::setw(Reporter_stream::column_width - 1) << this->noise->get_noise();;\n+ stream << std::setprecision(2) << std::fixed << std::setw(Reporter_stream::column_width - 1) << this->noise->get_noise() << \" \";\nbreak;\n}\ncase Noise_type::EP :\n{\n- stream << std::setprecision(4) << std::fixed << std::setw(Reporter_stream::column_width - 1) << this->noise->get_noise();;\n+ stream << std::setprecision(4) << std::fixed << std::setw(Reporter_stream::column_width - 1) << this->noise->get_noise() << \" \";\nbreak;\n}\n}\n- stream << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n+ noise_report.push_back(stream.str());\n+\n- stream.flags(f);\n+ return report;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Noise/Reporter_noise.hpp", "new_path": "src/Tools/Display/Reporter/Noise/Reporter_noise.hpp", "diff": "@@ -25,7 +25,7 @@ public:\nexplicit Reporter_noise(Noise<R>* const& noise);\nvirtual ~Reporter_noise() = default;\n- void report(std::ostream &stream = std::cout, bool final = false);\n+ report_t report(bool final = false);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Reporter.cpp", "new_path": "src/Tools/Display/Reporter/Reporter.cpp", "diff": "@@ -52,3 +52,9 @@ void Reporter\n{\n}\n+\n+const std::vector<Reporter::group_t>& Reporter\n+::get_groups() const\n+{\n+ return this->cols_groups;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Reporter.hpp", "new_path": "src/Tools/Display/Reporter/Reporter.hpp", "diff": "@@ -25,6 +25,10 @@ public:\nusing column_title_t = std::vector<title_t>;\nusing group_t = std::pair<group_title_t, column_title_t>;\n+\n+ using report_t = std::vector<std::vector<std::string>>;\n+\n+protected:\nstd::vector<group_t> cols_groups;\npublic:\n@@ -32,7 +36,14 @@ public:\nvirtual ~Reporter() = default;\n- virtual void report(std::ostream &stream = std::cout, bool final = false) = 0;\n+\n+ const std::vector<group_t>& get_groups() const;\n+\n+ /*\n+ * Report a vector as long as the number of groups (cols_groups.size())\n+ * with each sub vector as long as the number of columns of the matching group (cols_groups[i].second.size())\n+ */\n+ virtual report_t report(bool final = false) = 0;\nvirtual void init(); // do nothing by default\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "diff": "@@ -35,7 +35,7 @@ public:\nvirtual ~Reporter_throughput() = default;\n- void report(std::ostream &stream = std::cout, bool final = false);\n+ report_t report(bool final = false);\nvoid init();\n};\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "diff": "@@ -30,12 +30,15 @@ Reporter_throughput<T>\n}\ntemplate <typename T>\n-void Reporter_throughput<T>\n-::report(std::ostream &stream, bool final)\n+Reporter::report_t Reporter_throughput<T>\n+::report(bool final)\n{\n- std::ios::fmtflags f(stream.flags());\n+ assert(this->cols_groups.size() == 1);\n+\n+ report_t report(this->cols_groups.size());\n+\n+ auto& thgput_report = report[0];\n- const auto report_style = Reporter_stream::report_style;\nauto progress = progress_function();\n@@ -50,22 +53,20 @@ void Reporter_throughput<T>\nelse\nt_report = std::chrono::steady_clock::now();\n-\n- auto str_time = get_time_format(displayed_time);\n-\n- stream << std::string(extra_spaces(throughput_group), ' ');\n+ auto str_time = get_time_format(displayed_time) + \" \";\n+ int n_spaces = (int)Reporter_stream::column_width - (int)str_time.size();\n+ str_time = std::string((n_spaces >= 0) ? n_spaces : 0, ' ') + get_time_format(displayed_time);\nstd::stringstream str_cthr;\n- str_cthr << std::setprecision(3) << std::fixed << std::setw(Reporter_stream::column_width-1) << simu_cthr;\n+ str_cthr << std::setprecision(3) << std::fixed << std::setw(Reporter_stream::column_width-1) << simu_cthr << \" \";\n- stream << str_cthr.str() << report_style << Reporter_stream::spaced_scol_separator << rang::style::reset;\n- stream << str_time << report_style << Reporter_stream::spaced_dcol_separator << rang::style::reset;\n+ thgput_report.push_back(str_cthr.str());\n+ thgput_report.push_back(str_time);\n- stream.flags(f);\n+ return report;\n}\n-\ntemplate <typename T>\nvoid Reporter_throughput<T>\n::init()\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/Terminal.cpp", "new_path": "src/Tools/Display/Terminal/Terminal.cpp", "diff": "@@ -24,11 +24,11 @@ Terminal\nvoid Terminal\n::legend(std::ostream &stream) const\n{\n- std::vector<Reporter::group_t*> cols_groups;\n+ std::vector<const Reporter::group_t*> cols_groups;\nfor(auto& r : this->reporters)\nif (r != nullptr)\n- for (auto& g : r->cols_groups)\n+ for (auto& g : r->get_groups())\ncols_groups.push_back(&g);\nelse\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"'this->reporters' contains null pointer.\");\n@@ -203,16 +203,7 @@ void Terminal\nvoid Terminal\n::temp_report(std::ostream &stream)\n{\n- std::ios::fmtflags f(stream.flags());\n-\n- for(auto& r : this->reporters)\n- r->report(stream, false);\n-\n- stream << rang::style::bold << rang::fg::green << (real_time_state++ < 2 ? \" *\" : \" \") << rang::style::reset << \"\\r\";\n- real_time_state %= (uint8_t)4;\n-\n- stream.flush();\n- stream.flags(f);\n+ this->report(stream, false);\n}\nvoid Terminal\n@@ -223,18 +214,9 @@ void Terminal\nauto et = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - t_term).count();\nif (!module::Monitor::is_over() || et >= 1.f)\n- {\n- std::ios::fmtflags f(stream.flags());\n- for(auto& r : this->reporters)\n- r->report(stream, true);\n-\n- stream << (module::Monitor::is_interrupt() ? \" x\" : \" \") << std::endl;\n-\n- stream.flags(f);\n- }\n+ this->report(stream, true);\nt_term = std::chrono::steady_clock::now();\n-\n}\nvoid Terminal\n@@ -274,3 +256,59 @@ void Terminal\nterminal->temp_report(std::clog); // display statistics in the terminal\n}\n}\n+\n+void Terminal\n+::report(std::ostream &stream, bool final)\n+{\n+ std::ios::fmtflags f(stream.flags());\n+\n+ const auto report_style = Reporter_stream::report_style;\n+\n+ stream << \"\\r\" << Reporter_stream::data_tag;\n+\n+\n+ for (unsigned r = 0; r < this->reporters.size(); r++)\n+ if (this->reporters[r] != nullptr)\n+ {\n+ auto report = this->reporters[r]->report(final);\n+ auto& groups = this->reporters[r]->get_groups();\n+\n+ assert(report.size() == groups.size());\n+\n+ for (unsigned g = 0; g < groups.size(); g++)\n+ {\n+ assert(report[g].size() == groups[g].second.size());\n+\n+ stream << report_style << std::string(Reporter::extra_spaces(groups[g]), ' ') << rang::style::reset;\n+\n+ for (unsigned c = 0; c < report[g].size(); c++)\n+ {\n+ stream << report[g][c];\n+\n+ if (c != (report[g].size() - 1))\n+ stream << report_style << Reporter_stream::col_separator << rang::style::reset;\n+ }\n+\n+ if (g != (groups.size() - 1))\n+ stream << report_style << Reporter_stream::group_separator << rang::style::reset;\n+ }\n+\n+ if (r != (this->reporters.size() - 1))\n+ stream << report_style << Reporter_stream::group_separator << rang::style::reset;\n+ }\n+ else\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, \"'this->reporters' contains null pointer.\");\n+\n+ if (final)\n+ {\n+ stream << (module::Monitor::is_interrupt() ? \" x\" : \" \") << std::endl;\n+ }\n+ else\n+ {\n+ stream << rang::style::bold << rang::fg::green << (real_time_state++ < 2 ? \" *\" : \" \") << rang::style::reset << \"\\r\";\n+ real_time_state %= (uint8_t)4;\n+ }\n+\n+ stream.flags(f);\n+ stream.flush();\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/Terminal.hpp", "new_path": "src/Tools/Display/Terminal/Terminal.hpp", "diff": "@@ -80,6 +80,9 @@ public:\nvoid start_temp_report(const std::chrono::milliseconds freq = std::chrono::milliseconds(500));\nvoid stop_temp_report();\n+protected:\n+ virtual void report(std::ostream &stream = std::cout, bool final = false);\n+\nprivate:\nstatic void start_thread_terminal(Terminal *terminal, const std::chrono::milliseconds freq);\n};\n" } ]
C++
MIT License
aff3ct/aff3ct
Create a generic terminal::report function to display reports from Reporters that return only vector of data
8,483
07.06.2018 13:12:51
-7,200
837ea5c9e885c75ba5fc580dbdc629d0fe3db7d1
Move the Signal handling in the terminal instead of Monitor
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -116,7 +116,7 @@ template <typename B>\nbool Monitor_BFER<B>\n::fe_limit_achieved()\n{\n- return (get_n_fe() >= get_fe_limit()) || this->is_interrupt();\n+ return get_n_fe() >= get_fe_limit();\n}\ntemplate <typename B>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/EXIT/Monitor_EXIT.cpp", "new_path": "src/Module/Monitor/EXIT/Monitor_EXIT.cpp", "diff": "-#include <cmath>\n-#include <string>\n-#include <vector>\n-#include <stdexcept>\n-\n-#include \"Monitor_EXIT.hpp\"\n-\n-using namespace aff3ct::module;\n-\n-template <typename B, typename R>\n-Monitor_EXIT<B,R>\n-::Monitor_EXIT(const int N, const unsigned n_trials, const int n_frames)\n-: Monitor(n_frames),\n- n_trials(n_trials),\n- I_A_sum((R)0),\n- n_analyzed_frames(0)\n-{\n- const std::string name = \"Monitor_EXIT\";\n- this->set_name(name);\n-\n-// auto &p = this->create_task(\"check_mutual_info\", (int)mnt::tsk::check_mutual_info);\n-// auto &ps_bits = this->template create_socket_in<B>(p, \"bits\", this->N * this->n_frames);\n-// auto &ps_llrs_a = this->template create_socket_in<R>(p, \"llrs_a\", this->N * this->n_frames);\n-// auto &ps_llrs_e = this->template create_socket_in<R>(p, \"llrs_e\", this->N * this->n_frames);\n-\n-// this->create_codelet(p, [this, &ps_bits, &ps_llrs_a, &ps_llrs_e]() -> int\n-// {\n-// this->check_mutual_info(static_cast<B*>(ps_bits .get_dataptr()),\n-// static_cast<R*>(ps_llrs_a.get_dataptr()),\n-// static_cast<R*>(ps_llrs_e.get_dataptr()));\n-\n-// return 0;\n-// });\n-}\n-\n-template <typename B, typename R>\n-void Monitor_EXIT<B,R>\n-::check_mutual_info(const B *bits, const R *llrs_a, const R *llrs_e, const int frame_id)\n-{\n- const auto f_start = (frame_id < 0) ? 0 : frame_id % this->n_frames;\n- const auto f_stop = (frame_id < 0) ? this->n_frames : f_start +1;\n-\n- for (auto f = f_start; f < f_stop; f++)\n- {\n- this->_check_mutual_info_avg(bits + f * this->N,\n- llrs_a + f * this->N,\n- f);\n-\n- bits_buff .insert(bits_buff .end(), bits + f * this->N, bits + (f +1) * this->N);\n- llrs_e_buff.insert(llrs_e_buff.end(), llrs_e + f * this->N, llrs_e + (f +1) * this->N);\n-\n- n_analyzed_frames++;\n- }\n-\n- for (auto c : this->callbacks_measure)\n- c();\n-}\n-\n-template <typename B, typename R>\n-void Monitor_EXIT<B,R>\n-::_check_mutual_info_avg(const B *bits, const R *llrs_a, const int frame_id)\n-{\n- for (int j = 0; j < this->N; j++)\n- {\n- double symb = -2.0 * (double)bits[j] +1.0;\n- I_A_sum += (R)(1.0 - std::log2(1.0 + std::exp(-symb * (double)llrs_a[j])));\n- }\n-}\n-\n-template <typename B, typename R>\n-R Monitor_EXIT<B,R>\n-::_check_mutual_info_histo() const\n-{\n- size_t N = this->bits_buff.size();\n- unsigned bit_1_count = 0;\n- for (size_t i = 0; i < N; i++)\n- bit_1_count += (unsigned)bits_buff[i];\n-\n- unsigned bit_0_count = (unsigned)N - bit_1_count;\n- if (bit_0_count == 0 || bit_1_count == 0)\n- {\n- return (R)0;\n- }\n- else\n- {\n- const R inf = std::numeric_limits<R>::infinity();\n-\n- bool lots_of_bins;\n- unsigned bin_count;\n- int bin_offset = 0;\n- R bin_width = (R)0;\n-\n- // determine the min and max value for llrs / 0 and llrs / 1\n- R llr_0_max = -inf, llr_1_max = -inf;\n- R llr_0_min = +inf, llr_1_min = +inf;\n-\n- unsigned llr_0_noninfinite_count = 0;\n- unsigned llr_1_noninfinite_count = 0;\n-\n- for (unsigned i = 0; i < N; i++)\n- {\n- if (!std::isinf(llrs_e_buff[i]))\n- {\n- if ((int)bits_buff[i] == 0)\n- {\n- llr_0_noninfinite_count++;\n- llr_0_min = std::min(llrs_e_buff[i], llr_0_min);\n- llr_0_max = std::max(llrs_e_buff[i], llr_0_max);\n- }\n- else\n- {\n- llr_1_noninfinite_count++;\n- llr_1_min = std::min(llrs_e_buff[i], llr_1_min);\n- llr_1_max = std::max(llrs_e_buff[i], llr_1_max);\n- }\n- }\n- }\n- if (llr_0_noninfinite_count && llr_1_noninfinite_count && llr_0_min <= llr_1_max && llr_1_min <= llr_0_max)\n- {\n- R llr_0_mean = (R)0;\n- R llr_1_mean = (R)0;\n- for (unsigned i = 0; i < N; i++)\n- {\n- if (!std::isinf(llrs_e_buff[i]))\n- {\n- if ((int)bits_buff[i] == 0) llr_0_mean += llrs_e_buff[i];\n- else llr_1_mean += llrs_e_buff[i];\n- }\n- }\n- llr_0_mean /= llr_0_noninfinite_count;\n- llr_1_mean /= llr_1_noninfinite_count;\n-\n- R llr_0_variance = (R)0;\n- R llr_1_variance = (R)0;\n- for (unsigned i = 0; i < N; i++)\n- {\n- if (!std::isinf(llrs_e_buff[i]))\n- {\n- if ((int)bits_buff[i] == 0) llr_0_variance += std::pow((llrs_e_buff[i] - llr_0_mean), 2);\n- else llr_1_variance += std::pow((llrs_e_buff[i] - llr_1_mean), 2);\n- }\n- }\n- llr_0_variance /= llr_0_noninfinite_count;\n- llr_1_variance /= llr_1_noninfinite_count;\n-\n- bin_width = (R)0.5 * ((R)3.49 * (R)std::sqrt(llr_0_variance) * (R)(std::pow(llr_0_noninfinite_count, (R)-1.0 / (R)3.0)) +\n- (R)3.49 * (R)std::sqrt(llr_1_variance) * (R)(std::pow(llr_1_noninfinite_count, (R)-1.0 / (R)3.0)));\n- if (bin_width > (R)0)\n- {\n- bin_offset = (int)std::floor(std::min(llr_0_min, llr_1_min) / bin_width) -1;\n- auto tmp = std::max(llr_0_max, llr_1_max) / bin_width - (R)bin_offset + (R)1;\n- bin_count = (unsigned)std::ceil(tmp);\n- if ((R)bin_count == tmp)\n- bin_count++;\n- }\n- else\n- {\n- bin_offset = -1;\n- bin_count = 3;\n- }\n- lots_of_bins = true;\n- }\n- else\n- {\n- lots_of_bins = false;\n- bin_count = 4;\n- }\n-\n- std::vector<std::vector<unsigned>> histogram(2, std::vector<unsigned>(bin_count));\n- std::vector<std::vector<R >> pdf (2, std::vector<R >(bin_count));\n- for (unsigned i = 0; i < N; i++)\n- {\n- if (llrs_e_buff[i] == -inf) histogram[(int)bits_buff[i]][0 ]++;\n- else if (llrs_e_buff[i] == inf) histogram[(int)bits_buff[i]][bin_count -1]++;\n- else\n- {\n- if (lots_of_bins)\n- {\n- if (bin_width > 0.0)\n- histogram[(int)bits_buff[i]][(int)(std::floor(llrs_e_buff[i] / bin_width) - bin_offset)]++;\n- else\n- histogram[(int)bits_buff[i]][1]++;\n- }\n- else\n- histogram[(int)bits_buff[i]][(int)bits_buff[i] +1]++;\n- }\n- }\n-\n- for (unsigned i = 0; i < bin_count; i++)\n- {\n- pdf[0][i] = (R)histogram[0][i] / (R)bit_0_count;\n- pdf[1][i] = (R)histogram[1][i] / (R)bit_1_count;\n- }\n-\n- R I_E = (R)0;\n- for (auto b = 0; b < 2; b++)\n- for (unsigned bin_ix = 0; bin_ix < bin_count; bin_ix++)\n- if (pdf[b][bin_ix] > (R)0)\n- I_E += (R)0.5 * pdf[b][bin_ix] * std::log2((R)2.0 * pdf[b][bin_ix] / (pdf[0][bin_ix] + pdf[1][bin_ix]));\n-\n- return I_E;\n- }\n-}\n-\n-template <typename B, typename R>\n-unsigned Monitor_EXIT<B,R>\n-::get_n_trials() const\n-{\n- return n_trials;\n-}\n-\n-template <typename B, typename R>\n-bool Monitor_EXIT<B,R>\n-::n_trials_achieved() const\n-{\n- return (get_n_analyzed_fra() >= get_n_trials()) || Monitor::interrupt;\n-}\n-\n-template <typename B, typename R>\n-R Monitor_EXIT<B,R>\n-::get_I_A() const\n-{\n- return this->I_A_sum / (R)(this->N * this->n_analyzed_frames);\n-}\n-\n-template <typename B, typename R>\n-R Monitor_EXIT<B,R>\n-::get_I_E() const\n-{\n- return this->_check_mutual_info_histo();\n-}\n-\n-template <typename B, typename R>\n-unsigned long long Monitor_EXIT<B,R>\n-::get_n_analyzed_fra() const\n-{\n- return n_analyzed_frames;\n-}\n-\n-template <typename B, typename R>\n-void Monitor_EXIT<B,R>\n-::add_handler_measure(std::function<void(void)> callback)\n-{\n- this->callbacks_measure.push_back(callback);\n-}\n-\n-template <typename B, typename R>\n-void Monitor_EXIT<B,R>\n-::reset()\n-{\n- Monitor::reset();\n-\n- this->n_analyzed_frames = 0;\n- this->I_A_sum = (R)0;\n- this->bits_buff.clear();\n- this->llrs_e_buff.clear();\n-}\n-\n-template <typename B, typename R>\n-void Monitor_EXIT<B,R>\n-::clear_callbacks()\n-{\n- this->callbacks_measure.clear();\n-}\n-\n-// ==================================================================================== explicit template instantiation\n-#include \"Tools/types.h\"\n-#ifdef MULTI_PREC\n-template class aff3ct::module::Monitor_EXIT<B_32,R_32>;\n-template class aff3ct::module::Monitor_EXIT<B_64,R_64>;\n-#else\n-template class aff3ct::module::Monitor_EXIT<B,R>;\n-#endif\n-// ==================================================================================== explicit template instantiation\n+// #include <cmath>\n+// #include <string>\n+// #include <vector>\n+// #include <stdexcept>\n+\n+// #include \"Monitor_EXIT.hpp\"\n+\n+// using namespace aff3ct::module;\n+\n+// template <typename B, typename R>\n+// Monitor_EXIT<B,R>\n+// ::Monitor_EXIT(const int N, const unsigned n_trials, const int n_frames)\n+// : Monitor(n_frames),\n+// n_trials(n_trials),\n+// I_A_sum((R)0),\n+// n_analyzed_frames(0)\n+// {\n+// const std::string name = \"Monitor_EXIT\";\n+// this->set_name(name);\n+\n+// // auto &p = this->create_task(\"check_mutual_info\", (int)mnt::tsk::check_mutual_info);\n+// // auto &ps_bits = this->template create_socket_in<B>(p, \"bits\", this->N * this->n_frames);\n+// // auto &ps_llrs_a = this->template create_socket_in<R>(p, \"llrs_a\", this->N * this->n_frames);\n+// // auto &ps_llrs_e = this->template create_socket_in<R>(p, \"llrs_e\", this->N * this->n_frames);\n+\n+// // this->create_codelet(p, [this, &ps_bits, &ps_llrs_a, &ps_llrs_e]() -> int\n+// // {\n+// // this->check_mutual_info(static_cast<B*>(ps_bits .get_dataptr()),\n+// // static_cast<R*>(ps_llrs_a.get_dataptr()),\n+// // static_cast<R*>(ps_llrs_e.get_dataptr()));\n+\n+// // return 0;\n+// // });\n+// }\n+\n+// template <typename B, typename R>\n+// void Monitor_EXIT<B,R>\n+// ::check_mutual_info(const B *bits, const R *llrs_a, const R *llrs_e, const int frame_id)\n+// {\n+// const auto f_start = (frame_id < 0) ? 0 : frame_id % this->n_frames;\n+// const auto f_stop = (frame_id < 0) ? this->n_frames : f_start +1;\n+\n+// for (auto f = f_start; f < f_stop; f++)\n+// {\n+// this->_check_mutual_info_avg(bits + f * this->N,\n+// llrs_a + f * this->N,\n+// f);\n+\n+// bits_buff .insert(bits_buff .end(), bits + f * this->N, bits + (f +1) * this->N);\n+// llrs_e_buff.insert(llrs_e_buff.end(), llrs_e + f * this->N, llrs_e + (f +1) * this->N);\n+\n+// n_analyzed_frames++;\n+// }\n+\n+// for (auto c : this->callbacks_measure)\n+// c();\n+// }\n+\n+// template <typename B, typename R>\n+// void Monitor_EXIT<B,R>\n+// ::_check_mutual_info_avg(const B *bits, const R *llrs_a, const int frame_id)\n+// {\n+// for (int j = 0; j < this->N; j++)\n+// {\n+// double symb = -2.0 * (double)bits[j] +1.0;\n+// I_A_sum += (R)(1.0 - std::log2(1.0 + std::exp(-symb * (double)llrs_a[j])));\n+// }\n+// }\n+\n+// template <typename B, typename R>\n+// R Monitor_EXIT<B,R>\n+// ::_check_mutual_info_histo() const\n+// {\n+// size_t N = this->bits_buff.size();\n+// unsigned bit_1_count = 0;\n+// for (size_t i = 0; i < N; i++)\n+// bit_1_count += (unsigned)bits_buff[i];\n+\n+// unsigned bit_0_count = (unsigned)N - bit_1_count;\n+// if (bit_0_count == 0 || bit_1_count == 0)\n+// {\n+// return (R)0;\n+// }\n+// else\n+// {\n+// const R inf = std::numeric_limits<R>::infinity();\n+\n+// bool lots_of_bins;\n+// unsigned bin_count;\n+// int bin_offset = 0;\n+// R bin_width = (R)0;\n+\n+// // determine the min and max value for llrs / 0 and llrs / 1\n+// R llr_0_max = -inf, llr_1_max = -inf;\n+// R llr_0_min = +inf, llr_1_min = +inf;\n+\n+// unsigned llr_0_noninfinite_count = 0;\n+// unsigned llr_1_noninfinite_count = 0;\n+\n+// for (unsigned i = 0; i < N; i++)\n+// {\n+// if (!std::isinf(llrs_e_buff[i]))\n+// {\n+// if ((int)bits_buff[i] == 0)\n+// {\n+// llr_0_noninfinite_count++;\n+// llr_0_min = std::min(llrs_e_buff[i], llr_0_min);\n+// llr_0_max = std::max(llrs_e_buff[i], llr_0_max);\n+// }\n+// else\n+// {\n+// llr_1_noninfinite_count++;\n+// llr_1_min = std::min(llrs_e_buff[i], llr_1_min);\n+// llr_1_max = std::max(llrs_e_buff[i], llr_1_max);\n+// }\n+// }\n+// }\n+// if (llr_0_noninfinite_count && llr_1_noninfinite_count && llr_0_min <= llr_1_max && llr_1_min <= llr_0_max)\n+// {\n+// R llr_0_mean = (R)0;\n+// R llr_1_mean = (R)0;\n+// for (unsigned i = 0; i < N; i++)\n+// {\n+// if (!std::isinf(llrs_e_buff[i]))\n+// {\n+// if ((int)bits_buff[i] == 0) llr_0_mean += llrs_e_buff[i];\n+// else llr_1_mean += llrs_e_buff[i];\n+// }\n+// }\n+// llr_0_mean /= llr_0_noninfinite_count;\n+// llr_1_mean /= llr_1_noninfinite_count;\n+\n+// R llr_0_variance = (R)0;\n+// R llr_1_variance = (R)0;\n+// for (unsigned i = 0; i < N; i++)\n+// {\n+// if (!std::isinf(llrs_e_buff[i]))\n+// {\n+// if ((int)bits_buff[i] == 0) llr_0_variance += std::pow((llrs_e_buff[i] - llr_0_mean), 2);\n+// else llr_1_variance += std::pow((llrs_e_buff[i] - llr_1_mean), 2);\n+// }\n+// }\n+// llr_0_variance /= llr_0_noninfinite_count;\n+// llr_1_variance /= llr_1_noninfinite_count;\n+\n+// bin_width = (R)0.5 * ((R)3.49 * (R)std::sqrt(llr_0_variance) * (R)(std::pow(llr_0_noninfinite_count, (R)-1.0 / (R)3.0)) +\n+// (R)3.49 * (R)std::sqrt(llr_1_variance) * (R)(std::pow(llr_1_noninfinite_count, (R)-1.0 / (R)3.0)));\n+// if (bin_width > (R)0)\n+// {\n+// bin_offset = (int)std::floor(std::min(llr_0_min, llr_1_min) / bin_width) -1;\n+// auto tmp = std::max(llr_0_max, llr_1_max) / bin_width - (R)bin_offset + (R)1;\n+// bin_count = (unsigned)std::ceil(tmp);\n+// if ((R)bin_count == tmp)\n+// bin_count++;\n+// }\n+// else\n+// {\n+// bin_offset = -1;\n+// bin_count = 3;\n+// }\n+// lots_of_bins = true;\n+// }\n+// else\n+// {\n+// lots_of_bins = false;\n+// bin_count = 4;\n+// }\n+\n+// std::vector<std::vector<unsigned>> histogram(2, std::vector<unsigned>(bin_count));\n+// std::vector<std::vector<R >> pdf (2, std::vector<R >(bin_count));\n+// for (unsigned i = 0; i < N; i++)\n+// {\n+// if (llrs_e_buff[i] == -inf) histogram[(int)bits_buff[i]][0 ]++;\n+// else if (llrs_e_buff[i] == inf) histogram[(int)bits_buff[i]][bin_count -1]++;\n+// else\n+// {\n+// if (lots_of_bins)\n+// {\n+// if (bin_width > 0.0)\n+// histogram[(int)bits_buff[i]][(int)(std::floor(llrs_e_buff[i] / bin_width) - bin_offset)]++;\n+// else\n+// histogram[(int)bits_buff[i]][1]++;\n+// }\n+// else\n+// histogram[(int)bits_buff[i]][(int)bits_buff[i] +1]++;\n+// }\n+// }\n+\n+// for (unsigned i = 0; i < bin_count; i++)\n+// {\n+// pdf[0][i] = (R)histogram[0][i] / (R)bit_0_count;\n+// pdf[1][i] = (R)histogram[1][i] / (R)bit_1_count;\n+// }\n+\n+// R I_E = (R)0;\n+// for (auto b = 0; b < 2; b++)\n+// for (unsigned bin_ix = 0; bin_ix < bin_count; bin_ix++)\n+// if (pdf[b][bin_ix] > (R)0)\n+// I_E += (R)0.5 * pdf[b][bin_ix] * std::log2((R)2.0 * pdf[b][bin_ix] / (pdf[0][bin_ix] + pdf[1][bin_ix]));\n+\n+// return I_E;\n+// }\n+// }\n+\n+// template <typename B, typename R>\n+// unsigned Monitor_EXIT<B,R>\n+// ::get_n_trials() const\n+// {\n+// return n_trials;\n+// }\n+\n+// template <typename B, typename R>\n+// bool Monitor_EXIT<B,R>\n+// ::n_trials_achieved() const\n+// {\n+// return get_n_analyzed_fra() >= get_n_trials();\n+// }\n+\n+// template <typename B, typename R>\n+// R Monitor_EXIT<B,R>\n+// ::get_I_A() const\n+// {\n+// return this->I_A_sum / (R)(this->N * this->n_analyzed_frames);\n+// }\n+\n+// template <typename B, typename R>\n+// R Monitor_EXIT<B,R>\n+// ::get_I_E() const\n+// {\n+// return this->_check_mutual_info_histo();\n+// }\n+\n+// template <typename B, typename R>\n+// unsigned long long Monitor_EXIT<B,R>\n+// ::get_n_analyzed_fra() const\n+// {\n+// return n_analyzed_frames;\n+// }\n+\n+// template <typename B, typename R>\n+// void Monitor_EXIT<B,R>\n+// ::add_handler_measure(std::function<void(void)> callback)\n+// {\n+// this->callbacks_measure.push_back(callback);\n+// }\n+\n+// template <typename B, typename R>\n+// void Monitor_EXIT<B,R>\n+// ::reset()\n+// {\n+// Monitor::reset();\n+\n+// this->n_analyzed_frames = 0;\n+// this->I_A_sum = (R)0;\n+// this->bits_buff.clear();\n+// this->llrs_e_buff.clear();\n+// }\n+\n+// template <typename B, typename R>\n+// void Monitor_EXIT<B,R>\n+// ::clear_callbacks()\n+// {\n+// this->callbacks_measure.clear();\n+// }\n+\n+// // ==================================================================================== explicit template instantiation\n+// #include \"Tools/types.h\"\n+// #ifdef MULTI_PREC\n+// template class aff3ct::module::Monitor_EXIT<B_32,R_32>;\n+// template class aff3ct::module::Monitor_EXIT<B_64,R_64>;\n+// #else\n+// template class aff3ct::module::Monitor_EXIT<B,R>;\n+// #endif\n+// // ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "diff": "@@ -131,7 +131,7 @@ template <typename B, typename R>\nbool Monitor_MI<B,R>\n::n_trials_limit_achieved()\n{\n- return (this->get_n_trials_fra() >= this->get_n_trials_limit()) || this->is_interrupt();\n+ return this->get_n_trials_fra() >= this->get_n_trials_limit();\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor.cpp", "new_path": "src/Module/Monitor/Monitor.cpp", "diff": "#include \"Monitor.hpp\"\n-bool aff3ct::module::Monitor::interrupt = false;\n-bool aff3ct::module::Monitor::first_interrupt = true;\n-int aff3ct::module::Monitor::interrupt_cnt = 0;\n-bool aff3ct::module::Monitor::over = false;\n-\n-std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> aff3ct::module::Monitor::t_last_interrupt;\n-\nusing namespace aff3ct;\nusing namespace aff3ct::module;\n@@ -19,20 +12,6 @@ Monitor\nconst std::string name = \"Monitor\";\nthis->set_name(name);\nthis->set_short_name(name);\n-\n- Monitor::interrupt = false;\n-\n-#ifndef ENABLE_MPI\n- // Install a signal handler\n- std::signal(SIGINT, Monitor::signal_interrupt_handler);\n-#endif\n-}\n-\n-void Monitor\n-::reset()\n-{\n- Monitor::interrupt = false;\n- Monitor::interrupt_cnt = 0;\n}\nvoid Monitor\n@@ -40,53 +19,7 @@ void Monitor\n{\n}\n-\n-bool Monitor\n-::is_interrupt()\n-{\n- return Monitor::interrupt;\n-}\n-\n-bool Monitor\n-::is_over()\n-{\n- return Monitor::over;\n-}\n-\n-void Monitor\n-::stop()\n-{\n- Monitor::interrupt = true;\n- Monitor::over = true;\n-}\n-\nvoid Monitor\n-::signal_interrupt_handler(int signal)\n-{\n- Monitor::interrupt_cnt++;\n-\n- auto t_now = std::chrono::steady_clock::now();\n- if (!Monitor::first_interrupt)\n- {\n- auto d_delta_interrupt = t_now - Monitor::t_last_interrupt;\n- if (d_delta_interrupt < std::chrono::milliseconds(500))\n- Monitor::stop();\n-\n- if (d_delta_interrupt < std::chrono::milliseconds(2100))\n- {\n- if (Monitor::interrupt_cnt >= 4)\n+::reset()\n{\n- std::cerr << \"\\r# Killed by user interruption!\"\n- \" \"\n- << std::endl;\n- std::exit(EXIT_FAILURE);\n- }\n- }\n- else\n- Monitor::interrupt_cnt = 1;\n- }\n- Monitor::t_last_interrupt = t_now;\n-\n- Monitor::first_interrupt = false;\n- Monitor::interrupt = true;\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor.hpp", "new_path": "src/Module/Monitor/Monitor.hpp", "diff": "#define MONITOR_HPP_\n#include <functional>\n-#include <csignal>\n#include <chrono>\n#include <vector>\n#include <string>\n@@ -36,13 +35,6 @@ namespace module\n*/\nclass Monitor : public Module\n{\n-protected:\n- static bool interrupt; /*!< True if there is a SIGINT signal (ctrl+C). */\n- static bool first_interrupt; /*!< True if this is the first time that SIGIN is called. */\n- static int interrupt_cnt; /*!< The number of gor interrupt signal. */\n- static bool over; /*!< True if SIGINT is called twice in the Monitor::d_delta_interrupt time */\n- static std::chrono::time_point<std::chrono::steady_clock, std::chrono::nanoseconds> t_last_interrupt; /*!< Time point of the last call to SIGINT */\n-\npublic:\n/*!\n* \\brief Constructor.\n@@ -64,29 +56,6 @@ public:\nvirtual void clear_callbacks();\nvirtual void collect(const Monitor& m) = 0;\n-\n-\n- /*!\n- * \\brief Tells if the user asked for stopping the current computations.\n- *\n- * \\return true if the SIGINT (ctrl+c) is called.\n- */\n- static bool is_interrupt();\n-\n- /*!\n- * \\brief Tells if the user asked for stopping the whole simulation.\n- *\n- * \\return true if the SIGINT (ctrl+c) is called twice.\n- */\n- static bool is_over();\n-\n- /*!\n- * \\brief Put Monitor<B,R>::interrupt and Monitor<B,R>::over to true.\n- */\n- static void stop();\n-\n-private:\n- static void signal_interrupt_handler(int signal);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -159,7 +159,7 @@ void BFER<B,R,Q>\n{\nthis->build_communication_chain();\n- if (module::Monitor::is_over())\n+ if (tools::Terminal::is_over())\n{\nthis->release_objects();\nreturn;\n@@ -222,7 +222,7 @@ void BFER<B,R,Q>\nthis->build_communication_chain();\n- if (module::Monitor::is_over())\n+ if (tools::Terminal::is_over())\n{\nthis->release_objects();\nreturn;\n@@ -254,7 +254,7 @@ void BFER<B,R,Q>\n}\ncatch (std::exception const& e)\n{\n- module::Monitor::stop();\n+ tools::Terminal::stop();\nterminal->final_report(std::cout); // display final report to not lost last line overwritten by the error messages\nrang::format_on_each_line(std::cerr, std::string(e.what()) + \"\\n\", rang::tag::error);\n@@ -334,10 +334,10 @@ void BFER<B,R,Q>\nthis->dumper_red->clear();\n}\n- if (!params_BFER.crit_nostop && !params_BFER.err_track_revert && !module::Monitor::is_interrupt() &&\n+ if (!params_BFER.crit_nostop && !params_BFER.err_track_revert && !tools::Terminal::is_interrupt() &&\n!this->monitor_red->fe_limit_achieved() &&\n(params_BFER.max_frame == 0 || this->monitor_red->get_n_analyzed_fra() >= params_BFER.max_frame))\n- module::Monitor::stop();\n+ tools::Terminal::stop();\nthis->monitor_red->reset();\nfor (auto &m : modules)\n@@ -346,8 +346,10 @@ void BFER<B,R,Q>\nfor (auto &t : mm->tasks)\nt->reset_stats();\n- if (module::Monitor::is_over())\n+ if (tools::Terminal::is_over())\nbreak;\n+\n+ tools::Terminal::reset();\n}\nthis->release_objects();\n@@ -388,7 +390,7 @@ void BFER<B,R,Q>\n}\ncatch (std::exception const& e)\n{\n- module::Monitor::stop();\n+ tools::Terminal::stop();\nsimu->simu_error = true;\nsimu->mutex_exception.lock();\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Iterative/Threads/BFER_ite_threads.cpp", "new_path": "src/Simulation/BFER/Iterative/Threads/BFER_ite_threads.cpp", "diff": "@@ -66,7 +66,7 @@ void BFER_ite_threads<B,R,Q>\n}\ncatch (std::exception const& e)\n{\n- module::Monitor::stop();\n+ tools::Terminal::stop();\nsimu->mutex_exception.lock();\n@@ -333,10 +333,12 @@ void BFER_ite_threads<B,R,Q>\nusing namespace std::chrono;\nauto t_snr = steady_clock::now();\n- while ((!this->monitor_red->fe_limit_achieved()) && // while max frame error count has not been reached\n- (this->params_BFER_ite.stop_time == seconds(0) ||\n- (steady_clock::now() - t_snr) < this->params_BFER_ite.stop_time) &&\n- (this->params_BFER_ite.max_frame == 0 || this->monitor_red->get_n_analyzed_fra() < this->params_BFER_ite.max_frame))\n+ while (!tools::Terminal::is_interrupt()\n+ && !this->monitor_red->fe_limit_achieved() // while max frame error count has not been reached\n+ && (this->params_BFER_ite.stop_time == seconds(0)\n+ || (steady_clock::now() - t_snr) < this->params_BFER_ite.stop_time)\n+ && (this->params_BFER_ite.max_frame == 0\n+ || this->monitor_red->get_n_analyzed_fra() < this->params_BFER_ite.max_frame))\n{\nif (this->params_BFER_ite.debug)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "new_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "diff": "@@ -66,7 +66,7 @@ void BFER_std_threads<B,R,Q>\n}\ncatch (std::exception const& e)\n{\n- module::Monitor::stop();\n+ tools::Terminal::stop();\nsimu->mutex_exception.lock();\n@@ -268,10 +268,11 @@ void BFER_std_threads<B,R,Q>\nauto t_snr = steady_clock::now();\n// communication chain execution\n- while (!this->monitor_red->fe_limit_achieved() && // while max frame error count has not been reached\n+ while (!tools::Terminal::is_interrupt() && !this->monitor_red->fe_limit_achieved() && // while max frame error count has not been reached\n(this->params_BFER_std.stop_time == seconds(0) ||\n(steady_clock::now() - t_snr) < this->params_BFER_std.stop_time) &&\n- (this->params_BFER_std.max_frame == 0 || this->monitor_red->get_n_analyzed_fra() < this->params_BFER_std.max_frame))\n+ (this->params_BFER_std.max_frame == 0 ||\n+ this->monitor_red->get_n_analyzed_fra() < this->params_BFER_std.max_frame))\n{\nif (this->params_BFER_std.debug)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/Terminal.cpp", "new_path": "src/Tools/Display/Terminal/Terminal.cpp", "diff": "#include <cassert>\n-#include \"Module/Monitor/Monitor.hpp\"\n+#include <csignal>\n+\n#include \"Tools/Exception/exception.hpp\"\n#include \"Terminal.hpp\"\n+bool aff3ct::tools::Terminal::interrupt = false;\n+bool aff3ct::tools::Terminal::first_interrupt = true;\n+int aff3ct::tools::Terminal::interrupt_cnt = 0;\n+bool aff3ct::tools::Terminal::over = false;\n+\n+std::chrono::time_point<std::chrono::steady_clock> aff3ct::tools::Terminal::t_last_interrupt;\n+\n+\nusing namespace aff3ct;\nusing namespace aff3ct::tools;\n@@ -13,6 +22,12 @@ Terminal\nt_term(std::chrono::steady_clock::now()),\nreal_time_state(0)\n{\n+ Terminal::interrupt = false;\n+\n+#ifndef ENABLE_MPI\n+ // Install a signal handler\n+ std::signal(SIGINT, Terminal::signal_interrupt_handler);\n+#endif\n}\nTerminal\n@@ -213,7 +228,7 @@ void Terminal\nauto et = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - t_term).count();\n- if (!module::Monitor::is_over() || et >= 1.f)\n+ if (!Terminal::is_over() || et >= 1.f)\nthis->report(stream, true);\nt_term = std::chrono::steady_clock::now();\n@@ -301,7 +316,7 @@ void Terminal\nif (final)\n{\n- stream << (module::Monitor::is_interrupt() ? \" x\" : \" \") << std::endl;\n+ stream << (Terminal::is_interrupt() ? \" x\" : \" \") << std::endl;\n}\nelse\n{\n@@ -312,3 +327,61 @@ void Terminal\nstream.flags(f);\nstream.flush();\n}\n+\n+void Terminal\n+::reset()\n+{\n+ Terminal::interrupt = false;\n+ Terminal::interrupt_cnt = 0;\n+}\n+\n+\n+bool Terminal\n+::is_interrupt()\n+{\n+ return Terminal::interrupt;\n+}\n+\n+bool Terminal\n+::is_over()\n+{\n+ return Terminal::over;\n+}\n+\n+void Terminal\n+::stop()\n+{\n+ Terminal::interrupt = true;\n+ Terminal::over = true;\n+}\n+\n+void Terminal\n+::signal_interrupt_handler(int signal)\n+{\n+ Terminal::interrupt_cnt++;\n+\n+ auto t_now = std::chrono::steady_clock::now();\n+ if (!Terminal::first_interrupt)\n+ {\n+ auto d_delta_interrupt = t_now - Terminal::t_last_interrupt;\n+ if (d_delta_interrupt < std::chrono::milliseconds(500))\n+ Terminal::stop();\n+\n+ if (d_delta_interrupt < std::chrono::milliseconds(2100))\n+ {\n+ if (Terminal::interrupt_cnt >= 4)\n+ {\n+ std::cerr << \"\\r# Killed by user interruption!\"\n+ \" \"\n+ << std::endl;\n+ std::exit(EXIT_FAILURE);\n+ }\n+ }\n+ else\n+ Terminal::interrupt_cnt = 1;\n+ }\n+ Terminal::t_last_interrupt = t_now;\n+\n+ Terminal::first_interrupt = false;\n+ Terminal::interrupt = true;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/Terminal.hpp", "new_path": "src/Tools/Display/Terminal/Terminal.hpp", "diff": "@@ -39,6 +39,13 @@ private:\nstd::condition_variable cond_terminal;\nbool stop_terminal;\n+ static bool interrupt; /*!< True if there is a SIGINT signal (ctrl+C). */\n+ static bool first_interrupt; /*!< True if this is the first time that SIGIN is called. */\n+ static int interrupt_cnt; /*!< The number of gor interrupt signal. */\n+ static bool over; /*!< True if SIGINT is called twice in the Terminal::d_delta_interrupt time */\n+ static std::chrono::time_point<std::chrono::steady_clock> t_last_interrupt; /*!< Time point of the last call to SIGINT */\n+\n+\nprotected:\nstd::vector<Reporter*>& reporters;\n@@ -80,11 +87,38 @@ public:\nvoid start_temp_report(const std::chrono::milliseconds freq = std::chrono::milliseconds(500));\nvoid stop_temp_report();\n+\n+ /*!\n+ * \\brief Tells if the user asked for stopping the current computations.\n+ *\n+ * \\return true if the SIGINT (ctrl+c) is called.\n+ */\n+ static bool is_interrupt();\n+\n+ /*!\n+ * \\brief Tells if the user asked for stopping the whole simulation.\n+ *\n+ * \\return true if the SIGINT (ctrl+c) is called twice.\n+ */\n+ static bool is_over();\n+\n+ /*!\n+ * \\brief Put Terminal::interrupt and Terminal::over to true.\n+ */\n+ static void stop();\n+\n+ /*!\n+ * \\brief Put Terminal::interrupt and Terminal::over to false.\n+ */\n+ static void reset();\n+\nprotected:\nvirtual void report(std::ostream &stream = std::cout, bool final = false);\nprivate:\nstatic void start_thread_terminal(Terminal *terminal, const std::chrono::milliseconds freq);\n+\n+ static void signal_interrupt_handler(int signal);\n};\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Move the Signal handling in the terminal instead of Monitor
8,483
07.06.2018 14:43:09
-7,200
6d4a95b886dceb4b2dfd0a81f0af7bf4a5bb4b45
Fix Monitor MI, reporter throughput and cosmetics in Simulation::BFER with MPI calls
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Monitor/MI_BFER/Monitor_MI_BFER.cpp", "new_path": "src/Factory/Module/Monitor/MI_BFER/Monitor_MI_BFER.cpp", "diff": "@@ -79,13 +79,13 @@ void Monitor_MI_BFER::parameters\nvoid Monitor_MI_BFER::parameters\n::get_headers(std::map<std::string,header_list>& headers, const bool full) const\n{\n- Monitor::parameters::get_headers(headers, full);\n+ Monitor_BFER::parameters::get_headers(headers, full);\nauto p = this->get_prefix();\nheaders[p].push_back(std::make_pair(\"Compute mutual info\", this->mutinfo ? \"yes\" : \"no\"));\n- headers[p].push_back(std::make_pair(\"Number of trials (n)\", std::to_string(this->n_trials)));\n- if (full) headers[p].push_back(std::make_pair(\"Inter frame level\", std::to_string(this->n_frames)));\n+ if (this->mutinfo)\n+ Monitor_MI::parameters::get_headers(headers, full);\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "diff": "@@ -124,6 +124,9 @@ void Monitor_MI<B,R>\nthis->vals.n_fra++;\nthis->vals.MI += (mi - this->vals.MI) / (R)this->vals.n_fra;\n+ this->vals.MI_max = std::max(this->vals.MI_max, mi);\n+ this->vals.MI_min = std::min(this->vals.MI_min, mi);\n+\nthis->mutinfo_hist.add_value(mi);\n}\n@@ -159,14 +162,14 @@ template <typename B, typename R>\nR Monitor_MI<B,R>\n::get_MI_min() const\n{\n- return this->mutinfo_hist.get_hist_min();\n+ return this->vals.MI_min;\n}\ntemplate <typename B, typename R>\nR Monitor_MI<B,R>\n::get_MI_max() const\n{\n- return this->mutinfo_hist.get_hist_max();\n+ return this->vals.MI_max;\n}\ntemplate<typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "diff": "@@ -41,9 +41,10 @@ public:\nValues_t& operator+=(const Values_t& o)\n{\n- MI = MI * o.MI;\nn_fra += o.n_fra;\n- MI += o.MI;\n+ MI += (o.MI - MI) / n_fra;\n+ MI_max = std::max(MI_max, o.MI_max);\n+ MI_min = std::min(MI_min, o.MI_min);\nreturn *this;\n}\n@@ -51,7 +52,7 @@ public:\n{\nMI = 0.;\nMI_max = 0.;\n- MI_min = 0.;\n+ MI_min = 1.;\nn_fra = 0;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor_reduction.hxx", "new_path": "src/Module/Monitor/Monitor_reduction.hxx", "diff": "@@ -15,11 +15,9 @@ namespace module\ntemplate <class M>\nMonitor_reduction<M>\n::Monitor_reduction(const std::vector<M*> &monitors)\n-: M((monitors.size() && monitors.front()) ? *monitors.front() : M(),\n- monitors.size() ? std::accumulate(monitors.begin(), monitors.end(), 0,\n- [](int tot, const M* m) { return tot + m->get_n_frames(); })\n- : 1\n- ),\n+: Monitor(std::accumulate(monitors.begin(), monitors.end(), 0,\n+ [](int tot, const M* m) { return tot + m->get_n_frames(); })),\n+ M((monitors.size() && monitors.front()) ? *monitors.front() : M(), this->n_frames),\nmonitors(monitors)\n{\nif (monitors.size() == 0)\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -104,7 +104,10 @@ BFER<B,R,Q>\nrep_er = new tools::Reporter_BFER<B>(*this->monitor_red);\nreporters.push_back(rep_er);\n- rep_throughput = new tools::Reporter_throughput<uint64_t>(std::bind(&Monitor_reduction_type::get_n_fe, this->monitor_red), this->monitor_red->get_fe_limit());\n+ rep_throughput = new tools::Reporter_throughput<uint64_t>(std::bind(&Monitor_reduction_type::get_n_fe, this->monitor_red),\n+ this->monitor_red->get_fe_limit(),\n+ std::bind(&Monitor_reduction_type::get_n_analyzed_fra, this->monitor_red),\n+ this->monitor_red->get_K());\nreporters.push_back(rep_throughput);\n}\n@@ -231,21 +234,17 @@ void BFER<B,R,Q>\nif (params_BFER.display_legend)\n#ifdef ENABLE_MPI\n- if (((!params_BFER.ter->disabled && noise_idx == noise_begin && !params_BFER.debug) ||\n- (params_BFER.statistics && !params_BFER.debug)) && params_BFER.mpi_rank == 0)\n-#else\n- if (((!params_BFER.ter->disabled && noise_idx == noise_begin && !params_BFER.debug) ||\n- (params_BFER.statistics && !params_BFER.debug)))\n+ if (params_BFER.mpi_rank == 0)\n#endif\n+ if ((!params_BFER.ter->disabled && noise_idx == noise_begin && !params_BFER.debug)\n+ || (params_BFER.statistics && !params_BFER.debug))\nterminal->legend(std::cout);\n// start the terminal to display BER/FER results\n#ifdef ENABLE_MPI\n- if (!params_BFER.ter->disabled && params_BFER.ter->frequency != std::chrono::nanoseconds(0) && !params_BFER.debug\n- && params_BFER.mpi_rank == 0)\n-#else\n- if (!params_BFER.ter->disabled && params_BFER.ter->frequency != std::chrono::nanoseconds(0) && !params_BFER.debug)\n+ if (params_BFER.mpi_rank == 0)\n#endif\n+ if (!params_BFER.ter->disabled && params_BFER.ter->frequency != std::chrono::nanoseconds(0) && !params_BFER.debug)\nterminal->start_temp_report(params_BFER.ter->frequency);\ntry\n@@ -262,10 +261,9 @@ void BFER<B,R,Q>\n}\n#ifdef ENABLE_MPI\n- if (!params_BFER.ter->disabled && terminal != nullptr && !this->simu_error && params_BFER.mpi_rank == 0)\n-#else\n- if (!params_BFER.ter->disabled && terminal != nullptr && !this->simu_error)\n+ if (params_BFER.mpi_rank == 0)\n#endif\n+ if (!params_BFER.ter->disabled && terminal != nullptr && !this->simu_error)\n{\nif (params_BFER.debug)\nterminal->legend(std::cout);\n@@ -339,6 +337,9 @@ void BFER<B,R,Q>\n(params_BFER.max_frame == 0 || this->monitor_red->get_n_analyzed_fra() >= params_BFER.max_frame))\ntools::Terminal::stop();\n+ if (tools::Terminal::is_over())\n+ break;\n+\nthis->monitor_red->reset();\nfor (auto &m : modules)\nfor (auto mm : m.second)\n@@ -346,8 +347,7 @@ void BFER<B,R,Q>\nfor (auto &t : mm->tasks)\nt->reset_stats();\n- if (tools::Terminal::is_over())\n- break;\n+ std::cout << \"end noise : \" << noise->get_noise() << std::endl;\ntools::Terminal::reset();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Iterative/Threads/BFER_ite_threads.cpp", "new_path": "src/Simulation/BFER/Iterative/Threads/BFER_ite_threads.cpp", "diff": "@@ -51,6 +51,8 @@ void BFER_ite_threads<B,R,Q>\nfor (auto tid = 1; tid < this->params_BFER_ite.n_threads; tid++)\nthreads[tid -1].join();\n+ this->monitor_red->reduce();\n+\nif (!this->prev_err_messages.empty())\nthrow std::runtime_error(this->prev_err_messages.back());\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "new_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "diff": "@@ -51,6 +51,9 @@ void BFER_std_threads<B,R,Q>\nfor (auto tid = 1; tid < this->params_BFER_std.n_threads; tid++)\nthreads[tid -1].join();\n+\n+ this->monitor_red->reduce();\n+\nif (!this->prev_err_messages_to_display.empty())\nthrow std::runtime_error(this->prev_err_messages_to_display.back());\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Noise/Reporter_noise.cpp", "new_path": "src/Tools/Display/Reporter/Noise/Reporter_noise.cpp", "diff": "@@ -29,16 +29,16 @@ Reporter_noise<R>\nswitch (this->noise->get_type())\n{\ncase Noise_type::SIGMA :\n- Noise_title = {\"Signal Noise Ratio (SNR)\", \"\"};\n+ Noise_title = {\"Signal Noise Ratio\", \"(SNR)\"};\nNoise_cols.push_back(std::make_pair(\"Es/N0\", \"(dB)\"));\nNoise_cols.push_back(std::make_pair(\"Eb/N0\", \"(dB)\"));\nbreak;\ncase Noise_type::ROP :\n- Noise_title = {\"Received Optical Power (ROP)\", \"\"};\n+ Noise_title = {\"Received Optical\", \"Power (ROP)\"};\nNoise_cols.push_back(std::make_pair(\"ROP\", \"(dB)\"));\nbreak;\ncase Noise_type::EP :\n- Noise_title = {\"Event Probability (EP)\", \"\"};\n+ Noise_title = {\"Event Probability\", \"(EP)\"};\nNoise_cols.push_back(std::make_pair(\"EP\", \"\"));\nbreak;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "diff": "@@ -19,19 +19,20 @@ class Reporter_throughput : public Reporter\n{\nstatic_assert(std::is_convertible<T, double>::value, \"T type must be convertible to a double.\");\n-public:\n- using PF_t = std::function<T(void)>;\n-\nprotected:\n- PF_t progress_function;\n- const unsigned long long limit;\n+ std::function<T(void)> progress_function;\n+ std::function<T(void)> get_nbits_function;\n+\n+ const T progress_limit;\n+ const T nbits_factor;\nstd::chrono::time_point<std::chrono::steady_clock> t_report;\ngroup_t throughput_group;\npublic:\n- explicit Reporter_throughput(std::function<T(void)> progress_function, const unsigned long long limit = 0);\n+ explicit Reporter_throughput(std::function<T(void)> progress_function, const T progress_limit = 0,\n+ std::function<T(void)> get_nbits_function = nullptr, const T nbits_factor = 1);\nvirtual ~Reporter_throughput() = default;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "diff": "@@ -12,17 +12,20 @@ namespace tools\n{\ntemplate <typename T>\nReporter_throughput<T>\n-::Reporter_throughput(std::function<T(void)> progress_function, const unsigned long long limit)\n+::Reporter_throughput(std::function<T(void)> progress_function, const T progress_limit,\n+ std::function<T(void)> get_nbits_function, const T nbits_factor)\n: Reporter(),\nprogress_function(progress_function),\n- limit(limit),\n+ get_nbits_function(get_nbits_function),\n+ progress_limit(progress_limit),\n+ nbits_factor(nbits_factor),\nt_report(std::chrono::steady_clock::now())\n{\nauto& throughput_title = throughput_group.first;\nauto& throughput_cols = throughput_group.second;\nthroughput_title = std::make_pair(\"Global throughput\", \"and elapsed time\");\n- throughput_cols.clear();\n+\nthroughput_cols.push_back(std::make_pair(\"SIM_THR\", \"(Mb/s)\"));\nthroughput_cols.push_back(std::make_pair(\"ET/RT\", \"(hhmmss)\"));\n@@ -39,28 +42,35 @@ Reporter::report_t Reporter_throughput<T>\nauto& thgput_report = report[0];\n+ T progress = 0, nbits = 0;\n- auto progress = progress_function();\n+ if (progress_function != nullptr)\n+ progress = progress_function();\n- auto simu_time = (double)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - t_report).count(); // usec\n- auto simu_cthr = ((double)progress) / simu_time; // = Mbps\n+ if (get_nbits_function != nullptr)\n+ nbits = get_nbits_function() * nbits_factor;\n- auto displayed_time = (progress == 0) ? 0.f : simu_time * 1e-6f; // sec\n+ auto simu_time = (double)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - t_report).count(); // usec\n+ double displayed_time = simu_time * 1e-6; // sec\n- if (!final)\n- displayed_time *= (double)limit / (double)progress - 1.;\n+ if (!final && progress_function != nullptr && progress != 0 && progress_limit != 0)\n+ displayed_time *= (double)progress_limit / (double)progress - 1.;\nelse\nt_report = std::chrono::steady_clock::now();\n+\nauto str_time = get_time_format(displayed_time) + \" \";\nint n_spaces = (int)Reporter_stream::column_width - (int)str_time.size();\n- str_time = std::string((n_spaces >= 0) ? n_spaces : 0, ' ') + get_time_format(displayed_time);\n+ str_time = std::string((n_spaces >= 0) ? n_spaces : 0, ' ') + str_time;\n+\n+ auto simu_cthr = (double)nbits / simu_time; // = Mbps\nstd::stringstream str_cthr;\nstr_cthr << std::setprecision(3) << std::fixed << std::setw(Reporter_stream::column_width-1) << simu_cthr << \" \";\n+\nthgput_report.push_back(str_cthr.str());\nthgput_report.push_back(str_time);\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix Monitor MI, reporter throughput and cosmetics in Simulation::BFER with MPI calls
8,490
07.06.2018 15:54:19
-7,200
6c9c1aea24b82d7ea4f0fa234a46f101c71cdf96
Reduce the size of the coverage generated files.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -105,7 +105,8 @@ build-coverage-linux-gcc:\n- sse4.2\nartifacts:\npaths:\n- - build_coverage_linux_x86_gcc/\n+ - build_coverage_linux_x86_gcc/bin/\n+ - build_coverage_linux_x86_gcc/CMakeFiles.tar.gz\nscript:\n- ./ci/build-coverage-linux-gcc.sh\n@@ -179,6 +180,8 @@ test-coverage-regression:\nname: code_coverage_files\nwhen: always\npaths:\n+ - build_coverage_linux_x86_gcc/bin/\n+ - build_coverage_linux_x86_gcc/CMakeFiles.tar.gz\n- code_coverage_files/\nscript:\n- ./ci/test-coverage-regression.sh\n" }, { "change_type": "MODIFY", "old_path": "ci/build-coverage-linux-gcc.sh", "new_path": "ci/build-coverage-linux-gcc.sh", "diff": "@@ -7,9 +7,10 @@ function compile {\nbuild=$1\nmkdir $build\ncd $build\n- cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG=\"-g -O0\" -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -msse4.2 -DMULTI_PREC -DENABLE_COOL_BASH --coverage\" -DCMAKE_EXE_LINKER_FLAGS=\"--coverage\"\n+ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG=\"-O0\" -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -msse4.2 -DMULTI_PREC -DENABLE_COOL_BASH --coverage\" -DCMAKE_EXE_LINKER_FLAGS=\"--coverage\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nmake -j $THREADS\n+ tar -zcvf CMakeFiles.tar.gz CMakeFiles\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\ncd ..\n}\n" }, { "change_type": "MODIFY", "old_path": "ci/test-coverage-regression.sh", "new_path": "ci/test-coverage-regression.sh", "diff": "@@ -3,6 +3,10 @@ set -x\nbuild_root=build_coverage_linux_x86_gcc\n+cd ${build_root}\n+tar -xvvf CMakeFiles.tar.gz\n+cd ..\n+\nfunction gen_coverage_info\n{\nbuild=$1\n" } ]
C++
MIT License
aff3ct/aff3ct
Reduce the size of the coverage generated files.
8,490
07.06.2018 22:23:10
-7,200
60fbbd9c8f946c242a8b2eb11de40c2bdf4677bc
Fix coverage in the CI.
[ { "change_type": "MODIFY", "old_path": "ci/analysis-cppcheck.sh", "new_path": "ci/analysis-cppcheck.sh", "diff": "@@ -8,6 +8,8 @@ mkdir cppcheck\nfind .\\/src\\/ -type f -follow -print | grep \"[.]h$\\|[.]hpp$\\|[.]hxx$\\|[.]cpp$\" > src_files.txt\nsed -i -e 's/.\\/src\\/Tools\\/date.h//g' src_files.txt\nsed -i -e 's/.\\/src\\/Tools\\/MSVC\\/dirent.h//g' src_files.txt\n+# cppcheck for sonarqube\n+cppcheck --language=c++ --suppress=missingIncludeSystem --force --enable=all --std=c++11 -U_MSC_VER --file-list=src_files.txt --xml --xml-version=2 2> cppcheck/cppcheck.xml\ncppcheck --language=c++ --suppress=missingIncludeSystem --force --enable=all --std=c++11 -U_MSC_VER --file-list=src_files.txt 2> cppcheck/cppcheck_all.log\ncat cppcheck/cppcheck_all.log | grep \"(error)\" > cppcheck/cppcheck_error.log\ncat cppcheck/cppcheck_all.log | grep \"(warning)\" > cppcheck/cppcheck_warning.log\n@@ -30,7 +32,4 @@ else\necho \"There is no error :-).\"\nfi\n-# cppcheck for sonarqube\n-cppcheck --language=c++ --suppress=missingIncludeSystem --force --enable=all --std=c++11 -U_MSC_VER --file-list=src_files.txt --xml --xml-version=2 2> cppcheck/cppcheck.xml\n-\nexit 0;\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/coverage-linux.sh", "new_path": "ci/coverage-linux.sh", "diff": "@@ -3,6 +3,8 @@ set -x\nmkdir code_coverage_report || true\ngenhtml code_coverage_files/aff3ct_clean.info --output-directory ./code_coverage_files/\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n# for sonarqube\nlcov_cobertura.py code_coverage_files/aff3ct_clean.info --output code_coverage_files/aff3ct_clean.xml\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/test-coverage-regression.sh", "new_path": "ci/test-coverage-regression.sh", "diff": "#!/bin/bash\nset -x\n+WD=$(pwd)\nbuild_root=build_coverage_linux_x86_gcc\ncd ${build_root}\n@@ -35,3 +36,4 @@ lcov --capture --directory $build_root/CMakeFiles/aff3ct-obj.dir/src --output-fi\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nlcov --remove code_coverage_files/aff3ct.info \"*/usr*\" \"*lib/*\" --output-file $pwd/code_coverage_files/aff3ct_clean.info\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+sed -i -e \"s#${WD}/#\\./#g\" code_coverage_files/aff3ct_clean.info\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix coverage in the CI.
8,490
08.06.2018 08:43:23
-7,200
1ab141de672a168a9e262f695dc9518577fbc918
Remove version.cpp file in the code coverage.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -160,13 +160,10 @@ test-regression:\n- sse4.2\n- powerful\n- python\n- dependencies:\n- - build-test-linux-gcc\nartifacts:\nname: test-regression-results\nwhen: always\npaths:\n- - build_test_linux_x86_gcc/bin/\n- test-regression-results/\nscript:\n- ./ci/test-regression.py --build-path build_test_linux_x86_gcc --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1\n@@ -178,14 +175,10 @@ test-coverage-regression:\n- lcov\n- sse4.2\n- powerful\n- dependencies:\n- - build-coverage-linux-gcc\nartifacts:\n- name: code_coverage_files\n+ name: code-coverage-files\nwhen: always\npaths:\n- - build_coverage_linux_x86_gcc/bin/\n- - build_coverage_linux_x86_gcc/CMakeFiles.tar.gz\n- code_coverage_files/\nscript:\n- ./ci/test-coverage-regression.sh\n@@ -197,13 +190,10 @@ coverage-linux:\n- lcov\n- lcov_cobertura\ncoverage: '/.*lines\\.*: (\\d+.\\d+\\%)/'\n- dependencies:\n- - test-coverage-regression\nartifacts:\n- name: code_coverage_report\n+ name: code-coverage-report\nwhen: always\npaths:\n- - code_coverage_files/\n- code_coverage_report/\nscript:\n- ./ci/coverage-linux.sh\n@@ -215,12 +205,5 @@ sonarqube-linux:\nonly:\n- master\n- development\n- dependencies:\n- - coverage-linux\n- - analysis-cppcheck\n- artifacts:\n- paths:\n- - cppcheck/\n- - code_coverage_files/\nscript:\n- ./ci/sonarqube-linux.sh\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/test-coverage-regression.sh", "new_path": "ci/test-coverage-regression.sh", "diff": "@@ -34,6 +34,6 @@ pwd=$(pwd)\nmkdir code_coverage_files || true\nlcov --capture --directory $build_root/CMakeFiles/aff3ct-obj.dir/src --output-file code_coverage_files/aff3ct.info\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-lcov --remove code_coverage_files/aff3ct.info \"*/usr*\" \"*lib/*\" --output-file $pwd/code_coverage_files/aff3ct_clean.info\n+lcov --remove code_coverage_files/aff3ct.info \"*/usr*\" \"*lib/*\" \"*/Tools/version.cpp\" --output-file $pwd/code_coverage_files/aff3ct_clean.info\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nsed -i -e \"s#${WD}/#\\./#g\" code_coverage_files/aff3ct_clean.info\n" } ]
C++
MIT License
aff3ct/aff3ct
Remove version.cpp file in the code coverage.
8,490
08.06.2018 10:09:06
-7,200
0cde914bb830ea1a6505d2bbc725791f4c0062cb
Fix bad code coverage report path.
[ { "change_type": "MODIFY", "old_path": "ci/coverage-linux.sh", "new_path": "ci/coverage-linux.sh", "diff": "set -x\nmkdir code_coverage_report || true\n-genhtml code_coverage_files/aff3ct_clean.info --output-directory ./code_coverage_files/\n+genhtml code_coverage_files/aff3ct_clean.info --output-directory ./code_coverage_report/\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n# for sonarqube\n-lcov_cobertura.py code_coverage_files/aff3ct_clean.info --output code_coverage_files/aff3ct_clean.xml\n+lcov_cobertura.py code_coverage_files/aff3ct_clean.info --output code_coverage_report/aff3ct.xml\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/sonarqube-linux.sh", "new_path": "ci/sonarqube-linux.sh", "diff": "@@ -23,7 +23,7 @@ echo \"sonar.links.ci=https://gitlab.inria.fr/fec/aff3ct/pipelines\" >> son\necho \"sonar.links.issue=https://github.com/aff3ct/aff3ct/issues\" >> sonar-project.properties\necho \"sonar.language=c++\" >> sonar-project.properties\necho \"sonar.cxx.cppcheck.reportPath=cppcheck/cppcheck.xml\" >> sonar-project.properties\n-echo \"sonar.cxx.coverage.reportPath=code_coverage_files/aff3ct_clean.xml\" >> sonar-project.properties\n+echo \"sonar.cxx.coverage.reportPath=code_coverage_report/aff3ct.xml\" >> sonar-project.properties\n#echo \"sonar.cfamily.build-wrapper-output=./build_sonar/bw-output\" >> sonar-project.properties\nsonar-scanner\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix bad code coverage report path.
8,483
08.06.2018 17:20:24
-7,200
2936c4b3a8e052719f19c30bfa2f431ca343fa40
Fix the monitor_reduction reduction issue because of reset latency. Add operator= in monitors and histogram
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -230,14 +230,14 @@ bool Monitor_BFER<B>\ntemplate <typename B>\nvoid Monitor_BFER<B>\n-::collect(const Monitor& m)\n+::collect(const Monitor& m, bool fully)\n{\n- collect(dynamic_cast<const Monitor_BFER<B>&>(m));\n+ collect(dynamic_cast<const Monitor_BFER<B>&>(m), fully);\n}\ntemplate <typename B>\nvoid Monitor_BFER<B>\n-::collect(const Monitor_BFER<B>& m)\n+::collect(const Monitor_BFER<B>& m, bool fully)\n{\nif (this->K != m.K)\n{\n@@ -248,9 +248,29 @@ void Monitor_BFER<B>\n}\nthis->vals += m.vals;\n+\n+ if (fully)\nthis->err_hist.add_values(m.err_hist);\n}\n+template <typename B>\n+const typename Monitor_BFER<B>::Values_t& Monitor_BFER<B>\n+::get_vals() const\n+{\n+ return vals;\n+}\n+\n+template <typename B>\n+Monitor_BFER<B>& Monitor_BFER<B>\n+::operator=(const Monitor_BFER<B>& m)\n+{\n+ this->vals = m.vals;\n+ this->err_hist = m.err_hist;\n+\n+ return *this;\n+}\n+\n+\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "new_path": "src/Module/Monitor/BFER/Monitor_BFER.hpp", "diff": "@@ -86,6 +86,8 @@ public:\nvirtual ~Monitor_BFER() = default;\n+ const Values_t& get_vals() const;\n+\nint get_K() const;\n/*!\n@@ -148,8 +150,10 @@ public:\nvirtual void reset();\nvirtual void clear_callbacks();\n- virtual void collect(const Monitor& m);\n- virtual void collect(const Monitor_BFER<B>& m);\n+ virtual void collect(const Monitor& m, bool fully = false);\n+ virtual void collect(const Monitor_BFER<B>& m, bool fully = false);\n+\n+ Monitor_BFER<B>& operator=(const Monitor_BFER<B>& m);\nprotected:\nvirtual int _check_errors(const B *U, const B *Y, const int frame_id);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "diff": "@@ -214,14 +214,14 @@ void Monitor_MI<B,R>\ntemplate <typename B, typename R>\nvoid Monitor_MI<B,R>\n-::collect(const Monitor& m)\n+::collect(const Monitor& m, bool fully)\n{\n- collect(dynamic_cast<const Monitor_MI<B,R>&>(m));\n+ collect(dynamic_cast<const Monitor_MI<B,R>&>(m), fully);\n}\ntemplate <typename B, typename R>\nvoid Monitor_MI<B,R>\n-::collect(const Monitor_MI<B,R>& m)\n+::collect(const Monitor_MI<B,R>& m, bool fully)\n{\nif (this->N != m.N)\n{\n@@ -232,9 +232,28 @@ void Monitor_MI<B,R>\n}\nthis->vals += m.vals;\n+\n+ if (fully)\nthis->mutinfo_hist.add_values(m.mutinfo_hist);\n}\n+template <typename B, typename R>\n+const typename Monitor_MI<B,R>::Values_t& Monitor_MI<B,R>\n+::get_vals() const\n+{\n+ return vals;\n+}\n+\n+template <typename B, typename R>\n+Monitor_MI<B,R>& Monitor_MI<B,R>\n+::operator=(const Monitor_MI<B,R>& m)\n+{\n+ this->vals = m.vals;\n+ this->mutinfo_hist = m.mutinfo_hist;\n+\n+ return *this;\n+}\n+\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef MULTI_PREC\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "diff": "@@ -94,6 +94,8 @@ public:\nvirtual ~Monitor_MI() = default;\n+ const Values_t& get_vals() const;\n+\nint get_N() const;\ntemplate <class AB = std::allocator<B>, class AR = std::allocator<R>>\n@@ -144,8 +146,10 @@ public:\nvirtual void reset();\nvirtual void clear_callbacks();\n- virtual void collect(const Monitor& m);\n- virtual void collect(const Monitor_MI<B,R>& m);\n+ virtual void collect(const Monitor& m, bool fully = false);\n+ virtual void collect(const Monitor_MI<B,R>& m, bool fully = false);\n+\n+ Monitor_MI<B,R>& operator=(const Monitor_MI<B,R>& m);\nprotected:\nvirtual R _get_mutual_info(const B *X, const R *Y, const int frame_id);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.cpp", "new_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.cpp", "diff": "@@ -100,17 +100,34 @@ void Monitor_MI_BFER<B,R>\ntemplate <typename B, typename R>\nvoid Monitor_MI_BFER<B,R>\n-::collect(const Monitor& m)\n+::collect(const Monitor& m, bool fully)\n{\n- collect(dynamic_cast<const Monitor_MI_BFER<B,R>&>(m));\n+ collect(dynamic_cast<const Monitor_MI_BFER<B,R>&>(m), fully);\n}\ntemplate <typename B, typename R>\nvoid Monitor_MI_BFER<B,R>\n-::collect(const Monitor_MI_BFER<B,R>& m)\n+::collect(const Monitor_MI_BFER<B,R>& m, bool fully)\n{\n- Monitor_MI<B,R>::collect(m);\n- Monitor_BFER<B>::collect(m);\n+ Monitor_MI<B,R>::collect(m, fully);\n+ Monitor_BFER<B>::collect(m, fully);\n+}\n+\n+template <typename B, typename R>\n+const typename Monitor_MI_BFER<B,R>::Values_t& Monitor_MI_BFER<B,R>\n+::get_vals() const\n+{\n+ return vals;\n+}\n+\n+template <typename B, typename R>\n+Monitor_MI_BFER<B,R>& Monitor_MI_BFER<B,R>\n+::operator=(const Monitor_MI_BFER<B,R>& m)\n+{\n+ Monitor_MI<B,R>::operator=(m);\n+ Monitor_BFER<B>::operator=(m);\n+\n+ return *this;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.hpp", "new_path": "src/Module/Monitor/MI_BFER/Monitor_MI_BFER.hpp", "diff": "@@ -23,6 +23,7 @@ namespace module\n}\n}\n+\ntemplate <typename B = int, typename R = float>\nclass Monitor_MI_BFER : public Monitor_MI<B,R>, public Monitor_BFER<B>\n{\n@@ -100,7 +101,7 @@ public:\n#endif\n};\n-private:\n+protected:\nValues_t vals;\npublic:\n@@ -115,13 +116,17 @@ public:\nvirtual ~Monitor_MI_BFER() = default;\n+ const Values_t& get_vals() const;\n+\nvirtual void add_handler_check(std::function<void(void)> callback);\nvirtual void reset();\nvirtual void clear_callbacks();\n- virtual void collect(const Monitor& m);\n- virtual void collect(const Monitor_MI_BFER<B,R>& m);\n+ virtual void collect(const Monitor& m, bool fully = false);\n+ virtual void collect(const Monitor_MI_BFER<B,R>& m, bool fully = false);\n+\n+ Monitor_MI_BFER<B,R>& operator=(const Monitor_MI_BFER<B,R>& m);\nprotected:\nMonitor_MI_BFER(const bool create_task, const int K, const int N,\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor.cpp", "new_path": "src/Module/Monitor/Monitor.cpp", "diff": "@@ -23,3 +23,9 @@ void Monitor\n::reset()\n{\n}\n+\n+Monitor& Monitor\n+::operator=(const Monitor& m)\n+{\n+ return *this;\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor.hpp", "new_path": "src/Module/Monitor/Monitor.hpp", "diff": "@@ -55,7 +55,17 @@ public:\nvirtual void clear_callbacks();\n- virtual void collect(const Monitor& m) = 0;\n+ /*!\n+ * \\brief collect data from 'm' monitor into this monitor.\n+ * 'fully' flag indicates if only \"Value_t\" struct vals must be merged\n+ * or also any other attributes of the class.\n+ */\n+ virtual void collect(const Monitor& m, bool fully = false) = 0;\n+\n+ /*!\n+ * \\brief completely copy values of the monitor 'm' into this monitor\n+ */\n+ Monitor& operator=(const Monitor& m);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor_reduction.hpp", "new_path": "src/Module/Monitor/Monitor_reduction.hpp", "diff": "@@ -25,7 +25,7 @@ public:\nvirtual void reset();\nvirtual void clear_callbacks();\n- virtual void reduce();\n+ virtual void reduce(bool fully = false);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor_reduction.hxx", "new_path": "src/Module/Monitor/Monitor_reduction.hxx", "diff": "@@ -81,12 +81,17 @@ void Monitor_reduction<M>\ntemplate <class M>\nvoid Monitor_reduction<M>\n-::reduce()\n+::reduce(bool fully)\n{\n- M::reset();\n+ M collecter(*this);\nfor (auto& m : monitors)\n- M::collect(*m);\n+ collecter.collect(*m, fully);\n+\n+ if (fully)\n+ M::operator=(collecter);\n+ else\n+ this->vals = collecter.get_vals();\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor_reduction_mpi.hpp", "new_path": "src/Module/Monitor/Monitor_reduction_mpi.hpp", "diff": "@@ -34,7 +34,7 @@ public:\nvirtual ~Monitor_reduction_mpi() = default;\nvoid reset ();\n- void reduce();\n+ void reduce(bool fully = false);\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor_reduction_mpi.hxx", "new_path": "src/Module/Monitor/Monitor_reduction_mpi.hxx", "diff": "@@ -67,13 +67,13 @@ Monitor_reduction_mpi<M>\ntemplate <class M>\nvoid Monitor_reduction_mpi<M>\n-::reduce()\n+::reduce(bool fully)\n{\n// only the master thread can do this\nif (std::this_thread::get_id() == this->master_thread_id &&\n((std::chrono::steady_clock::now() - t_last_mpi_comm) >= d_mpi_comm_frequency))\n{\n- Monitor_reduction<M>::reduce();\n+ Monitor_reduction<M>::reduce(fully);\nM::Values_t mvals_recv;\nauto& mvals_send = this->vals;\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -347,8 +347,6 @@ void BFER<B,R,Q>\nfor (auto &t : mm->tasks)\nt->reset_stats();\n- std::cout << \"end noise : \" << noise->get_noise() << std::endl;\n-\ntools::Terminal::reset();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Iterative/Threads/BFER_ite_threads.cpp", "new_path": "src/Simulation/BFER/Iterative/Threads/BFER_ite_threads.cpp", "diff": "@@ -51,7 +51,7 @@ void BFER_ite_threads<B,R,Q>\nfor (auto tid = 1; tid < this->params_BFER_ite.n_threads; tid++)\nthreads[tid -1].join();\n- this->monitor_red->reduce();\n+ this->monitor_red->reduce(true);\nif (!this->prev_err_messages.empty())\nthrow std::runtime_error(this->prev_err_messages.back());\n@@ -470,7 +470,7 @@ void BFER_ite_threads<B,R,Q>\nmonitor[mnt::tsk::check_errors].exec();\nif (tid == 0)\n- this->monitor_red->reduce();\n+ this->monitor_red->reduce(false);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "new_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "diff": "@@ -52,7 +52,7 @@ void BFER_std_threads<B,R,Q>\nthreads[tid -1].join();\n- this->monitor_red->reduce();\n+ this->monitor_red->reduce(true);\nif (!this->prev_err_messages_to_display.empty())\nthrow std::runtime_error(this->prev_err_messages_to_display.back());\n@@ -363,7 +363,7 @@ void BFER_std_threads<B,R,Q>\nmonitor[mnt::tsk::get_mutual_info].exec();\nif (tid == 0)\n- this->monitor_red->reduce();\n+ this->monitor_red->reduce(false);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Histogram.hpp", "new_path": "src/Tools/Algo/Histogram.hpp", "diff": "@@ -34,6 +34,22 @@ public:\n~Histogram() = default;\n+ Histogram<R>& operator=(const Histogram<R>& other)\n+ {\n+ if (this->precision != other.precision)\n+ {\n+ std::stringstream message;\n+ message << \"Histograms do not have the same precision ('this->precision' = \" << this->precision\n+ << \", other.precision = \" << other.precision << \").\" << std::endl;\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ n_values = other.n_values;\n+ hist = other.hist;\n+\n+ return *this;\n+ }\n+\ninline void add_values(const Histogram<R>& other)\n{\nif (this->precision != other.precision)\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the monitor_reduction reduction issue because of reset latency. Add operator= in monitors and histogram
8,490
09.06.2018 10:35:17
-7,200
83b7f9f693803193bceee1598da227922dd51388
Auto branch detection in CI.
[ { "change_type": "MODIFY", "old_path": "ci/sonarqube-linux.sh", "new_path": "ci/sonarqube-linux.sh", "diff": "@@ -10,8 +10,9 @@ set -x\n#cd ..\n# Create the sonar config file on the fly\n+BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\nVERSION=$(git tag | tail -n 1 | cut -d $'v' -f2-)\n-echo \"sonar.projectKey=storm:aff3ct:gitlab:master\" > sonar-project.properties\n+echo \"sonar.projectKey=storm:aff3ct:gitlab:$BRANCH\" > sonar-project.properties\n#echo \"sonar.projectName=AFF3CT\" >> sonar-project.properties\necho \"sonar.projectVersion=$VERSION\" >> sonar-project.properties\necho \"sonar.login=c6ab3ccd4dd7a8d9aa3e90d5766c74e0c9889947\" >> sonar-project.properties\n" } ]
C++
MIT License
aff3ct/aff3ct
Auto branch detection in CI.
8,490
09.06.2018 14:15:22
-7,200
54b210b016657ffb7a7484e68aabb2eae3ba6914
Try to fix branch auto detection in CI.
[ { "change_type": "MODIFY", "old_path": "ci/sonarqube-linux.sh", "new_path": "ci/sonarqube-linux.sh", "diff": "@@ -10,7 +10,11 @@ set -x\n#cd ..\n# Create the sonar config file on the fly\n-BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\n+BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n+if [ -z \"$BRANCH\" ]\n+then\n+ BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n+fi\nVERSION=$(git tag | tail -n 1 | cut -d $'v' -f2-)\necho \"sonar.projectKey=storm:aff3ct:gitlab:$BRANCH\" > sonar-project.properties\n#echo \"sonar.projectName=AFF3CT\" >> sonar-project.properties\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix branch auto detection in CI.
8,490
09.06.2018 22:35:27
-7,200
562a366adcac4edb9a73c5a8bffdeeac5e11bc78
Add the possibility to specify the number of threads per runner.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -29,6 +29,8 @@ build-linux-gcc:\ntags:\n- linux\n- gcc\n+ - cmake\n+ - gsl\nscript:\n- ./ci/build-linux-gcc.sh\n@@ -142,7 +144,6 @@ test-regression:\nretry: 1\ntags:\n- linux\n- - gcc\n- sse4.2\n- powerful\n- python\n@@ -152,7 +153,8 @@ test-regression:\npaths:\n- test-regression-results/\nscript:\n- - ./ci/test-regression.py --build-path build_test_linux_x86_gcc --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1\n+ - source ./ci/threads.sh\n+ - ./ci/test-regression.py --build-path build_test_linux_x86_gcc --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\ntest-build-coverage-regression:\nstage: test\n" }, { "change_type": "MODIFY", "old_path": "ci/threads.sh", "new_path": "ci/threads.sh", "diff": "#!/bin/bash\n# set -x\n+if [ -z \"$THREADS\" ]; then\nHOSTNAME=$(hostname)\nif [ $HOSTNAME = \"vroum\" ]\n@@ -10,3 +11,4 @@ else\nTHREADS=$(grep -c ^processor /proc/cpuinfo)\nfi\nexport THREADS\n+fi\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the possibility to specify the number of threads per runner.
8,490
09.06.2018 22:37:38
-7,200
a190438d248d43c49ddf48ffd6ea1338c645985e
Fix the GitHub link.
[ { "change_type": "MODIFY", "old_path": "ci/sonarqube-linux.sh", "new_path": "ci/sonarqube-linux.sh", "diff": "@@ -23,7 +23,7 @@ echo \"sonar.login=c6ab3ccd4dd7a8d9aa3e90d5766c74e0c9889947\" >> sonar-pr\necho \"sonar.sources=./src/\" >> sonar-project.properties\necho \"sonar.exclusions=**/date.h, **/dirent.h\" >> sonar-project.properties\necho \"sonar.links.homepage=https://aff3ct.github.io/\" >> sonar-project.properties\n-echo \"sonar.links.scm=https://github.com/aff3ct/aff3ct\" >> sonar-project.properties\n+echo \"sonar.links.scm=https://github.com/aff3ct/aff3ct/tree/$BRANCH\" >> sonar-project.properties\necho \"sonar.links.ci=https://gitlab.inria.fr/fec/aff3ct/pipelines\" >> sonar-project.properties\necho \"sonar.links.issue=https://github.com/aff3ct/aff3ct/issues\" >> sonar-project.properties\necho \"sonar.language=c++\" >> sonar-project.properties\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the GitHub link.
8,490
10.06.2018 10:31:21
-7,200
4f838186be4fdac2b98e457a088fe6ed12af5a83
Add default args in Terminal_BFER factory.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Display/Terminal/BFER/Terminal_BFER.hpp", "new_path": "src/Factory/Tools/Display/Terminal/BFER/Terminal_BFER.hpp", "diff": "@@ -38,12 +38,12 @@ struct Terminal_BFER : Terminal\n// builder\ntemplate <typename B = int, typename R = float>\ntools::Terminal_BFER<B,R>* build(const module::Monitor_BFER<B,R> &monitor,\n- bool display_mutinfo, bool display_bfer) const;\n+ bool display_mutinfo = false, bool display_bfer = true) const;\n};\ntemplate <typename B = int, typename R = float>\nstatic tools::Terminal_BFER<B,R>* build(const parameters &params, const module::Monitor_BFER<B,R> &monitor,\n- bool display_mutinfo, bool display_bfer);\n+ bool display_mutinfo = false, bool display_bfer = true);\n};\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Add default args in Terminal_BFER factory.
8,490
10.06.2018 10:57:03
-7,200
17999357cb46bdf6336a3efa374105bdc7296c20
Control the number of threads in the short run after the compilation.
[ { "change_type": "MODIFY", "old_path": "ci/build-linux-gcc-4.8.sh", "new_path": "ci/build-linux-gcc-4.8.sh", "diff": "@@ -9,4 +9,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_BUILD_TYPE=Rele\nmake -j $THREADS\n./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-gcc-8-bit.sh", "new_path": "ci/build-linux-gcc-8-bit.sh", "diff": "@@ -9,4 +9,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release\nmake -j $THREADS\n./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-gcc-mpi.sh", "new_path": "ci/build-linux-gcc-mpi.sh", "diff": "@@ -9,4 +9,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release\nmake -j $THREADS\n./bin/aff3ct --version\n-mpirun -np $THREADS ./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+mpirun -np $THREADS ./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-gcc-systemc.sh", "new_path": "ci/build-linux-gcc-systemc.sh", "diff": "@@ -12,4 +12,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release\nmake -j $THREADS\n./bin/aff3ct --version\n-./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-gcc.sh", "new_path": "ci/build-linux-gcc.sh", "diff": "@@ -9,4 +9,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release\nmake -j $THREADS\n./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-icpc.sh", "new_path": "ci/build-linux-icpc.sh", "diff": "@@ -11,4 +11,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=icpc -DCMAKE_BUILD_TYPE=Release\nmake -j $THREADS\n./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --chn-implem MKL --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --chn-implem MKL --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-mac-osx-clang.sh", "new_path": "ci/build-mac-osx-clang.sh", "diff": "@@ -7,4 +7,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Rele\nmake\n./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t 1 --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-test-linux-gcc.sh", "new_path": "ci/build-test-linux-gcc.sh", "diff": "@@ -9,3 +9,6 @@ mkdir ${build_root}\ncd ${build_root}\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-g -Wall -funroll-loops -msse4.2 -DMULTI_PREC -DENABLE_COOL_BASH\"\nmake -j $THREADS\n+\n+./bin/aff3ct --version\n+./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -10,4 +10,4 @@ mingw32-make\ncd bin\naff3ct.exe --version\n-aff3ct.exe -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+aff3ct.exe -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t 1 --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -12,4 +12,4 @@ devenv /build Release aff3ct.sln\ncd bin\\Release\naff3ct.exe --version\n-aff3ct.exe -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n+aff3ct.exe -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t 1 --ter-freq 0\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
Control the number of threads in the short run after the compilation.
8,490
10.06.2018 11:20:07
-7,200
028b5be3cd93cae73b975fd3fffa99c9c72995d9
Fix ambiguous overloading.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Decoder_SIHO_HIHO.hpp", "new_path": "src/Module/Decoder/Decoder_SIHO_HIHO.hpp", "diff": "@@ -26,6 +26,13 @@ namespace module\ntemplate <typename B = int, typename R = float>\nclass Decoder_SIHO_HIHO : public Decoder_SIHO<B,R>, public Decoder_HIHO<B>\n{\n+public:\n+ inline Task& operator[](const dec::tsk t) { return Module::operator[]((int)t); }\n+ inline Socket& operator[](const dec::sck::decode_siho s) { return Module::operator[]((int)dec::tsk::decode_siho )[(int)s]; }\n+ inline Socket& operator[](const dec::sck::decode_siho_cw s) { return Module::operator[]((int)dec::tsk::decode_siho_cw)[(int)s]; }\n+ inline Socket& operator[](const dec::sck::decode_hiho s) { return Module::operator[]((int)dec::tsk::decode_hiho )[(int)s]; }\n+ inline Socket& operator[](const dec::sck::decode_hiho_cw s) { return Module::operator[]((int)dec::tsk::decode_hiho_cw)[(int)s]; }\n+\npublic:\n/*!\n* \\brief Constructor.\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Decoder_SISO_SIHO.hpp", "new_path": "src/Module/Decoder/Decoder_SISO_SIHO.hpp", "diff": "@@ -26,6 +26,12 @@ namespace module\ntemplate <typename B = int, typename R = float>\nclass Decoder_SISO_SIHO : public Decoder_SIHO<B,R>, public Decoder_SISO<R>\n{\n+public:\n+ inline Task& operator[](const dec::tsk t) { return Module::operator[]((int)t); }\n+ inline Socket& operator[](const dec::sck::decode_siso s) { return Module::operator[]((int)dec::tsk::decode_siso )[(int)s]; }\n+ inline Socket& operator[](const dec::sck::decode_siho s) { return Module::operator[]((int)dec::tsk::decode_siho )[(int)s]; }\n+ inline Socket& operator[](const dec::sck::decode_siho_cw s) { return Module::operator[]((int)dec::tsk::decode_siho_cw)[(int)s]; }\n+\npublic:\n/*!\n* \\brief Constructor.\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix ambiguous overloading.
8,490
10.06.2018 15:20:40
-7,200
7d3403d3e54239fdbc2cdc5997f9797d5ed4f2ed
SystemC does not support multi-threading.
[ { "change_type": "MODIFY", "old_path": "ci/build-linux-gcc-systemc.sh", "new_path": "ci/build-linux-gcc-systemc.sh", "diff": "@@ -12,4 +12,4 @@ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release\nmake -j $THREADS\n./bin/aff3ct --version\n-./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n+./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
SystemC does not support multi-threading.
8,490
12.06.2018 16:35:42
-7,200
e3885197aacda982bc94fbc3aebb46f35783469b
Simplify the CI.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -24,15 +24,59 @@ analysis-cppcheck:\nscript:\n- ./ci/analysis-cppcheck.sh\n-build-linux-gcc:\n+build-linux-gcc-nointr:\nstage: build\ntags:\n- linux\n- gcc\n- cmake\n- gsl\n+ - x86\n+ artifacts:\n+ paths:\n+ - build_linux_gcc_nointr.tar.gz\n+ script:\n+ - export CC=\"g++\"\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -DMIPP_NO_INTRINSICS\"\n+ - export NAME=\"build_linux_gcc_nointr\"\n+ - ./ci/build-linux-macosx.sh\n+\n+build-linux-gcc-sse4.2:\n+ stage: build\n+ tags:\n+ - linux\n+ - gcc\n+ - cmake\n+ - gsl\n+ - x86\n+ artifacts:\n+ paths:\n+ - build_linux_gcc_sse4.2.tar.gz\nscript:\n- - ./ci/build-linux-gcc.sh\n+ - export CC=\"g++\"\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - export NAME=\"build_linux_gcc_sse4.2\"\n+ - ./ci/build-linux-macosx.sh\n+\n+build-linux-gcc-avx2:\n+ stage: build\n+ tags:\n+ - linux\n+ - gcc\n+ - cmake\n+ - gsl\n+ - x86\n+ artifacts:\n+ paths:\n+ - build_linux_gcc_avx2.tar.gz\n+ script:\n+ - export CC=\"g++\"\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -mavx2 -mfma\"\n+ - export NAME=\"build_linux_gcc_avx2\"\n+ - ./ci/build-linux-macosx.sh\nbuild-linux-gcc-8-bit:\nstage: build\n@@ -42,8 +86,15 @@ build-linux-gcc-8-bit:\n- arm32\n- cmake\n- gsl\n+ artifacts:\n+ paths:\n+ - build_linux_gcc_8_bit.tar.gz\nscript:\n- - ./ci/build-linux-gcc-8-bit.sh\n+ - export CC=\"g++\"\n+ - export OPT=\"-DENABLE_GSL=ON\"\n+ - export FLAGS=\"-DPREC_8_BIT -march=native\"\n+ - export NAME=\"build_linux_gcc_8_bit\"\n+ - ./ci/build-linux-macosx.sh\nbuild-linux-gcc-mpi:\nstage: build\n@@ -53,8 +104,15 @@ build-linux-gcc-mpi:\n- mpi\n- cmake\n- gsl\n+ artifacts:\n+ paths:\n+ - build_linux_gcc_mpi.tar.gz\nscript:\n- - ./ci/build-linux-gcc-mpi.sh\n+ - export CC=\"g++\"\n+ - export OPT=\"-DENABLE_GSL=ON -DENABLE_MPI=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -march=native\"\n+ - export NAME=\"build_linux_gcc_mpi\"\n+ - ./ci/build-linux-macosx.sh\nbuild-linux-gcc-systemc:\nstage: build\n@@ -63,8 +121,17 @@ build-linux-gcc-systemc:\n- gcc\n- systemc\n- cmake\n+ artifacts:\n+ paths:\n+ - build_linux_gcc_systemc.tar.gz\nscript:\n- - ./ci/build-linux-gcc-systemc.sh\n+ - cp $SYSTEMC_HOME/FindSystemC.cmake cmake/Modules/\n+ - cp $SYSTEMC_HOME/FindTLM.cmake cmake/Modules/\n+ - export CC=\"g++\"\n+ - export OPT=\"-DENABLE_SYSTEMC=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -march=native -Wno-deprecated-declarations\"\n+ - export NAME=\"build_linux_gcc_systemc\"\n+ - ./ci/build-linux-macosx.sh\nbuild-linux-clang:\nstage: build\n@@ -72,10 +139,16 @@ build-linux-clang:\n- linux\n- clang\n- cmake\n- - x86\n- gsl\n+ artifacts:\n+ paths:\n+ - build_linux_clang.tar.gz\nscript:\n- - ./ci/build-linux-clang.sh\n+ - export CC=\"clang++\"\n+ - export OPT=\"-DENABLE_GSL=ON\"\n+ - export FLAGS=\"-DMULTI_PREC\"\n+ - export NAME=\"build_linux_clang\"\n+ - ./ci/build-linux-macosx.sh\nbuild-linux-gcc-4.8:\nstage: build\n@@ -84,8 +157,15 @@ build-linux-gcc-4.8:\n- gcc-4.8\n- cmake\n- gsl\n+ artifacts:\n+ paths:\n+ - build_linux_gcc-4.8.tar.gz\nscript:\n- - ./ci/build-linux-gcc-4.8.sh\n+ - export CC=\"g++-4.8\"\n+ - export OPT=\"-DENABLE_GSL=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -march=native\"\n+ - export NAME=\"build_linux_gcc-4.8\"\n+ - ./ci/build-linux-macosx.sh\nbuild-linux-icpc:\nstage: build\n@@ -95,53 +175,63 @@ build-linux-icpc:\n- cmake\n- mkl\n- gsl\n- script:\n- - ./ci/build-linux-icpc.sh\n-\n-build-test-linux-gcc:\n- stage: build\n- tags:\n- - linux\n- - gcc\n- - sse4.2\n- - cmake\n- - gsl\nartifacts:\npaths:\n- - build_test_linux_x86_gcc/bin/\n+ - build_linux_icpc.tar.gz\nscript:\n- - ./ci/build-test-linux-gcc.sh\n+ - source /opt/intel/vars-intel.sh\n+ - export CC=\"icpc\"\n+ - export OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n+ - export FLAGS=\"-DMULTI_PREC -march=native -std=c++11\"\n+ - export NAME=\"build_linux_icpc\"\n+ - ./ci/build-linux-macosx.sh\n-build-windows-gcc:\n+build-windows-gcc-sse4.2:\nstage: build\ntags:\n- windows\n- gcc\n- cmake\n+ artifacts:\n+ paths:\n+ - build_windows_gcc_sse4.2/\nscript:\n- ./ci/build-windows-gcc.bat\n-build-windows-msvc:\n+build-windows-msvc-avx:\nstage: build\ntags:\n- windows\n- msvc\n- cmake\n+ artifacts:\n+ paths:\n+ - build_windows_msvc_avx/\nscript:\n- ./ci/build-windows-msvc.bat\n-build-mac-osx-clang:\n+build-mac-osx-clang-sse4.2:\nstage: build\ntags:\n- mac-osx\n- apple-clang\n- cmake\n+ - x86\n+ artifacts:\n+ paths:\n+ - build_macosx_clang_sse4.2.tar.gz\nscript:\n- - ./ci/build-mac-osx-clang.sh\n+ - export CC=\"clang++\"\n+ - export OPT=\"\"\n+ - export FLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - export NAME=\"build_macosx_clang_sse4.2\"\n+ - ./ci/build-linux-macosx.sh\ntest-regression:\nstage: test\nretry: 1\n+ dependencies:\n+ - build-linux-gcc-sse4.2\ntags:\n- linux\n- sse4.2\n@@ -153,8 +243,9 @@ test-regression:\npaths:\n- test-regression-results/\nscript:\n+ - tar -xvvf build_linux_gcc_sse4.2.tar.gz\n- source ./ci/threads.sh\n- - ./ci/test-regression.py --build-path build_test_linux_x86_gcc --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+ - ./ci/test-regression.py --build-path build_linux_gcc_sse4.2 --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\ntest-build-coverage-regression:\nstage: test\n@@ -174,6 +265,8 @@ test-build-coverage-regression:\ncoverage-linux:\nstage: coverage\n+ dependencies:\n+ - test-build-coverage-regression\ntags:\n- linux\n- lcov\n@@ -189,6 +282,9 @@ coverage-linux:\nsonarqube-linux:\nstage: deploy\n+ dependencies:\n+ - analysis-cppcheck\n+ - coverage-linux\ntags:\n- sonarqube\nonly:\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-clang.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DMULTI_PREC\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-gcc-4.8.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DMULTI_PREC\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-gcc-8-bit.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DPREC_8_BIT\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-gcc-mpi.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DENABLE_MPI=ON -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DMULTI_PREC\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-mpirun -np $THREADS ./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-gcc-systemc.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-cp $SYSTEMC_HOME/FindSystemC.cmake cmake/Modules/\n-cp $SYSTEMC_HOME/FindTLM.cmake cmake/Modules/\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_SYSTEMC=ON -DCMAKE_CXX_FLAGS=\"-Wall -Wno-deprecated-declarations -funroll-loops -march=native -DMULTI_PREC\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -t 1 -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-gcc.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DMULTI_PREC\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-linux-icpc.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-source /opt/intel/vars-intel.sh\n-mkdir build\n-cd build\n-#cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=icpc -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DENABLE_MKL=ON -DCMAKE_CXX_FLAGS=\"-funroll-loops -march=native -DMULTI_PREC -std=c++11 -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type -Wsign-compare -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wunused-variable -Wwrite-strings\"\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=icpc -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DENABLE_MKL=ON -DCMAKE_CXX_FLAGS=\"-funroll-loops -march=native -DMULTI_PREC -std=c++11 -Wall\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --chn-implem MKL --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/build-linux-macosx.sh", "diff": "+#!/bin/bash\n+set -x\n+\n+source ci/threads.sh\n+\n+mkdir build\n+cd build\n+\n+cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CC \\\n+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -DENABLE_COOL_BASH $FLAGS\" \\\n+ -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DENABLE_SHARED_LIB=ON $OPT\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+\n+make -j $THREADS\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+\n+mkdir $NAME $NAME/bin $NAME/lib\n+cp bin/aff3ct $NAME/bin/aff3ct\n+cp lib/libaff3ct.a $NAME/lib/libaff3ct.a\n+tar -zcvf $NAME.tar.gz $NAME/\n+mv $NAME.tar.gz ../\n" }, { "change_type": "DELETE", "old_path": "ci/build-mac-osx-clang.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-mkdir build\n-cd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DMULTI_PREC\"\n-make\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t 1 --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ci/build-test-linux-gcc.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-source ci/threads.sh\n-\n-build_root=build_test_linux_x86_gcc\n-\n-mkdir ${build_root}\n-cd ${build_root}\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-g -Wall -funroll-loops -msse4.2 -DMULTI_PREC -DENABLE_COOL_BASH\"\n-make -j $THREADS\n-\n-./bin/aff3ct --version\n-./bin/aff3ct -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t $THREADS --ter-freq 0\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -5,9 +5,14 @@ set PATH=%PATH%;C:\\Program Files\\CMake\\bin\nset PATH=%PATH%;C:\\Program Files\\Git\\mingw64\\bin\nmkdir build\ncd build\n-cmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -Wno-misleading-indentation -funroll-loops -march=native -DMULTI_PREC\"\n+cmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DCMAKE_CXX_FLAGS=\"-Wall -Wno-misleading-indentation -funroll-loops -msse4.2 -DMULTI_PREC\" -DCMAKE_EXE_LINKER_FLAGS=\"-static -static-libgcc -static-libstdc++\"\nmingw32-make\n-cd bin\n-aff3ct.exe --version\n-aff3ct.exe -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t 1 --ter-freq 0\n\\ No newline at end of file\n+mkdir build_windows_gcc_sse4.2\n+mkdir build_windows_gcc_sse4.2\\bin\\\n+mkdir build_windows_gcc_sse4.2\\lib\\\n+\n+copy bin\\aff3ct.exe build_windows_gcc_sse4.2\\bin\\\n+copy lib\\libaff3ct.a build_windows_gcc_sse4.2\\lib\\\n+\n+move build_windows_gcc_sse4.2 ..\\\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -7,9 +7,14 @@ set \"VSCMD_START_DIR=%CD%\"\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\nmkdir build\ncd build\n-cmake .. -G\"Visual Studio 15 2017 Win64\" -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE -DMULTI_PREC /EHsc /arch:AVX\"\n+cmake .. -G\"Visual Studio 15 2017 Win64\" -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DMULTI_PREC /MT /EHsc /arch:AVX\"\ndevenv /build Release aff3ct.sln\n-cd bin\\Release\n-aff3ct.exe --version\n-aff3ct.exe -C POLAR -m 1.0 -M 3.5 -s 0.25 -K 1755 -N 2048 --crc-poly 32-GZIP --dec-type ASCL -t 1 --ter-freq 0\n\\ No newline at end of file\n+mkdir build_windows_msvc_avx\n+mkdir build_windows_msvc_avx\\bin\\\n+mkdir build_windows_msvc_avx\\lib\\\n+\n+copy bin\\Release\\aff3ct.exe build_windows_msvc_avx\\bin\\\n+copy lib\\Release\\libaff3ct.lib build_windows_msvc_avx\\lib\\\n+\n+move build_windows_msvc_avx ..\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Simplify the CI.
8,490
12.06.2018 16:51:48
-7,200
86ce51c44e0dea5478f43506f3edc304aae25062
Try to fix CI issues.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -36,9 +36,10 @@ build-linux-gcc-nointr:\npaths:\n- build_linux_gcc_nointr.tar.gz\nscript:\n- - export CC=\"g++\"\n- - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- - export FLAGS=\"-DMULTI_PREC -DMIPP_NO_INTRINSICS\"\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS='-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive' -DENABLE_GSL=ON\"\n+ - export CFLAGS=\"-DMULTI_PREC -DMIPP_NO_INTRINSICS\"\n- export NAME=\"build_linux_gcc_nointr\"\n- ./ci/build-linux-macosx.sh\n@@ -54,9 +55,10 @@ build-linux-gcc-sse4.2:\npaths:\n- build_linux_gcc_sse4.2.tar.gz\nscript:\n- - export CC=\"g++\"\n- - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- - export FLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS='-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive' -DENABLE_GSL=ON\"\n+ - export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n- export NAME=\"build_linux_gcc_sse4.2\"\n- ./ci/build-linux-macosx.sh\n@@ -72,9 +74,10 @@ build-linux-gcc-avx2:\npaths:\n- build_linux_gcc_avx2.tar.gz\nscript:\n- - export CC=\"g++\"\n- - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- - export FLAGS=\"-DMULTI_PREC -mavx2 -mfma\"\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS='-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive' -DENABLE_GSL=ON\"\n+ - export CFLAGS=\"-DMULTI_PREC -mavx2 -mfma\"\n- export NAME=\"build_linux_gcc_avx2\"\n- ./ci/build-linux-macosx.sh\n@@ -90,9 +93,10 @@ build-linux-gcc-8-bit:\npaths:\n- build_linux_gcc_8_bit.tar.gz\nscript:\n- - export CC=\"g++\"\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n- export OPT=\"-DENABLE_GSL=ON\"\n- - export FLAGS=\"-DPREC_8_BIT -march=native\"\n+ - export CFLAGS=\"-DPREC_8_BIT -march=native\"\n- export NAME=\"build_linux_gcc_8_bit\"\n- ./ci/build-linux-macosx.sh\n@@ -108,9 +112,10 @@ build-linux-gcc-mpi:\npaths:\n- build_linux_gcc_mpi.tar.gz\nscript:\n- - export CC=\"g++\"\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n- export OPT=\"-DENABLE_GSL=ON -DENABLE_MPI=ON\"\n- - export FLAGS=\"-DMULTI_PREC -march=native\"\n+ - export CFLAGS=\"-DMULTI_PREC -march=native\"\n- export NAME=\"build_linux_gcc_mpi\"\n- ./ci/build-linux-macosx.sh\n@@ -127,9 +132,10 @@ build-linux-gcc-systemc:\nscript:\n- cp $SYSTEMC_HOME/FindSystemC.cmake cmake/Modules/\n- cp $SYSTEMC_HOME/FindTLM.cmake cmake/Modules/\n- - export CC=\"g++\"\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n- export OPT=\"-DENABLE_SYSTEMC=ON\"\n- - export FLAGS=\"-DMULTI_PREC -march=native -Wno-deprecated-declarations\"\n+ - export CFLAGS=\"-DMULTI_PREC -march=native -Wno-deprecated-declarations\"\n- export NAME=\"build_linux_gcc_systemc\"\n- ./ci/build-linux-macosx.sh\n@@ -144,9 +150,10 @@ build-linux-clang:\npaths:\n- build_linux_clang.tar.gz\nscript:\n- - export CC=\"clang++\"\n+ - export CC=\"clang\"\n+ - export CXX=\"clang++\"\n- export OPT=\"-DENABLE_GSL=ON\"\n- - export FLAGS=\"-DMULTI_PREC\"\n+ - export CFLAGS=\"-DMULTI_PREC\"\n- export NAME=\"build_linux_clang\"\n- ./ci/build-linux-macosx.sh\n@@ -161,9 +168,10 @@ build-linux-gcc-4.8:\npaths:\n- build_linux_gcc-4.8.tar.gz\nscript:\n- - export CC=\"g++-4.8\"\n+ - export CC=\"gcc-4.8\"\n+ - export CXX=\"g++-4.8\"\n- export OPT=\"-DENABLE_GSL=ON\"\n- - export FLAGS=\"-DMULTI_PREC -march=native\"\n+ - export CFLAGS=\"-DMULTI_PREC -march=native\"\n- export NAME=\"build_linux_gcc-4.8\"\n- ./ci/build-linux-macosx.sh\n@@ -180,9 +188,10 @@ build-linux-icpc:\n- build_linux_icpc.tar.gz\nscript:\n- source /opt/intel/vars-intel.sh\n- - export CC=\"icpc\"\n+ - export CC=\"icc\"\n+ - export CXX\"icpc\"\n- export OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n- - export FLAGS=\"-DMULTI_PREC -march=native -std=c++11\"\n+ - export CFLAGS=\"-DMULTI_PREC -march=native -std=c++11\"\n- export NAME=\"build_linux_icpc\"\n- ./ci/build-linux-macosx.sh\n@@ -221,9 +230,10 @@ build-mac-osx-clang-sse4.2:\npaths:\n- build_macosx_clang_sse4.2.tar.gz\nscript:\n- - export CC=\"clang++\"\n+ - export CC=\"clang\"\n+ - export CXX=\"clang++\"\n- export OPT=\"\"\n- - export FLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n- export NAME=\"build_macosx_clang_sse4.2\"\n- ./ci/build-linux-macosx.sh\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-macosx.sh", "new_path": "ci/build-linux-macosx.sh", "diff": "@@ -6,8 +6,8 @@ source ci/threads.sh\nmkdir build\ncd build\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CC \\\n- -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -DENABLE_COOL_BASH $FLAGS\" \\\n+cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \\\n+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -DENABLE_COOL_BASH $CFLAGS\" \\\n-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DENABLE_SHARED_LIB=ON $OPT\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix CI issues.
8,490
12.06.2018 17:13:06
-7,200
4cc631e5aada6ff392693e9f43d8175961fbdc69
Name artifacts + remove tar.gz after builds.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -33,8 +33,9 @@ build-linux-gcc-nointr:\n- gsl\n- x86\nartifacts:\n+ name: build-linux-gcc-nointr\npaths:\n- - build_linux_gcc_nointr.tar.gz\n+ - build_linux_gcc_nointr\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n@@ -53,8 +54,9 @@ build-linux-gcc-sse4.2:\n- gsl\n- x86\nartifacts:\n+ name: build-linux-gcc-sse4.2\npaths:\n- - build_linux_gcc_sse4.2.tar.gz\n+ - build_linux_gcc_sse4.2\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n@@ -73,8 +75,9 @@ build-linux-gcc-avx2:\n- gsl\n- x86\nartifacts:\n+ name: build-linux-gcc-avx2\npaths:\n- - build_linux_gcc_avx2.tar.gz\n+ - build_linux_gcc_avx2\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n@@ -93,8 +96,9 @@ build-linux-gcc-8-bit:\n- cmake\n- gsl\nartifacts:\n+ name: build-linux-gcc-8-bit\npaths:\n- - build_linux_gcc_8_bit.tar.gz\n+ - build_linux_gcc_8_bit\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n@@ -113,8 +117,9 @@ build-linux-gcc-mpi:\n- cmake\n- gsl\nartifacts:\n+ name: build-linux-gcc-mpi\npaths:\n- - build_linux_gcc_mpi.tar.gz\n+ - build_linux_gcc_mpi\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n@@ -132,8 +137,9 @@ build-linux-gcc-systemc:\n- systemc\n- cmake\nartifacts:\n+ name: build-linux-gcc-systemc\npaths:\n- - build_linux_gcc_systemc.tar.gz\n+ - build_linux_gcc_systemc\nscript:\n- cp $SYSTEMC_HOME/FindSystemC.cmake cmake/Modules/\n- cp $SYSTEMC_HOME/FindTLM.cmake cmake/Modules/\n@@ -153,8 +159,9 @@ build-linux-clang:\n- cmake\n- gsl\nartifacts:\n+ name: build-linux-clang\npaths:\n- - build_linux_clang.tar.gz\n+ - build_linux_clang\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n@@ -172,8 +179,9 @@ build-linux-gcc-4.8:\n- cmake\n- gsl\nartifacts:\n+ name: build-linux-gcc-4.8\npaths:\n- - build_linux_gcc-4.8.tar.gz\n+ - build_linux_gcc-4.8\nscript:\n- export CC=\"gcc-4.8\"\n- export CXX=\"g++-4.8\"\n@@ -192,8 +200,9 @@ build-linux-icpc:\n- mkl\n- gsl\nartifacts:\n+ name: build-linux-icpc\npaths:\n- - build_linux_icpc.tar.gz\n+ - build_linux_icpc\nscript:\n- source /opt/intel/vars-intel.sh\n- export CC=\"icc\"\n@@ -211,8 +220,9 @@ build-windows-gcc-sse4.2:\n- gcc\n- cmake\nartifacts:\n+ name: build-windows-gcc-sse4.2\npaths:\n- - build_windows_gcc_sse4.2/\n+ - build_windows_gcc_sse4.2\nscript:\n- ./ci/build-windows-gcc.bat\n@@ -223,8 +233,9 @@ build-windows-msvc-avx:\n- msvc\n- cmake\nartifacts:\n+ name: build-windows-msvc-avx\npaths:\n- - build_windows_msvc_avx/\n+ - build_windows_msvc_avx\nscript:\n- ./ci/build-windows-msvc.bat\n@@ -236,8 +247,9 @@ build-mac-osx-clang-sse4.2:\n- cmake\n- x86\nartifacts:\n+ name: build-macosx-clang-sse4.2\npaths:\n- - build_macosx_clang_sse4.2.tar.gz\n+ - build_macosx_clang_sse4.2\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n@@ -263,7 +275,6 @@ test-regression:\npaths:\n- test-regression-results/\nscript:\n- - tar -xvvf build_linux_gcc_sse4.2.tar.gz\n- source ./ci/threads.sh\n- ./ci/test-regression.py --build-path build_linux_gcc_sse4.2 --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-macosx.sh", "new_path": "ci/build-linux-macosx.sh", "diff": "@@ -15,5 +15,4 @@ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nmkdir $NAME $NAME/bin $NAME/lib\ncp bin/aff3ct $NAME/bin/aff3ct\ncp lib/libaff3ct.a $NAME/lib/libaff3ct.a\n-tar -zcvf $NAME.tar.gz $NAME/\n-mv $NAME.tar.gz ../\n+mv $NAME ../\n" } ]
C++
MIT License
aff3ct/aff3ct
Name artifacts + remove tar.gz after builds.
8,490
12.06.2018 17:23:31
-7,200
eab62a73121bb39db89dabc4dcb643f98da337f2
Fix cmake cmd.
[ { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -7,7 +7,7 @@ set \"VSCMD_START_DIR=%CD%\"\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\nmkdir build\ncd build\n-cmake .. -G\"Visual Studio 15 2017 Win64\" -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DMULTI_PREC /MT /EHsc /arch:AVX\"\n+cmake .. -G\"Visual Studio 15 2017 Win64\" -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE -DMULTI_PREC /MT /EHsc /arch:AVX\"\ndevenv /build Release aff3ct.sln\nmkdir build_windows_msvc_avx\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix cmake cmd.
8,490
12.06.2018 17:23:48
-7,200
15b0d09003823dd8224eb42c237dc1ac5c33c05b
Escape double quote.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -39,7 +39,7 @@ build-linux-gcc-nointr:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT='-DCMAKE_EXE_LINKER_FLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\" -DENABLE_GSL=ON'\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -DMIPP_NO_INTRINSICS\"\n- export NAME=\"build_linux_gcc_nointr\"\n- source ./ci/threads.sh\n@@ -60,7 +60,7 @@ build-linux-gcc-sse4.2:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT='-DCMAKE_EXE_LINKER_FLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\" -DENABLE_GSL=ON'\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n- export NAME=\"build_linux_gcc_sse4.2\"\n- source ./ci/threads.sh\n@@ -81,7 +81,7 @@ build-linux-gcc-avx2:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT='-DCMAKE_EXE_LINKER_FLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\" -DENABLE_GSL=ON'\n+ - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -mavx2 -mfma\"\n- export NAME=\"build_linux_gcc_avx2\"\n- source ./ci/threads.sh\n" } ]
C++
MIT License
aff3ct/aff3ct
Escape double quote.
8,490
12.06.2018 17:45:44
-7,200
58a9af28ec656be7955cdec8b6503a137e979075
Try to fix bugs in the CI.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -39,8 +39,9 @@ build-linux-gcc-nointr:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -DMIPP_NO_INTRINSICS\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_nointr\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -60,8 +61,9 @@ build-linux-gcc-sse4.2:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_sse4.2\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -81,8 +83,9 @@ build-linux-gcc-avx2:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT=\"-DCMAKE_EXE_LINKER_FLAGS=\\\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\\\" -DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -mavx2 -mfma\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_avx2\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -102,8 +105,8 @@ build-linux-gcc-8-bit:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT=\"-DENABLE_GSL=ON\"\n- export CFLAGS=\"-DPREC_8_BIT -march=native\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_8_bit\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -123,8 +126,8 @@ build-linux-gcc-mpi:\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT=\"-DENABLE_GSL=ON -DENABLE_MPI=ON\"\n- export CFLAGS=\"-DMULTI_PREC -march=native\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MPI=ON\"\n- export NAME=\"build_linux_gcc_mpi\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -145,8 +148,8 @@ build-linux-gcc-systemc:\n- cp $SYSTEMC_HOME/FindTLM.cmake cmake/Modules/\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- - export OPT=\"-DENABLE_SYSTEMC=ON\"\n- export CFLAGS=\"-DMULTI_PREC -march=native -Wno-deprecated-declarations\"\n+ - export CMAKE_OPT=\"-DENABLE_SYSTEMC=ON\"\n- export NAME=\"build_linux_gcc_systemc\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -165,8 +168,8 @@ build-linux-clang:\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n- - export OPT=\"-DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_clang\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -185,8 +188,8 @@ build-linux-gcc-4.8:\nscript:\n- export CC=\"gcc-4.8\"\n- export CXX=\"g++-4.8\"\n- - export OPT=\"-DENABLE_GSL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -march=native\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc-4.8\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -207,8 +210,8 @@ build-linux-icpc:\n- source /opt/intel/vars-intel.sh\n- export CC=\"icc\"\n- export CXX\"icpc\"\n- - export OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n- export CFLAGS=\"-DMULTI_PREC -march=native -std=c++11\"\n+ - export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n- export NAME=\"build_linux_icpc\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n@@ -253,8 +256,8 @@ build-mac-osx-clang-sse4.2:\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n- - export OPT=\"\"\n- export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - export CMAKE_OPT=\"\"\n- export NAME=\"build_macosx_clang_sse4.2\"\n- source ./ci/threads.sh\n- ./ci/build-linux-macosx.sh\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-macosx.sh", "new_path": "ci/build-linux-macosx.sh", "diff": "@@ -4,10 +4,37 @@ set -x\nmkdir build\ncd build\n+if [ -z \"$CC\" ]\n+then\n+ echo \"Please define the 'CC' environment variable.\"\n+ exit 1\n+fi\n+\n+if [ -z \"$CXX\" ]\n+then\n+ echo \"Please define the 'CXX' environment variable.\"\n+ exit 1\n+fi\n+\n+if [ -z \"$THREADS\" ]\n+then\n+ echo \"The 'THREADS' environment variable is not set, default value = 1.\"\n+ THREADS=1\n+fi\n+\n+if [ -z \"$LFLAGS\" ]\n+then\n+ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \\\n+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -DENABLE_COOL_BASH $CFLAGS\" \\\n+ -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DENABLE_SHARED_LIB=ON $CMAKE_OPT\n+ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+else\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \\\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -DENABLE_COOL_BASH $CFLAGS\" \\\n- -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DENABLE_SHARED_LIB=ON $OPT\n+ -DCMAKE_EXE_LINKER_FLAGS=\"$LFLAGS\" \\\n+ -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DENABLE_SHARED_LIB=ON $CMAKE_OPT\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+fi\nmake -j $THREADS\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n" }, { "change_type": "MODIFY", "old_path": "ci/threads.sh", "new_path": "ci/threads.sh", "diff": "# set -x\nif [ -z \"$THREADS\" ]; then\n+ if [ ! -f /proc/cpuinfo ]; then\n+ export THREADS=1\n+ else\nTHREADS=$(grep -c ^processor /proc/cpuinfo)\nexport THREADS\nfi\n-\n-if [ -z \"$THREADS\" ]; then\n- THREADS=1\n- export THREADS\nfi\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix bugs in the CI.
8,490
12.06.2018 18:00:48
-7,200
f7eac8048b3874eb18073dd794586446d43779cb
Good AFF3CT lib. name.
[ { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -15,6 +15,6 @@ mkdir build_windows_msvc_avx\\bin\\\nmkdir build_windows_msvc_avx\\lib\\\ncopy bin\\Release\\aff3ct.exe build_windows_msvc_avx\\bin\\\n-copy lib\\Release\\libaff3ct.lib build_windows_msvc_avx\\lib\\\n+copy lib\\Release\\aff3ct.lib build_windows_msvc_avx\\lib\\\nmove build_windows_msvc_avx ..\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Good AFF3CT lib. name.
8,490
12.06.2018 18:14:42
-7,200
f56051dfc2e0f3fe3182e6949077907de7f68e4b
Fix yaml error.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -209,7 +209,7 @@ build-linux-icpc:\nscript:\n- source /opt/intel/vars-intel.sh\n- export CC=\"icc\"\n- - export CXX\"icpc\"\n+ - export CXX=\"icpc\"\n- export CFLAGS=\"-DMULTI_PREC -march=native -std=c++11\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n- export NAME=\"build_linux_icpc\"\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix yaml error.
8,490
12.06.2018 18:34:05
-7,200
2c65c994f8bc450c83ac160f99f98adb35fee7f4
Rename static lib. extension.
[ { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -12,7 +12,7 @@ mkdir build_windows_gcc_sse4.2\nmkdir build_windows_gcc_sse4.2\\bin\\\nmkdir build_windows_gcc_sse4.2\\lib\\\n-copy bin\\aff3ct.exe build_windows_gcc_sse4.2\\bin\\\n-copy lib\\libaff3ct.a build_windows_gcc_sse4.2\\lib\\\n+copy bin\\aff3ct.exe build_windows_gcc_sse4.2\\bin\\aff3ct.exe\n+copy lib\\libaff3ct.a build_windows_gcc_sse4.2\\lib\\aff3ct.lib\nmove build_windows_gcc_sse4.2 ..\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Rename static lib. extension.
8,490
12.06.2018 18:53:39
-7,200
cbc01bd6f0ad4f47da67a4f8af1976ae4386efb5
Add includes in build archives.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -202,6 +202,7 @@ build-linux-icpc:\n- cmake\n- mkl\n- gsl\n+ - x86\nartifacts:\nname: build-linux-icpc\npaths:\n@@ -222,6 +223,7 @@ build-windows-gcc-sse4.2:\n- windows\n- gcc\n- cmake\n+ - x86\nartifacts:\nname: build-windows-gcc-sse4.2\npaths:\n@@ -235,6 +237,7 @@ build-windows-msvc-avx:\n- windows\n- msvc\n- cmake\n+ - x86\nartifacts:\nname: build-windows-msvc-avx\npaths:\n" }, { "change_type": "MODIFY", "old_path": "ci/build-linux-macosx.sh", "new_path": "ci/build-linux-macosx.sh", "diff": "@@ -39,7 +39,11 @@ fi\nmake -j $THREADS\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-mkdir $NAME $NAME/bin $NAME/lib\n+mkdir $NAME $NAME/bin $NAME/lib $NAME/inc\ncp bin/aff3ct $NAME/bin/aff3ct\ncp lib/libaff3ct.a $NAME/lib/libaff3ct.a\n+cp -r ../src/* $NAME/inc/\n+find $NAME/inc/ -type f -follow -print | grep \"[.]cpp$\" | xargs rm -f\n+find $NAME/inc/ -type f -follow -print | grep \"[.]cpp.in$\" | xargs rm -f\n+\nmv $NAME ../\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -11,8 +11,11 @@ mingw32-make\nmkdir build_windows_gcc_sse4.2\nmkdir build_windows_gcc_sse4.2\\bin\\\nmkdir build_windows_gcc_sse4.2\\lib\\\n+mkdir build_windows_gcc_sse4.2\\inc\\\n+\ncopy bin\\aff3ct.exe build_windows_gcc_sse4.2\\bin\\aff3ct.exe\ncopy lib\\libaff3ct.a build_windows_gcc_sse4.2\\lib\\aff3ct.lib\n+copy ..\\src\\* build_windows_gcc_sse4.2\\inc\\\nmove build_windows_gcc_sse4.2 ..\\\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -13,8 +13,10 @@ devenv /build Release aff3ct.sln\nmkdir build_windows_msvc_avx\nmkdir build_windows_msvc_avx\\bin\\\nmkdir build_windows_msvc_avx\\lib\\\n+mkdir build_windows_msvc_avx\\inc\\\ncopy bin\\Release\\aff3ct.exe build_windows_msvc_avx\\bin\\\ncopy lib\\Release\\aff3ct.lib build_windows_msvc_avx\\lib\\\n+copy ..\\src\\* build_windows_msvc_avx\\inc\\\nmove build_windows_msvc_avx ..\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Add includes in build archives.
8,490
12.06.2018 20:19:42
-7,200
a7a67326b02671efb9f1d01e921919f6ed119517
Use xcopy instead of copy for recursive copies.
[ { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -16,6 +16,6 @@ mkdir build_windows_gcc_sse4.2\\inc\\\ncopy bin\\aff3ct.exe build_windows_gcc_sse4.2\\bin\\aff3ct.exe\ncopy lib\\libaff3ct.a build_windows_gcc_sse4.2\\lib\\aff3ct.lib\n-copy ..\\src\\* build_windows_gcc_sse4.2\\inc\\\n+xcopy ..\\src\\* build_windows_gcc_sse4.2\\inc\\ /s /e\nmove build_windows_gcc_sse4.2 ..\\\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -17,6 +17,6 @@ mkdir build_windows_msvc_avx\\inc\\\ncopy bin\\Release\\aff3ct.exe build_windows_msvc_avx\\bin\\\ncopy lib\\Release\\aff3ct.lib build_windows_msvc_avx\\lib\\\n-copy ..\\src\\* build_windows_msvc_avx\\inc\\\n+xcopy ..\\src\\* build_windows_msvc_avx\\inc\\ /s /e\nmove build_windows_msvc_avx ..\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Use xcopy instead of copy for recursive copies.
8,490
12.06.2018 20:39:08
-7,200
0127f8713fa482f7c2cc9f820b04a3a5204da76a
Improve the genericity of the Windows batch scripts.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -229,6 +229,10 @@ build-windows-gcc-sse4.2:\npaths:\n- build_windows_gcc_sse4.2\nscript:\n+ - setx CFLAGS \"-DMULTI_PREC -msse4.2\"\n+ - setx LFLAGS \"-static -static-libgcc -static-libstdc++\"\n+ - setx CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - setx NAME \"build_windows_gcc_sse4.2\"\n- ./ci/build-windows-gcc.bat\nbuild-windows-msvc-avx:\n@@ -243,6 +247,9 @@ build-windows-msvc-avx:\npaths:\n- build_windows_msvc_avx\nscript:\n+ - setx CFLAGS \"-DMULTI_PREC /arch:AVX\"\n+ - setx CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - setx NAME \"build_windows_msvc_avx\"\n- ./ci/build-windows-msvc.bat\nbuild-mac-osx-clang-sse4.2:\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -5,17 +5,16 @@ set PATH=%PATH%;C:\\Program Files\\CMake\\bin\nset PATH=%PATH%;C:\\Program Files\\Git\\mingw64\\bin\nmkdir build\ncd build\n-cmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DCMAKE_CXX_FLAGS=\"-Wall -Wno-misleading-indentation -funroll-loops -msse4.2 -DMULTI_PREC\" -DCMAKE_EXE_LINKER_FLAGS=\"-static -static-libgcc -static-libstdc++\"\n+cmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"-Wall -Wno-misleading-indentation -funroll-loops %CFLAGS%\" -DCMAKE_EXE_LINKER_FLAGS=\"%LFLAGS%\"\nmingw32-make\n-mkdir build_windows_gcc_sse4.2\n-mkdir build_windows_gcc_sse4.2\\bin\\\n-mkdir build_windows_gcc_sse4.2\\lib\\\n-mkdir build_windows_gcc_sse4.2\\inc\\\n+mkdir %NAME%\n+mkdir %NAME%\\bin\\\n+mkdir %NAME%\\lib\\\n+mkdir %NAME%\\inc\\\n+ copy bin\\aff3ct.exe %NAME%\\bin\\aff3ct.exe\n+ copy lib\\libaff3ct.a %NAME%\\lib\\aff3ct.lib\n+xcopy ..\\src\\* %NAME%\\inc\\ /s /e\n- copy bin\\aff3ct.exe build_windows_gcc_sse4.2\\bin\\aff3ct.exe\n- copy lib\\libaff3ct.a build_windows_gcc_sse4.2\\lib\\aff3ct.lib\n-xcopy ..\\src\\* build_windows_gcc_sse4.2\\inc\\ /s /e\n-\n-move build_windows_gcc_sse4.2 ..\\\n+move %NAME% ..\\\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -7,16 +7,16 @@ set \"VSCMD_START_DIR=%CD%\"\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\nmkdir build\ncd build\n-cmake .. -G\"Visual Studio 15 2017 Win64\" -DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE -DMULTI_PREC /MT /EHsc /arch:AVX\"\n+cmake .. -G\"Visual Studio 15 2017 Win64\" %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc %CFLAGS%\"\ndevenv /build Release aff3ct.sln\n-mkdir build_windows_msvc_avx\n-mkdir build_windows_msvc_avx\\bin\\\n-mkdir build_windows_msvc_avx\\lib\\\n-mkdir build_windows_msvc_avx\\inc\\\n+mkdir %NAME%\n+mkdir %NAME%\\bin\\\n+mkdir %NAME%\\lib\\\n+mkdir %NAME%\\inc\\\n- copy bin\\Release\\aff3ct.exe build_windows_msvc_avx\\bin\\\n- copy lib\\Release\\aff3ct.lib build_windows_msvc_avx\\lib\\\n-xcopy ..\\src\\* build_windows_msvc_avx\\inc\\ /s /e\n+ copy bin\\Release\\aff3ct.exe %NAME%\\bin\\\n+ copy lib\\Release\\aff3ct.lib %NAME%\\lib\\\n+xcopy ..\\src\\* %NAME%\\inc\\ /s /e\n-move build_windows_msvc_avx ..\\\n+move %NAME% ..\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Improve the genericity of the Windows batch scripts.
8,490
12.06.2018 20:59:42
-7,200
6ba5da7ba4eee72d90b25948d39d1a4c31d37cee
Replace setx by set.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -229,10 +229,10 @@ build-windows-gcc-sse4.2:\npaths:\n- build_windows_gcc_sse4.2\nscript:\n- - setx CFLAGS \"-DMULTI_PREC -msse4.2\"\n- - setx LFLAGS \"-static -static-libgcc -static-libstdc++\"\n- - setx CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n- - setx NAME \"build_windows_gcc_sse4.2\"\n+ - set CFLAGS \"-DMULTI_PREC -msse4.2\"\n+ - set LFLAGS \"-static -static-libgcc -static-libstdc++\"\n+ - set CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - set NAME \"build_windows_gcc_sse4.2\"\n- ./ci/build-windows-gcc.bat\nbuild-windows-msvc-avx:\n@@ -247,9 +247,9 @@ build-windows-msvc-avx:\npaths:\n- build_windows_msvc_avx\nscript:\n- - setx CFLAGS \"-DMULTI_PREC /arch:AVX\"\n- - setx CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n- - setx NAME \"build_windows_msvc_avx\"\n+ - set CFLAGS \"-DMULTI_PREC /arch:AVX\"\n+ - set CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - set NAME \"build_windows_msvc_avx\"\n- ./ci/build-windows-msvc.bat\nbuild-mac-osx-clang-sse4.2:\n" } ]
C++
MIT License
aff3ct/aff3ct
Replace setx by set.
8,490
12.06.2018 21:03:29
-7,200
0789ff32e7c7496263c3677d620c1d673f2ae30e
Try an other syntax.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -229,10 +229,10 @@ build-windows-gcc-sse4.2:\npaths:\n- build_windows_gcc_sse4.2\nscript:\n- - set CFLAGS \"-DMULTI_PREC -msse4.2\"\n- - set LFLAGS \"-static -static-libgcc -static-libstdc++\"\n- - set CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n- - set NAME \"build_windows_gcc_sse4.2\"\n+ - set CFLAGS=\"-DMULTI_PREC -msse4.2\"\n+ - set LFLAGS=\"-static -static-libgcc -static-libstdc++\"\n+ - set CMAKE_OPT=\"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - set NAME=\"build_windows_gcc_sse4.2\"\n- ./ci/build-windows-gcc.bat\nbuild-windows-msvc-avx:\n@@ -247,9 +247,9 @@ build-windows-msvc-avx:\npaths:\n- build_windows_msvc_avx\nscript:\n- - set CFLAGS \"-DMULTI_PREC /arch:AVX\"\n- - set CMAKE_OPT \"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n- - set NAME \"build_windows_msvc_avx\"\n+ - set CFLAGS=\"-DMULTI_PREC /arch:AVX\"\n+ - set CMAKE_OPT=\"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - set NAME=\"build_windows_msvc_avx\"\n- ./ci/build-windows-msvc.bat\nbuild-mac-osx-clang-sse4.2:\n" } ]
C++
MIT License
aff3ct/aff3ct
Try an other syntax.
8,490
12.06.2018 21:14:19
-7,200
b0f040ddec75ee7516eff664fc4e567605a707dd
Try to fix batch scripts.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -229,10 +229,10 @@ build-windows-gcc-sse4.2:\npaths:\n- build_windows_gcc_sse4.2\nscript:\n- - set CFLAGS=\"-DMULTI_PREC -msse4.2\"\n- - set LFLAGS=\"-static -static-libgcc -static-libstdc++\"\n- - set CMAKE_OPT=\"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n- - set NAME=\"build_windows_gcc_sse4.2\"\n+ - set \"CFLAGS=-DMULTI_PREC -msse4.2\"\n+ - set \"LFLAGS=-static -static-libgcc -static-libstdc++\"\n+ - set \"CMAKE_OPT=-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - set \"NAME=build_windows_gcc_sse4.2\"\n- ./ci/build-windows-gcc.bat\nbuild-windows-msvc-avx:\n@@ -247,9 +247,9 @@ build-windows-msvc-avx:\npaths:\n- build_windows_msvc_avx\nscript:\n- - set CFLAGS=\"-DMULTI_PREC /arch:AVX\"\n- - set CMAKE_OPT=\"-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n- - set NAME=\"build_windows_msvc_avx\"\n+ - set \"CFLAGS=-DMULTI_PREC /arch:AVX\"\n+ - set \"CMAKE_OPT=-DENABLE_EXEC=ON -DENABLE_STATIC_LIB=ON\"\n+ - set \"NAME=build_windows_msvc_avx\"\n- ./ci/build-windows-msvc.bat\nbuild-mac-osx-clang-sse4.2:\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@@ -6,7 +6,9 @@ set PATH=%PATH%;C:\\Program Files\\Git\\mingw64\\bin\nmkdir build\ncd build\ncmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"-Wall -Wno-misleading-indentation -funroll-loops %CFLAGS%\" -DCMAKE_EXE_LINKER_FLAGS=\"%LFLAGS%\"\n+if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\nmingw32-make\n+if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\nmkdir %NAME%\nmkdir %NAME%\\bin\\\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -8,7 +8,9 @@ call \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\nmkdir build\ncd build\ncmake .. -G\"Visual Studio 15 2017 Win64\" %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc %CFLAGS%\"\n+if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\ndevenv /build Release aff3ct.sln\n+if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\nmkdir %NAME%\nmkdir %NAME%\\bin\\\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix batch scripts.
8,490
13.06.2018 14:52:11
-7,200
30988f5ca51eb17515c335e22934f4c713ca7d6b
Add an automatic script to deploy the builds on the AFF3CT web site.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -43,7 +43,7 @@ build-linux-gcc-nointr:\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_nointr\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-gcc-sse4.2:\n@@ -65,7 +65,7 @@ build-linux-gcc-sse4.2:\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_sse4.2\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-gcc-avx2:\n@@ -87,7 +87,7 @@ build-linux-gcc-avx2:\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_avx2\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-gcc-8-bit:\n@@ -108,7 +108,7 @@ build-linux-gcc-8-bit:\n- export CFLAGS=\"-DPREC_8_BIT -march=native\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_8_bit\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-gcc-mpi:\n@@ -129,7 +129,7 @@ build-linux-gcc-mpi:\n- export CFLAGS=\"-DMULTI_PREC -march=native\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MPI=ON\"\n- export NAME=\"build_linux_gcc_mpi\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-gcc-systemc:\n@@ -151,7 +151,7 @@ build-linux-gcc-systemc:\n- export CFLAGS=\"-DMULTI_PREC -march=native -Wno-deprecated-declarations\"\n- export CMAKE_OPT=\"-DENABLE_SYSTEMC=ON\"\n- export NAME=\"build_linux_gcc_systemc\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-clang:\n@@ -171,7 +171,7 @@ build-linux-clang:\n- export CFLAGS=\"-DMULTI_PREC\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_clang\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-gcc-4.8:\n@@ -191,7 +191,7 @@ build-linux-gcc-4.8:\n- export CFLAGS=\"-DMULTI_PREC -march=native\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc-4.8\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-linux-icpc:\n@@ -214,7 +214,7 @@ build-linux-icpc:\n- export CFLAGS=\"-DMULTI_PREC -march=native -std=c++11\"\n- export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n- export NAME=\"build_linux_icpc\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\nbuild-windows-gcc-sse4.2:\n@@ -269,7 +269,7 @@ build-mac-osx-clang-sse4.2:\n- export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n- export CMAKE_OPT=\"\"\n- export NAME=\"build_macosx_clang_sse4.2\"\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/build-linux-macosx.sh\ntest-regression:\n@@ -288,7 +288,7 @@ test-regression:\npaths:\n- test-regression-results/\nscript:\n- - source ./ci/threads.sh\n+ - source ./ci/tools/threads.sh\n- ./ci/test-regression.py --build-path build_linux_gcc_sse4.2 --max-snr-time 5 --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\ntest-build-coverage-regression:\n@@ -324,7 +324,7 @@ coverage-linux:\nscript:\n- ./ci/coverage-linux.sh\n-sonarqube-linux:\n+deploy-sonarqube-linux:\nstage: deploy\ndependencies:\n- analysis-cppcheck\n@@ -335,7 +335,31 @@ sonarqube-linux:\n- master\n- development\nscript:\n- - ./ci/sonarqube-linux.sh\n+ - source ./ci/tools/git-tag.sh\n+ - source ./ci/tools/git-branch.sh\n+ - ./ci/deploy-sonarqube-linux.sh\n+\n+deploy-builds-linux:\n+ stage: deploy\n+ dependencies:\n+ - build-linux-gcc-sse4.2\n+ - build-linux-gcc-avx2\n+ - build-windows-gcc-sse4.2\n+ - build-mac-osx-clang-sse4.2\n+ tags:\n+ - linux\n+ - github\n+ only:\n+ - master\n+ - development\n+ script:\n+ - source ./ci/tools/git-branch.sh\n+ - source ./ci/tools/git-tag.sh\n+ - source ./ci/tools/git-hash.sh\n+ - source ./ci/tools/git-date.sh\n+ - source ./ci/tools/git-message.sh\n+ - source ./ci/tools/git-author.sh\n+ - ./ci/deploy-builds-linux.sh build_linux_gcc_sse4.2 build_linux_gcc_avx2 build_windows_gcc_sse4.2 build_mac_osx_clang_sse4.2\npages:\nstage: deploy\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/deploy-builds-linux.sh", "diff": "+#!/bin/bash\n+set -x\n+\n+git clone git@github.com:aff3ct/aff3ct.github.io.git\n+mkdir aff3ct.github.io/ressources/builds\n+\n+for BUILD in \"$@\"\n+do\n+ PREFIX=aff3ct_${GIT_BRANCH}\n+ ZIP_NAME=$(echo \"${BUILD/build/$PREFIX}\")\n+ ZIP_NAME=$(echo \"${ZIP_NAME/\\./\\_}.zip\")\n+\n+ find $BUILD/inc/ -type f -follow -print | grep \"[.]cpp$\" | xargs rm -f\n+ find $BUILD/inc/ -type f -follow -print | grep \"[.]cpp.in$\" | xargs rm -f\n+ cp -r conf $BUILD/\n+ rm -rf $BUILD/conf/.git\n+\n+ zip -r $ZIP_NAME $BUILD\n+\n+ cp $ZIP_NAME aff3ct.github.io/ressources/builds/\n+done\n+\n+echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\"\" >> aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\n+\n+git add -f aff3ct.github.io/ressources/builds/*\n+git add -f aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\n+git commit -m \"Automatic from Gitlab: add new AFF3CT builds to the download section ($GIT_HASH).\"\n+git push origin master\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/deploy-sonarqube-linux.sh", "diff": "+#!/bin/bash\n+set -x\n+\n+if [ -z \"$SONARQUBE_TOKEN\" ]\n+then\n+ echo \"The SONARQUBE_TOKEN environment variable is not defined!\"\n+ exit 1\n+fi\n+\n+if [ -z \"$GIT_TAG\" ]\n+then\n+ echo \"The GIT_TAG environment variable is not defined!\"\n+ exit 1\n+fi\n+\n+if [ -z \"$GIT_BRANCH\" ]\n+then\n+ echo \"The GIT_BRANCH environment variable is not defined!\"\n+ exit 1\n+fi\n+\n+# Create the sonar config file on the fly\n+GIT_VERSION=$(echo $GIT_TAG | cut -d $'v' -f2-)\n+echo \"sonar.projectKey=storm:aff3ct:gitlab:$GIT_BRANCH\" > sonar-project.properties\n+#echo \"sonar.projectName=AFF3CT\" >> sonar-project.properties\n+echo \"sonar.projectVersion=$GIT_VERSION\" >> sonar-project.properties\n+echo \"sonar.login=$SONARQUBE_TOKEN\" >> sonar-project.properties\n+echo \"sonar.sources=./src/\" >> sonar-project.properties\n+echo \"sonar.exclusions=**/date.h, **/dirent.h\" >> sonar-project.properties\n+echo \"sonar.links.homepage=https://aff3ct.github.io/\" >> sonar-project.properties\n+echo \"sonar.links.scm=https://github.com/aff3ct/aff3ct/tree/$GIT_BRANCH\" >> sonar-project.properties\n+echo \"sonar.links.ci=https://gitlab.inria.fr/fec/aff3ct/pipelines\" >> sonar-project.properties\n+echo \"sonar.links.issue=https://github.com/aff3ct/aff3ct/issues\" >> sonar-project.properties\n+echo \"sonar.language=c++\" >> sonar-project.properties\n+echo \"sonar.cxx.cppcheck.reportPath=cppcheck/cppcheck.xml\" >> sonar-project.properties\n+echo \"sonar.cxx.coverage.reportPath=code_coverage_report/aff3ct.xml\" >> sonar-project.properties\n+\n+sonar-scanner\n" }, { "change_type": "DELETE", "old_path": "ci/sonarqube-linux.sh", "new_path": null, "diff": "-#!/bin/bash\n-set -x\n-\n-## gcc\n-#mkdir build_sonar\n-#cd build_sonar\n-#cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_GSL=ON -DCMAKE_CXX_FLAGS=\"-Wall -funroll-loops -march=native -DMULTI_PREC\"\n-#THREADS=$(grep -c ^processor /proc/cpuinfo)\n-#build-wrapper-linux-x86-64 --out-dir bw-output make -j $THREADS clean all\n-#cd ..\n-\n-if [ -z \"$SONARQUBE_TOKEN\" ]\n-then\n- echo \"The SONARQUBE_TOKEN environment variable is not defined!\"\n- exit 1\n-fi\n-\n-# Create the sonar config file on the fly\n-BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n-if [ -z \"$BRANCH\" ]\n-then\n- BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n-fi\n-VERSION=$(git tag | tail -n 1 | cut -d $'v' -f2-)\n-echo \"sonar.projectKey=storm:aff3ct:gitlab:$BRANCH\" > sonar-project.properties\n-#echo \"sonar.projectName=AFF3CT\" >> sonar-project.properties\n-echo \"sonar.projectVersion=$VERSION\" >> sonar-project.properties\n-echo \"sonar.login=$SONARQUBE_TOKEN\" >> sonar-project.properties\n-echo \"sonar.sources=./src/\" >> sonar-project.properties\n-echo \"sonar.exclusions=**/date.h, **/dirent.h\" >> sonar-project.properties\n-echo \"sonar.links.homepage=https://aff3ct.github.io/\" >> sonar-project.properties\n-echo \"sonar.links.scm=https://github.com/aff3ct/aff3ct/tree/$BRANCH\" >> sonar-project.properties\n-echo \"sonar.links.ci=https://gitlab.inria.fr/fec/aff3ct/pipelines\" >> sonar-project.properties\n-echo \"sonar.links.issue=https://github.com/aff3ct/aff3ct/issues\" >> sonar-project.properties\n-echo \"sonar.language=c++\" >> sonar-project.properties\n-echo \"sonar.cxx.cppcheck.reportPath=cppcheck/cppcheck.xml\" >> sonar-project.properties\n-echo \"sonar.cxx.coverage.reportPath=code_coverage_report/aff3ct.xml\" >> sonar-project.properties\n-#echo \"sonar.cfamily.build-wrapper-output=./build_sonar/bw-output\" >> sonar-project.properties\n-\n-sonar-scanner\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/tools/git-author.sh", "diff": "+#!/bin/bash\n+# set -x\n+\n+GIT_AUTHOR=$(git log -1 --pretty=format:'%an')\n+\n+if [ -z \"$GIT_AUTHOR\" ]\n+then\n+ export GIT_AUTHOR\n+fi\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/tools/git-branch.sh", "diff": "+#!/bin/bash\n+# set -x\n+\n+GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n+if [ -z \"$GIT_BRANCH\" ]\n+then\n+ GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n+fi\n+\n+if [ -z \"$GIT_BRANCH\" ]\n+then\n+ export GIT_BRANCH\n+fi\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/tools/git-date.sh", "diff": "+#!/bin/bash\n+# set -x\n+\n+GIT_DATE=$(git log -1 --format=%cd)\n+\n+if [ -z \"$GIT_DATE\" ]\n+then\n+ export GIT_DATE\n+fi\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/tools/git-hash.sh", "diff": "+#!/bin/bash\n+# set -x\n+\n+GIT_HASH=$(git rev-parse --short HEAD)\n+\n+if [ -z \"$GIT_HASH\" ]\n+then\n+ export GIT_HASH\n+fi\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/tools/git-message.sh", "diff": "+#!/bin/bash\n+# set -x\n+\n+GIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)\n+\n+if [ -z \"$GIT_MESSAGE\" ]\n+then\n+ export GIT_MESSAGE\n+fi\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/tools/git-tag.sh", "diff": "+#!/bin/bash\n+# set -x\n+\n+GIT_TAG=$(git tag | tail -n 1)\n+\n+if [ -z \"$GIT_TAG\" ]\n+then\n+ export GIT_TAG\n+fi\n" }, { "change_type": "RENAME", "old_path": "ci/threads.sh", "new_path": "ci/tools/threads.sh", "diff": "" } ]
C++
MIT License
aff3ct/aff3ct
Add an automatic script to deploy the builds on the AFF3CT web site.
8,490
13.06.2018 15:15:16
-7,200
ea0114a9b7c5a3899b65b896dd597e36e9fe0a59
Fix environment variable scripts.
[ { "change_type": "MODIFY", "old_path": "ci/tools/git-author.sh", "new_path": "ci/tools/git-author.sh", "diff": "GIT_AUTHOR=$(git log -1 --pretty=format:'%an')\n-if [ -z \"$GIT_AUTHOR\" ]\n+if [ ! -z \"$GIT_AUTHOR\" ]\nthen\nexport GIT_AUTHOR\nfi\n" }, { "change_type": "MODIFY", "old_path": "ci/tools/git-branch.sh", "new_path": "ci/tools/git-branch.sh", "diff": "@@ -7,7 +7,7 @@ then\nGIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\nfi\n-if [ -z \"$GIT_BRANCH\" ]\n+if [ ! -z \"$GIT_BRANCH\" ]\nthen\nexport GIT_BRANCH\nfi\n" }, { "change_type": "MODIFY", "old_path": "ci/tools/git-date.sh", "new_path": "ci/tools/git-date.sh", "diff": "GIT_DATE=$(git log -1 --format=%cd)\n-if [ -z \"$GIT_DATE\" ]\n+if [ ! -z \"$GIT_DATE\" ]\nthen\nexport GIT_DATE\nfi\n" }, { "change_type": "MODIFY", "old_path": "ci/tools/git-hash.sh", "new_path": "ci/tools/git-hash.sh", "diff": "GIT_HASH=$(git rev-parse --short HEAD)\n-if [ -z \"$GIT_HASH\" ]\n+if [ ! -z \"$GIT_HASH\" ]\nthen\nexport GIT_HASH\nfi\n" }, { "change_type": "MODIFY", "old_path": "ci/tools/git-message.sh", "new_path": "ci/tools/git-message.sh", "diff": "GIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)\n-if [ -z \"$GIT_MESSAGE\" ]\n+if [ ! -z \"$GIT_MESSAGE\" ]\nthen\nexport GIT_MESSAGE\nfi\n" }, { "change_type": "MODIFY", "old_path": "ci/tools/git-tag.sh", "new_path": "ci/tools/git-tag.sh", "diff": "GIT_TAG=$(git tag | tail -n 1)\n-if [ -z \"$GIT_TAG\" ]\n+if [ ! -z \"$GIT_TAG\" ]\nthen\nexport GIT_TAG\nfi\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix environment variable scripts.
8,490
13.06.2018 16:34:26
-7,200
55e4ba8564e054fbca633abb2491730eeed52c76
Fix the deploy builds script.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -8,7 +8,7 @@ for BUILD in \"$@\"\ndo\nPREFIX=aff3ct_${GIT_BRANCH}\nZIP_NAME=$(echo \"${BUILD/build/$PREFIX}\")\n- ZIP_NAME=$(echo \"${ZIP_NAME/\\./\\_}.zip\")\n+ ZIP_NAME=$(echo \"${ZIP_NAME/\\./\\_}_$GIT_HASH.zip\")\nfind $BUILD/inc/ -type f -follow -print | grep \"[.]cpp$\" | xargs rm -f\nfind $BUILD/inc/ -type f -follow -print | grep \"[.]cpp.in$\" | xargs rm -f\n@@ -22,7 +22,8 @@ done\necho \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\"\" >> aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\n-git add -f aff3ct.github.io/ressources/builds/*\n-git add -f aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\n+cd aff3ct.github.io\n+git add -f ressources/builds/*\n+git add -f ressources/download_${GIT_BRANCH}.csv\ngit commit -m \"Automatic from Gitlab: add new AFF3CT builds to the download section ($GIT_HASH).\"\ngit push origin master\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the deploy builds script.
8,490
13.06.2018 18:49:23
-7,200
156a94280903ba58c8310d5a4ee118f040e6cdc0
Rename 'mac-osx' in 'macos' + add the builds list in the CSV for the web site.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -44,7 +44,7 @@ build-linux-gcc-nointr:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_nointr\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-gcc-sse4.2:\nstage: build\n@@ -66,7 +66,7 @@ build-linux-gcc-sse4.2:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_sse4.2\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-gcc-avx2:\nstage: build\n@@ -88,7 +88,7 @@ build-linux-gcc-avx2:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_avx2\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-gcc-8-bit:\nstage: build\n@@ -109,7 +109,7 @@ build-linux-gcc-8-bit:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc_8_bit\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-gcc-mpi:\nstage: build\n@@ -130,7 +130,7 @@ build-linux-gcc-mpi:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MPI=ON\"\n- export NAME=\"build_linux_gcc_mpi\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-gcc-systemc:\nstage: build\n@@ -152,7 +152,7 @@ build-linux-gcc-systemc:\n- export CMAKE_OPT=\"-DENABLE_SYSTEMC=ON\"\n- export NAME=\"build_linux_gcc_systemc\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-clang:\nstage: build\n@@ -172,7 +172,7 @@ build-linux-clang:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_clang\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-gcc-4.8:\nstage: build\n@@ -192,7 +192,7 @@ build-linux-gcc-4.8:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON\"\n- export NAME=\"build_linux_gcc-4.8\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-linux-icpc:\nstage: build\n@@ -215,7 +215,7 @@ build-linux-icpc:\n- export CMAKE_OPT=\"-DENABLE_GSL=ON -DENABLE_MKL=ON\"\n- export NAME=\"build_linux_icpc\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\nbuild-windows-gcc-sse4.2:\nstage: build\n@@ -252,25 +252,25 @@ build-windows-msvc-avx:\n- set \"NAME=build_windows_msvc_avx\"\n- ./ci/build-windows-msvc.bat\n-build-mac-osx-clang-sse4.2:\n+build-macos-clang-sse4.2:\nstage: build\ntags:\n- - mac-osx\n+ - macos\n- apple-clang\n- cmake\n- x86\nartifacts:\n- name: build-macosx-clang-sse4.2\n+ name: build-macos-clang-sse4.2\npaths:\n- - build_macosx_clang_sse4.2\n+ - build_macos_clang_sse4.2\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n- export CFLAGS=\"-DMULTI_PREC -msse4.2\"\n- export CMAKE_OPT=\"\"\n- - export NAME=\"build_macosx_clang_sse4.2\"\n+ - export NAME=\"build_macos_clang_sse4.2\"\n- source ./ci/tools/threads.sh\n- - ./ci/build-linux-macosx.sh\n+ - ./ci/build-linux-macos.sh\ntest-regression:\nstage: test\n@@ -345,7 +345,7 @@ deploy-builds-linux:\n- build-linux-gcc-sse4.2\n- build-linux-gcc-avx2\n- build-windows-gcc-sse4.2\n- - build-mac-osx-clang-sse4.2\n+ - build-macos-clang-sse4.2\ntags:\n- linux\n- github\n@@ -359,7 +359,7 @@ deploy-builds-linux:\n- source ./ci/tools/git-date.sh\n- source ./ci/tools/git-message.sh\n- source ./ci/tools/git-author.sh\n- - ./ci/deploy-builds-linux.sh build_linux_gcc_sse4.2 build_linux_gcc_avx2 build_windows_gcc_sse4.2 build_mac_osx_clang_sse4.2\n+ - ./ci/deploy-builds-linux.sh build_linux_gcc_sse4.2 build_linux_gcc_avx2 build_windows_gcc_sse4.2 build_macos_clang_sse4.2\npages:\nstage: deploy\n" }, { "change_type": "RENAME", "old_path": "ci/build-linux-macosx.sh", "new_path": "ci/build-linux-macos.sh", "diff": "" }, { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -18,9 +18,16 @@ do\nzip -r $ZIP_NAME $BUILD\ncp $ZIP_NAME aff3ct.github.io/ressources/builds/\n+\n+ if [ -z \"$BUILDS_LIST\" ]\n+ then\n+ BUILDS_LIST=${ZIP_NAME}\n+ else\n+ BUILDS_LIST=${FILE},${ZIP_NAME}\n+ fi\ndone\n-echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\"\" >> aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\n+echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\ncd aff3ct.github.io\ngit add -f ressources/builds/*\n" } ]
C++
MIT License
aff3ct/aff3ct
Rename 'mac-osx' in 'macos' + add the builds list in the CSV for the web site.
8,490
14.06.2018 14:58:59
-7,200
8654ee965b67790ea75aac68bddb28632e666e9b
Fix the terminal display when calling 'legend()' multiple times.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "new_path": "src/Tools/Display/Terminal/BFER/Terminal_BFER.cpp", "diff": "@@ -57,6 +57,12 @@ void Terminal_BFER<B,R>\n::legend(std::ostream &stream)\n{\nthis->cols_groups.resize(2);\n+ for (size_t i = 0; i < this->cols_groups.size(); i++)\n+ {\n+ this->cols_groups[i].first.first.clear();\n+ this->cols_groups[i].first.second.clear();\n+ this->cols_groups[i].second.clear();\n+ }\nauto& bfer_title = this->cols_groups[0].first;\nauto& bfer_cols = this->cols_groups[0].second;\n@@ -74,8 +80,6 @@ void Terminal_BFER<B,R>\nbfer_title.first += \"Bit Error Rate (BER) and Frame Error Rate (FER)\";\n}\n- bfer_cols.clear();\n-\nif (this->n == nullptr)\n{\nstd::stringstream message;\n@@ -114,7 +118,6 @@ void Terminal_BFER<B,R>\n}\nthroughput_title = std::make_pair(\"Global throughput\", \"and elapsed time\");\n- throughput_cols.clear();\nthroughput_cols.push_back(std::make_pair(\"SIM_THR\", \"(Mb/s)\"));\nthroughput_cols.push_back(std::make_pair(\"ET/RT\", \"(hhmmss)\"));\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Terminal/EXIT/Terminal_EXIT.cpp", "new_path": "src/Tools/Display/Terminal/EXIT/Terminal_EXIT.cpp", "diff": "@@ -62,6 +62,12 @@ void Terminal_EXIT<B,R>\n::legend(std::ostream &stream)\n{\nthis->cols_groups.resize(2);\n+ for (size_t i = 0; i < this->cols_groups.size(); i++)\n+ {\n+ this->cols_groups[i].first.first.clear();\n+ this->cols_groups[i].first.second.clear();\n+ this->cols_groups[i].second.clear();\n+ }\nauto& bfer_title = this->cols_groups[0].first;\nauto& bfer_cols = this->cols_groups[0].second;\n@@ -69,7 +75,6 @@ void Terminal_EXIT<B,R>\nauto& throughput_cols = this->cols_groups[1].second;\nbfer_title = std::make_pair(\"EXIT chart depending on the\", \"\");\n- bfer_cols.clear();\nif (this->n == nullptr)\n{\n@@ -96,7 +101,6 @@ void Terminal_EXIT<B,R>\n}\nbfer_title.second += \" and the channel A noise\";\n- throughput_cols.clear();\nbfer_cols.push_back(std::make_pair(\"SIG_A\", \"(dB)\"));\nbfer_cols.push_back(std::make_pair(\"FRA\", \"\"));\nbfer_cols.push_back(std::make_pair(\"A_PRIORI\", \"(I_A)\"));\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the terminal display when calling 'legend()' multiple times.
8,490
14.06.2018 17:49:28
-7,200
d4bb66c0a964b89a15841d7aaabe044a17b0afc6
Try to fix the git-branch.sh script for real...
[ { "change_type": "MODIFY", "old_path": "ci/tools/git-branch.sh", "new_path": "ci/tools/git-branch.sh", "diff": "@@ -7,6 +7,11 @@ then\nGIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\nfi\n+if [ -z \"$GIT_BRANCH\" ]\n+then\n+ GIT_BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\n+fi\n+\nif [ ! -z \"$GIT_BRANCH\" ]\nthen\nexport GIT_BRANCH\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix the git-branch.sh script for real...
8,490
15.06.2018 16:46:51
-7,200
e0bab074830e39b855d62c8ee16807b3c2d93e19
Simplify the transpose selector code a little bit.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Perf/Transpose/transpose_selector.cpp", "new_path": "src/Tools/Perf/Transpose/transpose_selector.cpp", "diff": "#include <iostream>\n+#include <limits>\n#include <mipp.h>\n#include \"Tools/Exception/exception.hpp\"\nbool aff3ct::tools::char_transpose(const signed char *src, signed char *dst, int n)\n{\n- bool is_transposed = false;\n-#if defined(__MIC__) || defined(__KNCNI__) || defined(__AVX512__) || defined(__AVX512F__)\n- // is_transposed = false;\n-#elif defined(__AVX2__)\n- if (n >= 256)\n+#if defined(__AVX2__)\n+ int min_n = 256;\n+#elif defined(__SSE4_1__) || (defined(__ARM_NEON__) || defined(__ARM_NEON))\n+ int min_n = 128;\n+#else\n+ int min_n = std::numeric_limits<int>::max();\n+#endif\n+\n+ if (n >= min_n)\n{\n- if (((uintptr_t)src) % (256 / 8))\n+ if (((uintptr_t)src) % (min_n / 8))\nthrow runtime_error(__FILE__, __LINE__, __func__, \"'src' is unaligned memory.\");\n- if (((uintptr_t)dst) % (256 / 8))\n+ if (((uintptr_t)dst) % (min_n / 8))\nthrow runtime_error(__FILE__, __LINE__, __func__, \"'dst' is unaligned memory.\");\n-\n+#if defined(__AVX2__)\nuchar_transpose_avx((__m256i*) src, (__m256i*) dst, n);\n- is_transposed = true;\n- }\n+ return true;\n#elif defined(__SSE4_1__)\n- if (n >= 128)\n- {\n- if (((uintptr_t)src) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'src' is unaligned memory.\");\n- if (((uintptr_t)dst) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'dst' is unaligned memory.\");\n-\nuchar_transpose_sse((__m128i*) src, (__m128i*) dst, n);\n- is_transposed = true;\n- }\n+ return true;\n#elif (defined(__ARM_NEON__) || defined(__ARM_NEON))\n- if (n >= 128)\n- {\n- if (((uintptr_t)src) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'src' is unaligned memory.\");\n- if (((uintptr_t)dst) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'dst' is unaligned memory.\");\n-\nuchar_transpose_neon((trans_TYPE*) src, (trans_TYPE*) dst, n);\n- is_transposed = true;\n- }\n-#else\n- throw runtime_error(__FILE__, __LINE__, __func__, \"Transposition does not support this architecture \"\n- \"(supported architectures are: NEON, NEONv2, SSE4.1 and AVX2).\");\n+ return true;\n#endif\n+ }\n- return is_transposed;\n+ return false;\n}\nbool aff3ct::tools::char_itranspose(const signed char *src, signed char *dst, int n)\n{\n- bool is_itransposed = false;\n-#if defined(__MIC__) || defined(__KNCNI__) || defined(__AVX512__) || defined(__AVX512F__)\n- // is_itransposed = false;\n-#elif defined(__AVX2__)\n- if (n >= 256)\n+#if defined(__AVX2__)\n+ int min_n = 256;\n+#elif defined(__SSE4_1__) || (defined(__ARM_NEON__) || defined(__ARM_NEON))\n+ int min_n = 128;\n+#else\n+ int min_n = std::numeric_limits<int>::max();\n+#endif\n+\n+ if (n >= min_n)\n{\n- if (((uintptr_t)src) % (256 / 8))\n+ if (((uintptr_t)src) % (min_n / 8))\nthrow runtime_error(__FILE__, __LINE__, __func__, \"'src' is unaligned memory.\");\n- if (((uintptr_t)dst) % (256 / 8))\n+ if (((uintptr_t)dst) % (min_n / 8))\nthrow runtime_error(__FILE__, __LINE__, __func__, \"'dst' is unaligned memory.\");\n-\n+#if defined(__AVX2__)\nuchar_itranspose_avx((__m256i*) src, (__m256i*) dst, n / 8);\n- is_itransposed = true;\n- }\n+ return true;\n#elif defined(__SSE4_1__)\n- if (n >= 128)\n- {\n- if (((uintptr_t)src) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'src' is unaligned memory.\");\n- if (((uintptr_t)dst) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'dst' is unaligned memory.\");\n-\nuchar_itranspose_sse((__m128i*) src, (__m128i*) dst, n / 8);\n- is_itransposed = true;\n- }\n+ return true;\n#elif (defined(__ARM_NEON__) || defined(__ARM_NEON))\n- if (n >= 128)\n- {\n- if (((uintptr_t)src) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'src' is unaligned memory.\");\n- if (((uintptr_t)dst) % (128 / 8))\n- throw runtime_error(__FILE__, __LINE__, __func__, \"'dst' is unaligned memory.\");\n-\nuchar_itranspose_neon((trans_TYPE*) src, (trans_TYPE*) dst, n / 8);\n- is_itransposed = true;\n- }\n-#else\n- throw runtime_error(__FILE__, __LINE__, __func__, \"Transposition inverse does not support this architecture \"\n- \"(supported architectures are: NEON, NEONv2, SSE4.1 and AVX2).\");\n+ return true;\n#endif\n+ }\n- return is_itransposed;\n+ return false;\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Simplify the transpose selector code a little bit.
8,490
15.06.2018 18:08:44
-7,200
527d5b71c3427df2b3c8455fce3feca1108d7ba0
Force the 'GIT_BRANCH' value to 'development'.
[ { "change_type": "MODIFY", "old_path": "ci/tools/git-branch.sh", "new_path": "ci/tools/git-branch.sh", "diff": "#!/bin/bash\n# set -x\n-GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n-if [ -z \"$GIT_BRANCH\" ]\n-then\n- GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n-fi\n+# GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n+# if [ -z \"$GIT_BRANCH\" ]\n+# then\n+# GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n+# fi\n-if [ -z \"$GIT_BRANCH\" ]\n-then\n- GIT_BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\n-fi\n+# if [ -z \"$GIT_BRANCH\" ]\n+# then\n+# GIT_BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\n+# fi\n-if [ ! -z \"$GIT_BRANCH\" ]\n-then\n- export GIT_BRANCH\n-fi\n+# if [ ! -z \"$GIT_BRANCH\" ]\n+# then\n+# export GIT_BRANCH\n+# fi\n+\n+export GIT_BRANCH=development\n" } ]
C++
MIT License
aff3ct/aff3ct
Force the 'GIT_BRANCH' value to 'development'.
8,490
15.06.2018 18:09:49
-7,200
843182a9d8eb371bf91fc6f1aeec657cdda07e82
Force the 'GIT_BRANCH' value to 'master'.
[ { "change_type": "MODIFY", "old_path": "ci/tools/git-branch.sh", "new_path": "ci/tools/git-branch.sh", "diff": "#!/bin/bash\n# set -x\n-GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n-if [ -z \"$GIT_BRANCH\" ]\n-then\n- GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n-fi\n+# GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*),.*/\\1/p')\n+# if [ -z \"$GIT_BRANCH\" ]\n+# then\n+# GIT_BRANCH=$(git show -s --pretty=%d HEAD | sed -rne 's/.*origin\\/(.*)\\)$/\\1/p')\n+# fi\n-if [ -z \"$GIT_BRANCH\" ]\n-then\n- GIT_BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\n-fi\n+# if [ -z \"$GIT_BRANCH\" ]\n+# then\n+# GIT_BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\\/]*\\/([^\\ ]+).*$/\\1/p')\n+# fi\n-if [ ! -z \"$GIT_BRANCH\" ]\n-then\n- export GIT_BRANCH\n-fi\n+# if [ ! -z \"$GIT_BRANCH\" ]\n+# then\n+# export GIT_BRANCH\n+# fi\n+\n+export GIT_BRANCH=master\n" } ]
C++
MIT License
aff3ct/aff3ct
Force the 'GIT_BRANCH' value to 'master'.
8,490
14.06.2018 11:51:20
-7,200
beb167f952707ca62837cdcaa294999295522c31
Add a generic LDPC SIMD layered scheduler and SIMD MS, OMS and NMS update rules.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "#include \"Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hpp\"\n#include \"Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered.hpp\"\n+#include \"Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/SPA/Update_rule_SPA.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/LSPA/Update_rule_LSPA.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/AMS/Update_rule_AMS.hpp\"\n#include \"Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.hpp\"\n@@ -206,8 +210,31 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\n}\nelse if (this->type == \"BP_LAYERED\" && this->simd_strategy == \"INTER\")\n{\n- if (this->implem == \"NMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->norm_factor, (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\n- else if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)this->offset, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ // legacy LDPC layered SIMD\n+ // if (this->implem == \"NMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->norm_factor, (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ // else if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)this->offset, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+\n+ // new LDPC layered SIMD\n+ if (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_MS_inter <Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_MS_inter <Q>( ), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->implem == \"OMS\" ) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_OMS_inter <Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_OMS_inter<Q>(this->offset), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->implem == \"NMS\" )\n+ {\n+ if (typeid(Q) == typeid(int16_t) || typeid(Q) == typeid(int8_t))\n+ {\n+ if (this->norm_factor == 0.125f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,1>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,1>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.250f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,2>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,2>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.375f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,3>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,3>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.500f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,4>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,4>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.625f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,5>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,5>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.750f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,6>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,6>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.875f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,7>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,7>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 1.000f) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q,8>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,8>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else\n+ return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ }\n+ else\n+ return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ }\n}\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hpp", "diff": "+#ifndef DECODER_LDPC_BP_LAYERED_INTER_HPP_\n+#define DECODER_LDPC_BP_LAYERED_INTER_HPP_\n+\n+#include <mipp.h>\n+\n+#include \"Tools/Algo/Sparse_matrix/Sparse_matrix.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp\"\n+\n+#include \"../../../Decoder_SISO_SIHO.hpp\"\n+#include \"../Decoder_LDPC_BP.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B = int, typename R = float, class Update_rule = tools::Update_rule_NMS_inter<R>>\n+class Decoder_LDPC_BP_layered_inter : public Decoder_SISO_SIHO<B,R>, public Decoder_LDPC_BP\n+{\n+protected:\n+ const std::vector<unsigned> &info_bits_pos;\n+\n+ Update_rule up_rule;\n+\n+ const R sat_val;\n+\n+ // data structures for iterative decoding\n+ std::vector<mipp::vector<mipp::Reg<R>>> var_nodes;\n+ std::vector<mipp::vector<mipp::Reg<R>>> branches;\n+\n+ mipp::vector<mipp::Reg<R>> contributions;\n+ mipp::vector<mipp::Reg<R>> Y_N_reorderered;\n+ mipp::vector<mipp::Reg<B>> V_reorderered;\n+\n+ bool init_flag;\n+\n+public:\n+ Decoder_LDPC_BP_layered_inter(const int K, const int N, const int n_ite,\n+ const tools::Sparse_matrix &H,\n+ const std::vector<unsigned> &info_bits_pos,\n+ const Update_rule &up_rule,\n+ const bool enable_syndrome = true,\n+ const int syndrome_depth = 1,\n+ const int n_frames = 1);\n+ virtual ~Decoder_LDPC_BP_layered_inter();\n+ void reset();\n+\n+protected:\n+ void _decode_siso (const R *Y_N1, R *Y_N2, const int frame_id);\n+ void _decode_siho (const R *Y_N, B *V_K, const int frame_id);\n+ void _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n+\n+ void _load (const R *Y_N, const int frame_id);\n+ void _decode (const int frame_id);\n+ void _decode_single_ite (mipp::vector<mipp::Reg<R>> &var_nodes, mipp::vector<mipp::Reg<R>> &branches);\n+ bool _check_syndrome_soft(const mipp::vector<mipp::Reg<R>> &var_nodes);\n+};\n+}\n+}\n+\n+#include \"Decoder_LDPC_BP_layered_inter.hxx\"\n+\n+#endif /* DECODER_LDPC_BP_LAYERED_INTER_HPP_ */\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hxx", "diff": "+#include <limits>\n+#include <cmath>\n+#include <sstream>\n+#include <iostream>\n+\n+#include \"Tools/general_utils.h\"\n+#include \"Tools/Math/utils.h\"\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Perf/Reorderer/Reorderer.hpp\"\n+\n+#include \"Decoder_LDPC_BP_layered_inter.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+\n+template <typename R>\n+inline mipp::Reg<R> saturate(const mipp::Reg<R> v, const R s)\n+{\n+ return v;\n+}\n+template <>\n+inline mipp::Reg<int16_t> saturate(const mipp::Reg<int16_t> v, const int16_t s)\n+{\n+ return mipp::sat(v, (int16_t)-s, (int16_t)+s);\n+}\n+template <>\n+inline mipp::Reg<int8_t> saturate(const mipp::Reg<int8_t> v, const int8_t s)\n+{\n+ return mipp::sat(v, (int8_t)-s, (int8_t)+s);\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::Decoder_LDPC_BP_layered_inter(const int K, const int N, const int n_ite,\n+ const tools::Sparse_matrix &_H,\n+ const std::vector<unsigned> &info_bits_pos,\n+ const Update_rule &up_rule,\n+ const bool enable_syndrome,\n+ const int syndrome_depth,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, mipp::N<R>() ),\n+ Decoder_SISO_SIHO<B,R>(K, N, n_frames, mipp::N<R>() ),\n+ Decoder_LDPC_BP (K, N, n_ite, _H, enable_syndrome, syndrome_depth ),\n+ info_bits_pos (info_bits_pos ),\n+ up_rule (up_rule ),\n+ sat_val ((R)((1 << ((sizeof(R) * 8 -2) - (int)std::log2(this->H.get_rows_max_degree()))) -1)),\n+ var_nodes (this->n_dec_waves, mipp::vector<mipp::Reg<R>>(N) ),\n+ branches (this->n_dec_waves, mipp::vector<mipp::Reg<R>>(this->H.get_n_connections()) ),\n+ contributions (this->H.get_cols_max_degree() ),\n+ Y_N_reorderered (N ),\n+ V_reorderered (N ),\n+ init_flag (true )\n+{\n+ const std::string name = \"Decoder_LDPC_BP_layered_inter<\" + this->up_rule.get_name() + \">\";\n+ this->set_name(name);\n+\n+ if (this->sat_val <= 0)\n+ {\n+ std::stringstream message;\n+ message << \"'sat_val' has to be greater than 0 ('sat_val' = \" << this->sat_val << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::~Decoder_LDPC_BP_layered_inter()\n+{\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::reset()\n+{\n+ this->init_flag = true;\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_load(const R *Y_N, const int frame_id)\n+{\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+\n+ // memory zones initialization\n+ if (this->init_flag)\n+ {\n+ const auto zero = mipp::Reg<R>((R)0);\n+ std::fill(this->branches [cur_wave].begin(), this->branches [cur_wave].end(), zero);\n+ std::fill(this->var_nodes[cur_wave].begin(), this->var_nodes[cur_wave].end(), zero);\n+\n+ if (cur_wave == this->n_dec_waves -1) this->init_flag = false;\n+ }\n+\n+ std::vector<const R*> frames(mipp::N<R>());\n+ for (auto f = 0; f < mipp::N<R>(); f++) frames[f] = Y_N + f * this->N;\n+ tools::Reorderer_static<R,mipp::N<R>()>::apply(frames, (R*)this->Y_N_reorderered.data(), this->N);\n+\n+ for (auto i = 0; i < (int)var_nodes[cur_wave].size(); i++)\n+ this->var_nodes[cur_wave][i] += this->Y_N_reorderered[i]; // var_nodes contain previous extrinsic information\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_decode_siso(const R *Y_N1, R *Y_N2, const int frame_id)\n+{\n+ // memory zones initialization\n+ this->_load(Y_N1, frame_id);\n+\n+ this->_decode(frame_id);\n+\n+ // prepare for next round by processing extrinsic information\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+ for (auto v = 0; v < this->N; v++)\n+ this->var_nodes[cur_wave][v] -= Y_N_reorderered[v];\n+\n+ std::vector<R*> frames(mipp::N<R>());\n+ for (auto f = 0; f < mipp::N<R>(); f++) frames[f] = Y_N2 + f * this->N;\n+ tools::Reorderer_static<R,mipp::N<R>()>::apply_rev((R*)this->var_nodes[cur_wave].data(), frames, this->N);\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n+{\n+// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n+ this->_load(Y_N, frame_id);\n+// auto d_load = std::chrono::steady_clock::now() - t_load;\n+\n+// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n+ this->_decode(frame_id);\n+// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n+\n+// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n+ // take the hard decision\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+ for (auto v = 0; v < this->K; v++)\n+ {\n+ const auto k = this->info_bits_pos[v];\n+ V_reorderered[v] = mipp::cast<R,B>(this->var_nodes[cur_wave][k]) >> (sizeof(B) * 8 - 1);\n+ }\n+\n+ std::vector<B*> frames(mipp::N<R>());\n+ for (auto f = 0; f < mipp::N<R>(); f++) frames[f] = V_K + f * this->K;\n+ tools::Reorderer_static<B,mipp::N<R>()>::apply_rev((B*)V_reorderered.data(), frames, this->K);\n+// auto d_store = std::chrono::steady_clock::now() - t_store;\n+\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::load, d_load);\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::decode, d_decod);\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::store, d_store);\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n+{\n+// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n+ this->_load(Y_N, frame_id);\n+// auto d_load = std::chrono::steady_clock::now() - t_load;\n+\n+// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n+ this->_decode(frame_id);\n+// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n+\n+// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n+ // take the hard decision\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+ for (auto v = 0; v < this->N; v++)\n+ V_reorderered[v] = mipp::cast<R,B>(this->var_nodes[cur_wave][v]) >> (sizeof(B) * 8 - 1);\n+\n+ std::vector<B*> frames(mipp::N<R>());\n+ for (auto f = 0; f < mipp::N<R>(); f++) frames[f] = V_N + f * this->N;\n+ tools::Reorderer_static<B,mipp::N<R>()>::apply_rev((B*)V_reorderered.data(), frames, this->N);\n+// auto d_store = std::chrono::steady_clock::now() - t_store;\n+\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::load, d_load);\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::decode, d_decod);\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::store, d_store);\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_decode(const int frame_id)\n+{\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+\n+ this->up_rule.begin_decoding(this->n_ite);\n+\n+ for (auto ite = 0; ite < this->n_ite; ite++)\n+ {\n+ this->up_rule.begin_ite(ite);\n+ this->_decode_single_ite(this->var_nodes[cur_wave], this->branches[cur_wave]);\n+ this->up_rule.end_ite();\n+\n+ if (this->_check_syndrome_soft(this->var_nodes[cur_wave]))\n+ break;\n+ }\n+\n+ this->up_rule.end_decoding();\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_decode_single_ite(mipp::vector<mipp::Reg<R>> &var_nodes, mipp::vector<mipp::Reg<R>> &branches)\n+{\n+ auto kr = 0;\n+ auto kw = 0;\n+\n+ // layered scheduling\n+ const auto n_chk_nodes = (int)this->H.get_n_cols();\n+ for (auto c = 0; c < n_chk_nodes; c++)\n+ {\n+ const auto chk_degree = (int)this->H[c].size();\n+ this->up_rule.begin_chk_node_in(c, chk_degree);\n+ for (auto v = 0; v < chk_degree; v++)\n+ {\n+ this->contributions[v] = var_nodes[this->H[c][v]] - branches[kr++];\n+ this->up_rule.compute_chk_node_in(v, this->contributions[v]);\n+ }\n+ this->up_rule.end_chk_node_in();\n+\n+ this->up_rule.begin_chk_node_out(c, chk_degree);\n+ for (auto v = 0; v < chk_degree; v++)\n+ {\n+ branches[kw] = saturate<R>(this->up_rule.compute_chk_node_out(v, this->contributions[v]), this->sat_val);\n+ var_nodes[this->H[c][v]] = this->contributions[v] + branches[kw++];\n+ }\n+ this->up_rule.end_chk_node_out();\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+bool Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\n+::_check_syndrome_soft(const mipp::vector<mipp::Reg<R>> &var_nodes)\n+{\n+ if (this->enable_syndrome)\n+ {\n+ const auto zero = mipp::Msk<mipp::N<B>()>(false);\n+ auto syndrome = zero;\n+\n+ auto n_chk_nodes = (int)H.get_n_cols();\n+ auto c = 0;\n+ while (c < n_chk_nodes && mipp::testz(syndrome))\n+ {\n+ auto sign = zero;\n+ const auto chk_degree = (int)this->H[c].size();\n+ for (auto v = 0; v < chk_degree; v++)\n+ {\n+ const auto value = var_nodes[this->H[c][v]];\n+ sign ^= mipp::sign(value);\n+ }\n+\n+ syndrome |= sign;\n+ c++;\n+ }\n+\n+ const auto syndrome_scalar = mipp::testz(syndrome);\n+\n+ this->cur_syndrome_depth = syndrome_scalar ? (this->cur_syndrome_depth +1) % this->syndrome_depth : 0;\n+ return syndrome_scalar && (this->cur_syndrome_depth == 0);\n+ }\n+ else\n+ return false;\n+}\n+\n+}\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp", "diff": "+#ifndef UPDATE_RULE_MS_INTER_HPP\n+#define UPDATE_RULE_MS_INTER_HPP\n+\n+#include <limits>\n+#include <string>\n+#include <mipp.h>\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+template <typename R > class Update_rule_OMS_inter;\n+template <typename R, int N> class Update_rule_NMS_inter;\n+\n+template <typename R = float>\n+class Update_rule_MS_inter // Min Sum\n+{\n+ friend Update_rule_OMS_inter<R >;\n+ friend Update_rule_NMS_inter<R,0>;\n+ friend Update_rule_NMS_inter<R,1>;\n+ friend Update_rule_NMS_inter<R,2>;\n+ friend Update_rule_NMS_inter<R,3>;\n+ friend Update_rule_NMS_inter<R,4>;\n+ friend Update_rule_NMS_inter<R,5>;\n+ friend Update_rule_NMS_inter<R,6>;\n+ friend Update_rule_NMS_inter<R,7>;\n+ friend Update_rule_NMS_inter<R,8>;\n+\n+protected:\n+ const std::string name;\n+ const mipp::Msk<mipp::N<R>()> false_msk;\n+ const mipp::Reg<R> zero;\n+ const mipp::Reg<R> max;\n+ mipp::Msk<mipp::N<R>()> sign;\n+ mipp::Reg<R> min1;\n+ mipp::Reg<R> min2;\n+ mipp::Reg<R> cst1;\n+ mipp::Reg<R> cst2;\n+\n+ int n_ite;\n+ int ite;\n+\n+public:\n+ Update_rule_MS_inter()\n+ : name(\"MS\"), false_msk(false), zero((R)0), max(std::numeric_limits<R>::max()), sign(false), min1(max), min2(max),\n+ cst1(zero), cst2(zero), n_ite(0), ite(0)\n+ {\n+ }\n+\n+ virtual ~Update_rule_MS_inter()\n+ {\n+ }\n+\n+ std::string get_name() const\n+ {\n+ return this->name;\n+ }\n+\n+ // ----------------------------------------------------------------------------------------------------------------\n+ // ----------------------------------------------------------------------------------------------------------------\n+\n+ inline void begin_decoding(const int n_ite)\n+ {\n+ this->n_ite = n_ite;\n+ }\n+\n+ inline void begin_ite(const int ite)\n+ {\n+ this->ite = ite;\n+ }\n+\n+ // incoming values from the variable nodes into the check nodes\n+ inline void begin_chk_node_in(const int chk_id, const int chk_degree)\n+ {\n+ this->sign = this->false_msk;\n+ this->min1 = this->max;\n+ this->min2 = this->max;\n+ }\n+\n+ inline void compute_chk_node_in(const int var_id, const mipp::Reg<R> var_val)\n+ {\n+ const auto var_abs = mipp::abs(var_val);\n+ const auto var_sign = mipp::sign(var_val);\n+ const auto tmp = this->min1;\n+\n+\n+ this->sign ^= var_sign;\n+ this->min1 = mipp::min(this->min1, var_abs );\n+ this->min2 = mipp::min(this->min2, mipp::max(var_abs, tmp));\n+ }\n+\n+ inline void end_chk_node_in()\n+ {\n+ this->cst1 = mipp::blend(this->zero, this->min2, this->min2 < this->zero);\n+ this->cst2 = mipp::blend(this->zero, this->min1, this->min1 < this->zero);\n+ }\n+\n+ // outcomming values from the check nodes into the variable nodes\n+ inline void begin_chk_node_out(const int chk_id, const int chk_degree)\n+ {\n+ }\n+\n+ inline mipp::Reg<R> compute_chk_node_out(const int var_id, const mipp::Reg<R> var_val)\n+ {\n+ const auto var_abs = mipp::abs(var_val);\n+ auto res_abs = mipp::blend(this->cst1, this->cst2, var_abs == this->min1);\n+ const auto res_sng = this->sign ^ mipp::sign(var_val);\n+\n+ return mipp::copysign(res_abs, res_sng);\n+ }\n+\n+ inline void end_chk_node_out()\n+ {\n+ }\n+\n+ inline void end_ite()\n+ {\n+ }\n+\n+ inline void end_decoding()\n+ {\n+ }\n+};\n+}\n+}\n+\n+#endif /* UPDATE_RULE_MS_INTER_HPP */\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp", "diff": "+#ifndef UPDATE_RULE_NMS_INTER_HPP\n+#define UPDATE_RULE_NMS_INTER_HPP\n+\n+#include <cassert>\n+#include <limits>\n+#include <string>\n+#include <cmath>\n+\n+#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp\"\n+#include \"Tools/Math/utils.h\"\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+\n+template <typename R, int F = 0> inline mipp::Reg<R> normalize(const mipp::Reg<R> val, const float factor)\n+{\n+ return val * mipp::Reg<R>((R)factor);\n+}\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 1>(const mipp::Reg<int16_t > v, const float f) { return (v >> 3); } // v * 0.125\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 2>(const mipp::Reg<int16_t > v, const float f) { return (v >> 2); } // v * 0.250\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 3>(const mipp::Reg<int16_t > v, const float f) { return (v >> 3) + (v >> 2); } // v * 0.375\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 4>(const mipp::Reg<int16_t > v, const float f) { return (v >> 1); } // v * 0.500\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 5>(const mipp::Reg<int16_t > v, const float f) { return (v >> 3) + (v >> 1); } // v * 0.625\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 6>(const mipp::Reg<int16_t > v, const float f) { return (v >> 2) + (v >> 1); } // v * 0.750\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 7>(const mipp::Reg<int16_t > v, const float f) { return (v >> 3) + (v >> 2) + (v >> 1); } // v * 0.825\n+template <> inline mipp::Reg<int16_t > normalize<int16_t, 8>(const mipp::Reg<int16_t > v, const float f) { return v; } // v * 1.000\n+template <> inline mipp::Reg<float > normalize<float , 8>(const mipp::Reg<float > v, const float f) { return v; } // v * 1.000\n+template <> inline mipp::Reg<double > normalize<double , 8>(const mipp::Reg<double > v, const float f) { return v; } // v * 1.000\n+\n+\n+template <typename R = float, int F = 0>\n+class Update_rule_NMS_inter // Normalized Min Sum\n+{\n+protected:\n+ const std::string name;\n+ const float normalize_factor;\n+ Update_rule_MS_inter<R> MS;\n+\n+public:\n+ explicit Update_rule_NMS_inter(const float normalize_factor)\n+ : name(\"NMS\"), normalize_factor(normalize_factor), MS()\n+ {\n+ if (typeid(R) == typeid(int16_t) || typeid(R) == typeid(int8_t))\n+ {\n+ bool error = false;\n+ if (normalize_factor == 0.125f) { if (F != 1) error = true; }\n+ else if (normalize_factor == 0.250f) { if (F != 2) error = true; }\n+ else if (normalize_factor == 0.375f) { if (F != 3) error = true; }\n+ else if (normalize_factor == 0.500f) { if (F != 4) error = true; }\n+ else if (normalize_factor == 0.625f) { if (F != 5) error = true; }\n+ else if (normalize_factor == 0.750f) { if (F != 6) error = true; }\n+ else if (normalize_factor == 0.875f) { if (F != 7) error = true; }\n+ else if (normalize_factor == 1.000f) { if (F != 8) error = true; }\n+ else\n+ {\n+ std::stringstream message;\n+ message << \"'normalize_factor' can only be 0.125f, 0.250f, 0.375f, 0.500f, 0.625f, 0.750f, 0.875f or 1.000f\"\n+ << \" ('normalize_factor' = \" << normalize_factor << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (error)\n+ {\n+ std::stringstream message;\n+ message << \"Incompatible 'normalize_factor' and 'F' template ('normalize_factor' = \"\n+ << normalize_factor << \", 'F' = \" << F << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+ }\n+ }\n+\n+ virtual ~Update_rule_NMS_inter()\n+ {\n+ }\n+\n+ std::string get_name() const\n+ {\n+ return this->name;\n+ }\n+\n+ inline void begin_decoding(const int n_ite)\n+ {\n+ MS.begin_decoding(n_ite);\n+ }\n+\n+ inline void begin_ite(const int ite)\n+ {\n+ MS.begin_ite(ite);\n+ }\n+\n+ // incoming values from the variable nodes into the check nodes\n+ inline void begin_chk_node_in(const int chk_id, const int chk_degree)\n+ {\n+ MS.begin_chk_node_in(chk_id, chk_degree);\n+ }\n+\n+ inline void compute_chk_node_in(const int var_id, const mipp::Reg<R> var_val)\n+ {\n+ MS.compute_chk_node_in(var_id, var_val);\n+ }\n+\n+ inline void end_chk_node_in()\n+ {\n+ MS.cst1 = normalize<R,F>(MS.min2, this->normalize_factor);\n+ MS.cst2 = normalize<R,F>(MS.min1, this->normalize_factor);\n+ MS.cst1 = mipp::blend(MS.zero, MS.cst1, MS.cst1 < MS.zero);\n+ MS.cst2 = mipp::blend(MS.zero, MS.cst2, MS.cst2 < MS.zero);\n+ }\n+\n+ // outcomming values from the check nodes into the variable nodes\n+ inline void begin_chk_node_out(const int chk_id, const int chk_degree)\n+ {\n+ MS.begin_chk_node_out(chk_id, chk_degree);\n+ }\n+\n+ inline mipp::Reg<R> compute_chk_node_out(const int var_id, const mipp::Reg<R> var_val)\n+ {\n+ return MS.compute_chk_node_out(var_id, var_val);\n+ }\n+\n+ inline void end_chk_node_out()\n+ {\n+ MS.end_chk_node_out();\n+ }\n+\n+ inline void end_ite()\n+ {\n+ MS.end_ite();\n+ }\n+\n+ inline void end_decoding()\n+ {\n+ MS.end_decoding();\n+ }\n+};\n+}\n+}\n+\n+#endif /* UPDATE_RULE_NMS_INTER_HPP */\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS_inter.hpp", "diff": "+#ifndef UPDATE_RULE_OMS_INTER_HPP\n+#define UPDATE_RULE_OMS_INTER_HPP\n+\n+#include <cassert>\n+#include <limits>\n+#include <string>\n+#include <cmath>\n+\n+#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp\"\n+#include \"Tools/Math/utils.h\"\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+template <typename R = float>\n+class Update_rule_OMS_inter // Offset Min Sum\n+{\n+protected:\n+ const std::string name;\n+ const mipp::Reg<R> offset;\n+ Update_rule_MS_inter<R> MS;\n+\n+public:\n+ explicit Update_rule_OMS_inter(const R offset)\n+ : name(\"OMS\"), offset(offset), MS()\n+ {\n+ }\n+\n+ virtual ~Update_rule_OMS_inter()\n+ {\n+ }\n+\n+ std::string get_name() const\n+ {\n+ return this->name;\n+ }\n+\n+ inline void begin_decoding(const int n_ite)\n+ {\n+ MS.begin_decoding(n_ite);\n+ }\n+\n+ inline void begin_ite(const int ite)\n+ {\n+ MS.begin_ite(ite);\n+ }\n+\n+ // incoming values from the variable nodes into the check nodes\n+ inline void begin_chk_node_in(const int chk_id, const int chk_degree)\n+ {\n+ MS.begin_chk_node_in(chk_id, chk_degree);\n+ }\n+\n+ inline void compute_chk_node_in(const int var_id, const mipp::Reg<R> var_val)\n+ {\n+ MS.compute_chk_node_in(var_id, var_val);\n+ }\n+\n+ inline void end_chk_node_in()\n+ {\n+ MS.cst1 = MS.min2 - this->offset;\n+ MS.cst2 = MS.min1 - this->offset;\n+ MS.cst1 = mipp::blend(MS.zero, MS.cst1, MS.cst1 < MS.zero);\n+ MS.cst2 = mipp::blend(MS.zero, MS.cst2, MS.cst2 < MS.zero);\n+ }\n+\n+ // outcomming values from the check nodes into the variable nodes\n+ inline void begin_chk_node_out(const int chk_id, const int chk_degree)\n+ {\n+ MS.begin_chk_node_out(chk_id, chk_degree);\n+ }\n+\n+ inline mipp::Reg<R> compute_chk_node_out(const int var_id, const mipp::Reg<R> var_val)\n+ {\n+ return MS.compute_chk_node_out(var_id, var_val);\n+ }\n+\n+ inline void end_chk_node_out()\n+ {\n+ MS.end_chk_node_out();\n+ }\n+\n+ inline void end_ite()\n+ {\n+ MS.end_ite();\n+ }\n+\n+ inline void end_decoding()\n+ {\n+ MS.end_decoding();\n+ }\n+};\n+}\n+}\n+\n+#endif /* UPDATE_RULE_OMS_INTER_HPP */\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a generic LDPC SIMD layered scheduler and SIMD MS, OMS and NMS update rules.
8,490
14.06.2018 16:45:13
-7,200
4f3add9644d93d396c598c326914f1b6397f1b03
Add a specific #ifdef to check if the aligned new is on.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "#include \"Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hpp\"\n#include \"Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered.hpp\"\n-#include \"Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/SPA/Update_rule_SPA.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/LSPA/Update_rule_LSPA.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS.hpp\"\n-#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS.hpp\"\n-#include \"Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS.hpp\"\n-#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/AMS/Update_rule_AMS.hpp\"\n+#ifdef __cpp_aligned_new\n+#include \"Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS_inter.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp\"\n+#endif\n+\n#include \"Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.hpp\"\n#include \"Module/Decoder/LDPC/BP/Flooding/Gallager/Decoder_LDPC_BP_flooding_Gallager_A.hpp\"\n#include \"Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp\"\n@@ -210,11 +213,7 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\n}\nelse if (this->type == \"BP_LAYERED\" && this->simd_strategy == \"INTER\")\n{\n- // legacy LDPC layered SIMD\n- // if (this->implem == \"NMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->norm_factor, (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\n- // else if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)this->offset, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n-\n- // new LDPC layered SIMD\n+#ifdef __cpp_aligned_new // new LDPC layered SIMD\nif (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_MS_inter <Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_MS_inter <Q>( ), this->enable_syndrome, this->syndrome_depth, this->n_frames);\nelse if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_OMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_OMS_inter<Q>(this->offset), this->enable_syndrome, this->syndrome_depth, this->n_frames);\nelse if (this->implem == \"NMS\")\n@@ -235,6 +234,11 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\nelse\nreturn new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\n+#else // legacy LDPC layered SIMD\n+ if (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->implem == \"NMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->norm_factor, (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)this->offset, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+#endif\n}\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a specific #ifdef to check if the aligned new is on.
8,490
15.06.2018 11:01:32
-7,200
e3790e8d0de6172a4a6019ef8c44b158dffdd3d5
Add a throw when NMS 8-bit + add 8-bit normalize specialization.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.cpp", "diff": "@@ -40,7 +40,7 @@ Decoder_LDPC_BP_layered_ONMS_inter<B,R>\nconst std::string name = \"Decoder_LDPC_BP_layered_ONMS_inter\";\nthis->set_name(name);\n- if (typeid(R) == typeid(signed char))\n+ if (sizeof(R) == 1)\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"This decoder does not work in 8-bit fixed-point.\");\nif (saturation <= 0)\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp", "new_path": "src/Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp", "diff": "@@ -19,15 +19,23 @@ template <typename R, int F = 0> inline mipp::Reg<R> normalize(const mipp::Reg<R\nreturn val * mipp::Reg<R>((R)factor);\n}\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 1>(const mipp::Reg<int16_t> v, const float f) { return (v >> 3); } // v * 0.125\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 1>(const mipp::Reg<int8_t > v, const float f) { return (v >> 3); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 2>(const mipp::Reg<int16_t> v, const float f) { return (v >> 2); } // v * 0.250\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 2>(const mipp::Reg<int8_t > v, const float f) { return (v >> 2); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 3>(const mipp::Reg<int16_t> v, const float f) { return (v >> 3) + (v >> 2); } // v * 0.375\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 3>(const mipp::Reg<int8_t > v, const float f) { return (v >> 3) + (v >> 2); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 4>(const mipp::Reg<int16_t> v, const float f) { return (v >> 1); } // v * 0.500\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 4>(const mipp::Reg<int8_t > v, const float f) { return (v >> 1); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 5>(const mipp::Reg<int16_t> v, const float f) { return (v >> 3) + (v >> 1); } // v * 0.625\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 5>(const mipp::Reg<int8_t > v, const float f) { return (v >> 3) + (v >> 1); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 6>(const mipp::Reg<int16_t> v, const float f) { return (v >> 2) + (v >> 1); } // v * 0.750\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 6>(const mipp::Reg<int8_t > v, const float f) { return (v >> 2) + (v >> 1); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 7>(const mipp::Reg<int16_t> v, const float f) { return (v >> 3) + (v >> 2) + (v >> 1); } // v * 0.825\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 7>(const mipp::Reg<int8_t > v, const float f) { return (v >> 3) + (v >> 2) + (v >> 1); }\ntemplate <> inline mipp::Reg<int16_t> normalize<int16_t, 8>(const mipp::Reg<int16_t> v, const float f) { return v; } // v * 1.000\n-template <> inline mipp::Reg<float > normalize<float , 8>(const mipp::Reg<float > v, const float f) { return v; } // v * 1.000\n-template <> inline mipp::Reg<double > normalize<double , 8>(const mipp::Reg<double > v, const float f) { return v; } // v * 1.000\n+template <> inline mipp::Reg<int8_t > normalize<int8_t , 8>(const mipp::Reg<int8_t > v, const float f) { return v; }\n+template <> inline mipp::Reg<float > normalize<float , 8>(const mipp::Reg<float > v, const float f) { return v; }\n+template <> inline mipp::Reg<double > normalize<double , 8>(const mipp::Reg<double > v, const float f) { return v; }\ntemplate <typename R = float, int F = 0>\n@@ -42,6 +50,9 @@ public:\nexplicit Update_rule_NMS_inter(const float normalize_factor)\n: name(\"NMS\"), normalize_factor(normalize_factor), MS()\n{\n+ if (sizeof(R) == 1)\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, \"This update rule does not work in 8-bit fixed-point.\");\n+\nif (typeid(R) == typeid(int16_t) || typeid(R) == typeid(int8_t))\n{\nbool error = false;\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a throw when NMS 8-bit + add 8-bit normalize specialization.
8,490
15.06.2018 14:03:42
-7,200
1c8a0e1f6b0dfe9e405cb55cb45ec37022c970e7
Add the BP flooding with inter SIMD.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "#ifdef __cpp_aligned_new\n#include \"Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hpp\"\n+#include \"Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/MS/Update_rule_MS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/OMS/Update_rule_OMS_inter.hpp\"\n#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp\"\n@@ -240,6 +241,31 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\nelse if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)this->offset, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n#endif\n}\n+#ifdef __cpp_aligned_new // new LDPC flooding SIMD\n+ else if (this->type == \"BP_FLOODING\" && this->simd_strategy == \"INTER\")\n+ {\n+ if (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_MS_inter <Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_MS_inter <Q>( ), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_OMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_OMS_inter<Q>(this->offset), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->implem == \"NMS\")\n+ {\n+ if (typeid(Q) == typeid(int16_t) || typeid(Q) == typeid(int8_t))\n+ {\n+ if (this->norm_factor == 0.125f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,1>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,1>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.250f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,2>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,2>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.375f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,3>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,3>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.500f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,4>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,4>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.625f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,5>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,5>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.750f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,6>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,6>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 0.875f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,7>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,7>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else if (this->norm_factor == 1.000f) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q,8>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q,8>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ else\n+ return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ }\n+ else\n+ return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_NMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ }\n+ }\n+#endif\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hxx", "new_path": "src/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hxx", "diff": "@@ -97,8 +97,8 @@ void Decoder_LDPC_BP_flooding<B,R,Update_rule>\nthis->_decode(Y_N1, frame_id);\n// prepare for next round by processing extrinsic information\n- for (auto i = 0; i < this->N; i++)\n- Y_N2[i] = this->post[i] - Y_N1[i];\n+ for (auto v = 0; v < this->N; v++)\n+ Y_N2[v] = this->post[v] - Y_N1[v];\n}\ntemplate <typename B, typename R, class Update_rule>\n@@ -123,10 +123,10 @@ void Decoder_LDPC_BP_flooding<B,R,Update_rule>\n// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n// take the hard decision\n- for (auto i = 0; i < this->K; i++)\n+ for (auto v = 0; v < this->K; v++)\n{\n- const auto k = this->info_bits_pos[i];\n- V_K[i] = !(this->post[k] >= 0);\n+ const auto k = this->info_bits_pos[v];\n+ V_K[v] = !(this->post[k] >= 0);\n}\n// auto d_store = std::chrono::steady_clock::now() - t_store;\n@@ -230,12 +230,12 @@ void Decoder_LDPC_BP_flooding<B,R,Update_rule>\nthis->up_rule.begin_chk_node_in(c, chk_degree);\nfor (auto v = 0; v < chk_degree; v++)\n- up_rule.compute_chk_node_in(v, var_to_chk[transpose_ptr[v]]);\n+ this->up_rule.compute_chk_node_in(v, var_to_chk[transpose_ptr[v]]);\nthis->up_rule.end_chk_node_in();\nthis->up_rule.begin_chk_node_out(c, chk_degree);\nfor (auto v = 0; v < chk_degree; v++)\n- chk_to_var[transpose_ptr[v]] = up_rule.compute_chk_node_out(v, var_to_chk[transpose_ptr[v]]);\n+ chk_to_var[transpose_ptr[v]] = this->up_rule.compute_chk_node_out(v, var_to_chk[transpose_ptr[v]]);\nthis->up_rule.end_chk_node_out();\ntranspose_ptr += chk_degree;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding_inter.hpp", "diff": "+#ifndef DECODER_LDPC_BP_FLOODING_INTER_HPP_\n+#define DECODER_LDPC_BP_FLOODING_INTER_HPP_\n+\n+#include <mipp.h>\n+\n+#include \"Tools/Algo/Sparse_matrix/Sparse_matrix.hpp\"\n+#include \"Tools/Code/LDPC/Update_rule/NMS/Update_rule_NMS_inter.hpp\"\n+\n+#include \"../../../Decoder_SISO_SIHO.hpp\"\n+#include \"../Decoder_LDPC_BP.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B = int, typename R = float, class Update_rule = tools::Update_rule_NMS_inter<R>>\n+class Decoder_LDPC_BP_flooding_inter : public Decoder_SISO_SIHO<B,R>, public Decoder_LDPC_BP\n+{\n+protected:\n+ const std::vector<unsigned> &info_bits_pos;\n+\n+ Update_rule up_rule;\n+\n+ const R sat_val;\n+\n+ std::vector<uint32_t> transpose;\n+\n+ mipp::vector<mipp::Reg<R>> post; // a posteriori information\n+ std::vector<mipp::vector<mipp::Reg<R>>> chk_to_var; // check nodes to variable nodes messages\n+ std::vector<mipp::vector<mipp::Reg<R>>> var_to_chk; // variable nodes to check nodes messages\n+\n+ mipp::vector<mipp::Reg<R>> Y_N_reorderered;\n+ mipp::vector<mipp::Reg<B>> V_reorderered;\n+\n+ bool init_flag;\n+\n+public:\n+ Decoder_LDPC_BP_flooding_inter(const int K, const int N, const int n_ite,\n+ const tools::Sparse_matrix &H,\n+ const std::vector<unsigned> &info_bits_pos,\n+ const Update_rule &up_rule,\n+ const bool enable_syndrome = true,\n+ const int syndrome_depth = 1,\n+ const int n_frames = 1);\n+ virtual ~Decoder_LDPC_BP_flooding_inter();\n+ void reset();\n+\n+protected:\n+ void _decode_siso (const R *Y_N1, R *Y_N2, const int frame_id);\n+ void _decode_siho (const R *Y_N, B *V_K, const int frame_id);\n+ void _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n+\n+ void _load (const R *Y_N, const int frame_id);\n+ void _decode (const mipp::Reg<R> *Y_N, const int cur_wave);\n+ void _initialize_var_to_chk(const mipp::Reg<R> *Y_N, const mipp::vector<mipp::Reg<R>> &chk_to_var,\n+ mipp::vector<mipp::Reg<R>> &var_to_chk);\n+ void _decode_single_ite (const mipp::vector<mipp::Reg<R>> &var_to_chk, mipp::vector<mipp::Reg<R>> &chk_to_var);\n+ void _compute_post (const mipp::Reg<R> *Y_N, const mipp::vector<mipp::Reg<R>> &chk_to_var,\n+ mipp::vector<mipp::Reg<R>> &post);\n+ bool _check_syndrome_soft (const mipp::vector<mipp::Reg<R>> &var_nodes);\n+};\n+}\n+}\n+\n+#include \"Decoder_LDPC_BP_flooding_inter.hxx\"\n+\n+#endif /* DECODER_LDPC_BP_FLOODING_INTER_HPP_ */\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding_inter.hxx", "diff": "+#include <limits>\n+#include <cmath>\n+#include <sstream>\n+#include <iostream>\n+\n+#include \"Tools/general_utils.h\"\n+#include \"Tools/Math/utils.h\"\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Perf/Reorderer/Reorderer.hpp\"\n+\n+#include \"../Layered/Decoder_LDPC_BP_layered_inter.hpp\"\n+#include \"Decoder_LDPC_BP_flooding_inter.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B, typename R, class Update_rule>\n+Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::Decoder_LDPC_BP_flooding_inter(const int K, const int N, const int n_ite,\n+ const tools::Sparse_matrix &_H,\n+ const std::vector<unsigned> &info_bits_pos,\n+ const Update_rule &up_rule,\n+ const bool enable_syndrome,\n+ const int syndrome_depth,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, mipp::N<R>() ),\n+ Decoder_SISO_SIHO<B,R>(K, N, n_frames, mipp::N<R>() ),\n+ Decoder_LDPC_BP (K, N, n_ite, _H, enable_syndrome, syndrome_depth ),\n+ info_bits_pos (info_bits_pos ),\n+ up_rule (up_rule ),\n+ sat_val ((R)((1 << ((sizeof(R) * 8 -2) - (int)std::log2(this->H.get_rows_max_degree()))) -1)),\n+ transpose (this->H.get_n_connections() ),\n+ post (N, -1 ),\n+ chk_to_var (this->n_dec_waves, mipp::vector<mipp::Reg<R>>(this->H.get_n_connections()) ),\n+ var_to_chk (this->n_dec_waves, mipp::vector<mipp::Reg<R>>(this->H.get_n_connections()) ),\n+ Y_N_reorderered (N ),\n+ V_reorderered (N ),\n+ init_flag (true )\n+{\n+ const std::string name = \"Decoder_LDPC_BP_flooding_inter<\" + this->up_rule.get_name() + \">\";\n+ this->set_name(name);\n+\n+ if (this->sat_val <= 0)\n+ {\n+ std::stringstream message;\n+ message << \"'sat_val' has to be greater than 0 ('sat_val' = \" << this->sat_val << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ mipp::vector<unsigned char> connections(this->H.get_n_rows(), 0);\n+\n+ const auto &chk_to_var_id = this->H.get_col_to_rows();\n+ const auto &var_to_chk_id = this->H.get_row_to_cols();\n+\n+ auto k = 0;\n+ for (auto i = 0; i < (int)chk_to_var_id.size(); i++)\n+ {\n+ for (auto j = 0; j < (int)chk_to_var_id[i].size(); j++)\n+ {\n+ auto var_id = chk_to_var_id[i][j];\n+\n+ auto branch_id = 0;\n+ for (auto ii = 0; ii < (int)var_id; ii++)\n+ branch_id += (int)var_to_chk_id[ii].size();\n+ branch_id += connections[var_id];\n+ connections[var_id]++;\n+\n+ if (connections[var_id] > (int)var_to_chk_id[var_id].size())\n+ {\n+ std::stringstream message;\n+ message << \"'connections[var_id]' has to be equal or smaller than 'var_to_chk_id[var_id].size()' \"\n+ << \"('var_id' = \" << var_id << \", 'connections[var_id]' = \" << connections[var_id]\n+ << \", 'var_to_chk_id[var_id].size()' = \" << var_to_chk_id[var_id].size() << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ transpose[k] = branch_id;\n+ k++;\n+ }\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::~Decoder_LDPC_BP_flooding_inter()\n+{\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::reset()\n+{\n+ this->init_flag = true;\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_decode_siso(const R *Y_N1, R *Y_N2, const int frame_id)\n+{\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+\n+ // memory zones initialization\n+ if (this->init_flag)\n+ {\n+ const auto zero = mipp::Reg<R>((R)0);\n+ std::fill(this->chk_to_var[cur_wave].begin(), this->chk_to_var[cur_wave].end(), zero);\n+\n+ if (cur_wave == this->n_dec_waves -1) this->init_flag = false;\n+ }\n+\n+ this->_decode((const mipp::Reg<R>*)Y_N1, cur_wave);\n+\n+ // prepare for next round by processing extrinsic information\n+ for (auto v = 0; v < this->N; v++)\n+ {\n+ auto ext = this->post[v] - mipp::Reg<R>(&Y_N1[v * mipp::N<R>()]);\n+ ext.store(&Y_N2[v * mipp::N<R>()]);\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n+{\n+// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+\n+ // memory zones initialization\n+ if (this->init_flag)\n+ {\n+ const auto zero = mipp::Reg<R>((R)0);\n+ std::fill(this->chk_to_var[cur_wave].begin(), this->chk_to_var[cur_wave].end(), zero);\n+\n+ if (cur_wave == this->n_dec_waves -1) this->init_flag = false;\n+ }\n+// auto d_load = std::chrono::steady_clock::now() - t_load;\n+\n+// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n+ // actual decoding\n+ this->_decode((const mipp::Reg<R>*)Y_N, cur_wave);\n+// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n+\n+// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n+ // take the hard decision\n+ for (auto v = 0; v < this->K; v++)\n+ {\n+ const auto k = this->info_bits_pos[v];\n+ V_reorderered[v] = mipp::cast<R,B>(this->post[k]) >> (sizeof(B) * 8 - 1);\n+ }\n+\n+ std::vector<B*> frames(mipp::N<R>());\n+ for (auto f = 0; f < mipp::N<R>(); f++) frames[f] = V_K + f * this->K;\n+ tools::Reorderer_static<B,mipp::N<R>()>::apply_rev((B*)V_reorderered.data(), frames, this->K);\n+// auto d_store = std::chrono::steady_clock::now() - t_store;\n+\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::load, d_load);\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::decode, d_decod);\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::store, d_store);\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n+{\n+// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n+ const auto cur_wave = frame_id / this->simd_inter_frame_level;\n+\n+ // memory zones initialization\n+ if (this->init_flag)\n+ {\n+ const auto zero = mipp::Reg<R>((R)0);\n+ std::fill(this->chk_to_var[frame_id].begin(), this->chk_to_var[frame_id].end(), zero);\n+\n+ if (cur_wave == this->n_dec_waves -1) this->init_flag = false;\n+ }\n+// auto d_load = std::chrono::steady_clock::now() - t_load;\n+\n+// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n+ // actual decoding\n+ this->_decode((const mipp::Reg<R>*)Y_N, cur_wave);\n+// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n+\n+// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n+ for (auto v = 0; v < this->N; v++)\n+ V_reorderered[v] = mipp::cast<R,B>(this->post[v]) >> (sizeof(B) * 8 - 1);\n+\n+ std::vector<B*> frames(mipp::N<R>());\n+ for (auto f = 0; f < mipp::N<R>(); f++) frames[f] = V_N + f * this->N;\n+ tools::Reorderer_static<B,mipp::N<R>()>::apply_rev((B*)V_reorderered.data(), frames, this->N);\n+// auto d_store = std::chrono::steady_clock::now() - t_store;\n+\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::load, d_load);\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::decode, d_decod);\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::store, d_store);\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_decode(const mipp::Reg<R> *Y_N, const int cur_wave)\n+{\n+ this->up_rule.begin_decoding(this->n_ite);\n+\n+ auto ite = 0;\n+ for (; ite < this->n_ite; ite++)\n+ {\n+ this->up_rule.begin_ite(ite);\n+ this->_initialize_var_to_chk(Y_N, this->chk_to_var[cur_wave], this->var_to_chk[cur_wave]);\n+ this->_decode_single_ite(this->var_to_chk[cur_wave], this->chk_to_var[cur_wave]);\n+ this->up_rule.end_ite();\n+\n+ if (this->enable_syndrome && ite != this->n_ite -1)\n+ {\n+ this->_compute_post(Y_N, this->chk_to_var[cur_wave], this->post);\n+ if (this->_check_syndrome_soft(this->post))\n+ break;\n+ }\n+ }\n+ if (ite == this->n_ite)\n+ this->_compute_post(Y_N, this->chk_to_var[cur_wave], this->post);\n+\n+ this->up_rule.end_decoding();\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_initialize_var_to_chk(const mipp::Reg<R> *Y_N,\n+ const mipp::vector<mipp::Reg<R>> &chk_to_var,\n+ mipp::vector<mipp::Reg<R>> &var_to_chk)\n+{\n+ auto *chk_to_var_ptr = chk_to_var.data();\n+ auto *var_to_chk_ptr = var_to_chk.data();\n+\n+ const auto n_var_nodes = (int)this->H.get_n_rows();;\n+ for (auto v = 0; v < n_var_nodes; v++)\n+ {\n+ const auto var_degree = (int)this->H.get_row_to_cols()[v].size();\n+\n+ auto sum_chk_to_var = mipp::Reg<R>((R)0);\n+ for (auto c = 0; c < var_degree; c++)\n+ sum_chk_to_var += chk_to_var_ptr[c];\n+\n+ const auto tmp = Y_N[v] + sum_chk_to_var;\n+ for (auto c = 0; c < var_degree; c++)\n+ var_to_chk_ptr[c] = tmp - chk_to_var_ptr[c];\n+\n+ chk_to_var_ptr += var_degree;\n+ var_to_chk_ptr += var_degree;\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_decode_single_ite(const mipp::vector<mipp::Reg<R>> &var_to_chk, mipp::vector<mipp::Reg<R>> &chk_to_var)\n+{\n+ auto transpose_ptr = this->transpose.data();\n+\n+ // flooding scheduling\n+ const auto n_chk_nodes = (int)this->H.get_n_cols();\n+ for (auto c = 0; c < n_chk_nodes; c++)\n+ {\n+ const auto chk_degree = (int)this->H.get_col_to_rows()[c].size();\n+\n+ this->up_rule.begin_chk_node_in(c, chk_degree);\n+ for (auto v = 0; v < chk_degree; v++)\n+ this->up_rule.compute_chk_node_in(v, var_to_chk[transpose_ptr[v]]);\n+ this->up_rule.end_chk_node_in();\n+\n+ this->up_rule.begin_chk_node_out(c, chk_degree);\n+ for (auto v = 0; v < chk_degree; v++)\n+ {\n+ auto val = saturate<R>(this->up_rule.compute_chk_node_out(v, var_to_chk[transpose_ptr[v]]), this->sat_val);\n+ chk_to_var[transpose_ptr[v]] = val;\n+ }\n+ this->up_rule.end_chk_node_out();\n+\n+ transpose_ptr += chk_degree;\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+void Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_compute_post(const mipp::Reg<R> *Y_N,\n+ const mipp::vector<mipp::Reg<R>> &chk_to_var,\n+ mipp::vector<mipp::Reg<R>> &post)\n+{\n+ // compute the a posteriori info\n+ const auto *chk_to_var_ptr = chk_to_var.data();\n+ const auto n_var_nodes = (int)this->H.get_n_rows();;\n+ for (auto v = 0; v < n_var_nodes; v++)\n+ {\n+ const auto var_degree = (int)this->H.get_row_to_cols()[v].size();\n+\n+ auto sum_chk_to_var = mipp::Reg<R>((R)0);\n+ for (auto c = 0; c < var_degree; c++)\n+ sum_chk_to_var += chk_to_var_ptr[c];\n+\n+ // filling the output\n+ post[v] = Y_N[v] + sum_chk_to_var;\n+\n+ chk_to_var_ptr += var_degree;\n+ }\n+}\n+\n+template <typename B, typename R, class Update_rule>\n+bool Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\n+::_check_syndrome_soft(const mipp::vector<mipp::Reg<R>> &var_nodes)\n+{\n+ const auto zero = mipp::Msk<mipp::N<B>()>(false);\n+ auto syndrome = zero;\n+\n+ auto n_chk_nodes = (int)H.get_n_cols();\n+ auto c = 0;\n+ auto syndrome_scalar = true;\n+ while (c < n_chk_nodes && (syndrome_scalar = mipp::testz(syndrome)))\n+ {\n+ auto sign = zero;\n+ const auto chk_degree = (int)this->H[c].size();\n+ for (auto v = 0; v < chk_degree; v++)\n+ {\n+ const auto value = var_nodes[this->H[c][v]];\n+ sign ^= mipp::sign(value);\n+ }\n+\n+ syndrome |= sign;\n+ c++;\n+ }\n+\n+ this->cur_syndrome_depth = syndrome_scalar ? (this->cur_syndrome_depth +1) % this->syndrome_depth : 0;\n+ return syndrome_scalar && (this->cur_syndrome_depth == 0);\n+}\n+}\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hxx", "new_path": "src/Module/Decoder/LDPC/BP/Layered/Decoder_LDPC_BP_layered_inter.hxx", "diff": "@@ -241,7 +241,8 @@ bool Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\nauto n_chk_nodes = (int)H.get_n_cols();\nauto c = 0;\n- while (c < n_chk_nodes && mipp::testz(syndrome))\n+ auto syndrome_scalar = true;\n+ while (c < n_chk_nodes && (syndrome_scalar = mipp::testz(syndrome)))\n{\nauto sign = zero;\nconst auto chk_degree = (int)this->H[c].size();\n@@ -255,8 +256,6 @@ bool Decoder_LDPC_BP_layered_inter<B,R,Update_rule>\nc++;\n}\n- const auto syndrome_scalar = mipp::testz(syndrome);\n-\nthis->cur_syndrome_depth = syndrome_scalar ? (this->cur_syndrome_depth +1) % this->syndrome_depth : 0;\nreturn syndrome_scalar && (this->cur_syndrome_depth == 0);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.cpp", "new_path": "src/Module/Decoder/LDPC/BP/Layered/ONMS/Decoder_LDPC_BP_layered_ONMS_inter.cpp", "diff": "@@ -357,7 +357,8 @@ bool Decoder_LDPC_BP_layered_ONMS_inter<B,R>\nauto n_chk_nodes = (int)H.get_n_cols();\nauto c = 0;\n- while (c < n_chk_nodes && mipp::testz(syndrome))\n+ auto syndrome_scalar = true;\n+ while (c < n_chk_nodes && (syndrome_scalar = mipp::testz(syndrome)))\n{\nauto sign = zero;\nconst auto chk_degree = (int)this->H[c].size();\n@@ -371,7 +372,7 @@ bool Decoder_LDPC_BP_layered_ONMS_inter<B,R>\nc++;\n}\n- return (mipp::testz(syndrome));\n+ return syndrome_scalar;\n}\n// ==================================================================================== explicit template instantiation\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the BP flooding with inter SIMD.
8,490
27.06.2018 17:24:13
-7,200
3c1eadaaab72c09b585e50e792413c57775658ee
CI: automatically rm old builds in the web site.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -33,4 +33,42 @@ cd aff3ct.github.io\ngit add -f ressources/builds/*\ngit add -f ressources/download_${GIT_BRANCH}.csv\ngit commit -m \"Automatic from Gitlab: add new AFF3CT builds to the download section ($GIT_HASH).\"\n-git push origin master\n\\ No newline at end of file\n+\n+#delete old builds\n+BUILD_CSV=ressources/download_${GIT_BRANCH}.csv\n+N_BUILDS_TO_KEEP=0\n+if [ \"${GIT_BRANCH}\" == \"master\" ]; then\n+ N_BUILDS_TO_KEEP=5\n+else\n+ N_BUILDS_TO_KEEP=10\n+fi\n+N_BUILDS=$(wc -l $BUILD_CSV | cut -d \" \" -f1)\n+N_BUILDS=$(($N_BUILDS-1))\n+N_BUILDS_TO_RM=$(($N_BUILDS-$N_BUILDS_TO_KEEP))\n+if (( $N_BUILDS_TO_RM >= 1 )); then\n+ B=0\n+ cat $BUILD_CSV | while read line\n+ do\n+ if (( $B != 0 )); then\n+ FILES=$(echo $line | cut -d \";\" -f6)\n+ s1=\"\\\"\"\n+ s2=\"\"\n+ FILES=$(echo \"${FILES//$s1/$s2}\")\n+ N_FILES=$(echo $FILES | sed 's/,/\\n/g' | wc -l)\n+ for (( F=1; F<=N_FILES; F++ ))\n+ do\n+ FILE=$(echo $FILES | cut -d \",\" -f$F)\n+ FILE_PATH=ressources/builds/$FILE;\n+ if [ -f $FILE_PATH ]; then\n+ git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ${FILE_PATH}' --prune-empty --tag-name-filter cat -- --all\n+ fi\n+ done\n+ fi\n+ if [ \"${B}\" -eq $N_BUILDS_TO_RM ]; then\n+ break\n+ fi\n+ B=$((B+1))\n+ done\n+fi\n+\n+git push origin master --force\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: automatically rm old builds in the web site.
8,490
27.06.2018 23:15:34
-7,200
17d20499dd63fcdce6ebff904b3ff18e75c48683
CI: fix rm builds.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -60,7 +60,7 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\nFILE=$(echo $FILES | cut -d \",\" -f$F)\nFILE_PATH=ressources/builds/$FILE;\nif [ -f $FILE_PATH ]; then\n- git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ${FILE_PATH}' --prune-empty --tag-name-filter cat -- --all\n+ git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch ${FILE_PATH}\" --prune-empty --tag-name-filter cat -- --all\nfi\ndone\nfi\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: fix rm builds.
8,490
28.06.2018 10:37:42
-7,200
bde1001d76d9356d559a2efc26ea46b1535f652e
CI: use git-lfs to store the builds on GitHub.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -377,6 +377,7 @@ deploy-builds-linux:\ntags:\n- linux\n- github\n+ - git-lfs\nonly:\n- master\n- development\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -30,6 +30,8 @@ done\necho \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\ncd aff3ct.github.io\n+git lfs install --local\n+git lfs track ressources/builds/*\ngit add -f ressources/builds/*\ngit add -f ressources/download_${GIT_BRANCH}.csv\ngit commit -m \"Automatic from Gitlab: add new AFF3CT builds to the download section ($GIT_HASH).\"\n@@ -61,6 +63,10 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\nFILE_PATH=ressources/builds/$FILE;\nif [ -f $FILE_PATH ]; then\ngit filter-branch --force --index-filter \"git rm --cached --ignore-unmatch ${FILE_PATH}\" --prune-empty --tag-name-filter cat -- --all\n+ rm -rf .git/refs/original/\n+ git reflog expire --expire=now --all\n+ git gc --prune=now\n+ git gc --aggressive --prune=now\nfi\ndone\nfi\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: use git-lfs to store the builds on GitHub.
8,490
28.06.2018 17:35:12
-7,200
1a628f2b509b74112142b1b1b17b55638bc4f9e7
CI: put the AFF3CT builds on GitLab.com + do not use Git LFS.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "#!/bin/bash\nset -x\n-git clone git@github.com:aff3ct/aff3ct.github.io.git\n-mkdir aff3ct.github.io/ressources/builds\n+git clone git@gitlab.com:aff3ct/ressources.git\n+mkdir ressources/aff3ct_builds\nfor BUILD in \"$@\"\ndo\n@@ -17,7 +17,7 @@ do\nzip -r $ZIP_NAME $BUILD\n- cp $ZIP_NAME aff3ct.github.io/ressources/builds/\n+ cp $ZIP_NAME ressources/aff3ct_builds/\nif [ -z \"$BUILDS_LIST\" ]\nthen\n@@ -27,17 +27,17 @@ do\nfi\ndone\n-echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> aff3ct.github.io/ressources/download_${GIT_BRANCH}.csv\n+echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ressources/aff3ct_builds/download_${GIT_BRANCH}.csv\n-cd aff3ct.github.io\n-git lfs install --local\n-git lfs track ressources/builds/*\n-git add -f ressources/builds/*\n-git add -f ressources/download_${GIT_BRANCH}.csv\n-git commit -m \"Automatic from Gitlab: add new AFF3CT builds to the download section ($GIT_HASH).\"\n+cd ressources\n+# git lfs install --local\n+# git lfs track aff3ct_builds/aff3ct_*\n+git add -f aff3ct_builds/*\n+git add -f aff3ct_builds/download_${GIT_BRANCH}.csv\n+git commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\n#delete old builds\n-BUILD_CSV=ressources/download_${GIT_BRANCH}.csv\n+BUILD_CSV=aff3ct_builds/download_${GIT_BRANCH}.csv\nN_BUILDS_TO_KEEP=0\nif [ \"${GIT_BRANCH}\" == \"master\" ]; then\nN_BUILDS_TO_KEEP=5\n@@ -60,7 +60,7 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\nfor (( F=1; F<=N_FILES; F++ ))\ndo\nFILE=$(echo $FILES | cut -d \",\" -f$F)\n- FILE_PATH=ressources/builds/$FILE;\n+ FILE_PATH=aff3ct_builds/$FILE;\nif [ -f $FILE_PATH ]; then\ngit filter-branch --force --index-filter \"git rm --cached --ignore-unmatch ${FILE_PATH}\" --prune-empty --tag-name-filter cat -- --all\nrm -rf .git/refs/original/\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: put the AFF3CT builds on GitLab.com + do not use Git LFS.
8,490
28.06.2018 18:40:56
-7,200
e37b3ced99caa39d74f35e3bac635f56d3a5c3dd
CI: update the deploy script.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -376,7 +376,7 @@ deploy-builds-linux:\n- build-macos-clang-x64-sse4.2\ntags:\n- linux\n- - gitlab.com\n+ - github\n- git-lfs\nonly:\n- master\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "#!/bin/bash\nset -x\n-git clone git@gitlab.com:aff3ct/ressources.git\n+REPO=aff3ct.github.io\n+git clone git@github.com:aff3ct/${REPO}.git\n+cd ${REPO}\n+git submodule update --init --recursive\nmkdir ressources/aff3ct_builds\n+cd ..\nfor BUILD in \"$@\"\ndo\n@@ -17,7 +21,7 @@ do\nzip -r $ZIP_NAME $BUILD\n- cp $ZIP_NAME ressources/aff3ct_builds/\n+ cp $ZIP_NAME ${REPO}/ressources/aff3ct_builds/\nif [ -z \"$BUILDS_LIST\" ]\nthen\n@@ -27,13 +31,19 @@ do\nfi\ndone\n-echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ressources/aff3ct_builds/download_${GIT_BRANCH}.csv\n+echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ${REPO}/download/download_${GIT_BRANCH}.csv\n+\n+cd ${REPO}\n+git add -f download/download_${GIT_BRANCH}.csv\n+git commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\n+git push origin master\ncd ressources\n+git checkout master\n+git pull origin master\n# git lfs install --local\n-# git lfs track aff3ct_builds/aff3ct_*\n+# git lfs track aff3ct_builds/*\ngit add -f aff3ct_builds/*\n-git add -f aff3ct_builds/download_${GIT_BRANCH}.csv\ngit commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\n#delete old builds\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: update the deploy script.
8,490
28.06.2018 20:17:54
-7,200
5faa4329e2e8a5dc6805520d89c5084bd72fdb1a
CI: fix deploy script.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -47,7 +47,7 @@ git add -f aff3ct_builds/*\ngit commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\n#delete old builds\n-BUILD_CSV=aff3ct_builds/download_${GIT_BRANCH}.csv\n+BUILD_CSV=../download/download_${GIT_BRANCH}.csv\nN_BUILDS_TO_KEEP=0\nif [ \"${GIT_BRANCH}\" == \"master\" ]; then\nN_BUILDS_TO_KEEP=5\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: fix deploy script.
8,490
28.06.2018 20:23:55
-7,200
431eb5bf201c837c6f0e38eb1d364447a6d1e344
CI: update the submodule.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -33,12 +33,7 @@ done\necho \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ${REPO}/download/download_${GIT_BRANCH}.csv\n-cd ${REPO}\n-git add -f download/download_${GIT_BRANCH}.csv\n-git commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\n-git push origin master\n-\n-cd ressources\n+cd ${REPO}/ressources\ngit checkout master\ngit pull origin master\n# git lfs install --local\n@@ -88,3 +83,9 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\nfi\ngit push origin master --force\n+\n+cd ..\n+git add -f download/download_${GIT_BRANCH}.csv\n+git add -f ressources\n+git commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\n+git push origin master\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: update the submodule.
8,490
28.06.2018 22:26:16
-7,200
a2fb16759586f3bb1944460d13a37378c2ec4f33
CI: speedup the deployment script.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -71,7 +71,7 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\nrm -rf .git/refs/original/\ngit reflog expire --expire=now --all\ngit gc --prune=now\n- git gc --aggressive --prune=now\n+ # git gc --aggressive --prune=now\nfi\ndone\nfi\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: speedup the deployment script.
8,490
29.06.2018 08:37:59
-7,200
c2d84483615dd1f85a30a2ceca6f2c3e29985861
CI: make git gc only once.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -70,8 +70,6 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\ngit filter-branch --force --index-filter \"git rm --cached --ignore-unmatch ${FILE_PATH}\" --prune-empty --tag-name-filter cat -- --all\nrm -rf .git/refs/original/\ngit reflog expire --expire=now --all\n- git gc --prune=now\n- # git gc --aggressive --prune=now\nfi\ndone\nfi\n@@ -82,6 +80,8 @@ if (( $N_BUILDS_TO_RM >= 1 )); then\ndone\nfi\n+git gc --prune=now\n+# git gc --aggressive --prune=now\ngit push origin master --force\ncd ..\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: make git gc only once.
8,490
29.06.2018 14:15:56
-7,200
c14ad23aa7906c15267c92bf28e7e178d59723f0
CI: adapt deploy script.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "#!/bin/bash\nset -x\n-REPO=aff3ct.github.io\n-git clone git@github.com:aff3ct/${REPO}.git\n-cd ${REPO}\n+REPO_WEB=aff3ct.github.io\n+REPO_RESSOURCES=ressources\n+git clone git@github.com:aff3ct/${REPO_WEB}.git\n+cd ${REPO_WEB}\n+git clone git@github.com:aff3ct/${REPO_RESSOURCES}.git\ngit submodule update --init --recursive\nmkdir ressources/aff3ct_builds\ncd ..\n@@ -21,7 +23,7 @@ do\nzip -r $ZIP_NAME $BUILD\n- cp $ZIP_NAME ${REPO}/ressources/aff3ct_builds/\n+ cp $ZIP_NAME ${REPO_WEB}/${REPO_RESSOURCES}/aff3ct_builds/\nif [ -z \"$BUILDS_LIST\" ]\nthen\n@@ -31,11 +33,9 @@ do\nfi\ndone\n-echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ${REPO}/download/download_${GIT_BRANCH}.csv\n+echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ${REPO_WEB}/download/download_${GIT_BRANCH}.csv\n-cd ${REPO}/ressources\n-git checkout master\n-git pull origin master\n+cd ${REPO_WEB}/${REPO_RESSOURCES}\n# git lfs install --local\n# git lfs track aff3ct_builds/*\ngit add -f aff3ct_builds/*\n@@ -86,6 +86,5 @@ git push origin master --force\ncd ..\ngit add -f download/download_${GIT_BRANCH}.csv\n-git add -f ressources\ngit commit -m \"Automatic: add new AFF3CT builds ($GIT_HASH).\"\ngit push origin master\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: adapt deploy script.
8,490
02.07.2018 11:19:10
-7,200
ecdf18aef26da4b98cb0b51e66ad4e3e8a045aac
Enable legacy LDPC SIMD inter decoder when the aligned new is supported.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "@@ -69,6 +69,9 @@ void Decoder_LDPC::parameters\n// so K is the N - H's height\ntools::add_options(args.at({p+\"-type\", \"D\"}), 0, \"BP_FLOODING\", \"BP_LAYERED\", \"BP_PEELING\");\n+#ifdef __cpp_aligned_new\n+ tools::add_options(args.at({p+\"-type\", \"D\"}), 0, \"BP_LAYERED_LEGACY\");\n+#endif\ntools::add_options(args.at({p+\"-implem\" }), 0, \"SPA\", \"LSPA\", \"MS\", \"OMS\", \"NMS\", \"AMS\", \"GALA\");\nargs.add(\n@@ -212,9 +215,9 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\nelse if (this->min == \"MINS\") return new module::Decoder_LDPC_BP_layered<B,Q,tools::Update_rule_AMS <Q,tools::min_star <Q>>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_AMS <Q,tools::min_star <Q>>( ), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\n}\n+#ifdef __cpp_aligned_new\nelse if (this->type == \"BP_LAYERED\" && this->simd_strategy == \"INTER\")\n{\n-#ifdef __cpp_aligned_new // new LDPC layered SIMD\nif (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_MS_inter <Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_MS_inter <Q>( ), this->enable_syndrome, this->syndrome_depth, this->n_frames);\nelse if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_OMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_OMS_inter<Q>(this->offset), this->enable_syndrome, this->syndrome_depth, this->n_frames);\nelse if (this->implem == \"NMS\")\n@@ -235,13 +238,19 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\nelse\nreturn new module::Decoder_LDPC_BP_layered_inter<B,Q,tools::Update_rule_NMS_inter<Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_NMS_inter<Q>(this->norm_factor), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\n-#else // legacy LDPC layered SIMD\n+ }\n+#endif\n+#ifdef __cpp_aligned_new\n+ else if (this->type == \"BP_LAYERED_LEGACY\" && this->simd_strategy == \"INTER\")\n+#else\n+ else if (this->type == \"BP_LAYERED\" && this->simd_strategy == \"INTER\")\n+#endif\n+ {\nif (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\nelse if (this->implem == \"NMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->norm_factor, (Q)0 , this->enable_syndrome, this->syndrome_depth, this->n_frames);\nelse if (this->implem == \"OMS\") return new module::Decoder_LDPC_BP_layered_ONMS_inter<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 1.f , (Q)this->offset, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n-#endif\n}\n-#ifdef __cpp_aligned_new // new LDPC flooding SIMD\n+#ifdef __cpp_aligned_new\nelse if (this->type == \"BP_FLOODING\" && this->simd_strategy == \"INTER\")\n{\nif (this->implem == \"MS\" ) return new module::Decoder_LDPC_BP_flooding_inter<B,Q,tools::Update_rule_MS_inter <Q>>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, tools::Update_rule_MS_inter <Q>( ), this->enable_syndrome, this->syndrome_depth, this->n_frames);\n" } ]
C++
MIT License
aff3ct/aff3ct
Enable legacy LDPC SIMD inter decoder when the aligned new is supported.
8,483
02.07.2018 11:47:14
-7,200
e90516900440c5efb05f131cc97b2f1dc52c3aac
[PATCH] Fix the MI computation when there is a poncturer
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -35,9 +35,9 @@ void Monitor_BFER::parameters\nauto p = this->get_prefix();\nargs.add(\n- {p+\"-cw-size\", \"N\"},\n+ {p+\"-fra-size\", \"N\"},\ntools::Integer(tools::Positive(), tools::Non_zero()),\n- \"the codeword size for the mutual information computation.\",\n+ \"the frame size for the mutual information computation.\",\ntools::arg_rank::REQ);\nargs.add(\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Simulation/BFER_std.cpp", "new_path": "src/Launcher/Simulation/BFER_std.cpp", "diff": "@@ -130,7 +130,7 @@ void BFER_std<B,R,Q>\nparams.qnt->store(this->arg_vals);\nparams.mnt->K = params.coded_monitoring ? N_cw : params.src->K;\n- params.mnt->N = N_cw;\n+ params.mnt->N = N;\nparams.mnt->store(this->arg_vals);\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "new_path": "src/Simulation/BFER/Standard/Threads/BFER_std_threads.cpp", "diff": "@@ -244,7 +244,7 @@ void BFER_std_threads<B,R,Q>\nif (this->params_BFER_std.mnt->mutinfo)\n{\n- mnt[mnt::sck::get_mutual_info::X](enc[enc::sck::encode ::X_N ]);\n+ mnt[mnt::sck::get_mutual_info::X](mdm[mdm::sck::modulate ::X_N1]);\nmnt[mnt::sck::get_mutual_info::Y](mdm[mdm::sck::demodulate::Y_N2]);\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
[PATCH] Fix the MI computation when there is a poncturer Signed-off-by: Olivier HARTMANN <olivier.hartmann@u-bordeaux.fr>
8,483
02.07.2018 14:20:21
-7,200
d3cd85adc1e85c5adc32cc1a5750ee3dc867ec43
Change name monitors in arguments next to the one in attributes in Monitor Reduction
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/Monitor_reduction.hxx", "new_path": "src/Module/Monitor/Monitor_reduction.hxx", "diff": "@@ -14,11 +14,11 @@ namespace module\ntemplate <class M>\nMonitor_reduction<M>\n-::Monitor_reduction(const std::vector<M*> &monitors)\n-: Monitor(std::accumulate(monitors.begin(), monitors.end(), 0,\n+::Monitor_reduction(const std::vector<M*> &_monitors)\n+: Monitor(std::accumulate(_monitors.begin(), _monitors.end(), 0,\n[](int tot, const M* m) { return tot + m->get_n_frames(); })),\n- M((monitors.size() && monitors.front()) ? *monitors.front() : M(), this->n_frames),\n- monitors(monitors)\n+ M((_monitors.size() && _monitors.front()) ? *_monitors.front() : M(), this->n_frames),\n+ monitors(_monitors)\n{\nif (monitors.size() == 0)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/general_utils.cpp", "new_path": "src/Tools/general_utils.cpp", "diff": "@@ -169,7 +169,7 @@ std::vector<R> aff3ct::tools::generate_range(const std::vector<std::vector<R>>&\nstd::vector<R> rangeR(new_length);\n- for (unsigned i = 0; i < new_length; i++)\n+ for (auto i = 0; i < new_length; i++)\nrangeR[i] = ((R)range[i])/float_precision;\nreturn rangeR;\n" } ]
C++
MIT License
aff3ct/aff3ct
Change name monitors in arguments next to the one in attributes in Monitor Reduction
8,483
02.07.2018 14:35:33
-7,200
d3dc0e659faf7eeb239377ef4c7286748d552186
Complete the name change of the monitor N argument. Change this name in the launchers.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "new_path": "src/Factory/Module/Monitor/BFER/Monitor_BFER.cpp", "diff": "@@ -79,7 +79,7 @@ void Monitor_BFER::parameters\nauto p = this->get_prefix();\n- if(vals.exist({p+\"-cw-size\", \"N\"})) this->N = vals.to_int({p+\"-cw-size\", \"N\"});\n+ if(vals.exist({p+\"-fra-size\", \"N\"})) this->N = vals.to_int({p+\"-fra-size\", \"N\"});\nif(vals.exist({p+\"-info-bits\", \"K\"})) this->K = vals.to_int({p+\"-info-bits\", \"K\"});\nif(vals.exist({p+\"-fra\", \"F\"})) this->n_frames = vals.to_int({p+\"-fra\", \"F\"});\nif(vals.exist({p+\"-max-fe\", \"e\"})) this->n_frame_errors = vals.to_int({p+\"-max-fe\", \"e\"});\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Simulation/BFER_ite.cpp", "new_path": "src/Launcher/Simulation/BFER_ite.cpp", "diff": "@@ -82,7 +82,7 @@ void BFER_ite<B,R,Q>\nthis->args.erase({pqnt+\"-size\", \"N\"});\nthis->args.erase({pqnt+\"-fra\", \"F\"});\nthis->args.erase({pmnt+\"-info-bits\", \"K\"});\n- this->args.erase({pmnt+\"-cw-size\", \"N\"});\n+ this->args.erase({pmnt+\"-fra-size\", \"N\"});\nthis->args.erase({pmnt+\"-fra\", \"F\"});\nthis->args.erase({pter+\"-info-bits\", \"K\"});\nthis->args.erase({pter+\"-cw-size\", \"N\"});\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Simulation/BFER_std.cpp", "new_path": "src/Launcher/Simulation/BFER_std.cpp", "diff": "@@ -75,7 +75,7 @@ void BFER_std<B,R,Q>\nthis->args.erase({pqnt+\"-size\", \"N\"});\nthis->args.erase({pqnt+\"-fra\", \"F\"});\nthis->args.erase({pmnt+\"-info-bits\", \"K\"});\n- this->args.erase({pmnt+\"-cw-size\", \"N\"});\n+ this->args.erase({pmnt+\"-fra-size\", \"N\"});\nthis->args.erase({pmnt+\"-fra\", \"F\"});\nthis->args.erase({pter+\"-info-bits\", \"K\"});\nthis->args.erase({pter+\"-cw-size\", \"N\"});\n" } ]
C++
MIT License
aff3ct/aff3ct
Complete the name change of the monitor N argument. Change this name in the launchers.
8,483
03.07.2018 09:47:50
-7,200
b5fe635fc667960cf6061c4fc7d7951458894121
Fix reporter throughput. Add userfriendly constructor with Monitor MI/BFER as parameter.
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.cpp", "diff": "@@ -162,7 +162,7 @@ template <typename B, typename R>\nbool Monitor_MI<B,R>\n::n_trials_limit_achieved()\n{\n- return this->get_n_trials_fra() >= this->get_n_trials_limit();\n+ return this->get_n_trials() >= this->get_n_trials_limit();\n}\ntemplate <typename B, typename R>\n@@ -174,7 +174,7 @@ unsigned Monitor_MI<B,R>\ntemplate <typename B, typename R>\nunsigned long long Monitor_MI<B,R>\n-::get_n_trials_fra() const\n+::get_n_trials() const\n{\nreturn this->n_trials;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "diff": "@@ -90,7 +90,7 @@ public:\nvirtual bool n_trials_limit_achieved();\nunsigned get_n_trials_limit() const;\n- virtual unsigned long long get_n_trials_fra() const;\n+ virtual unsigned long long get_n_trials() const;\nvirtual R get_MI () const;\nvirtual R get_MI_min() const;\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -128,10 +128,7 @@ BFER<B,R,Q>\nrep_er = new tools::Reporter_BFER<B>(*this->monitor_er_red);\nreporters.push_back(rep_er);\n- rep_throughput = new tools::Reporter_throughput<uint64_t>(std::bind(&Monitor_BFER_type::get_n_fe, this->monitor_er_red),\n- this->monitor_er_red->get_fe_limit(),\n- std::bind(&Monitor_BFER_type::get_n_analyzed_fra, this->monitor_er_red),\n- this->monitor_er_red->get_K());\n+ rep_throughput = new tools::Reporter_throughput<uint64_t>(*this->monitor_er_red);\nreporters.push_back(rep_throughput);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/MI/Reporter_MI.cpp", "new_path": "src/Tools/Display/Reporter/MI/Reporter_MI.cpp", "diff": "@@ -34,7 +34,7 @@ Reporter::report_t Reporter_MI<B,R>\nauto& mi_report = report[0];\n- mi_report.push_back(Reporter_stream::format(monitor.get_n_trials_fra()) + \" \");\n+ mi_report.push_back(Reporter_stream::format(monitor.get_n_trials()) + \" \");\nstd::stringstream str_MI, str_MI_min, str_MI_max;\nstr_MI << std::setprecision(3) << std::setw(Reporter_stream::column_width-1) << monitor.get_MI () << \" \";\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hpp", "diff": "#include <type_traits>\n#include \"Module/Monitor/MI/Monitor_MI.hpp\"\n+#include \"Module/Monitor/BFER/Monitor_BFER.hpp\"\n#include \"../Reporter.hpp\"\nnamespace aff3ct\n@@ -34,6 +35,12 @@ public:\nexplicit Reporter_throughput(std::function<T(void)> progress_function, const T progress_limit = 0,\nstd::function<T(void)> get_nbits_function = nullptr, const T nbits_factor = 1);\n+ template<typename B>\n+ explicit Reporter_throughput(const module::Monitor_BFER<B>& m);\n+\n+ template<typename B, typename R>\n+ explicit Reporter_throughput(const module::Monitor_MI<B,R>& m);\n+\nvirtual ~Reporter_throughput() = default;\nreport_t report(bool final = false);\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "new_path": "src/Tools/Display/Reporter/Throughput/Reporter_throughput.hxx", "diff": "@@ -30,6 +30,31 @@ Reporter_throughput<T>\nthroughput_cols.push_back(std::make_pair(\"ET/RT\", \"(hhmmss)\"));\nthis->cols_groups.push_back(throughput_group);\n+\n+}\n+\n+template <typename T>\n+template <typename B>\n+Reporter_throughput<T>\n+::Reporter_throughput(const module::Monitor_BFER<B>& m)\n+: Reporter_throughput(std::bind(&module::Monitor_BFER<B>::get_n_fe, &m),\n+ (T)m.get_fe_limit(),\n+ std::bind(&module::Monitor_BFER<B>::get_n_analyzed_fra, &m),\n+ (T)m.get_K())\n+{\n+\n+}\n+\n+template <typename T>\n+template <typename B, typename R>\n+Reporter_throughput<T>\n+::Reporter_throughput(const module::Monitor_MI<B,R>& m)\n+: Reporter_throughput(std::bind(&module::Monitor_MI<B,R>::get_n_trials, &m),\n+ (T)m.get_n_trials_limit(),\n+ std::bind(&module::Monitor_MI<B,R>::get_n_trials, &m),\n+ (T)m.get_N())\n+{\n+\n}\ntemplate <typename T>\n@@ -50,14 +75,13 @@ Reporter::report_t Reporter_throughput<T>\nif (get_nbits_function != nullptr)\nnbits = get_nbits_function() * nbits_factor;\n+ using namespace std::chrono;\n- auto simu_time = (double)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - t_report).count(); // usec\n+ auto simu_time = (double)duration_cast<microseconds>(steady_clock::now() - t_report).count(); // usec\ndouble displayed_time = simu_time * 1e-6; // sec\n- if (!final && progress_function != nullptr && progress != 0 && progress_limit != 0)\n+ if (!final && progress != 0 && progress_limit != 0)\ndisplayed_time *= (double)progress_limit / (double)progress - 1.;\n- else\n- t_report = std::chrono::steady_clock::now();\nauto str_time = get_time_format(displayed_time) + \" \";\n@@ -81,6 +105,8 @@ template <typename T>\nvoid Reporter_throughput<T>\n::init()\n{\n+ Reporter::init();\n+\nt_report = std::chrono::steady_clock::now();\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix reporter throughput. Add userfriendly constructor with Monitor MI/BFER as parameter.