From 69e2d9db7260353527e6a8ea31d7c1ef2578f2d0 Mon Sep 17 00:00:00 2001
From: Utz-Uwe Haus <uhaus@hpe.com>
Date: Sun, 26 Apr 2020 13:12:00 +0000
Subject: [PATCH] some MIO fixes (still broken)

---
 include/maestro/core.h      |  1 +
 tests/check_transport_mio.c | 22 ++++++++++------------
 transport/mio.c             |  4 +++-
 transport/transport.c       |  2 +-
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/include/maestro/core.h b/include/maestro/core.h
index 33f7eb3e..38b7bf4e 100644
--- a/include/maestro/core.h
+++ b/include/maestro/core.h
@@ -44,6 +44,7 @@ extern "C" {
   #include "maestro/cdo.h"
   #include "maestro/pool.h"
   #include "maestro/pool_manager.h"
+  #include "maestro/attributes.h"
   #include <stdint.h>
 
   /**@defgroup MSTRO_Core Maestro Core API
diff --git a/tests/check_transport_mio.c b/tests/check_transport_mio.c
index 9c22d388..1cf0f20f 100644
--- a/tests/check_transport_mio.c
+++ b/tests/check_transport_mio.c
@@ -87,20 +87,19 @@ CHEAT_DECLARE (
                cheat_assert(MSTRO_OK == mstro_cdo_attribute_set(cdo_src,
                                                                 MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE,
                                                                 &bytes));
-               enum mstro_cdo_attr_value_types ttype;
-               const void* tval;
+               const int64_t* tval;
 
                cheat_assert(MSTRO_OK == mstro_cdo_attribute_get(cdo_src,
                                                                 MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE,
-                                                                &ttype,
-                                                                &tval));
+								NULL,
+                                                                (const void**)&tval));
                cheat_assert(*(const uint64_t*)tval==bytes);
                cheat_assert(MSTRO_OK == mstro_cdo_declaration_seal(cdo_src));
                cheat_assert(MSTRO_OK == mstro_cdo_attribute_get(cdo_src,
                                                                 MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE,
-                                                                &ttype,
-                                                                &tval));
-               cheat_assert(*(const uint64_t*)tval==bytes);
+                                                                NULL,
+                                                                (const void**)&tval));
+               cheat_assert(*tval==bytes);
                
                cheat_assert(MSTRO_OK == mstro_cdo_declare(name, MSTRO_ATTR_DEFAULT, &cdo_dst));
                
@@ -131,10 +130,9 @@ CHEAT_DECLARE (
 		ticket.cdoid = &id;
 
 		mstro_status status;
-		enum mstro_cdo_attr_value_types type1;
-	        const void* val1;
-	        cheat_assert(MSTRO_OK == mstro_cdo_attribute_get(cdo_src, "local_size", &type1, &val1));
-	        ticket.data_size = *(size_t*)val1;
+	        const int64_t* val1;
+	        cheat_assert(MSTRO_OK == mstro_cdo_attribute_get(cdo_src, "scope.local-size", NULL, (const void**)&val1));
+	        ticket.data_size = *val1;
 
 		ticket.ticket_case = MSTRO__POOL__TRANSFER_TICKET__TICKET_MIO;
 		Mstro__Pool__TransferTicketMIO mio = MSTRO__POOL__TRANSFER_TICKET_MIO__INIT;
@@ -189,7 +187,7 @@ CHEAT_DECLARE (
               
                double* data;
                size_t len;
-               enum mstro_cdo_attr_value_types type;
+               enum mstro_cdo_attr_value_type type;
                const void* val;
                
                cheat_assert(MSTRO_OK == mstro_cdo_access_ptr(cdo_dst, (void**)&data, NULL));
diff --git a/transport/mio.c b/transport/mio.c
index 9ce1511b..9aaf50bf 100644
--- a/transport/mio.c
+++ b/transport/mio.c
@@ -3,6 +3,8 @@
 #include "transport.h"
 #include "transport_mio.h"
 
+#include "attributes/maestro-schema.h"
+
 #include <mio.h> /* the MIO one */
 
 #include <limits.h>
@@ -546,7 +548,7 @@ mstro_transport_mio_dst_execute(mstro_cdo dst,
   }
   
   if (!(MSTRO_OK == mstro_attribute_dict_set(
-          dst, MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE, MSTRO_CDO_ATTR_VALUE_INVALID,
+          dst->attributes, MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE, MSTRO_CDO_ATTR_VALUE_INVALID,
           &len, true))) {
     ERR("Failed to set %s attribute of CDO %s for transport\n",
         MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE,
diff --git a/transport/transport.c b/transport/transport.c
index bf8cb505..a03e8c26 100644
--- a/transport/transport.c
+++ b/transport/transport.c
@@ -149,7 +149,7 @@ mstro_transport_init()
           MSTRO_ENV_MIO_CONFIG);
     } else {
       INFO("Initializing MIO with configuration file %s\n", env_mio_config);
-      status = mio_init(env_mio_config);
+      int status = mio_init(env_mio_config);
       if (status != 0) {
         ERR("Failed to initialize MIO (errno: %d\n)", status);
         return MSTRO_FAIL;
-- 
GitLab