#include "checks.h"
#include "common.h"
#include "layout.h"
#include "workqueue.h"

int main(int argc, char **argv)
{
  adlb_code ac;

  // Workaround: disable debug logging to avoid calls to MPI_WTime
  xlb_debug_enabled = false;

  xlb_s.types_size = 1;
  int comm_size = 64;

  // TODO: need way to provide hostnames
  const struct xlb_hostnames *hostnames = NULL;

  ac = xlb_layout_init(comm_size, comm_size - 1, 1,
                       hostnames, &xlb_s.layout);
  assert(ac == ADLB_SUCCESS);

  ac = xlb_workq_init(xlb_s.types_size, &xlb_s.layout);
  assert(ac == ADLB_SUCCESS);

}

#include "checks.h"
#include "common.h"
#include "layout.h"
#include "workqueue.h"

static void make_fake_hosts(const char **fake_hosts, int comm_size);

int main(int argc, char **argv)
{
  adlb_code ac;

  // Workaround: disable debug logging to avoid calls to MPI_WTime
  xlb_debug_enabled = false;

  xlb_s.types_size = 1;
  int comm_size = 64;
  int my_rank = comm_size - 1;
  int nservers = 1;


  const char *fake_hosts[comm_size];
  make_fake_hosts(fake_hosts, comm_size);

  struct xlb_hostnames hostnames;
  ac = xlb_hostnames_fill(&hostnames, fake_hosts, comm_size, my_rank);
  ADLB_CHECK(ac);

  ac = xlb_layout_init(comm_size, my_rank, nservers,
                       &hostnames, &xlb_s.layout);
  assert(ac == ADLB_SUCCESS);

  ac = xlb_workq_init(xlb_s.types_size, &xlb_s.layout);
  assert(ac == ADLB_SUCCESS);

}

static void make_fake_hosts(const char **fake_hosts, int comm_size)
{
  for (int i = 0; i < comm_size; i++) {
    switch (i % 8)
    {
      case 0:
        fake_hosts[i] = "ZERO";
        break;
      case 1:
        fake_hosts[i] = "ONE";
        break;
      case 2:
        fake_hosts[i] = "TWO";
        break;
      case 3:
        fake_hosts[i] = "THREE";
        break;
      case 4:
        fake_hosts[i] = "FOUR";
        break;
      case 5:
        fake_hosts[i] = "FIVE";
        break;
      case 6:
        fake_hosts[i] = "SIX";
        break;
      case 7:
        fake_hosts[i] = "SEVEN";
        break;
    }
  }
}

Create fake hostnames in test
Create fake hostnames in test

git-svn-id: 51d371801c0de2a0625fbca80cd99d181c32913f@15044 dc4e9af1-7f46-4ead-bba6-71afc04862de
