home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / test / io / bmi / driver-simple.c < prev    next >
C/C++ Source or Header  |  2004-07-28  |  1KB  |  75 lines

  1. /*
  2.  * (C) 2001 Clemson University and The University of Chicago
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <unistd.h>
  10. #include <errno.h>
  11. #include "gossip.h"
  12. #include <mpi.h>
  13. #include "bmi.h"
  14. #include "bench-initialize.h"
  15. #include "bench-args.h"
  16.  
  17. int main(
  18.     int argc,
  19.     char *argv[])
  20. {
  21.     int ret = -1;
  22.     int world_rank = 0;
  23.     MPI_Comm comm;
  24.     PVFS_BMI_addr_t *bmi_peer_array;
  25.     int *mpi_peer_array;
  26.     int num_clients;
  27.     struct bench_options opts;
  28.     int i = 0;
  29.     bmi_context_id context;
  30.  
  31.     /* start up benchmark environment */
  32.     ret = bench_init(&opts, argc, argv, &num_clients, &world_rank, &comm,
  33.              &bmi_peer_array, &mpi_peer_array, &context);
  34.     if (ret < 0)
  35.     {
  36.     fprintf(stderr, "bench_init() failure.\n");
  37.     return (-1);
  38.     }
  39.  
  40.     /* print some diagnostics */
  41.     if (world_rank < opts.num_servers)
  42.     {
  43.     printf("server: %d, talks to: \n", world_rank);
  44.     for (i = 0; i < num_clients; i++)
  45.     {
  46.         printf("%d ", mpi_peer_array[i]);
  47.     }
  48.     printf("\n");
  49.     }
  50.     else
  51.     {
  52.     printf("client: %d, talks to: \n", world_rank);
  53.     for (i = 0; i < opts.num_servers; i++)
  54.     {
  55.         printf("%d ", mpi_peer_array[i]);
  56.     }
  57.     printf("\n");
  58.     }
  59.  
  60.     /* shutdown interfaces */
  61.     BMI_close_context(context);
  62.     BMI_finalize();
  63.     MPI_Finalize();
  64.     return 0;
  65. }
  66.  
  67. /*
  68.  * Local variables:
  69.  *  c-indent-level: 4
  70.  *  c-basic-offset: 4
  71.  * End:
  72.  *
  73.  * vim: ts=8 sts=4 sw=4 expandtab
  74.  */
  75.