void SocketClientInitializer::init_itac_comm() { #ifdef CNC_WITH_ITAC VT_FUNC_I( "Dist::Socket::init_itac_comm" ); UINT32 nBytes; PAL_SockRes_t ret; // Receive client ranks (local and global): int itacRank[2]; ret = PAL_Recv( HERE, m_channel.m_socketCommData[0].m_recvSocket, itacRank, 2 * sizeof( int ), &nBytes, -1, false ); CNC_ASSERT( ret == PAL_SOCK_OK && nBytes == sizeof( itacRank ) ); int localRank = itacRank[0]; int globalRank = itacRank[1]; // Define process name in ITAC tracefile: char clientName[128]; sprintf( clientName, "sClient%d", localRank ); // Determine VTcs contact string: const char* vtContact; VT_CLIENT_INIT( globalRank, NULL, &vtContact ); // Send VTcs contact string to host: int length = (int)strlen( vtContact ) + 1; ret = PAL_Send( HERE, m_channel.m_socketCommData[0].m_sendSocket, &length, sizeof( int ), &nBytes, -1 ); CNC_ASSERT( ret == PAL_SOCK_OK && nBytes == sizeof( length ) ); ret = PAL_Send( HERE, m_channel.m_socketCommData[0].m_sendSocket, vtContact, length, &nBytes, -1 ); CNC_ASSERT( ret == PAL_SOCK_OK && nBytes == length ); // Construct ITAC thread name: char thrName[64]; sprintf( thrName, "RECV%d", m_channel.localId() ); // Initialize VTcs: VT_INIT(); VT_THREAD_NAME( thrName ); #endif // CNC_WITH_ITAC }
static inline void blink_thread__init(void) { VT_INIT(blink_thread, blink_thread__ip); }
/** Starts the thread */ void onewire__thread__start(void) { VT_INIT(onewire__thread, onewire__thread__ip); onewire__thread__alive__set(true); timer0__conf__set(ONEWIRE__BIT_SPAN_TIMER__FAST_CONF); }
void temperature_reader__thread__start(void) { VT_INIT(temperature_reader__thread, temperature_reader__thread__ip); timer0__conf__set(TIMER0_CONF_PRESCALER_1024|TIMER0_CONF_WGM_NORMAL); }
void start_bit_detected(void) { int0__stop(); VT_INIT(soft_usart__rx__thread, soft_usart__rx__thread__ip); soft_usart__timer__reset(); soft_usart__timer__start(); }