Skip to content

Commit

Permalink
Merge pull request #221 from slaperche-scality/ft/rename_namespace
Browse files Browse the repository at this point in the history
rename the namespace to `quadiron`
  • Loading branch information
slaperche-scality authored Jul 27, 2018
2 parents 73e7da2 + f23f54e commit 774f134
Show file tree
Hide file tree
Showing 66 changed files with 460 additions and 460 deletions.
42 changes: 21 additions & 21 deletions benchmark/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ Benchmark<T>::~Benchmark()

if (d_chunks != nullptr) {
for (int i = 0; i < k; i++) {
quad::aligned_deallocate<uint8_t>(d_chunks->at(i));
quadiron::aligned_deallocate<uint8_t>(d_chunks->at(i));
}
delete d_chunks;
}
if (c_chunks != nullptr) {
for (int i = 0; i < n_c; i++) {
quad::aligned_deallocate<uint8_t>(c_chunks->at(i));
quadiron::aligned_deallocate<uint8_t>(c_chunks->at(i));
}
delete c_chunks;
}
if (r_chunks != nullptr) {
for (int i = 0; i < k; i++) {
quad::aligned_deallocate<uint8_t>(r_chunks->at(i));
quadiron::aligned_deallocate<uint8_t>(r_chunks->at(i));
}
delete r_chunks;
}
Expand All @@ -154,33 +154,33 @@ int Benchmark<T>::init()
{
switch (fec_type) {
case EC_TYPE_RS_GF2N_V:
fec = new quad::fec::RsGf2n<T>(
word_size, k, m, quad::fec::RsMatrixType::VANDERMONDE);
fec = new quadiron::fec::RsGf2n<T>(
word_size, k, m, quadiron::fec::RsMatrixType::VANDERMONDE);
break;
case EC_TYPE_RS_GF2N_C:
fec = new quad::fec::RsGf2n<T>(
word_size, k, m, quad::fec::RsMatrixType::CAUCHY);
fec = new quadiron::fec::RsGf2n<T>(
word_size, k, m, quadiron::fec::RsMatrixType::CAUCHY);
break;
case EC_TYPE_RS_GF2N_FFT:
fec = new quad::fec::RsGf2nFft<T>(word_size, k, m);
fec = new quadiron::fec::RsGf2nFft<T>(word_size, k, m);
break;
case EC_TYPE_RS_GF2N_FFT_ADD:
fec = new quad::fec::RsGf2nFftAdd<T>(word_size, k, m);
fec = new quadiron::fec::RsGf2nFftAdd<T>(word_size, k, m);
break;
case EC_TYPE_RS_GFP_FFT:
fec = new quad::fec::RsGfpFft<T>(word_size, k, m);
fec = new quadiron::fec::RsGfpFft<T>(word_size, k, m);
break;
case EC_TYPE_RS_NF4:
fec = new quad::fec::RsNf4<T>(word_size, k, m);
fec = new quadiron::fec::RsNf4<T>(word_size, k, m);
break;
case EC_TYPE_RS_FNT:
fec = new quad::fec::RsFnt<T>(word_size, k, m, pkt_size);
fec = new quadiron::fec::RsFnt<T>(word_size, k, m, pkt_size);
break;
default:
return ERR_FEC_TYPE_NOT_SUPPORTED;
}

this->systematic_ec = (fec->type == quad::fec::FecType::SYSTEMATIC);
this->systematic_ec = (fec->type == quadiron::fec::FecType::SYSTEMATIC);
if (this->systematic_ec) {
this->n_c = this->m;
}
Expand All @@ -194,13 +194,13 @@ int Benchmark<T>::init()
r_chunks = new std::vector<uint8_t*>(k);

for (i = 0; i < k; i++) {
d_chunks->at(i) = quad::aligned_allocate<uint8_t>(chunk_size);
d_chunks->at(i) = quadiron::aligned_allocate<uint8_t>(chunk_size);
}
for (i = 0; i < n_c; i++) {
c_chunks->at(i) = quad::aligned_allocate<uint8_t>(chunk_size);
c_chunks->at(i) = quadiron::aligned_allocate<uint8_t>(chunk_size);
}
for (i = 0; i < k; i++) {
r_chunks->at(i) = quad::aligned_allocate<uint8_t>(chunk_size);
r_chunks->at(i) = quadiron::aligned_allocate<uint8_t>(chunk_size);
}

// Allocate memory for iostreambufs
Expand Down Expand Up @@ -228,7 +228,7 @@ int Benchmark<T>::init()
c_streams = new std::vector<std::ostream*>(n_c);
a_streams = new std::vector<std::istream*>(n);
r_streams = new std::vector<std::ostream*>(k);
c_props = std::vector<quad::Properties>(n_c);
c_props = std::vector<quadiron::Properties>(n_c);

for (i = 0; i < k; i++) {
d_streams->at(i) = new std::istream(d_istreambufs->at(i));
Expand Down Expand Up @@ -297,7 +297,7 @@ int Benchmark<T>::check_params()
}
}

size_t wordsize_limit = quad::arith::log2<T>(n) + 1;
size_t wordsize_limit = quadiron::arith::log2<T>(n) + 1;
if (wordsize_limit > 8 * word_size) {
return ERR_COMPT_CODE_LEN_T;
}
Expand Down Expand Up @@ -426,7 +426,7 @@ template <typename T>
void Benchmark<T>::get_avail_chunks(
std::vector<std::istream*>* avail_d_chunks,
std::vector<std::istream*>* avail_c_chunks,
std::vector<quad::Properties>& avail_c_props)
std::vector<quadiron::Properties>& avail_c_props)
{
std::random_shuffle(c_chunks_id->begin(), c_chunks_id->end());

Expand All @@ -436,7 +436,7 @@ void Benchmark<T>::get_avail_chunks(
}
for (i = 0; i < n_c; i++) {
avail_c_chunks->at(i) = nullptr;
avail_c_props.at(i) = quad::Properties();
avail_c_props.at(i) = quadiron::Properties();
}
if (systematic_ec) {
int avail_d_chunks_nb = 0;
Expand Down Expand Up @@ -488,7 +488,7 @@ bool Benchmark<T>::decode()
{
std::vector<std::istream*> d_streams_shuffled(k, nullptr);
std::vector<std::istream*> c_streams_shuffled(n_c, nullptr);
std::vector<quad::Properties> c_props_shuffled(n_c);
std::vector<quadiron::Properties> c_props_shuffled(n_c);

get_avail_chunks(
&d_streams_shuffled, &c_streams_shuffled, c_props_shuffled);
Expand Down
6 changes: 3 additions & 3 deletions benchmark/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class Benchmark {
size_t chunk_size;
uint32_t samples_nb;
PRNG* prng = nullptr;
quad::fec::FecCode<T>* fec = nullptr;
quadiron::fec::FecCode<T>* fec = nullptr;
Params_t* params = nullptr;

bool systematic_ec = false;
Expand Down Expand Up @@ -317,7 +317,7 @@ class Benchmark {
// streams of repair chunks
std::vector<std::ostream*>* r_streams = nullptr;
// props vector
std::vector<quad::Properties> c_props;
std::vector<quadiron::Properties> c_props;

int init();
int check_params();
Expand All @@ -333,7 +333,7 @@ class Benchmark {
void get_avail_chunks(
std::vector<std::istream*>* avail_d_chunks,
std::vector<std::istream*>* avail_c_chunks,
std::vector<quad::Properties>& avail_c_props);
std::vector<quadiron::Properties>& avail_c_props);
bool encode();
bool decode();
void show(Stats_t* stats);
Expand Down
4 changes: 2 additions & 2 deletions src/arith.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "core.h"
#include "exceptions.h"

namespace quad {
namespace quadiron {

template <typename T>
using DoubleSizeVal = typename DoubleSize<T>::T;
Expand Down Expand Up @@ -812,6 +812,6 @@ void get_prime_factors_final(
}

} // namespace arith
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/big_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std::ostream& operator<<(std::ostream& dest, __int128_t value);

} // namespace std

namespace quad {
namespace quadiron {

struct UInt256 {
__uint128_t lo;
Expand Down Expand Up @@ -123,6 +123,6 @@ struct Int256 {
}
};

} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#include "build_info.h"
#include "core.h"

namespace quad {
namespace quadiron {

const char* get_version()
{
return VERSION;
}

} // namespace quad
} // namespace quadiron
4 changes: 2 additions & 2 deletions src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include "big_int.h"

namespace quad {
namespace quadiron {

template <typename Type>
struct DoubleSize {
Expand Down Expand Up @@ -160,6 +160,6 @@ inline void aligned_deallocate(T* data)
#endif
}

} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <stdexcept>

namespace quad {
namespace quadiron {

/** Base class for all the exceptions generated by QuadIron. */
class Exception : public std::runtime_error {
Expand Down Expand Up @@ -71,6 +71,6 @@ class NoSolution : public Exception {
explicit NoSolution(const char* reason) : Exception(reason) {}
};

} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "vec_slice.h"
#include "vec_vector.h"

namespace quad {
namespace quadiron {

/** Forward Error Correction code implementations. */
namespace fec {
Expand Down Expand Up @@ -1142,6 +1142,6 @@ void FecCode<T>::decode_apply(
}

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "vec_poly.h"
#include "vec_zero_ext.h"

namespace quad {
namespace quadiron {

namespace fec {

Expand Down Expand Up @@ -290,6 +290,6 @@ class DecodeContext {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_rs_fnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "vec_vector.h"
#include "vec_zero_ext.h"

namespace quad {
namespace quadiron {
namespace fec {

/** Reed-Solomon (RS) erasure code based on Fermat Number Transform (FNT).
Expand Down Expand Up @@ -198,6 +198,6 @@ class RsFnt : public FecCode<T> {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_rs_gf2n.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "vec_matrix.h"
#include "vec_vector.h"

namespace quad {
namespace quadiron {
namespace fec {

enum class RsMatrixType { VANDERMONDE, CAUCHY };
Expand Down Expand Up @@ -154,6 +154,6 @@ class RsGf2n : public FecCode<T> {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_rs_gf2n_fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "vec_vector.h"
#include "vec_zero_ext.h"

namespace quad {
namespace quadiron {
namespace fec {

/** Reed-Solomon (RS) Erasure code over GF(2<sup>n</sup>)using FFT. */
Expand Down Expand Up @@ -151,6 +151,6 @@ class RsGf2nFft : public FecCode<T> {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_rs_gf2n_fft_add.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "vec_vector.h"
#include "vec_zero_ext.h"

namespace quad {
namespace quadiron {
namespace fec {

/** Reed-Solomon (RS) Erasure code over GF(2<sup>n</sup>) using additive FFT. */
Expand Down Expand Up @@ -248,6 +248,6 @@ class RsGf2nFftAdd : public FecCode<T> {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_rs_gfp_fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "vec_vector.h"
#include "vec_zero_ext.h"

namespace quad {
namespace quadiron {
namespace fec {

/** Reed-Solomon (RS) Erasure code over prime Galois Fields and FFT.
Expand Down Expand Up @@ -233,6 +233,6 @@ class RsGfpFft : public FecCode<T> {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fec_rs_nf4.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "vec_vector.h"
#include "vec_zero_ext.h"

namespace quad {
namespace quadiron {
namespace fec {

/** Reed-Solomon (RS) Erasure code over `n` GF(F<sub>4</sub>). */
Expand Down Expand Up @@ -254,6 +254,6 @@ class RsNf4 : public FecCode<T> {
};

} // namespace fec
} // namespace quad
} // namespace quadiron

#endif
4 changes: 2 additions & 2 deletions src/fft_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "vec_buffers.h"
#include "vec_vector.h"

namespace quad {
namespace quadiron {
namespace fft {

/** FFT implementation specialized for FFT size=2.
Expand Down Expand Up @@ -121,6 +121,6 @@ void Size2<T>::ifft(vec::Buffers<T>* output, vec::Buffers<T>* input)
}

} // namespace fft
} // namespace quad
} // namespace quadiron

#endif
Loading

0 comments on commit 774f134

Please sign in to comment.