Commit 721d0eb0 authored by Ramon Nou's avatar Ramon Nou
Browse files

Merge branch...

Merge branch 'amiranda/100-c-api-should-have-adm_adhoc_storage_t-and-adm_pfs_storage_t-types' into 'main'

Resolve "C API should have `ADM_adhoc_storage_t` and `ADM_pfs_storage_t` types"

This MR eliminates the `ADM_storage_t` from the C API and its 
corresponding `admire::storage` type from the C++ API to simplify
the usage and the implementation. 

Instead, the types `ADM_adhoc_storage_t` and `ADM_pfs_storage_t` 
are created for the C API, which correspond to the already existing 
types `admire::adhoc_storage` and `admire::pfs_storage`, which no 
longer inherit from `admire::storage`.

Additionally, this MR also removes `ADM_storage_type_t`, replacing it
with `ADM_adhoc_storage_type_t` and `ADM_pfs_storage_type_t`, and 
renames their values with the appropriate `ADM_ADHOC_` and `ADM_PFS_`
prefixes.

Closes #100

See merge request !69
parents 2c547961 eaeafd09
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -70,9 +70,9 @@ main(int argc, char* argv[]) {

    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_adhoc_storage_t adhoc_storage;
    ADM_return_t ret = ADM_register_adhoc_storage(
            server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage);
            server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stderr,
+2 −2
Original line number Diff line number Diff line
@@ -66,9 +66,9 @@ main(int argc, char* argv[]) {

    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_adhoc_storage_t adhoc_storage;
    ADM_return_t ret = ADM_register_adhoc_storage(
            server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage);
            server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stderr,
+2 −2
Original line number Diff line number Diff line
@@ -71,9 +71,9 @@ main(int argc, char* argv[]) {

    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_adhoc_storage_t adhoc_storage;
    ADM_return_t ret = ADM_register_adhoc_storage(
            server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage);
            server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stderr,
+5 −7
Original line number Diff line number Diff line
@@ -25,9 +25,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <admire.h>
#include <assert.h>
#include "common.h"
#include <net/proto/rpc_types.h>

#define NADHOC_NODES 25
#define NINPUTS      10
@@ -53,7 +51,7 @@ main(int argc, char* argv[]) {
    ADM_adhoc_resources_t adhoc_resources = NULL;
    ADM_adhoc_context_t adhoc_ctx = NULL;
    ADM_adhoc_context_t new_adhoc_ctx = NULL;
    ADM_storage_t adhoc_storage = NULL;
    ADM_adhoc_storage_t adhoc_storage = NULL;


    // Let's prepare all the information required by the API calls.
@@ -98,8 +96,9 @@ main(int argc, char* argv[]) {
    }

    // 2. Register the adhoc storage
    if(ADM_register_adhoc_storage(server, adhoc_name, ADM_STORAGE_DATACLAY,
                                  adhoc_ctx, &adhoc_storage) != ADM_SUCCESS) {
    if(ADM_register_adhoc_storage(server, adhoc_name,
                                  ADM_ADHOC_STORAGE_DATACLAY, adhoc_ctx,
                                  &adhoc_storage) != ADM_SUCCESS) {
        fprintf(stderr, "ADM_register_adhoc_storage() failed: %s\n",
                ADM_strerror(ret));
        goto cleanup;
@@ -120,8 +119,7 @@ main(int argc, char* argv[]) {
    }

    // We can now request the deployment to the server
    if((ret = ADM_deploy_adhoc_storage(server, adhoc_storage)) !=
       ADM_SUCCESS) {
    if((ret = ADM_deploy_adhoc_storage(server, adhoc_storage)) != ADM_SUCCESS) {
        fprintf(stderr, "ADM_deploy_adhoc_storage() failed: %s\n",
                ADM_strerror(ret));
        goto cleanup;
+2 −2
Original line number Diff line number Diff line
@@ -67,9 +67,9 @@ main(int argc, char* argv[]) {

    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_adhoc_storage_t adhoc_storage;
    ADM_return_t ret = ADM_register_adhoc_storage(
            server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage);
            server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stderr,
Loading