Refactoring with JSON and new Margo
This issue lists the things that need to be refactored once margo 0.9 is released.
-
abt_io_init_json
should be removed -
abt_io_init_pool
should be marked as deprecated (with a gcc attribute) - dependency to margo-cfg should be removed, to use json-c instead
- a new
abt_io_init_ext
function should be added, along with anabt_io_init_info
structure
The abt_io_init_ext
function should have the following prototype:
abt_io_instance_id abt_io_init_ext(const struct abt_io_init_info* args);
with abt_io_init_info
defined as follows:
struct abt_io_init_info {
const char* json_config;
ABT_pool pool;
};
The JSON configuration should be of the following format:
{ "thread_count" : <int> }
Note the absence of a "abtio" :
key; this is because in Bedrock we may want to list multiple abt-io instances in an array, and having the "abtio" :
key before the configuration will make the JSON more complicated.
The "thread_count" field, if not provided, defaults to 0. If the caller provides a non-null pool and a non-zero thread_count (either using abt_io_init or abt_io_init_ext with a non-zero "thread_count" field in the JSON configuration), ABT-IO should create as many ES as requested and have them use the provided pool (effectively, if the pool is also used by other ES outside of ABT-IO, these ES will be used by ABT-IO indirectly).
Warning: when testing if pool is null, remember to use (pool == ABT_POOL_NULL || pool == NULL) since ABT_POOL_NULL is not equal to NULL, yet the user may have done struct abt_io_init_info args = { 0 }
.