Commit 1b7e25b4 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

fixed to match API changes in Mercury

parent 2002d1b9
......@@ -607,7 +607,7 @@ na_tag_t mona_msg_get_max_tag(mona_instance_t mona);
*
* \return valid operation ID or NA_OP_ID_NULL
*/
na_op_id_t mona_op_create(mona_instance_t mona);
na_op_id_t* mona_op_create(mona_instance_t mona);
/**
* Destroy operation ID created with mona_op_create().
......@@ -620,7 +620,7 @@ na_op_id_t mona_op_create(mona_instance_t mona);
*/
na_return_t mona_op_destroy(
mona_instance_t mona,
na_op_id_t op_id);
na_op_id_t* op_id);
/**
* Allocate buf_size bytes and return a pointer to the allocated memory.
* If size is 0, mona_msg_buf_alloc() returns NULL. The plugin_data output
......@@ -1027,32 +1027,6 @@ na_return_t mona_mem_deregister(
mona_instance_t mona,
na_mem_handle_t mem_handle);
/**
* Expose memory for RMA operations.
* Memory pieces must be registered before one-sided transfers can be
* initiated.
*
* \param mona [IN/OUT] Mona instance
* \param mem_handle [IN] pointer to abstract memory handle
*
* \return NA_SUCCESS or corresponding NA error code
*/
na_return_t mona_mem_publish(
mona_instance_t mona,
na_mem_handle_t mem_handle);
/**
* Unpublish memory.
*
* \param mona [IN/OUT] Mona instance
* \param mem_handle [IN] abstract memory handle
*
* \return NA_SUCCESS or corresponding NA error code
*/
na_return_t mona_mem_unpublish(
mona_instance_t mona,
na_mem_handle_t mem_handle);
/**
* Get size required to serialize handle.
*
......@@ -1246,7 +1220,7 @@ na_bool_t mona_poll_try_wait(mona_instance_t mona);
*/
na_return_t mona_cancel(
mona_instance_t mona,
na_op_id_t op_id);
na_op_id_t* op_id);
/**
* Convert error return code to string (null terminated).
......
......@@ -11,7 +11,7 @@
typedef struct cached_op_id* cached_op_id_t;
typedef struct cached_op_id {
na_op_id_t op_id;
na_op_id_t* op_id;
cached_op_id_t next;
} cached_op_id;
......@@ -88,7 +88,7 @@ static inline cached_op_id_t get_op_id_from_cache(mona_instance_t mona)
mona->op_id_cache = id->next;
id->next = NULL;
} else {
na_op_id_t op_id = NA_Op_create(mona->na_class);
na_op_id_t* op_id = NA_Op_create(mona->na_class);
id = (cached_op_id_t)calloc(1, sizeof(*id));
id->op_id = op_id;
}
......
......@@ -388,14 +388,14 @@ na_tag_t mona_msg_get_max_tag(mona_instance_t mona)
// Mona operation logic
// ------------------------------------------------------------------------------------
na_op_id_t mona_op_create(mona_instance_t mona)
na_op_id_t* mona_op_create(mona_instance_t mona)
{
return NA_Op_create(mona->na_class);
}
na_return_t mona_op_destroy(
mona_instance_t mona,
na_op_id_t op_id)
na_op_id_t* op_id)
{
return NA_Op_destroy(mona->na_class, op_id);
}
......@@ -591,8 +591,8 @@ na_return_t mona_send_nc(
} else {
struct na_segment* segments = alloca(sizeof(*segments)*count);
for(i = 0; i < count; i++) {
segments[i].address = (na_ptr_t)buffers[i];
segments[i].size = buf_sizes[i];
segments[i].base = (na_ptr_t)buffers[i];
segments[i].len = buf_sizes[i];
}
na_ret = mona_mem_handle_create_segments(mona, segments, count, NA_MEM_READ_ONLY, &mem_handle);
}
......@@ -728,11 +728,11 @@ na_return_t mona_send_mem(
na_size_t ack_msg_size = mona_msg_get_unexpected_header_size(mona) + 1;
mona_request_t ack_req = MONA_REQUEST_NULL;
cached_op_id_t ack_cache_id = get_op_id_from_cache(mona);
na_op_id_t ack_op_id = ack_cache_id->op_id;
na_op_id_t* ack_op_id = ack_cache_id->op_id;
// Issue non-blocking receive for ACK
na_ret = mona_msg_irecv_expected(mona, ack_msg->buffer, ack_msg_size,
ack_msg->plugin_data, dest, dest_id, tag, &ack_op_id, &ack_req);
ack_msg->plugin_data, dest, dest_id, tag, ack_op_id, &ack_req);
if(na_ret != NA_SUCCESS) {
return_op_id_to_cache(mona, ack_cache_id);
goto finish;
......@@ -1100,8 +1100,8 @@ na_return_t mona_recv_nc(
} else {
struct na_segment* segments = alloca(sizeof(*segments)*count);
for(i = 0; i < count; i++) {
segments[i].address = (na_ptr_t)buffers[i];
segments[i].size = buf_sizes[i];
segments[i].base = (na_ptr_t)buffers[i];
segments[i].len = buf_sizes[i];
}
na_ret = mona_mem_handle_create_segments(mona, segments, count, NA_MEM_WRITE_ONLY, &mem_handle);
}
......@@ -1429,10 +1429,10 @@ na_return_t mona_msg_send_unexpected(
na_tag_t tag)
{
cached_op_id_t id = get_op_id_from_cache(mona);
na_op_id_t op_id = id->op_id;
na_op_id_t* op_id = id->op_id;
mona_request req = MONA_REQUEST_INITIALIZER;
na_return_t na_ret = mona_msg_isend_unexpected_internal(
mona, buf, buf_size, plugin_data, dest_addr, dest_id, tag, &op_id, &req);
mona, buf, buf_size, plugin_data, dest_addr, dest_id, tag, op_id, &req);
if(na_ret != NA_SUCCESS) goto finish;
na_ret = mona_wait_internal(&req);
finish:
......@@ -1505,10 +1505,10 @@ na_return_t mona_msg_recv_unexpected(
{
mona_request req = MONA_REQUEST_INITIALIZER;
cached_op_id_t id = get_op_id_from_cache(mona);
na_op_id_t op_id = id->op_id;
na_op_id_t* op_id = id->op_id;
na_return_t na_ret = mona_msg_irecv_unexpected_internal(
mona, buf, buf_size, plugin_data,
source_addr, tag, size, &op_id, &req);
source_addr, tag, size, op_id, &req);
if(na_ret != NA_SUCCESS) goto finish;
na_ret = mona_wait_internal(&req);
finish:
......@@ -1594,9 +1594,9 @@ na_return_t mona_msg_send_expected(
{
mona_request req = MONA_REQUEST_INITIALIZER;
cached_op_id_t id = get_op_id_from_cache(mona);
na_op_id_t op_id = id->op_id;
na_op_id_t* op_id = id->op_id;
na_return_t na_ret = mona_msg_isend_expected_internal(
mona, buf, buf_size, plugin_data, dest_addr, dest_id, tag, &op_id, &req);
mona, buf, buf_size, plugin_data, dest_addr, dest_id, tag, op_id, &req);
if(na_ret != NA_SUCCESS) goto finish;
na_ret = mona_wait_internal(&req);
finish:
......@@ -1669,9 +1669,9 @@ na_return_t mona_msg_recv_expected(
{
mona_request req = MONA_REQUEST_INITIALIZER;
cached_op_id_t id = get_op_id_from_cache(mona);
na_op_id_t op_id = id->op_id;
na_op_id_t* op_id = id->op_id;
na_return_t na_ret = mona_msg_irecv_expected_internal(
mona, buf, buf_size, plugin_data, source_addr, source_id, tag, &op_id, &req);
mona, buf, buf_size, plugin_data, source_addr, source_id, tag, op_id, &req);
if(na_ret != NA_SUCCESS) goto finish;
na_ret = mona_wait_internal(&req);
finish:
......@@ -1752,20 +1752,6 @@ na_return_t mona_mem_deregister(
return NA_Mem_deregister(mona->na_class, mem_handle);
}
na_return_t mona_mem_publish(
mona_instance_t mona,
na_mem_handle_t mem_handle)
{
return NA_Mem_publish(mona->na_class, mem_handle);
}
na_return_t mona_mem_unpublish(
mona_instance_t mona,
na_mem_handle_t mem_handle)
{
return NA_Mem_unpublish(mona->na_class, mem_handle);
}
na_size_t mona_mem_handle_get_serialize_size(
mona_instance_t mona,
na_mem_handle_t mem_handle)
......@@ -1842,11 +1828,11 @@ na_return_t mona_put(
{
mona_request req = MONA_REQUEST_INITIALIZER;
cached_op_id_t id = get_op_id_from_cache(mona);
na_op_id_t op_id = id->op_id;
na_op_id_t* op_id = id->op_id;
na_return_t na_ret = mona_iput_internal(
mona, local_mem_handle, local_offset,
remote_mem_handle, remote_offset,
data_size, remote_addr, remote_id, &op_id, &req);
data_size, remote_addr, remote_id, op_id, &req);
if(na_ret != NA_SUCCESS) goto finish;
na_ret = mona_wait_internal(&req);
finish:
......@@ -1926,13 +1912,13 @@ na_return_t mona_get(
{
mona_request req = MONA_REQUEST_INITIALIZER;
cached_op_id_t id = get_op_id_from_cache(mona);
na_op_id_t op_id = id->op_id;
na_op_id_t* op_id = id->op_id;
na_return_t na_ret = mona_iget_internal(
mona, local_mem_handle,
local_offset, remote_mem_handle,
remote_offset, data_size,
remote_addr, remote_id,
&op_id, &req);
op_id, &req);
if(na_ret != NA_SUCCESS) goto finish;
na_ret = mona_wait_internal(&req);
finish:
......@@ -1984,7 +1970,7 @@ na_bool_t mona_poll_try_wait(mona_instance_t mona)
na_return_t mona_cancel(
mona_instance_t mona,
na_op_id_t op_id)
na_op_id_t* op_id)
{
return NA_Cancel(mona->na_class, mona->na_context, op_id);
}
......
......@@ -11,7 +11,7 @@ typedef struct {
int rank;
na_addr_t self_addr;
na_addr_t other_addr;
na_op_id_t op_id;
na_op_id_t* op_id;
na_size_t msg_len;
char* buf;
void* plugin_data;
......@@ -117,7 +117,7 @@ static MunitResult test_send_recv_expected(const MunitParameter params[], void*
context->msg_len,
context->plugin_data,
context->other_addr,
0, 0, &(context->op_id));
0, 0, context->op_id);
munit_assert_int(ret, ==, NA_SUCCESS);
} else { // receiver
......@@ -131,7 +131,7 @@ static MunitResult test_send_recv_expected(const MunitParameter params[], void*
context->msg_len,
context->plugin_data,
context->other_addr,
0, 0, &(context->op_id));
0, 0, context->op_id);
munit_assert_int(ret, ==, NA_SUCCESS);
MPI_Barrier(MPI_COMM_WORLD);
......
......@@ -89,11 +89,11 @@ static MunitResult test_send_recv_expected(const MunitParameter params[], void*
} else { // receiver
mona_request_t req;
na_op_id_t op = mona_op_create(mona);
na_op_id_t* op = mona_op_create(mona);
ret = mona_msg_irecv_expected(
mona, buf, msg_len, plugin_data,
context->other_addr, 0, 0, &op, &req);
context->other_addr, 0, 0, op, &req);
munit_assert_int(ret, ==, NA_SUCCESS);
MPI_Barrier(MPI_COMM_WORLD);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment