Agora
1.2.0
Agora project
|
Go to the documentation of this file.
46 MacSender(
Config* cfg, std::string& data_filename,
size_t mac_packet_length,
47 size_t mac_payload_max_length,
size_t packets_per_frame,
48 std::string server_address,
size_t server_rx_port,
50 size_t core_offset = 30,
size_t worker_thread_num = 1,
51 size_t update_thread_num = 1,
size_t frame_duration_us = 0,
52 size_t inter_frame_delay = 0,
size_t enable_slow_start = 1,
53 bool create_thread_for_master =
false);
133 #endif // MAC_SENDER_H_
Declaration file for the MacDataReceiver interface class.
uint64_t GetTicksForFrame(size_t frame_id) const
Definition: mac_sender.cc:434
byte
Definition: core.h:388
Definition: concurrentqueue.h:630
Declaration file for the FileReceiver class.
size_t UeAntNum() const
Definition: config.h:41
virtual size_t Load(unsigned char *destination, size_t requested_bytes)=0
static constexpr bool kDebugSenderReceiver
Definition: symbols.h:354
void PinToCoreWithOffset(ThreadType thread_type, size_t core_offset, size_t thread_id, bool allow_reuse, bool verbose)
Definition: utils.cc:157
std::vector< std::thread > threads_
Definition: mac_sender.h:118
size_t SampsPerSymbol() const
Definition: config.h:234
double Rate() const
Definition: config.h:58
const size_t update_thread_num_
Definition: mac_sender.h:85
size_t try_dequeue_bulk_from_producer(producer_token_t const &producer, It itemFirst, size_t max)
Definition: concurrentqueue.h:1292
double * frame_start_
Definition: mac_sender.h:115
const double freq_ghz_
Definition: mac_sender.h:82
static constexpr size_t kBufferInit
Definition: mac_sender.cc:25
static constexpr size_t kFrameLoadAdvance
Definition: mac_sender.cc:24
static constexpr size_t kFrameWnd
Definition: symbols.h:18
void * WorkerThread(size_t tid)
Definition: mac_sender.cc:311
void * PaddedAlignedAlloc(Alignment_t alignment, size_t size)
Definition: memory_manage.cc:15
void CreateWorkerThreads(size_t num_workers)
Definition: mac_sender.cc:446
static double GetTimeUs()
Definition: gettime.h:14
double * frame_end_
Definition: mac_sender.h:116
const bool has_master_thread_
Definition: mac_sender.h:130
size_t GetMaxSymbolId() const
void ScheduleFrame(size_t frame)
Definition: mac_sender.cc:202
const uint64_t ticks_inter_frame_
Definition: mac_sender.h:105
std::vector< moodycamel::ConcurrentQueue< size_t > > data_update_queue_
Definition: mac_sender.h:113
Declaration file for the VideoReceiver class.
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
#define TOSTRING(x)
Definition: symbols.h:14
const FrameStats & Frame() const
Definition: config.h:340
static double CyclesToUs(size_t cycles, double freq_ghz)
Definition: gettime.h:97
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
uint16_t ue_id_
Definition: message.h:37
const size_t core_offset_
Definition: mac_sender.h:90
static gen_tag_t FrmSymUe(size_t frame_id, size_t symbol_id, size_t ue_id)
Definition: message.h:84
const size_t enable_slow_start_
Definition: mac_sender.h:86
filename
Definition: parse_all_dl.m:14
static std::atomic< size_t > num_workers_ready_atomic(0)
Definition: mac_sender.h:19
size_t mac_payload_max_length_
Definition: mac_sender.h:125
const size_t inter_frame_delay_
Definition: mac_sender.h:92
static constexpr size_t kMessageQueueSize
Definition: mac_sender.h:22
Declaration file for the simple mac sender class.
uint16_t ant_id_
Definition: message.h:38
Self defined functions for message storage and passing.
void Free()
Definition: memory_manage.h:84
std::string data_filename_
Definition: mac_sender.h:122
static gen_tag_t FrmSymAnt(size_t frame_id, size_t symbol_id, size_t ant_id)
Definition: message.h:106
static constexpr uint16_t kMacSendFromPort
Definition: mac_sender.cc:20
for i
Definition: generate_data.m:107
static constexpr bool kDebugPrintSender
Definition: mac_sender.cc:23
bool enqueue(T const &item)
Definition: concurrentqueue.h:974
static constexpr size_t kSlowStartThresh1
Definition: mac_sender.cc:28
size_t mac_packet_length_
Definition: mac_sender.h:124
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
static size_t Rdtsc()
Return the TSC.
Definition: gettime.h:25
static constexpr size_t kDequeueBulkSize
Definition: mac_sender.h:21
uint64_t ticks_wnd2_
Definition: mac_sender.h:101
void LoadFrame(size_t frame)
Definition: mac_sender.cc:195
static constexpr size_t kSlowStartMulStage2
Definition: mac_sender.cc:31
void * DataUpdateThread(size_t tid, size_t num_data_sources)
Definition: mac_sender.cc:453
uint64_t ticks_all_
Definition: mac_sender.h:96
size_t tag_
Definition: message.h:43
static constexpr size_t kVideoStreamRxPort
Definition: video_receiver.h:20
end start
Definition: inspect_agora_results.m:95
Table< uint8_t > tx_buffers_
Definition: mac_sender.h:120
size_t FramesToTest() const
Definition: config.h:309
moodycamel::ConcurrentQueue< size_t > send_queue_
Definition: mac_sender.h:107
Config * cfg_
Definition: mac_sender.h:81
void Send(const std::string &rem_hostname, uint16_t rem_port, const std::byte *msg, size_t len)
Send one UDP packet to a remote server. The client caches the the remote server's addrinfo after reso...
Definition: udp_client.h:50
static constexpr size_t kNumStatsFrames
Definition: symbols.h:300
The MacDataReceiver interface class.
Definition: mac_data_receiver.h:13
bool enqueue_bulk(It itemFirst, size_t count)
Definition: concurrentqueue.h:1016
void WriteStatsToFile(size_t tx_frame_count) const
Definition: mac_sender.cc:554
size_t packets_per_frame_
Definition: mac_sender.h:126
const size_t worker_thread_num_
Definition: mac_sender.h:84
static double MeasureRdtscFreq()
Definition: gettime.h:51
function[avg_proc_duration, std_proc_duration]
Definition: parse_dl_file.m:1
void StartTxfromMain(double *in_frame_start, double *in_frame_end)
Definition: mac_sender.cc:188
~MacSender()
Definition: mac_sender.cc:159
size_t frame_duration_us_
Definition: mac_sender.h:91
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
static const std::string kMacSendFromAddress
Definition: mac_sender.cc:19
void InterruptHandler(int)
Definition: mac_sender.cc:39
const std::string server_address_
Definition: mac_sender.h:127
static constexpr size_t kTxBufferElementAlignment
Definition: mac_sender.cc:26
Definition: json.hpp:5213
size_t tx_buffer_pkt_offset_
Definition: mac_sender.h:121
std::function< size_t(size_t)> get_data_symbol_id_
Definition: mac_sender.h:129
#define AGORA_LOG_FRAME(...)
Definition: logger.h:72
void Malloc(size_t dim1, size_t dim2, Agora_memory::Alignment_t alignment)
Definition: memory_manage.h:37
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
size_t TagToTxBuffersIndex(gen_tag_t tag) const
Definition: mac_sender.cc:50
#define AGORA_LOG_WARN(...)
Definition: logger.h:53
void * MasterThread(size_t tid)
Definition: mac_sender.cc:218
static gen_tag_t FrmSym(size_t frame_id, size_t symbol_id)
Definition: message.h:128
static constexpr size_t kMasterThreadId
Definition: mac_sender.cc:32
static constexpr size_t kSlowStartThresh2
Definition: mac_sender.cc:29
Declaration file for the configuration class which importants json configuration values into class va...
MacSender(Config *cfg, std::string &data_filename, size_t mac_packet_length, size_t mac_payload_max_length, size_t packets_per_frame, std::string server_address, size_t server_rx_port, std::function< size_t(size_t)> get_data_symbol_id, size_t core_offset=30, size_t worker_thread_num=1, size_t update_thread_num=1, size_t frame_duration_us=0, size_t inter_frame_delay=0, size_t enable_slow_start=1, bool create_thread_for_master=false)
Create and optionally start a Sender Client that sends data packets to a agora mac interface.
Definition: mac_sender.cc:56
bool try_dequeue(U &item)
Definition: concurrentqueue.h:1104
Definition: message.h:274
void DelayTicks(uint64_t start, uint64_t ticks)
Definition: mac_sender.cc:44
Definition: udp_client.h:13
static std::atomic< bool > keep_running(true)
moodycamel::ProducerToken ** task_ptok_
Definition: mac_sender.h:111
size_t PacketLength() const
Definition: config.h:238
moodycamel::ConcurrentQueue< size_t > completion_queue_
Definition: mac_sender.h:109
uint32_t frame_id_
Definition: message.h:32
uint64_t ticks_wnd1_
Definition: mac_sender.h:100
void UpdateTxBuffer(MacDataReceiver *data_source, gen_tag_t tag)
Definition: mac_sender.cc:523
static constexpr size_t kSlowStartMulStage1
Definition: mac_sender.cc:30
void StartTx()
Definition: mac_sender.cc:175
static constexpr bool kDebugPrintPerFrameDone
Definition: symbols.h:196
const double ticks_per_usec_
Definition: mac_sender.h:83
size_t NumTotalSyms() const
Definition: framestats.cc:93
const size_t server_rx_port_
Definition: mac_sender.h:128