Initializing ABT-IO

The following code shows how to initialize and finalize ABT-IO. ABT-IO must be initialized after Argobots and finalized before it. The abt_io_init function takes the number of ES to create for handling I/O operations. Alternatively, the abt_io_init_pool function can be used to make ABT-IO use an Argobots pool that was alread created.

#include <abt-io.h>

int main(int argc, char** argv)
{
    // Argobots must be initialized, either with ABT_init
    // or with margo_init, thallium::engine, or thallium::abt.
    ABT_init(argc, argv);

    // abt_io_init takes the number of ES to create as a parameter.
    abt_io_instance_id abtio = abt_io_init(2);

    // ABT-IO must be finalized before Argobots it finalized.
    abt_io_finalize(abtio);

    ABT_finalize();

    return 0;
}