Commit 8fb2c1e8 authored by Philip Carns's avatar Philip Carns

remove abt-snooozer

parent 49df64af
......@@ -21,7 +21,6 @@ Margo: https://xgitlab.cels.anl.gov/sds/margo
* argobots (origin/master):
(git://git.mcs.anl.gov/argo/argobots.git)
* abt-snoozer (https://xgitlab.cels.anl.gov/sds/abt-snoozer)
## Building Argobots (dependency)
......@@ -29,10 +28,6 @@ Example configuration:
../configure --prefix=/home/pcarns/working/install
## Building abt-snoozer (dependency)
See abt-snoozer README.md
## Building
Example configuration:
......@@ -67,6 +62,3 @@ system with a level of concurrency determined by the number of execution
streams in the abt-io pool. This is similar to aio functionality but with a
simpler interface and less serialization.
The abt-snoozer scheduler is not manditory, but is highly recommended
because it will enable the Argobots scheduler to idle gracefully when it is
idle or blocked on I/O operations.
......@@ -16,7 +16,6 @@
#include "abt-io-config.h"
#include <abt.h>
#include <abt-io.h>
#include <abt-snoozer.h>
#ifndef HAVE_ODIRECT
#define O_DIRECT 0
......@@ -27,7 +26,6 @@ struct worker_ult_common
int opt_io;
int opt_compute;
int opt_abt_io;
int opt_abt_snoozer;
int opt_unit_size;
int opt_num_units;
abt_io_instance_id aid;
......@@ -45,7 +43,7 @@ struct worker_ult_arg
static void worker_ult(void *_arg);
static double wtime(void);
static int ABT_nosnoozer_xstream_create(int num_xstreams, ABT_pool *newpool, ABT_xstream *newxstreams);
static int ABT_xstream_create_helper(int num_xstreams, ABT_pool *newpool, ABT_xstream *newxstreams);
int main(int argc, char **argv)
{
......@@ -61,10 +59,12 @@ int main(int argc, char **argv)
int compute_es_count = -1;
struct worker_ult_arg *arg_array;
struct worker_ult_common common;
ABT_sched self_sched;
ABT_xstream self_xstream;
if(argc != 10)
if(argc != 9)
{
fprintf(stderr, "Usage: abt-io-overlap <compute> <io> <abt_io 0|1> <abt_snoozer 0|1> <unit_size> <num_units> <compute_es_count> <io_es_count> <inflight_threads>\n");
fprintf(stderr, "Usage: abt-io-overlap <compute> <io> <abt_io 0|1> <unit_size> <num_units> <compute_es_count> <io_es_count> <inflight_threads>\n");
return(-1);
}
......@@ -74,18 +74,16 @@ int main(int argc, char **argv)
assert(ret == 1);
ret = sscanf(argv[3], "%d", &common.opt_abt_io);
assert(ret == 1);
ret = sscanf(argv[4], "%d", &common.opt_abt_snoozer);
assert(ret == 1);
ret = sscanf(argv[5], "%d", &common.opt_unit_size);
ret = sscanf(argv[4], "%d", &common.opt_unit_size);
assert(ret == 1);
assert(common.opt_unit_size % 4096 == 0);
ret = sscanf(argv[6], "%d", &common.opt_num_units);
ret = sscanf(argv[5], "%d", &common.opt_num_units);
assert(ret == 1);
ret = sscanf(argv[7], "%d", &compute_es_count);
ret = sscanf(argv[6], "%d", &compute_es_count);
assert(ret == 1);
ret = sscanf(argv[8], "%d", &io_es_count);
ret = sscanf(argv[7], "%d", &io_es_count);
assert(ret == 1);
ret = sscanf(argv[9], "%d", &common.inflight_threads);
ret = sscanf(argv[8], "%d", &common.inflight_threads);
assert(ret == 1);
io_xstreams = malloc(io_es_count * sizeof(*io_xstreams));
......@@ -98,35 +96,22 @@ int main(int argc, char **argv)
ret = ABT_init(argc, argv);
assert(ret == 0);
if(common.opt_abt_snoozer)
{
/* set primary ES to idle without polling */
ret = ABT_snoozer_xstream_self_set();
assert(ret == 0);
/* set caller (self) ES to sleep when idle by using SCHED_BASIC_WAIT */
ret = ABT_sched_create_basic(ABT_SCHED_BASIC_WAIT, 0, NULL,
ABT_SCHED_CONFIG_NULL, &self_sched);
assert(ret == ABT_SUCCESS);
ret = ABT_xstream_self(&self_xstream);
assert(ret == ABT_SUCCESS);
ret = ABT_xstream_set_main_sched(self_xstream, self_sched);
assert(ret == ABT_SUCCESS);
/* create dedicated pool for computation */
ret = ABT_snoozer_xstream_create(compute_es_count, &compute_pool, compute_xstreams);
assert(ret == 0);
}
else
{
ret = ABT_nosnoozer_xstream_create(compute_es_count, &compute_pool, compute_xstreams);
assert(ret == 0);
}
ret = ABT_xstream_create_helper(compute_es_count, &compute_pool, compute_xstreams);
assert(ret == 0);
if(common.opt_abt_io)
{
if(common.opt_abt_snoozer)
{
/* create dedicated pool drive IO */
ret = ABT_snoozer_xstream_create(io_es_count, &io_pool, io_xstreams);
assert(ret == 0);
}
else
{
ret = ABT_nosnoozer_xstream_create(io_es_count, &io_pool, io_xstreams);
assert(ret == 0);
}
ret = ABT_xstream_create_helper(io_es_count, &io_pool, io_xstreams);
assert(ret == 0);
/* initialize abt_io */
common.aid = abt_io_init_pool(io_pool);
......@@ -203,8 +188,8 @@ int main(int argc, char **argv)
free(compute_xstreams);
assert(common.opt_num_units == common.completed);
printf("#<opt_compute>\t<opt_io>\t<opt_abt_io>\t<opt_abt_snoozer>\t<opt_unit_size>\t<opt_num_units>\t<opt_compute_es_count>\t<opt_io_es_count>\t<time (s)>\t<bytes/s>\t<ops/s>\n");
printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\t%f\n", common.opt_compute, common.opt_io, common.opt_abt_io, common.opt_abt_snoozer,
printf("#<opt_compute>\t<opt_io>\t<opt_abt_io>\t<opt_unit_size>\t<opt_num_units>\t<opt_compute_es_count>\t<opt_io_es_count>\t<time (s)>\t<bytes/s>\t<ops/s>\n");
printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\t%f\n", common.opt_compute, common.opt_io, common.opt_abt_io,
common.opt_unit_size, common.opt_num_units, compute_es_count, io_es_count, seconds, ((double)common.opt_unit_size* (double)common.opt_num_units)/seconds, (double)common.opt_num_units/seconds);
return(0);
......@@ -287,7 +272,7 @@ static double wtime(void)
return((double)t.tv_sec + (double)t.tv_usec / 1000000.0);
}
static int ABT_nosnoozer_xstream_create(int num_xstreams, ABT_pool *newpool, ABT_xstream *newxstreams)
static int ABT_xstream_create_helper(int num_xstreams, ABT_pool *newpool, ABT_xstream *newxstreams)
{
ABT_sched *scheds;
int i;
......@@ -297,12 +282,12 @@ static int ABT_nosnoozer_xstream_create(int num_xstreams, ABT_pool *newpool, ABT
return(-1);
/* Create a shared pool */
ABT_pool_create_basic(ABT_POOL_FIFO, ABT_POOL_ACCESS_MPMC,
ABT_pool_create_basic(ABT_POOL_FIFO_WAIT, ABT_POOL_ACCESS_MPMC,
ABT_TRUE, newpool);
/* create schedulers */
for (i = 0; i < num_xstreams; i++) {
ABT_sched_create_basic(ABT_SCHED_DEFAULT, 1, newpool,
ABT_sched_create_basic(ABT_SCHED_BASIC_WAIT, 1, newpool,
ABT_SCHED_CONFIG_NULL, &scheds[i]);
}
......
......@@ -16,7 +16,6 @@
#include "abt-io-config.h"
#include <abt.h>
#include <abt-io.h>
#include <abt-snoozer.h>
#ifndef HAVE_ODIRECT
#define O_DIRECT 0
......@@ -77,13 +76,19 @@ int main(int argc, char **argv)
unsigned int concurrency;
double duration;
int buffer_per_thread = 0;
ABT_sched self_sched;
ABT_xstream self_xstream;
ABT_init(argc, argv);
/* set primary ES to idle without polling */
ret = ABT_snoozer_xstream_self_set();
assert(ret == 0);
/* set caller (self) ES to sleep when idle by using SCHED_BASIC_WAIT */
ret = ABT_sched_create_basic(ABT_SCHED_BASIC_WAIT, 0, NULL,
ABT_SCHED_CONFIG_NULL, &self_sched);
assert(ret == ABT_SUCCESS);
ret = ABT_xstream_self(&self_xstream);
assert(ret == ABT_SUCCESS);
ret = ABT_xstream_set_main_sched(self_xstream, self_sched);
assert(ret == ABT_SUCCESS);
if(argc != 6)
{
......
......@@ -17,7 +17,6 @@
#include <fcntl.h>
#include <abt.h>
#include <abt-snoozer.h>
#include "abt-io.h"
......@@ -41,7 +40,9 @@ abt_io_instance_id abt_io_init(int backing_thread_count)
ABT_pool pool;
ABT_xstream self_xstream;
ABT_xstream *progress_xstreams = NULL;
ABT_sched *progress_scheds = NULL;
int ret;
int i;
if (backing_thread_count < 0) return NULL;
......@@ -63,13 +64,42 @@ abt_io_instance_id abt_io_init(int backing_thread_count)
free(aid);
return ABT_IO_INSTANCE_NULL;
}
ret = ABT_snoozer_xstream_create(backing_thread_count, &pool,
progress_xstreams);
if (ret != ABT_SUCCESS) {
progress_scheds = malloc(
backing_thread_count * sizeof(*progress_scheds));
if (progress_scheds == NULL) {
free(progress_xstreams);
free(aid);
return ABT_IO_INSTANCE_NULL;
}
ret = ABT_pool_create_basic(ABT_POOL_FIFO_WAIT, ABT_POOL_ACCESS_MPMC,
ABT_TRUE, &pool);
if(ret != ABT_SUCCESS)
{
free(progress_xstreams);
free(progress_scheds);
free(aid);
return ABT_IO_INSTANCE_NULL;
}
for(i=0; i<backing_thread_count; i++)
{
ret = ABT_sched_create_basic(ABT_SCHED_BASIC_WAIT, 1, &pool,
ABT_SCHED_CONFIG_NULL, &progress_scheds[i]);
if (ret != ABT_SUCCESS) {
free(progress_xstreams);
free(progress_scheds);
free(aid);
return ABT_IO_INSTANCE_NULL;
}
ret = ABT_xstream_create(progress_scheds[i], &progress_xstreams[i]);
if (ret != ABT_SUCCESS) {
free(progress_xstreams);
free(progress_scheds);
free(aid);
return ABT_IO_INSTANCE_NULL;
}
}
}
aid->progress_pool = pool;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment