Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mochi-hpc/mochi-margo
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Aug 28, 2023
2 parents b10bc54 + 84c8add commit 05786aa
Show file tree
Hide file tree
Showing 8 changed files with 460 additions and 14 deletions.
2 changes: 1 addition & 1 deletion spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spack:
- mercury~boostsys ^libfabric fabrics=tcp,rxm
concretizer:
unify: true
reuse: false
reuse: true
modules:
prefix_inspections:
lib: [LD_LIBRARY_PATH]
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.subdir
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ noinst_HEADERS += src/margo-abt-macros.h \
src/margo-instance.h\
src/margo-macros.h\
src/margo-prio-pool.h\
src/margo-efirst-pool.h\
src/margo-timer-private.h \
src/margo-monitoring-internal.h \
src/margo-abt-config.h \
Expand All @@ -28,6 +29,7 @@ src_libmargo_la_SOURCES += \
src/margo-timer.c \
src/margo-util.c \
src/margo-prio-pool.c \
src/margo-efirst-pool.c \
src/margo-monitoring.c \
src/margo-default-monitoring.c

Expand Down
11 changes: 10 additions & 1 deletion src/margo-abt-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool __margo_abt_pool_validate_json(const json_object_t* jpool,
json_object_t* jkind = json_object_object_get(jpool, "kind");
if (jkind) {
CONFIG_IS_IN_ENUM_STRING(jkind, "pool kind", "fifo", "fifo_wait",
"prio_wait", "external");
"prio_wait", "earliest_first", "external");
if (strcmp(json_object_get_string(jkind), "external") == 0) {
margo_error(mid,
"Pool is marked as external and "
Expand Down Expand Up @@ -123,6 +123,15 @@ bool __margo_abt_pool_init_from_json(const json_object_t* jpool,
if (ret != ABT_SUCCESS) {
margo_error(mid, "ABT_pool_create failed with error code %d", ret);
}
} else if (strcmp(pool->kind, "earliest_first") == 0) {
if (!pool->access) pool->access = strdup("mpmc");
ABT_pool_def efirst_pool_def;
margo_create_efirst_pool_def(&efirst_pool_def);
ret = ABT_pool_create(&efirst_pool_def, ABT_POOL_CONFIG_NULL,
&pool->pool);
if (ret != ABT_SUCCESS) {
margo_error(mid, "ABT_pool_create failed with error code %d", ret);
}
} else {
// custom pool definition, not supported for now
margo_error(mid,
Expand Down
9 changes: 5 additions & 4 deletions src/margo-abt-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "margo.h"
#include "margo-globals.h"
#include "margo-prio-pool.h"
#include "margo-efirst-pool.h"
#include "margo-logging.h"
#include "margo-macros.h"
#include "margo-abt-macros.h"
Expand Down Expand Up @@ -51,10 +52,10 @@ typedef struct margo_abt margo_abt_t;
* margo is responsible for explicitly free'ing the pool or not.
*/
typedef struct margo_abt_pool {
char* name;
ABT_pool pool;
char* kind;
optional_char* access; /* Unknown for custom user pools */
char* name;
ABT_pool pool;
char* kind;
optional_char* access; /* Unknown for custom user pools */
_Atomic(uint32_t) num_rpc_ids; /* Number of RPC ids that use this pool */
_Atomic(uint32_t) num_xstreams; /* Number of xstreams that use this pool */
bool margo_free_flag; /* flag if Margo is responsible for freeing */
Expand Down
Loading

0 comments on commit 05786aa

Please sign in to comment.