Commit e671cc2a authored by Matthieu Dorier's avatar Matthieu Dorier

corrected REMI registration

parent 81938b7a
...@@ -180,16 +180,6 @@ int bake_provider_register( ...@@ -180,16 +180,6 @@ int bake_provider_register(
return BAKE_ERR_MERCURY; return BAKE_ERR_MERCURY;
} }
} }
/* check if a REMI provider exists with the same provider id */
{
int flag;
// TODO pass an actual ABT-IO instance
remi_provider_registered(mid, provider_id, &flag, NULL, NULL, NULL);
if(flag) {
fprintf(stderr, "bake_provider_register(): a REMI provider with the same (%d) already exists\n", provider_id);
return BAKE_ERR_REMI;
}
}
/* allocate the resulting structure */ /* allocate the resulting structure */
tmp_svr_ctx = calloc(1,sizeof(*tmp_svr_ctx)); tmp_svr_ctx = calloc(1,sizeof(*tmp_svr_ctx));
...@@ -287,18 +277,28 @@ int bake_provider_register( ...@@ -287,18 +277,28 @@ int bake_provider_register(
} }
/* register a REMI provider */ /* register a REMI provider */
// TODO actually use an ABT-IO instance {
ret = remi_provider_register(mid, ABT_IO_INSTANCE_NULL, provider_id, abt_pool, &(tmp_svr_ctx->remi_provider)); int flag;
if(ret != REMI_SUCCESS) { remi_provider_t remi_provider;
// XXX unregister RPCs, cleanup tmp_svr_ctx before returning /* check if a REMI provider exists with the same provider id */
return BAKE_ERR_REMI; remi_provider_registered(mid, provider_id, &flag, NULL, NULL, &remi_provider);
} if(flag) { /* REMI provider exists */
ret = remi_provider_register_migration_class(tmp_svr_ctx->remi_provider, tmp_svr_ctx->remi_provider = remi_provider;
"bake", NULL, } else { /* REMI provider does not exist */
bake_target_post_migration_callback, NULL, tmp_svr_ctx); // TODO actually use an ABT-IO instance
if(ret != REMI_SUCCESS) { ret = remi_provider_register(mid, ABT_IO_INSTANCE_NULL, provider_id, abt_pool, &(tmp_svr_ctx->remi_provider));
// XXX unregister RPCs, cleanup tmp_svr_ctx before returning if(ret != REMI_SUCCESS) {
return BAKE_ERR_REMI; // XXX unregister RPCs, cleanup tmp_svr_ctx before returning
return BAKE_ERR_REMI;
}
}
ret = remi_provider_register_migration_class(tmp_svr_ctx->remi_provider,
"bake", NULL,
bake_target_post_migration_callback, NULL, tmp_svr_ctx);
if(ret != REMI_SUCCESS) {
// XXX unregister RPCs, cleanup tmp_svr_ctx before returning
return BAKE_ERR_REMI;
}
} }
/* install the bake server finalize callback */ /* install the bake server finalize callback */
......
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