include/ccKVS/inline_util.h
static inline enum control_flow_directive check_polling_conditions(bool* multiget, uint16_t get_i, uint16_t get_num,
																   int* pull_ptr, uint16_t* qp_i, uint32_t per_qp_buf_slots, uint16_t per_qp_received_messages,
																   uint16_t wr_i, uint16_t received_messages, uint16_t wrkr_lid, uint32_t max_reqs)
{
	if ((*multiget) == true && get_i == get_num) { // check if the multiget should be over
		(*multiget) = false;
		MOD_ADD_WITH_BASE(pull_ptr[(*qp_i)], per_qp_buf_slots, 0);
		// if (wrkr_lid == 0)
		// 	hrd_green_printf("Multiget from clt %d is over wr_i %d, received messages %d, pull_ptr %d, get_num %d\n",
		// 			clt_i, wr_i, received_messages, pull_ptr[(*qp_i)],get_num );
	}
	if (WORKER_NUM_UD_QPS > 1) {
		if (per_qp_received_messages== per_qp_buf_slots && (*multiget) == false) {
			if ((*qp_i) == WORKER_NUM_UD_QPS -1 ) return break_; // all qp buffers were checked
			else MOD_ADD_WITH_BASE((*qp_i), WORKER_NUM_UD_QPS, 0);
		}
	}
	if (wr_i == WORKER_MAX_BATCH || (received_messages == max_reqs && (*multiget) == false)) {
		if (ENABLE_ASSERTIONS) {
			if ((*multiget) == true) {
				red_printf("Worker %d: wr_i = %d, received_messages %d, max reqs %d, get_i %d, get_num %d\n",
						   wrkr_lid, wr_i, received_messages, max_reqs, get_i, get_num);
				assert(false);
			}
		}
		return break_;
	}
	return no_cf_change;
}
// Check all the conditions to stop polling for remote requests, or switch qp or exit the  current multiget
Check all the conditions to stop polling for remote requests, or switch qp or exit the  current multiget
Check all the conditions to stop polling for remote requests or switch qp or exit the current multiget
static inline enum control_flow_directive check_polling_conditions(bool* multiget, uint16_t get_i, uint16_t get_num,
																   int* pull_ptr, uint16_t* qp_i, uint32_t per_qp_buf_slots, uint16_t per_qp_received_messages,
																   uint16_t wr_i, uint16_t received_messages, uint16_t wrkr_lid, uint32_t max_reqs)
{
	if ((*multiget) == true && get_i == get_num) { 
		(*multiget) = false;
		MOD_ADD_WITH_BASE(pull_ptr[(*qp_i)], per_qp_buf_slots, 0);
	}
	if (WORKER_NUM_UD_QPS > 1) {
		if (per_qp_received_messages== per_qp_buf_slots && (*multiget) == false) {
			if ((*qp_i) == WORKER_NUM_UD_QPS -1 ) return break_; 
			else MOD_ADD_WITH_BASE((*qp_i), WORKER_NUM_UD_QPS, 0);
		}
	}
	if (wr_i == WORKER_MAX_BATCH || (received_messages == max_reqs && (*multiget) == false)) {
		if (ENABLE_ASSERTIONS) {
			if ((*multiget) == true) {
				red_printf("Worker %d: wr_i = %d, received_messages %d, max reqs %d, get_i %d, get_num %d\n",
						   wrkr_lid, wr_i, received_messages, max_reqs, get_i, get_num);
				assert(false);
			}
		}
		return break_;
	}
	return no_cf_change;
}
static inline enum control_flow_directive check_polling_conditions ( bool * multiget , uint16_t get_i , uint16_t get_num , int * pull_ptr , uint16_t * qp_i , uint32_t per_qp_buf_slots , uint16_t per_qp_received_messages , uint16_t wr_i , uint16_t received_messages , uint16_t wrkr_lid , uint32_t max_reqs ) { if ( ( * multiget ) == true && get_i == get_num ) { ( * multiget ) = false ; MOD_ADD_WITH_BASE ( pull_ptr [ ( * qp_i ) ] , per_qp_buf_slots , 0 ) ; } if ( WORKER_NUM_UD_QPS > 1 ) { if ( per_qp_received_messages == per_qp_buf_slots && ( * multiget ) == false ) { if ( ( * qp_i ) == WORKER_NUM_UD_QPS - 1 ) return break_ ; else MOD_ADD_WITH_BASE ( ( * qp_i ) , WORKER_NUM_UD_QPS , 0 ) ; } } if ( wr_i == WORKER_MAX_BATCH || ( received_messages == max_reqs && ( * multiget ) == false ) ) { if ( ENABLE_ASSERTIONS ) { if ( ( * multiget ) == true ) { red_printf ( " \n " , wrkr_lid , wr_i , received_messages , max_reqs , get_i , get_num ) ; assert ( false ) ; } } return break_ ; } return no_cf_change ; }
Check all the conditions to stop polling for remote requests, or switch qp or exit the  current multiget
Check all the conditions to stop polling for remote requests or switch qp or exit the current multiget
// check if the multiget should be over // if (wrkr_lid == 0) // 	hrd_green_printf("Multiget from clt %d is over wr_i %d, received messages %d, pull_ptr %d, get_num %d\n", // 			clt_i, wr_i, received_messages, pull_ptr[(*qp_i)],get_num ); // all qp buffers were checked