diff --git a/include/maestro/i_pool_client.h b/include/maestro/i_pool_client.h index 1614190d3edf7fdebd45dd61271826853f3f73cf..b5f4aac0511b79adede6de62d52a0602805bf1a3 100644 --- a/include/maestro/i_pool_client.h +++ b/include/maestro/i_pool_client.h @@ -113,7 +113,7 @@ mstro_pc__transfer_completed(mstro_pool_operation op); * @return mstro_status return status */ mstro_status -mstro_pc__app_befriend_op(mstro_pool_operation op); +mstro_pc__app_befriend(mstro_pool_operation op); /** diff --git a/maestro/pool_client.c b/maestro/pool_client.c index d048ffdd3c74f86f8584a0d1d0138308cee821a3..51f9c77a34b3fdfa65defad4269277eed810c9d1 100644 --- a/maestro/pool_client.c +++ b/maestro/pool_client.c @@ -34,7 +34,7 @@ const mstro_pool_op_st_handler mstro_pc__init_transfer_steps[] = { NULL, mstro_pc__prepare_init_transfer, - mstro_pc__app_befriend_op, + mstro_pc__app_befriend, mstro_pc__init_transfer_reg_app, mstro_pc__init_transfer_send_ticket, NULL, @@ -47,7 +47,7 @@ const mstro_pool_op_st_handler mstro_pc__init_transfer_steps[] = { const mstro_pool_op_st_handler mstro_pc__transfer_steps[] = { NULL, mstro_pc__prepare_transfer, - mstro_pc__app_befriend_op, /**optional*/ + mstro_pc__app_befriend, /**optional*/ mstro_pc__init_transfer_reg_app, /*optional*/ mstro_pc__transfer_execute, NULL, @@ -812,36 +812,12 @@ mstro_pc__init_transfer_reg_app(mstro_pool_operation op) } assert(op->pc_transport.target_ep!=NULL); - size_t len; - uint8_t *buf; - /* prepare to duplicate methods structure .. the simple way (pack/unpack) */ - /* ensure we know how to talk to the recipient */ - /* FIXME: for transfer tickets we don't have the methods list at hand -- fake one */ - if (op->pc_transport.methods == NULL) - { - Mstro__Pool__TransportKind ofi_method[1] = { MSTRO__POOL__TRANSPORT_KIND__OFI }; - Mstro__Pool__TransportMethods m = MSTRO__POOL__TRANSPORT_METHODS__INIT; - m.n_supported = 1; - m.supported = &ofi_method[0]; - len = mstro__pool__transport_methods__get_packed_size(&m); - buf = malloc(sizeof(uint8_t)*len); - mstro__pool__transport_methods__pack(&m,buf); - } - else - { - len = mstro__pool__transport_methods__get_packed_size(op->pc_transport.methods); - buf = malloc(sizeof(uint8_t)*len); - mstro__pool__transport_methods__pack(op->pc_transport.methods,buf); - } - - Mstro__Pool__TransportMethods *methods = mstro__pool__transport_methods__unpack(NULL, len, buf); - free(buf); - + /* pass into registry */ status = mstro_pc_app_register(op->pc_transport.target_ep, op->pc_transport.target_addr, strdup(op->pc_transport.target_serialized_endpoint), - methods, + op->pc_transport.methods, op->msg->initiate_transfer->dst_appid->id, NULL); if(status!=MSTRO_OK) { @@ -854,7 +830,7 @@ mstro_pc__init_transfer_reg_app(mstro_pool_operation op) } mstro_status -mstro_pc__app_befriend_op(mstro_pool_operation op) +mstro_pc__app_befriend(mstro_pool_operation op) { mstro_status status = MSTRO_UNIMPL; struct mstro_pm_app_registry_entry *e; @@ -1259,8 +1235,18 @@ mstro_pc__op_maker(Mstro__Pool__MstroMsg **msg) op->pc_transport.target_ep = NULL; op->pc_transport.request = NULL; op->pc_transport.target_appid = (*msg)->transfer_ticket->srcid->id; - op->pc_transport.methods = NULL; + /**FIXME we do not know the transfer methods, so fake one*/ + Mstro__Pool__TransportKind ofi_method[1] = { MSTRO__POOL__TRANSPORT_KIND__OFI }; + Mstro__Pool__TransportMethods m = MSTRO__POOL__TRANSPORT_METHODS__INIT; + m.n_supported = 1; + m.supported = &ofi_method[0]; + size_t len = mstro__pool__transport_methods__get_packed_size(&m); + uint8_t *buf = malloc(sizeof(uint8_t)*len); + mstro__pool__transport_methods__pack(&m,buf); + Mstro__Pool__TransportMethods *methods = mstro__pool__transport_methods__unpack(NULL, len, buf); + op->pc_transport.methods = methods; op->pc_transport.target_serialized_endpoint = (*msg)->transfer_ticket->src_serialized_endpoint; + free(buf); break; case MSTRO__POOL__MSTRO_MSG__MSG_DECLARE_ACK: op->kind = MSTRO_OP_PC_DECLARE_ACK;