include/ccKVS/inline_util.h
static inline void serve_local_reqs(uint16_t wrkr_lid, struct mica_kv* kv, struct mica_op **local_op_ptr_arr,
									struct mica_resp* local_responses)
{
	uint16_t clt_i, i;
	for (clt_i = 0; clt_i < CLIENTS_PER_MACHINE; clt_i++) {
		for (i = 0; i < LOCAL_REGIONS; i++) {
			if (local_recv_flag[wrkr_lid][clt_i][i] == 0) continue; // find a client that has filled his region
			uint16_t wrkr_offset = (clt_i * LOCAL_WINDOW) + (i * LOCAL_REGION_SIZE);
			// green_printf("Worker %d reads locals from clt %d at local region %d, offset\n", wrkr_lid, clt_i,	i, wrkr_offset );
			struct mica_resp *local_resp_arr = local_responses + wrkr_offset;
			KVS_BATCH_OP(kv, LOCAL_REGION_SIZE, &local_op_ptr_arr[wrkr_offset], local_resp_arr);
			if (ENABLE_ASSERTIONS == 1) assert(local_recv_flag[wrkr_lid][clt_i][i] == 1);
			local_recv_flag[wrkr_lid][clt_i][i] = 0;
			w_stats[wrkr_lid].locals_per_worker += LOCAL_REGION_SIZE;
		}
	}
}
//poll and serve the local requests
poll and serve the local requests
poll and serve the local requests
static inline void serve_local_reqs(uint16_t wrkr_lid, struct mica_kv* kv, struct mica_op **local_op_ptr_arr,
									struct mica_resp* local_responses)
{
	uint16_t clt_i, i;
	for (clt_i = 0; clt_i < CLIENTS_PER_MACHINE; clt_i++) {
		for (i = 0; i < LOCAL_REGIONS; i++) {
			if (local_recv_flag[wrkr_lid][clt_i][i] == 0) continue; 
			uint16_t wrkr_offset = (clt_i * LOCAL_WINDOW) + (i * LOCAL_REGION_SIZE);
			struct mica_resp *local_resp_arr = local_responses + wrkr_offset;
			KVS_BATCH_OP(kv, LOCAL_REGION_SIZE, &local_op_ptr_arr[wrkr_offset], local_resp_arr);
			if (ENABLE_ASSERTIONS == 1) assert(local_recv_flag[wrkr_lid][clt_i][i] == 1);
			local_recv_flag[wrkr_lid][clt_i][i] = 0;
			w_stats[wrkr_lid].locals_per_worker += LOCAL_REGION_SIZE;
		}
	}
}
static inline void serve_local_reqs ( uint16_t wrkr_lid , struct mica_kv * kv , struct mica_op * * local_op_ptr_arr , struct mica_resp * local_responses ) { uint16_t clt_i , i ; for ( clt_i = 0 ; clt_i < CLIENTS_PER_MACHINE ; clt_i ++ ) { for ( i = 0 ; i < LOCAL_REGIONS ; i ++ ) { if ( local_recv_flag [ wrkr_lid ] [ clt_i ] [ i ] == 0 ) continue ; uint16_t wrkr_offset = ( clt_i * LOCAL_WINDOW ) + ( i * LOCAL_REGION_SIZE ) ; struct mica_resp * local_resp_arr = local_responses + wrkr_offset ; KVS_BATCH_OP ( kv , LOCAL_REGION_SIZE , & local_op_ptr_arr [ wrkr_offset ] , local_resp_arr ) ; if ( ENABLE_ASSERTIONS == 1 ) assert ( local_recv_flag [ wrkr_lid ] [ clt_i ] [ i ] == 1 ) ; local_recv_flag [ wrkr_lid ] [ clt_i ] [ i ] = 0 ; w_stats [ wrkr_lid ] . locals_per_worker += LOCAL_REGION_SIZE ; } } }
poll and serve the local requests
poll and serve the local requests
// find a client that has filled his region // green_printf("Worker %d reads locals from clt %d at local region %d, offset\n", wrkr_lid, clt_i,	i, wrkr_offset );