Skip to content
Snippets Groups Projects
  1. Oct 27, 2022
  2. Oct 26, 2022
  3. Oct 25, 2022
  4. Oct 21, 2022
  5. Oct 20, 2022
    • Ramon Nou's avatar
      Merge branch 'amiranda/81-make-admire-error_code-a-fully-fledged-class' into 'main' · f46dafa3
      Ramon Nou authored
      Resolve "Make `admire::error_code` a fully fledged class"
      
      This MR redefines the `admire::error_code` typedef transforming it into
      a fully-fledged C++ object.
      
      This has the following advantages:
      
      1. The default `error_code` constructor initializes to `ADM_SUCCESS`.
         Thus, we can now do `error_code ec;` instead of `error_code ec = ADM_SUCCESS;`.
      2. `error_code`s can be constructed explicitly from `ADM_return_t` values.
      3. `error_code`s can be constructed explicitly from `int32_t` (for RPC types).
      4. `error_code`s can be converted implicitly to `ADM_return_t`, which makes code
         less verbose when returning from C++ code to the C code.
      5. `error_code`s are convertible to `bool`. This means that we can now do
      
         ```c++
             error_code ec = fun();
             if(ec) { /* there was an error, do something */ }
         ```
         
         whereas previously we were forced to explicitly check against `ADM_SUCCESS`.
      
         ```c++
             error_code ec = fun();
             if(ec != ADM_SUCCESS) { /* there was an error, do something */ }
         ```
      
      6. `error_code`s provide `value()`, `name()`, and `message()` functions that make
         them much more flexible.
      7. Several `error_code` constants are defined to avoid using `ADM_return_t` 
         directly in C++ code, hopefully making the code more readable:
         
         ```c++
            constexpr error_code error_code::success = error_code{ADM_SUCCESS};
            constexpr error_code error_code::snafu = error_code{ADM_ESNAFU};
            constexpr error_code error_code::bad_args = error_code{ADM_EBADARGS};
            constexpr error_code error_code::out_of_memory = error_code{ADM_ENOMEM};
            constexpr error_code error_code::entity_exists = error_code{ADM_EEXISTS};
            constexpr error_code error_code::no_such_entity = error_code{ADM_ENOENT};
            constexpr error_code error_code::adhoc_in_use = error_code{ADM_EADHOC_BUSY};
            constexpr error_code error_code::other = error_code{ADM_EOTHER};
         ```
      
      Also, most of the implementation is `constexpr`, which is always nice.
      
      Closes #81
      
      See merge request !61
      f46dafa3
    • Alberto Miranda's avatar
      0480c839
  6. Oct 19, 2022
  7. Oct 18, 2022
    • Alberto Miranda's avatar
      examples: Ensure ADM_remove_job is called · c5de2913
      Alberto Miranda authored
      Print error messages to stderr instead of stdout
      
      Closes #86
      c5de2913
    • Alberto Miranda's avatar
      adhoc_storage: Fix bug with shadowed id · 7e9d1bd0
      Alberto Miranda authored
      Closes #88
      7e9d1bd0
    • Alberto Miranda's avatar
      Keep track of adhoc storage instances client jobs · 4291f4e9
      Alberto Miranda authored
      * adhoc_storage: Add job client information
      
      * adhoc_storage_manager: Now stores adhoc_storage_info records and
        provides functions to update them.
      
      * adhoc_storage_info: New synchronized type keeping updated information
        about the client job assigned to a adhoc_storage instance
      
      * adhoc_storage: The context can now be updated using a new update()
        function (non-synchronized for now, because it is only ever called
        via the adhoc_storage_manager).
      
      * job_info: Type is now synchronized.
      
      * errors: Add ADM_EADHOC_BUSY. Fix missing error messages for ADM_ENOENT
        and ADM_EEXISTS.
      
      * abt/shared_mutex: Is now movable.
      4291f4e9
  8. Oct 17, 2022
  9. Oct 14, 2022
    • Alberto Miranda's avatar
      Merge branch... · c94bd4d4
      Alberto Miranda authored
      Merge branch 'amiranda/78-there-s-no-way-to-select-the-adhoc-storage-type-when-calling-register_adhoc_storage' into 'main'
      
      Resolve "There's no way to select the adhoc storage type when calling `register_adhoc_storage`"
      
      This MR adds a `type` argument both to `ADM_register_adhoc_storage()` and 
      `admire::register_adhoc_storage()` so that client code can properly select
      the type of the instance to be registered.
      
      Closes #78
      
      See merge request !53
      c94bd4d4
    • Alberto Miranda's avatar
    • Alberto Miranda's avatar
      Merge branch 'amiranda/74-server_id-should-not-be-optional-in-adhoc_storage' into 'main' · 4308a673
      Alberto Miranda authored
      Resolve "server_id should not be optional in adhoc_storage"
      
      This MR makes the `server_id` member in adhoc_storage explicit. The rationale
      is that constructors (for the C++ API) or `.*_create()` functions (for the C API)
      will most of the time be called from internal code, since client code will rely
      mostly on `ADM_register_.*()` to obtain handlers.
      
      In this scenario, there's no possibility for the `server_id` "to not having been 
      assigned yet", which is why it was `optional` in the first place.
      
      Also, this MR renames the `user_id` to `name`, and the `server_id` to `id`.
      
      Closes #74 #75
      
      See merge request !51
      4308a673
    • Alberto Miranda's avatar
      examples: Update with new API changes · 13c5f9cb
      Alberto Miranda authored
      13c5f9cb
    • Alberto Miranda's avatar
      ADM_storage_t: Add `id` as an explicit field · 64ed4cbb
      Alberto Miranda authored
      Similarly for ADM_storage_create(), admire::storage, admire::adhoc_storage,
      and admire::pfs_storage.
      Also, rename any references to `server_id` to just `id`.
      64ed4cbb
Loading