Configuring Bedrock using Jx9, TOML, and simplified JSON

JSON configurations for Bedrock can very quickly become complicated to write by hand, especially when trying to list many execution streams for use in a many-core node, associated with as many pools and providers. The alternative configuration methods provided hereafter aim to simplified the writing of Bedrock configurations.

Simplified JSON

In a JSON Bedrock configurations, any key/value pair in the form "x.y" : value will be automatically converted into the object { "x" : { "y" : value }}. This way of writing the JSON file leads the more flat JSON files that are easier to read.

Jx9

By using the --jx9 argument of the bedrock program, one can use a Jx9 program instead of a JSON file to generate the JSON configuration.

The code bellow is an example of such a Jx9-based configuration. It first initializes a base configuration, then uses a loop to add as many pools as requested in the argobots section.

$config = {
   margo : {
     argobots : {
       pools : [
         {
           name : "my_pool"
         }
       ]
     }
  }
};

for ($i = 0; $i < $num_extra_pools; $i++) {
  $pool_name = sprintf("extra_pool_$i");
  array_push($config.margo.argobots.pools,
    {
       name : $pool_name
    }
  );
}

return $config;

Bedrock can use this file as follows.

bedrock ofi+tcp --jx9 -c example.jx9 --jx9-context num_extra_pools=4

The --jx9-context argument allows setting variables before the Jx9 script is executed, in the form of coma-separated assignments (e.g. x=1,y=2.5,z="abc" ).

TOML

Bedrock understands TOML configuration files using the --toml argument of the bedrock program. The code bellow is an example of such a TOML configuration.

libraries = [
    "libyokan-bedrock-module.so",
    "libflock-bedrock-module.so"
]

[margo]
use_progress_thread = true

  [[margo.argobots.pools]]
  name = "my_pool_1"
  kind = "fifo_wait"
  access = "mpmc"

  [[margo.argobots.pools]]
  name = "my_pool_2"
  kind = "fifo_wait"
  access = "mpmc"

[[providers]]
name = "my_provider_1"
type = "yokan"
provider_id = 1
  [providers.config.database]
  type = "map"

[[providers]]
name = "my_provider_2"
type = "flock"
provider_id = 2
  [providers.config]
  bootstrap = ["join", "mpi"]
  group = { "type" = "centralized" }
  file = "distributed_service.flock"

Since TOML is simply an alternative language to express the same kind of tree of data as JSON, please refer to the TOML documentation for its syntax, and refer to the Bedrock JSON format for the list of expected fields of a configuration.