summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/doxygen/other/logger.dox4
-rw-r--r--docs/doxygen/other/main_page.dox1
-rwxr-xr-xgnuradio-core/src/examples/mp-sched/affinity_set.py5
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.cc2
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.h8
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.i4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_detail.cc2
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_detail.h4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_logger.h1
-rw-r--r--gnuradio-core/src/lib/runtime/gr_tagged_stream_block.cc4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_tagged_stream_block.h18
-rw-r--r--gnuradio-core/src/lib/runtime/qa_gr_top_block.cc2
-rw-r--r--gnuradio-core/src/lib/swig/gnuradio.i1
-rw-r--r--gnuradio-core/src/python/gnuradio/gr/qa_affinity.py49
-rw-r--r--gr-blocks/grc/blocks_complex_to_real.xml8
-rw-r--r--gr-blocks/grc/blocks_plateau_detector_fb.xml2
-rw-r--r--gr-blocks/include/blocks/tagged_stream_mux.h6
-rw-r--r--gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h2
-rw-r--r--gr-digital/include/digital/packet_header_default.h18
-rw-r--r--gr-digital/include/digital/packet_header_ofdm.h7
-rw-r--r--gr-digital/include/digital/packet_headergenerator_bb.h27
-rw-r--r--gr-digital/include/digital/packet_headerparser_b.h6
-rw-r--r--gr-digital/lib/header_payload_demux_impl.h22
-rw-r--r--gr-digital/lib/ofdm_frame_equalizer_vcvc_impl.h2
-rw-r--r--gr-digital/lib/ofdm_serializer_vcc_impl.h15
-rw-r--r--gr-digital/lib/packet_header_default.cc1
-rw-r--r--gr-digital/lib/packet_headergenerator_bb_impl.cc27
-rw-r--r--gr-digital/lib/packet_headergenerator_bb_impl.h10
-rw-r--r--gr-digital/lib/packet_headerparser_b_impl.cc2
-rw-r--r--gr-digital/python/ofdm_txrx.py6
-rwxr-xr-xgr-digital/python/qa_ofdm_txrx.py5
-rwxr-xr-xgr-digital/python/qa_packet_headergenerator_bb.py4
-rw-r--r--gr-utils/src/python/modtool/templates.py4
-rw-r--r--grc/blocks/gr_vector_source_x.xml2
-rw-r--r--grc/python/Param.py20
-rw-r--r--grc/python/Port.py1
-rw-r--r--gruel/src/include/gruel/thread.h6
-rw-r--r--gruel/src/lib/thread.cc40
38 files changed, 221 insertions, 127 deletions
diff --git a/docs/doxygen/other/logger.dox b/docs/doxygen/other/logger.dox
index 9a97172ed0..22458051db 100644
--- a/docs/doxygen/other/logger.dox
+++ b/docs/doxygen/other/logger.dox
@@ -24,8 +24,8 @@ different levels. These levels are:
The order here determines the level of output. These levels are
hierarchical in that specifying any level also includes any level
-above it. For example, when using the Debug level, all Debug and
-higher messages are logged and Trace is ignored.
+above it. For example, when using the WARN level, all WARN and
+higher messages are logged while DEBUG and INFO are ignored.
\subsection configfile Logging Configuration
diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox
index 8895cd552d..9353bfb315 100644
--- a/docs/doxygen/other/main_page.dox
+++ b/docs/doxygen/other/main_page.dox
@@ -45,6 +45,7 @@ More details on GNU Radio concepts:
\li \ref page_metadata
\li \ref volk_guide
\li \ref page_pfb
+\li \ref page_tagged_stream_blocks
\section flowgraph Operating a Flowgraph
diff --git a/gnuradio-core/src/examples/mp-sched/affinity_set.py b/gnuradio-core/src/examples/mp-sched/affinity_set.py
index 6db632e0fa..65e929051b 100755
--- a/gnuradio-core/src/examples/mp-sched/affinity_set.py
+++ b/gnuradio-core/src/examples/mp-sched/affinity_set.py
@@ -42,9 +42,6 @@ class affinity_set(gr.top_block):
self.connect((self.gr_filt_0, 0), (self.gr_filt_1, 0))
self.connect((self.gr_filt_1, 0), (self.gr_null_sink_0, 0))
-
- # QT sink close method reimplementation
-
def get_samp_rate(self):
return self.samp_rate
@@ -58,7 +55,7 @@ if __name__ == '__main__':
tb.start()
while(1):
- ret = raw_input('Press Enter to quit: ')
+ ret = raw_input('Enter a new Core # or Press Enter to quit: ')
if(len(ret) == 0):
tb.stop()
sys.exit(0)
diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc
index 4950e8666c..674e52084a 100644
--- a/gnuradio-core/src/lib/runtime/gr_block.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block.cc
@@ -300,7 +300,7 @@ gr_block::is_set_max_noutput_items()
}
void
-gr_block::set_processor_affinity(const std::vector<unsigned int> &mask)
+gr_block::set_processor_affinity(const std::vector<int> &mask)
{
d_affinity = mask;
if(d_detail) {
diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h
index e4b30267e6..402c8ee7f1 100644
--- a/gnuradio-core/src/lib/runtime/gr_block.h
+++ b/gnuradio-core/src/lib/runtime/gr_block.h
@@ -459,9 +459,9 @@ class GR_CORE_API gr_block : public gr_basic_block {
/*!
* \brief Set the thread's affinity to processor core \p n.
*
- * \param mask a vector of unsigned ints of the core numbers available to this block.
+ * \param mask a vector of ints of the core numbers available to this block.
*/
- void set_processor_affinity(const std::vector<unsigned int> &mask);
+ void set_processor_affinity(const std::vector<int> &mask);
/*!
* \brief Remove processor affinity to a specific core.
@@ -471,7 +471,7 @@ class GR_CORE_API gr_block : public gr_basic_block {
/*!
* \brief Get the current processor affinity.
*/
- std::vector<unsigned int> processor_affinity() { return d_affinity; }
+ std::vector<int> processor_affinity() { return d_affinity; }
// ----------------------------------------------------------------------------
@@ -489,7 +489,7 @@ class GR_CORE_API gr_block : public gr_basic_block {
int d_max_noutput_items; // value of max_noutput_items for this block
int d_min_noutput_items;
tag_propagation_policy_t d_tag_propagation_policy; // policy for moving tags downstream
- std::vector<unsigned int> d_affinity; // thread affinity proc. mask
+ std::vector<int> d_affinity; // thread affinity proc. mask
protected:
gr_block (void){} //allows pure virtual interface sub-classes
diff --git a/gnuradio-core/src/lib/runtime/gr_block.i b/gnuradio-core/src/lib/runtime/gr_block.i
index a80f64d027..a53489f9a2 100644
--- a/gnuradio-core/src/lib/runtime/gr_block.i
+++ b/gnuradio-core/src/lib/runtime/gr_block.i
@@ -83,9 +83,9 @@ class gr_block : public gr_basic_block {
float pc_work_time_var();
// Methods to manage processor affinity.
- void set_processor_affinity(const gr_vector_uint &mask);
+ void set_processor_affinity(const std::vector<int> &mask);
void unset_processor_affinity();
- gr_vector_uint processor_affinity();
+ std::vector<int> processor_affinity();
// internal use
gr_block_detail_sptr detail () const { return d_detail; }
diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.cc b/gnuradio-core/src/lib/runtime/gr_block_detail.cc
index 82081039ac..af80e61cff 100644
--- a/gnuradio-core/src/lib/runtime/gr_block_detail.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block_detail.cc
@@ -215,7 +215,7 @@ gr_block_detail::get_tags_in_range(std::vector<gr_tag_t> &v,
}
void
-gr_block_detail::set_processor_affinity(const std::vector<unsigned int> &mask)
+gr_block_detail::set_processor_affinity(const std::vector<int> &mask)
{
if(threaded) {
try {
diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.h b/gnuradio-core/src/lib/runtime/gr_block_detail.h
index 32a01e763a..15d85135ae 100644
--- a/gnuradio-core/src/lib/runtime/gr_block_detail.h
+++ b/gnuradio-core/src/lib/runtime/gr_block_detail.h
@@ -159,9 +159,9 @@ class GR_CORE_API gr_block_detail {
/*!
* \brief Set core affinity of block to the cores in the vector mask.
*
- * \param mask a vector of unsigned ints of the core numbers available to this block.
+ * \param mask a vector of ints of the core numbers available to this block.
*/
- void set_processor_affinity(const std::vector<unsigned int> &mask);
+ void set_processor_affinity(const std::vector<int> &mask);
/*!
* \brief Unset core affinity.
diff --git a/gnuradio-core/src/lib/runtime/gr_logger.h b/gnuradio-core/src/lib/runtime/gr_logger.h
index 2ccd498822..2931a29172 100644
--- a/gnuradio-core/src/lib/runtime/gr_logger.h
+++ b/gnuradio-core/src/lib/runtime/gr_logger.h
@@ -44,6 +44,7 @@
#include <gr_core_api.h>
#include <assert.h>
#include <iostream>
+#include <boost/format.hpp>
//#ifndef ENABLE_GR_LOG
//#define ENABLE_GR_LOG 1
diff --git a/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.cc b/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.cc
index 3c4a75fd37..26ce2231aa 100644
--- a/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.cc
+++ b/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.cc
@@ -24,6 +24,7 @@
#include "config.h"
#endif
+#include <boost/format.hpp>
#include <gr_tagged_stream_block.h>
gr_tagged_stream_block::gr_tagged_stream_block (const std::string &name,
@@ -111,7 +112,8 @@ gr_tagged_stream_block::general_work (int noutput_items,
}
for (unsigned i = 0; i < input_items.size(); i++) {
if (d_n_input_items_reqd[i] == -1) {
- throw std::runtime_error("Missing length tag.");
+ GR_LOG_FATAL(d_logger, boost::format("Missing a required length tag on port %1% at item #%2%") % i % nitems_read(i));
+ throw std::runtime_error("Missing length tag.");
}
if (d_n_input_items_reqd[i] > ninput_items[i]) {
return 0;
diff --git a/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.h b/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.h
index a9d396c06f..a82b27f6a6 100644
--- a/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.h
+++ b/gnuradio-core/src/lib/runtime/gr_tagged_stream_block.h
@@ -35,8 +35,8 @@
class GR_CORE_API gr_tagged_stream_block : public gr_block
{
private:
- pmt::pmt_t d_length_tag_key; //! This is the key for the tag that stores the PDU length
- gr_vector_int d_n_input_items_reqd; //! How many input items do I need to process the next PDU?
+ pmt::pmt_t d_length_tag_key; //!< This is the key for the tag that stores the PDU length
+ gr_vector_int d_n_input_items_reqd; //!< How many input items do I need to process the next PDU?
protected:
std::string d_length_tag_key_str;
@@ -46,7 +46,8 @@ class GR_CORE_API gr_tagged_stream_block : public gr_block
gr_io_signature_sptr output_signature,
const std::string &length_tag_key);
- /* \brief Parse all tags on the first sample of a PDU, return the number of items per input
+ /*!
+ * \brief Parse all tags on the first sample of a PDU, return the number of items per input
* and prune the length tags.
*
* In most cases, you don't need to override this, unless the number of items read
@@ -66,7 +67,8 @@ class GR_CORE_API gr_tagged_stream_block : public gr_block
gr_vector_int &n_input_items_reqd
);
- /* \brief Calculate the number of output items.
+ /*!
+ * \brief Calculate the number of output items.
*
* This is basically the inverse function to forecast(): Given a number of input
* items, it returns the maximum number of output items.
@@ -77,7 +79,8 @@ class GR_CORE_API gr_tagged_stream_block : public gr_block
*/
virtual int calculate_output_stream_length(const gr_vector_int &ninput_items);
- /* \brief Set the new length tags on the output stream
+ /*!
+ * \brief Set the new length tags on the output stream
*
* Default behaviour: Set a tag with key \p length_tag_key and
* the number of produced items on every output port.
@@ -91,11 +94,12 @@ class GR_CORE_API gr_tagged_stream_block : public gr_block
public:
- /* \brief Don't override this.
+ /*! \brief Don't override this.
*/
void /* final */ forecast (int noutput_items, gr_vector_int &ninput_items_required);
- /* - Reads the number of input items from the tags using parse_length_tags()
+ /*!
+ * - Reads the number of input items from the tags using parse_length_tags()
* - Checks there's enough data on the input and output buffers
* - If not, inform the scheduler and do nothing
* - Calls work() with the exact number of items per PDU
diff --git a/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc b/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc
index 1d3dafadf8..6bbc9ceb89 100644
--- a/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc
+++ b/gnuradio-core/src/lib/runtime/qa_gr_top_block.cc
@@ -269,7 +269,7 @@ void qa_gr_top_block::t11_set_block_affinity()
gr_block_sptr src (gr_make_null_source(sizeof(float)));
gr_block_sptr snk (gr_make_null_sink(sizeof(float)));
- std::vector<unsigned int> set(1, 0), ret;
+ std::vector<int> set(1, 0), ret;
src->set_processor_affinity(set);
tb->connect(src, 0, snk, 0);
diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i
index 4378e6aad2..03b7817e22 100644
--- a/gnuradio-core/src/lib/swig/gnuradio.i
+++ b/gnuradio-core/src/lib/swig/gnuradio.i
@@ -45,6 +45,7 @@
// local file
%include <gr_shared_ptr.i>
+%include <gr_types.h>
%include <std_complex.i>
%include <std_vector.i>
%include <stl.i>
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_affinity.py b/gnuradio-core/src/python/gnuradio/gr/qa_affinity.py
new file mode 100644
index 0000000000..7b3ca6ed63
--- /dev/null
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_affinity.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+
+class test_affinity(gr_unittest.TestCase):
+
+ def setUp(self):
+ self.tb = gr.top_block()
+
+ def tearDown(self):
+ self.tb = None
+
+ def test_000(self):
+ # Just run some data through and make sure it doesn't puke.
+ src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
+
+ src = gr.vector_source_f(src_data)
+ snk = gr.vector_sink_f()
+
+ src.set_processor_affinity([0,])
+ self.tb.connect(src, snk)
+ self.tb.run()
+
+ a = src.processor_affinity()
+
+ self.assertEqual((0,), a)
+
+if __name__ == '__main__':
+ gr_unittest.run(test_affinity, "test_affinity.xml")
diff --git a/gr-blocks/grc/blocks_complex_to_real.xml b/gr-blocks/grc/blocks_complex_to_real.xml
index 0fe77dc1c5..6737f1da36 100644
--- a/gr-blocks/grc/blocks_complex_to_real.xml
+++ b/gr-blocks/grc/blocks_complex_to_real.xml
@@ -24,13 +24,7 @@
</sink>
<source>
<name>re</name>
- <type>real</type>
+ <type>float</type>
<vlen>$vlen</vlen>
</source>
- <source>
- <name>im</name>
- <type>real</type>
- <vlen>$vlen</vlen>
- <optional>1</optional>
- </source>
</block>
diff --git a/gr-blocks/grc/blocks_plateau_detector_fb.xml b/gr-blocks/grc/blocks_plateau_detector_fb.xml
index e06c3fe306..90f67a4cf5 100644
--- a/gr-blocks/grc/blocks_plateau_detector_fb.xml
+++ b/gr-blocks/grc/blocks_plateau_detector_fb.xml
@@ -17,7 +17,7 @@
</param>
<sink>
<name>in</name>
- <type>real</type>
+ <type>float</type>
</sink>
<source>
<name>out</name>
diff --git a/gr-blocks/include/blocks/tagged_stream_mux.h b/gr-blocks/include/blocks/tagged_stream_mux.h
index 23e8a94403..d271cf890f 100644
--- a/gr-blocks/include/blocks/tagged_stream_mux.h
+++ b/gr-blocks/include/blocks/tagged_stream_mux.h
@@ -31,12 +31,11 @@ namespace gr {
/*!
* \brief Combines tagged streams.
*
- * \description
* Takes N streams as input. Each stream is tagged with packet lengths.
* Packets are output sequentially from each input stream.
*
* The output signal has a new length tag, which is the sum of all
- * individual length tags.
+ * individual length tags. The old length tags are discarded.
*
* All other tags are propagated as expected, i.e. they stay associated
* with the same input item.
@@ -48,7 +47,8 @@ namespace gr {
public:
typedef boost::shared_ptr<tagged_stream_mux> sptr;
- /* \param itemsize Items size (number of bytes per item)
+ /*!
+ * \param itemsize Items size (number of bytes per item)
* \param lengthtagname Length tag key
*/
static sptr make(size_t itemsize, const std::string &lengthtagname);
diff --git a/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h b/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h
index d5d526ddc3..321c58473d 100644
--- a/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h
+++ b/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h
@@ -43,7 +43,7 @@ namespace gr {
public:
typedef boost::shared_ptr<ofdm_frame_equalizer_vcvc> sptr;
- /*
+ /*!
* \param equalizer The equalizer object that will do the actual work
* \param len_tag_key Length tag key
* \param propagate_channel_state If true, the channel state after the last symbol
diff --git a/gr-digital/include/digital/packet_header_default.h b/gr-digital/include/digital/packet_header_default.h
index a4158e728c..d69a0f30a6 100644
--- a/gr-digital/include/digital/packet_header_default.h
+++ b/gr-digital/include/digital/packet_header_default.h
@@ -30,9 +30,19 @@ namespace gr {
namespace digital {
/*!
- * \brief <+description of block+>
+ * \brief Default header formatter for digital packet transmission.
* \ingroup digital
*
+ * For bursty/packetized digital transmission, packets are usually prepended
+ * with a packet header, containing the number of bytes etc.
+ * This class is not a block, but a tool to create these packet header.
+ *
+ * This is a default packet header (see header_formatter()) for a description
+ * on the header format). To create other header, derive packet header creator
+ * classes from this function.
+ *
+ * gr::digital::packet_headergenerator_bb uses header generators derived from
+ * this class to create packet headers from data streams.
*/
class DIGITAL_API packet_header_default : public boost::enable_shared_from_this<gr::digital::packet_header_default>
{
@@ -53,7 +63,8 @@ namespace gr {
long header_len() { return d_header_len; };
pmt::pmt_t len_tag_key() { return d_len_tag_key; };
- /* \brief Encodes the header information in the given tags into bits and places them into \p out
+ /*!
+ * \brief Encodes the header information in the given tags into bits and places them into \p out
*
* Uses the following header format:
* Bits 0-11: The packet length (what was stored in the tag with key \p len_tag_key)
@@ -70,7 +81,8 @@ namespace gr {
const std::vector<gr_tag_t> &tags=std::vector<gr_tag_t>()
);
- /* \brief Inverse function to header_formatter().
+ /*!
+ * \brief Inverse function to header_formatter().
*
* Reads the bit stream in \in and writes a corresponding tag into \p tags.
*
diff --git a/gr-digital/include/digital/packet_header_ofdm.h b/gr-digital/include/digital/packet_header_ofdm.h
index 6c3453ed1d..9f70900b49 100644
--- a/gr-digital/include/digital/packet_header_ofdm.h
+++ b/gr-digital/include/digital/packet_header_ofdm.h
@@ -48,7 +48,8 @@ namespace gr {
int bits_per_sym=1);
~packet_header_ofdm();
- /* \brief Inverse function to header_formatter().
+ /*!
+ * \brief Inverse function to header_formatter().
*
* Does the same as packet_header_default::header_parser(), but
* adds another tag that stores the number of OFDM symbols in the
@@ -72,8 +73,8 @@ namespace gr {
protected:
pmt::pmt_t d_frame_len_tag_key;
- const std::vector<std::vector<int> > d_occupied_carriers; //! Which carriers/symbols carry data
- int d_syms_per_set; //! Helper variable: Total number of elements in d_occupied_carriers
+ const std::vector<std::vector<int> > d_occupied_carriers; //!< Which carriers/symbols carry data
+ int d_syms_per_set; //!< Helper variable: Total number of elements in d_occupied_carriers
};
} // namespace digital
diff --git a/gr-digital/include/digital/packet_headergenerator_bb.h b/gr-digital/include/digital/packet_headergenerator_bb.h
index 8d92bf84ed..cec860fd55 100644
--- a/gr-digital/include/digital/packet_headergenerator_bb.h
+++ b/gr-digital/include/digital/packet_headergenerator_bb.h
@@ -33,18 +33,33 @@ namespace gr {
* \brief Generates a header for a tagged, streamed packet.
* \ingroup digital
*
- * Input: A tagged stream. The first element must have a tag with the key
- * specified in len_tag_key, which hold the exact number of elements
- * in the PDU.
- * Output: An tagged stream of length header_len. The output is determined
- * by a header formatter.
+ * Input: A tagged stream. This is consumed entirely, it is not appended
+ * to the output stream.
+ * Output: An tagged stream containing the header. The details on the header
+ * are set in a header formatter object (of type packet_header_default
+ * or a subclass thereof). If only a number of bits is specified, a
+ * default header is generated (see packet_header_default).
*/
class DIGITAL_API packet_headergenerator_bb : virtual public gr_tagged_stream_block
{
public:
typedef boost::shared_ptr<packet_headergenerator_bb> sptr;
- static sptr make(const packet_header_default::sptr &header_formatter);
+ /* \param header_formatter A header formatter object.
+ * \param len_tag_key Length tag key. Note that for header generation,
+ * it is irrelevant which tag names are set in the
+ * formatter object, only this value is relevant!
+ */
+ static sptr make(
+ const packet_header_default::sptr &header_formatter,
+ const std::string &len_tag_key="packet_len"
+ );
+
+ /* \param header_len If this value is given, a packet_header_default
+ * object is used to generate the header. This is
+ * the number of bits per header.
+ * \param len_tag_key Length tag key.
+ */
static sptr make(
long header_len,
const std::string &len_tag_key = "packet_len");
diff --git a/gr-digital/include/digital/packet_headerparser_b.h b/gr-digital/include/digital/packet_headerparser_b.h
index a3db069cbd..2dc6a80717 100644
--- a/gr-digital/include/digital/packet_headerparser_b.h
+++ b/gr-digital/include/digital/packet_headerparser_b.h
@@ -35,7 +35,11 @@ namespace gr {
*
* In a sense, this is the inverse block to packet_headergenerator_bb.
* The difference is, the parsed header is not output as a stream,
- * but as a message.
+ * but as a PMT dictionary, which is published to message port with
+ * the id "header_data".
+ * The dictionary consists of the tags created by the header formatter
+ * object. You should be able to use the exact same formatter object
+ * as used on the Tx side in the packet_headergenerator_bb.
*
* If only a header length is given, this block uses the default header
* format.
diff --git a/gr-digital/lib/header_payload_demux_impl.h b/gr-digital/lib/header_payload_demux_impl.h
index ceab9a8629..dc8cc7883a 100644
--- a/gr-digital/lib/header_payload_demux_impl.h
+++ b/gr-digital/lib/header_payload_demux_impl.h
@@ -30,17 +30,17 @@ namespace gr {
class header_payload_demux_impl : public header_payload_demux
{
private:
- int d_header_len; //! Number of bytes per header
- int d_items_per_symbol; //! Bytes per symbol
- int d_gi; //! Bytes per guard interval
- pmt::pmt_t d_len_tag_key; //! Key of length tag
- pmt::pmt_t d_trigger_tag_key; //! Key of trigger tag (if used)
- bool d_output_symbols; //! If true, output is symbols, not items
- size_t d_itemsize; //! Bytes per item
- bool d_uses_trigger_tag; //! If a trigger tag is used
- int d_ninput_items_reqd; //! Helper for forecast()
- int d_state; //! Current read state
- int d_remaining_symbols; //! When in payload or header state, the number of symbols still to transmit
+ int d_header_len; //!< Number of bytes per header
+ int d_items_per_symbol; //!< Bytes per symbol
+ int d_gi; //!< Bytes per guard interval
+ pmt::pmt_t d_len_tag_key; //!< Key of length tag
+ pmt::pmt_t d_trigger_tag_key; //!< Key of trigger tag (if used)
+ bool d_output_symbols; //!< If true, output is symbols, not items
+ size_t d_itemsize; //!< Bytes per item
+ bool d_uses_trigger_tag; //!< If a trigger tag is used
+ int d_ninput_items_reqd; //!< Helper for forecast()
+ int d_state; //!< Current read state
+ int d_remaining_symbols; //!< When in payload or header state, the number of symbols still to transmit
// Helpers to make the state machine more readable
diff --git a/gr-digital/lib/ofdm_frame_equalizer_vcvc_impl.h b/gr-digital/lib/ofdm_frame_equalizer_vcvc_impl.h
index cba2d513ea..ddfcc43694 100644
--- a/gr-digital/lib/ofdm_frame_equalizer_vcvc_impl.h
+++ b/gr-digital/lib/ofdm_frame_equalizer_vcvc_impl.h
@@ -36,7 +36,7 @@ namespace gr {
std::vector<gr_complex> d_channel_state;
protected:
- // This aren't really necessary, so let's override them with nuthin'
+ // These aren't really necessary, so let's override them with nuthin'
void remove_length_tags(const std::vector<std::vector<gr_tag_t> > &tags) {};
void update_length_tags(int n_produced, int n_ports) {};
diff --git a/gr-digital/lib/ofdm_serializer_vcc_impl.h b/gr-digital/lib/ofdm_serializer_vcc_impl.h
index ef2f1c83b1..4f750eac71 100644
--- a/gr-digital/lib/ofdm_serializer_vcc_impl.h
+++ b/gr-digital/lib/ofdm_serializer_vcc_impl.h
@@ -30,16 +30,17 @@ namespace gr {
class ofdm_serializer_vcc_impl : public ofdm_serializer_vcc
{
private:
- int d_fft_len; //! FFT length
- std::vector<std::vector<int> > d_occupied_carriers; //! Which carriers/symbols carry data
- pmt::pmt_t d_packet_len_tag_key; //! Key of the length tag
- pmt::pmt_t d_out_len_tag_key; //! Key of the length tag
- const int d_symbols_skipped; //! Start position in d_occupied_carriers
- int d_curr_set; //! Current position in d_occupied_carriers
+ int d_fft_len; //!< FFT length
+ std::vector<std::vector<int> > d_occupied_carriers; //!< Which carriers/symbols carry data
+ pmt::pmt_t d_packet_len_tag_key; //!< Key of the length tag
+ pmt::pmt_t d_out_len_tag_key; //!< Key of the length tag
+ const int d_symbols_skipped; //!< Start position in d_occupied_carriers
+ int d_curr_set; //!< Current position in d_occupied_carriers
int d_symbols_per_set;
protected:
- /* Calculate the number of scalar complex symbols given a number of
+ /*!
+ * Calculate the number of scalar complex symbols given a number of
* OFDM symbols.
*/
int calculate_output_stream_length(const gr_vector_int &ninput_items);
diff --git a/gr-digital/lib/packet_header_default.cc b/gr-digital/lib/packet_header_default.cc
index dac57512d3..2bcbf59957 100644
--- a/gr-digital/lib/packet_header_default.cc
+++ b/gr-digital/lib/packet_header_default.cc
@@ -23,6 +23,7 @@
#include "config.h"
#endif
+#include <string.h>
#include <digital/packet_header_default.h>
namespace gr {
diff --git a/gr-digital/lib/packet_headergenerator_bb_impl.cc b/gr-digital/lib/packet_headergenerator_bb_impl.cc
index 2698977728..3232858148 100644
--- a/gr-digital/lib/packet_headergenerator_bb_impl.cc
+++ b/gr-digital/lib/packet_headergenerator_bb_impl.cc
@@ -23,6 +23,7 @@
#include "config.h"
#endif
+#include <boost/format.hpp>
#include <gr_io_signature.h>
#include "packet_headergenerator_bb_impl.h"
@@ -30,9 +31,12 @@ namespace gr {
namespace digital {
packet_headergenerator_bb::sptr
- packet_headergenerator_bb::make(const packet_header_default::sptr &header_formatter)
+ packet_headergenerator_bb::make(
+ const packet_header_default::sptr &header_formatter,
+ const std::string &len_tag_key
+ )
{
- return gnuradio::get_initial_sptr (new packet_headergenerator_bb_impl(header_formatter));
+ return gnuradio::get_initial_sptr (new packet_headergenerator_bb_impl(header_formatter, len_tag_key));
}
@@ -45,25 +49,23 @@ namespace gr {
const packet_header_default::sptr header_formatter(
new packet_header_default(header_len, len_tag_key)
);
- return gnuradio::get_initial_sptr (new packet_headergenerator_bb_impl(header_formatter));
+ return gnuradio::get_initial_sptr (new packet_headergenerator_bb_impl(header_formatter, len_tag_key));
}
packet_headergenerator_bb_impl::packet_headergenerator_bb_impl(
- const gr::digital::packet_header_default::sptr &header_formatter
+ const gr::digital::packet_header_default::sptr &header_formatter,
+ const std::string &len_tag_key
)
: gr_tagged_stream_block("packet_headergenerator_bb_impl",
gr_make_io_signature(1, 1, sizeof (char)),
gr_make_io_signature(1, 1, sizeof (char)),
- pmt::pmt_symbol_to_string(header_formatter->len_tag_key())),
- d_formatter(header_formatter),
- d_input_size(1),
- d_header_len(header_formatter->header_len()),
- d_len_tag_value(pmt::pmt_from_long(d_header_len))
+ len_tag_key),
+ d_formatter(header_formatter)
{
- set_output_multiple(d_header_len);
+ set_output_multiple(d_formatter->header_len());
// This is the worst case rate, because we don't know the true value, of course
- set_relative_rate(d_header_len);
+ set_relative_rate(d_formatter->header_len());
set_tag_propagation_policy(TPP_DONT);
}
@@ -79,10 +81,11 @@ namespace gr {
{
unsigned char *out = (unsigned char *) output_items[0];
if (!d_formatter->header_formatter(ninput_items[0], out)) {
+ GR_LOG_FATAL(d_logger, boost::format("header_formatter() returned false (this shouldn't happen). Offending header started at %1%") % nitems_read(0));
throw std::runtime_error("header formatter returned false.");
}
- return d_header_len;
+ return d_formatter->header_len();
}
} /* namespace digital */
diff --git a/gr-digital/lib/packet_headergenerator_bb_impl.h b/gr-digital/lib/packet_headergenerator_bb_impl.h
index 7d2494cf8b..ce60fdf76c 100644
--- a/gr-digital/lib/packet_headergenerator_bb_impl.h
+++ b/gr-digital/lib/packet_headergenerator_bb_impl.h
@@ -31,16 +31,16 @@ namespace gr {
{
private:
gr::digital::packet_header_default::sptr d_formatter;
- int d_input_size;
- int d_header_len;
- pmt::pmt_t d_len_tag_value;
public:
- packet_headergenerator_bb_impl(const packet_header_default::sptr &header_formatter);
+ packet_headergenerator_bb_impl(
+ const packet_header_default::sptr &header_formatter,
+ const std::string &len_tag_key
+ );
~packet_headergenerator_bb_impl();
void remove_length_tags(const std::vector<std::vector<gr_tag_t> > &tags) {};
- int calculate_output_stream_length(const gr_vector_int &ninput_items) { return d_header_len; };
+ int calculate_output_stream_length(const gr_vector_int &ninput_items) { return d_formatter->header_len(); };
int work(int noutput_items,
gr_vector_int &ninput_items,
diff --git a/gr-digital/lib/packet_headerparser_b_impl.cc b/gr-digital/lib/packet_headerparser_b_impl.cc
index 65883f5515..5f8f0cd560 100644
--- a/gr-digital/lib/packet_headerparser_b_impl.cc
+++ b/gr-digital/lib/packet_headerparser_b_impl.cc
@@ -23,6 +23,7 @@
#include "config.h"
#endif
+#include <boost/format.hpp>
#include <gr_io_signature.h>
#include "packet_headerparser_b_impl.h"
@@ -73,6 +74,7 @@ namespace gr {
std::vector<gr_tag_t> tags;
if (!d_header_formatter->header_parser(in, tags)) {
+ GR_LOG_INFO(d_logger, boost::format("Detected an invalid packet at item %1%") % nitems_read(0));
message_port_pub(msg_port_id, pmt::PMT_F);
} else {
pmt::pmt_t dict(pmt::pmt_make_dict());
diff --git a/gr-digital/python/ofdm_txrx.py b/gr-digital/python/ofdm_txrx.py
index 2734e9cc1c..de9811a646 100644
--- a/gr-digital/python/ofdm_txrx.py
+++ b/gr-digital/python/ofdm_txrx.py
@@ -128,10 +128,10 @@ class ofdm_tx(gr.hier_block2):
total_sync_word = sync_word1 + sync_word2
crc = digital.crc32_bb(False, self.frame_length_tag_key)
formatter_object = digital.packet_header_ofdm(
- occupied_carriers, 1, "", "", "",
- bps_header
+ occupied_carriers=occupied_carriers, n_syms=1,
+ bits_per_sym=self.bps_header
)
- header_gen = digital.packet_headergenerator_bb(formatter_object.base())
+ header_gen = digital.packet_headergenerator_bb(formatter_object.base(), self.frame_length_tag_key)
header_payload_mux = blocks.tagged_stream_mux(gr.sizeof_gr_complex*1, self.frame_length_tag_key)
self.connect(self, crc, header_gen, header_mod, (header_payload_mux, 0))
payload_constellation = _get_constellation(bps_payload)
diff --git a/gr-digital/python/qa_ofdm_txrx.py b/gr-digital/python/qa_ofdm_txrx.py
index 778f03f515..ad5a996b2c 100755
--- a/gr-digital/python/qa_ofdm_txrx.py
+++ b/gr-digital/python/qa_ofdm_txrx.py
@@ -21,8 +21,11 @@
#
import numpy
+import random
from gnuradio import gr, gr_unittest
-import digital_swig
+import digital_swig as digital
+from ofdm_txrx import ofdm_tx, ofdm_rx
+from utils import tagged_streams
class test_ofdm_txrx (gr_unittest.TestCase):
diff --git a/gr-digital/python/qa_packet_headergenerator_bb.py b/gr-digital/python/qa_packet_headergenerator_bb.py
index 1aeaa86063..11f6ebfe79 100755
--- a/gr-digital/python/qa_packet_headergenerator_bb.py
+++ b/gr-digital/python/qa_packet_headergenerator_bb.py
@@ -109,7 +109,7 @@ class qa_packet_headergenerator_bb (gr_unittest.TestCase):
tag3.value = pmt.pmt_from_long(4)
src = gr.vector_source_b(data, False, 1, (tag1, tag2, tag3))
formatter_object = digital.packet_header_default(12, tagname)
- header = digital.packet_headergenerator_bb(formatter_object.formatter())
+ header = digital.packet_headergenerator_bb(formatter_object.formatter(), tagname)
sink = gr.vector_sink_b()
self.tb.connect(src, header, sink)
self.tb.run()
@@ -141,7 +141,7 @@ class qa_packet_headergenerator_bb (gr_unittest.TestCase):
formatter_object = digital.packet_header_ofdm(occupied_carriers, 1, tagname)
self.assertEqual(formatter_object.header_len(), 6)
self.assertEqual(pmt.pmt_symbol_to_string(formatter_object.len_tag_key()), tagname)
- header = digital.packet_headergenerator_bb(formatter_object.formatter())
+ header = digital.packet_headergenerator_bb(formatter_object.formatter(), tagname)
sink = gr.vector_sink_b()
self.tb.connect(src, header, sink)
self.tb.run()
diff --git a/gr-utils/src/python/modtool/templates.py b/gr-utils/src/python/modtool/templates.py
index 289903348d..4f4469951c 100644
--- a/gr-utils/src/python/modtool/templates.py
+++ b/gr-utils/src/python/modtool/templates.py
@@ -506,7 +506,7 @@ Templates['grc_xml'] = '''<?xml version="1.0"?>
* optional (set to 1 for optional inputs) -->
<sink>
<name>in</name>
- <type><!-- e.g. int, real, complex, byte, short, xxx_vector, ...--></type>
+ <type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
</sink>
<!-- Make one 'source' node per output. Sub-nodes:
@@ -516,7 +516,7 @@ Templates['grc_xml'] = '''<?xml version="1.0"?>
* optional (set to 1 for optional inputs) -->
<source>
<name>out</name>
- <type><!-- e.g. int, real, complex, byte, short, xxx_vector, ...--></type>
+ <type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
</source>
</block>
'''
diff --git a/grc/blocks/gr_vector_source_x.xml b/grc/blocks/gr_vector_source_x.xml
index 992a6a787d..b3e595a453 100644
--- a/grc/blocks/gr_vector_source_x.xml
+++ b/grc/blocks/gr_vector_source_x.xml
@@ -48,7 +48,7 @@
<param>
<name>Vector</name>
<key>vector</key>
- <value>0, 0, 0</value>
+ <value>[0, 0, 0]</value>
<type>raw</type>
</param>
<param>
diff --git a/grc/python/Param.py b/grc/python/Param.py
index 2caca48024..3236441a86 100644
--- a/grc/python/Param.py
+++ b/grc/python/Param.py
@@ -94,8 +94,8 @@ class Param(_Param, _GUIParam):
def get_types(self): return (
'raw', 'enum',
- 'complex', 'real', 'int',
- 'complex_vector', 'real_vector', 'int_vector',
+ 'complex', 'real', 'float', 'int',
+ 'complex_vector', 'real_vector', 'float_vector', 'int_vector',
'hex', 'string', 'bool',
'file_open', 'file_save',
'id', 'stream_id',
@@ -174,10 +174,12 @@ class Param(_Param, _GUIParam):
#number types
'complex': Constants.COMPLEX_COLOR_SPEC,
'real': Constants.FLOAT_COLOR_SPEC,
+ 'float': Constants.FLOAT_COLOR_SPEC,
'int': Constants.INT_COLOR_SPEC,
#vector types
'complex_vector': Constants.COMPLEX_VECTOR_COLOR_SPEC,
'real_vector': Constants.FLOAT_VECTOR_COLOR_SPEC,
+ 'float_vector': Constants.FLOAT_VECTOR_COLOR_SPEC,
'int_vector': Constants.INT_VECTOR_COLOR_SPEC,
#special
'bool': Constants.INT_COLOR_SPEC,
@@ -257,7 +259,7 @@ class Param(_Param, _GUIParam):
#########################
# Numeric Types
#########################
- elif t in ('raw', 'complex', 'real', 'int', 'hex', 'bool'):
+ elif t in ('raw', 'complex', 'real', 'float', 'int', 'hex', 'bool'):
#raise exception if python cannot evaluate this value
try: e = self.get_parent().get_parent().evaluate(v)
except Exception, e: raise Exception, 'Value "%s" cannot be evaluated:\n%s'%(v, e)
@@ -267,9 +269,9 @@ class Param(_Param, _GUIParam):
if not isinstance(e, COMPLEX_TYPES):
raise Exception, 'Expression "%s" is invalid for type complex.'%str(e)
return e
- elif t == 'real':
+ elif t == 'real' or t == 'float':
if not isinstance(e, REAL_TYPES):
- raise Exception, 'Expression "%s" is invalid for type real.'%str(e)
+ raise Exception, 'Expression "%s" is invalid for type float.'%str(e)
return e
elif t == 'int':
if not isinstance(e, INT_TYPES):
@@ -284,7 +286,7 @@ class Param(_Param, _GUIParam):
#########################
# Numeric Vector Types
#########################
- elif t in ('complex_vector', 'real_vector', 'int_vector'):
+ elif t in ('complex_vector', 'real_vector', 'float_vector', 'int_vector'):
if not v: v = '()' #turn a blank string into an empty list, so it will eval
#raise exception if python cannot evaluate this value
try: e = self.get_parent().get_parent().evaluate(v)
@@ -297,12 +299,12 @@ class Param(_Param, _GUIParam):
if not all([isinstance(ei, COMPLEX_TYPES) for ei in e]):
raise Exception, 'Expression "%s" is invalid for type complex vector.'%str(e)
return e
- elif t == 'real_vector':
+ elif t == 'real_vector' or t == 'float_vector':
if not isinstance(e, VECTOR_TYPES):
self._lisitify_flag = True
e = [e]
if not all([isinstance(ei, REAL_TYPES) for ei in e]):
- raise Exception, 'Expression "%s" is invalid for type real vector.'%str(e)
+ raise Exception, 'Expression "%s" is invalid for type float vector.'%str(e)
return e
elif t == 'int_vector':
if not isinstance(e, VECTOR_TYPES):
@@ -443,7 +445,7 @@ class Param(_Param, _GUIParam):
if not self._init: self.evaluate()
if self._stringify_flag: return '"%s"'%v.replace('"', '\"')
else: return v
- elif t in ('complex_vector', 'real_vector', 'int_vector'): #vector types
+ elif t in ('complex_vector', 'real_vector', 'float_vector', 'int_vector'): #vector types
if not self._init: self.evaluate()
if self._lisitify_flag: return '(%s, )'%v
else: return '(%s)'%v
diff --git a/grc/python/Port.py b/grc/python/Port.py
index 738a33ba72..9e9f5676ef 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -90,6 +90,7 @@ class Port(_Port, _GUIPort):
"""
self._n = n
if n['type'] == 'msg': n['key'] = 'msg'
+ if n['type'] == 'message': n['key'] = n['name']
if dir == 'source' and not n.find('key'):
n['key'] = str(block._source_count)
block._source_count += 1
diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h
index 60832675cd..10c6c38ccc 100644
--- a/gruel/src/include/gruel/thread.h
+++ b/gruel/src/include/gruel/thread.h
@@ -75,7 +75,7 @@ namespace gruel {
* support in this way since 10.5 is not what we want or can use in
* this fashion).
*/
- GRUEL_API void thread_bind_to_processor(const std::vector<unsigned int> &mask);
+ GRUEL_API void thread_bind_to_processor(const std::vector<int> &mask);
/*! \brief Convineince function to bind the current thread to a single core.
*
@@ -87,7 +87,7 @@ namespace gruel {
* support in this way since 10.5 is not what we want or can use in
* this fashion).
*/
- GRUEL_API void thread_bind_to_processor(unsigned int n);
+ GRUEL_API void thread_bind_to_processor(int n);
/*! \brief Bind a thread to a set of cores.
*
@@ -101,7 +101,7 @@ namespace gruel {
* support in this way since 10.5 is not what we want or can use in
* this fashion).
*/
- GRUEL_API void thread_bind_to_processor(gr_thread_t thread, const std::vector<unsigned int> &mask);
+ GRUEL_API void thread_bind_to_processor(gr_thread_t thread, const std::vector<int> &mask);
/*! \brief Convineince function to bind the a thread to a single core.
diff --git a/gruel/src/lib/thread.cc b/gruel/src/lib/thread.cc
index 8ebe822fbf..a5116b687b 100644
--- a/gruel/src/lib/thread.cc
+++ b/gruel/src/lib/thread.cc
@@ -38,33 +38,33 @@ namespace gruel {
}
void
- thread_bind_to_processor(unsigned int n)
+ thread_bind_to_processor(int n)
{
- std::vector<unsigned int> mask(1, n);
+ std::vector<int> mask(1, n);
thread_bind_to_processor(get_current_thread_id(), mask);
}
void
- thread_bind_to_processor(const std::vector<unsigned int> &mask)
+ thread_bind_to_processor(const std::vector<int> &mask)
{
thread_bind_to_processor(get_current_thread_id(), mask);
}
void
- thread_bind_to_processor(gr_thread_t thread, unsigned int n)
+ thread_bind_to_processor(gr_thread_t thread, int n)
{
- std::vector<unsigned int> mask(1, n);
+ std::vector<int> mask(1, n);
thread_bind_to_processor(thread, mask);
}
void
- thread_bind_to_processor(gr_thread_t thread, const std::vector<unsigned int> &mask)
+ thread_bind_to_processor(gr_thread_t thread, const std::vector<int> &mask)
{
//DWORD_PTR mask = (1 << n);
DWORD_PTR dword_mask = 0;
- std::vector<unsigned int> _mask = mask;
- std::vector<unsigned int>::iterator itr;
+ std::vector<int> _mask = mask;
+ std::vector<int>::iterator itr;
for(itr = _mask.begin(); itr != _mask.end(); itr++)
dword_mask |= (1 << (*itr));
@@ -106,25 +106,25 @@ namespace gruel {
}
void
- thread_bind_to_processor(unsigned int n)
+ thread_bind_to_processor(int n)
{
// Not implemented on OSX
}
void
- thread_bind_to_processor(gr_thread_t thread, unsigned int n)
+ thread_bind_to_processor(gr_thread_t thread, int n)
{
// Not implemented on OSX
}
void
- thread_bind_to_processor(const std::vector<unsigned int> &mask)
+ thread_bind_to_processor(const std::vector<int> &mask)
{
// Not implemented on OSX
}
void
- thread_bind_to_processor(gr_thread_t thread, const std::vector<unsigned int> &mask)
+ thread_bind_to_processor(gr_thread_t thread, const std::vector<int> &mask)
{
// Not implemented on OSX
}
@@ -157,32 +157,32 @@ namespace gruel {
}
void
- thread_bind_to_processor(unsigned int n)
+ thread_bind_to_processor(int n)
{
- std::vector<unsigned int> mask(1, n);
+ std::vector<int> mask(1, n);
thread_bind_to_processor(get_current_thread_id(), mask);
}
void
- thread_bind_to_processor(const std::vector<unsigned int> &mask)
+ thread_bind_to_processor(const std::vector<int> &mask)
{
thread_bind_to_processor(get_current_thread_id(), mask);
}
void
- thread_bind_to_processor(gr_thread_t thread, unsigned int n)
+ thread_bind_to_processor(gr_thread_t thread, int n)
{
- std::vector<unsigned int> mask(1, n);
+ std::vector<int> mask(1, n);
thread_bind_to_processor(thread, mask);
}
void
- thread_bind_to_processor(gr_thread_t thread, const std::vector<unsigned int> &mask)
+ thread_bind_to_processor(gr_thread_t thread, const std::vector<int> &mask)
{
cpu_set_t set;
size_t len = sizeof(cpu_set_t);
- std::vector<unsigned int> _mask = mask;
- std::vector<unsigned int>::iterator itr;
+ std::vector<int> _mask = mask;
+ std::vector<int>::iterator itr;
CPU_ZERO(&set);
for(itr = _mask.begin(); itr != _mask.end(); itr++)