BurstFS_Server/burstfs_request_manager.c
int rm_pack_send_requests(char *req_msg_buf,\
			send_msg_t *send_metas, int req_num,\
				long *tot_sz) {

	/* tot_sz records the aggregate data size
	 * requested in this transfer */
	char *ptr = req_msg_buf;

	/*send format: cmd, req_num*/
	int cmd = XFER_COMM_DATA;
	memcpy(ptr, &cmd, sizeof(int));
	memcpy(ptr + sizeof(int), &(req_num),\
			sizeof(int));

	long send_size = 0;
	ptr += 2 * sizeof(int);

	int i;
	for (i = 0; i < req_num; i++) {
		send_size += send_metas[i].length;
		memcpy(ptr, &(send_metas[i]), sizeof(send_msg_t));
		ptr += sizeof(send_msg_t);

	}

	/*note: copy tot_size*/
	(*tot_sz) += send_size;

	return (int)(ptr - req_msg_buf);
}
/**
* pack the the requests to be sent to the same
* delegator.
* ToDo: pack and send multiple rounds if the
* total request sizes is larger than REQ_BUF_LEN
* @param rank: source rank that sends the requests
* @param req_msg_buf: request buffer
* @param req_num: number of read requests
* @param *tot_sz: the total data size to read in these
*  packed read requests
* @return success/error code
*/
pack the the requests to be sent to the same
delegator.
ToDo: pack and send multiple rounds if the
total request sizes is larger than REQ_BUF_LEN
pack the the requests to be sent to the same delegator . ToDo : pack and send multiple rounds if the total request sizes is larger than REQ_BUF_LEN
int rm_pack_send_requests(char *req_msg_buf,\
			send_msg_t *send_metas, int req_num,\
				long *tot_sz) {
	char *ptr = req_msg_buf;
	int cmd = XFER_COMM_DATA;
	memcpy(ptr, &cmd, sizeof(int));
	memcpy(ptr + sizeof(int), &(req_num),\
			sizeof(int));
	long send_size = 0;
	ptr += 2 * sizeof(int);
	int i;
	for (i = 0; i < req_num; i++) {
		send_size += send_metas[i].length;
		memcpy(ptr, &(send_metas[i]), sizeof(send_msg_t));
		ptr += sizeof(send_msg_t);
	}
	(*tot_sz) += send_size;
	return (int)(ptr - req_msg_buf);
}
int rm_pack_send_requests ( char * req_msg_buf , send_msg_t * send_metas , int req_num , long * tot_sz ) { char * ptr = req_msg_buf ; int cmd = XFER_COMM_DATA ; memcpy ( ptr , & cmd , sizeof ( int ) ) ; memcpy ( ptr + sizeof ( int ) , & ( req_num ) , sizeof ( int ) ) ; long send_size = 0 ; ptr += 2 * sizeof ( int ) ; int i ; for ( i = 0 ; i < req_num ; i ++ ) { send_size += send_metas [ i ] . length ; memcpy ( ptr , & ( send_metas [ i ] ) , sizeof ( send_msg_t ) ) ; ptr += sizeof ( send_msg_t ) ; } ( * tot_sz ) += send_size ; return ( int ) ( ptr - req_msg_buf ) ; }
pack the the requests to be sent to the same
delegator.
pack the the requests to be sent to the same delegator .
/* tot_sz records the aggregate data size
	 * requested in this transfer */ /*send format: cmd, req_num*/ /*note: copy tot_size*/