How to use a single-threaded scheduler


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

On older gnuradio releases there was an environment variable to set so
that it will switch to single threaded scheduler. Cannot remember the
name, though.

Bogdan

On Monday, March 31, 2014 7:35 PM, Tommy T. II [email protected]
wrote:

Dear list,

Is there any way to use the single-threaded scheduler over the
thread-per-block scheduler without rebuilding Gnu Radio?

Sincerely,

Tommy James Tracy II
Ph.D Student
High Performance Low Power Lab
University of Virginia
Phone: 913-775-2241


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Interesting results at least for situations when the queue is
before/after FFT. It is like the queue is starving the FFT. You could
try to see what is the actual data that the scheduler passes to the FFT
and the other blocks in each cases. From my experience, the smaller the
chunks are the slower the flowgraph is (I guess an obvious discovery :slight_smile:
)

Bogdan

On Monday, March 31, 2014 10:07 PM, Marcus M. [email protected]
wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That environment variable is “GR_SCHEDULER”:

git grep getenv

gnuradio-runtime/lib/top_block_impl.cc:char *v = getenv(“GR_SCHEDULER”);

and you need to set it to “STS”:

export GR_SCHEDULER=STS
./my_gr_flowgraph.py

Greetings,
Marcus

On 31.03.2014 18:49, Bogdan D. wrote:

On Monday, March 31, 2014 7:35 PM, Tommy T. II
University of Virginia Phone: 913-775-2241

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTObyIAAoJEBQ6EdjyzlHt/xMIAJ2i7VuA1p/u4o5zrChBWWzw
PHRplQArGVZKev1B1zSjlUI8l7q3RnMhzNJmp05auDNRM5GwsBreJ/4S8I8LZhHP
krILWrj+bPZ2QPjSy30iomIP/u7NoWZpOFXQWxt+egVd7WpEDyQVFEeN/5El22p9
iD3prgkSHAZ2YjSpPphxcGH251PSQPj5in3x0woE191AddaREXxbjx2YieZ6xupQ
k5tQuEkUU+HqpzAfhbNVTumNFHQrx4BRGXS4UYzpqFLCLWAGHsvg4xfm98MGhOBi
3zjXYTf1pkciivKcZDQHCci8/7kDWuDc1b/ngUCB1xsF795QdgP/lOYRD+6IJBQ=
=y96K
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That environment variable is “GR_SCHEDULER”:

git grep getenv

gnuradio-runtime/lib/top_block_impl.cc:char *v = getenv(“GR_SCHEDULER”);

and you need to set it to “STS”:

export GR_SCHEDULER=STS
./my_gr_flowgraph.py

Greetings,
Marcus

On 31.03.2014 18:49, Bogdan D. wrote:

On Monday, March 31, 2014 7:35 PM, Tommy T. II
University of Virginia Phone: 913-775-2241

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTObyIAAoJEBQ6EdjyzlHt/xMIAJ2i7VuA1p/u4o5zrChBWWzw
PHRplQArGVZKev1B1zSjlUI8l7q3RnMhzNJmp05auDNRM5GwsBreJ/4S8I8LZhHP
krILWrj+bPZ2QPjSy30iomIP/u7NoWZpOFXQWxt+egVd7WpEDyQVFEeN/5El22p9
iD3prgkSHAZ2YjSpPphxcGH251PSQPj5in3x0woE191AddaREXxbjx2YieZ6xupQ
k5tQuEkUU+HqpzAfhbNVTumNFHQrx4BRGXS4UYzpqFLCLWAGHsvg4xfm98MGhOBi
3zjXYTf1pkciivKcZDQHCci8/7kDWuDc1b/ngUCB1xsF795QdgP/lOYRD+6IJBQ=
=y96K
-----END PGP SIGNATURE-----

On 03/31/2014 09:05 PM, Marcus M. wrote:

./my_gr_flowgraph.py
Please note that the STS hasn’t been touched in a while, whereas the TPB
scheduler has had significant changes. Tags, in particular, won’t work
with the STS.

M

Hi!

--------------------> RetardoSat:
1.Come three samples (method work)

  • X: X position of receiver.
  • Y: Y position of receiver.
  • Z: Z position of receiver.
  • ClK: seconds.
  1. With Kepler paremeters calculates the satellite position, the
    distance between the satellite and the receiver and the signal delay.

  2. Send to the output (t) the calculated delay.

float out = (float)output_items[0];
const float *inx = (const float *) input_items[0];
const float *iny = (const float *) input_items[1];
const float *inz = (const float *) input_items[2];
const float *inTOW = (const float *) input_items[3];

     for(int i=0;i<noutput_items;++i){
         ...
         ...

}

--------------------> Reloj:

*Precision = tiempo inicial
**Tasa = sample rate

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

namespace gr {
namespace howto {

 reloj_ff::sptr
 reloj_ff::make(int tasa, int precision)
 {
   return gnuradio::get_initial_sptr
     (new reloj_ff_impl(tasa, precision));
 }

 /*
  * The private constructor
  */
 reloj_ff_impl::reloj_ff_impl(int tasa, int precision)
   : gr::block("reloj_ff",
       gr::io_signature::make(1,1,sizeof(float)),
       gr::io_signature::make(1, 1, sizeof(float)))
 {
     this->d_tasa=tasa;
     this->d_precision=(float)precision;
     this->posicion=0;
 }

 /*
  * Our virtual destructor.
  */
 reloj_ff_impl::~reloj_ff_impl()
 {
 }

 void
 reloj_ff_impl::forecast (int noutput_items, gr_vector_int

&ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}

 int
 reloj_ff_impl::general_work (int noutput_items,
                    gr_vector_int &ninput_items,
                    gr_vector_const_void_star &input_items,
                    gr_vector_void_star &output_items)
 {
float *out = (float*)output_items[0];
const float *in = (const float *) input_items[0];

     for(int i=0;i<noutput_items;++i){
         if(posicion!=d_tasa){
             out[i]=d_precision;
             ++posicion;
         }
         else{
             d_precision=d_precision+1;
             posicion=0;
             out[i]=d_precision;
         }
     }

     return noutput_items;
 }

} /* namespace howto /
} /
namespace gr */

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#ifndef INCLUDED_HOWTO_RELOJ_FF_IMPL_H
#define INCLUDED_HOWTO_RELOJ_FF_IMPL_H

#include <howto/reloj_ff.h>

namespace gr {
namespace howto {

 class reloj_ff_impl : public reloj_ff
 {
  private:
   // Nothing to declare in this block.

  public:
   reloj_ff_impl(int tasa, int precision);
   ~reloj_ff_impl();

     int d_tasa;
     float d_precision;
     int posicion;

   // Where all the action really happens
   void forecast (int noutput_items, gr_vector_int

&ninput_items_required);

   int general_work(int noutput_items,
       gr_vector_int &ninput_items,
       gr_vector_const_void_star &input_items,
       gr_vector_void_star &output_items);
 };

} // namespace howto
} // namespace gr

#endif /* INCLUDED_HOWTO_RELOJ_FF_IMPL_H */

:wink: