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 / description / test-request3.c < prev    next >
C/C++ Source or Header  |  2005-07-07  |  2KB  |  110 lines

  1. /*
  2.  * (C) 2002 Clemson University.
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */       
  6.  
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #include <pvfs2-types.h>
  10. #include <gossip.h>
  11. #include <pvfs2-debug.h>
  12.  
  13. #include <pint-distribution.h>
  14.  
  15. #include <simple-stripe.h>
  16.  
  17. extern PVFS_Distribution simple_stripe;
  18.  
  19. #define SEGMAX 32
  20. #define BYTEMAX 250
  21.  
  22. main(int argc, char **argv)
  23. {
  24.     int i;
  25.     PINT_Request req1;
  26.     PINT_Request req2;
  27.     PINT_Request req3;
  28.  
  29.     // PVFS_Process_request arguments
  30.     PINT_Request_state *reqs;
  31.     PVFS_Dist_parm dparm;
  32.     PINT_Request_file_data rfdata;
  33.     int32_t segmax;
  34.     PVFS_offset *offset_array;
  35.     PVFS_size *size_array;
  36.     PVFS_offset offset;
  37.     PVFS_size bytemax;
  38.     PVFS_boolean eof_flag;
  39.  
  40.    // Turn on debugging
  41.     gossip_enable_stderr();
  42.     gossip_set_debug_mask(1,REQUEST_DEBUG);
  43.  
  44.     req2.offset = 0; // This is a byte type
  45.     req2.num_ereqs = 1;
  46.     req2.stride = 0;
  47.     req2.num_blocks = 1;
  48.     req2.ub = 1;
  49.     req2.lb = 0;
  50.     req2.aggregate_size = 1;
  51.     req2.depth = 0;
  52.     req2.num_contig_chunks = 1;
  53.     req2.ereq = NULL;
  54.     req2.sreq = NULL;
  55.  
  56.     req3.offset = 0;
  57.     req3.num_ereqs = 8;
  58.     req3.stride = 20;
  59.     req3.num_blocks = 20;
  60.     req3.ub = 400;
  61.     req3.lb = 0;
  62.     req3.aggregate_size = 160;
  63.     req3.depth = 1;
  64.     req3.num_contig_chunks = 20;
  65.     req3.ereq = &req2;
  66.     req3.sreq = NULL;
  67.  
  68.     req1.offset = 0;
  69.     req1.num_ereqs = 4;
  70.     req1.stride = 2000;
  71.     req1.num_blocks = 10;
  72.     req1.ub = 19600;
  73.     req1.lb = 0;
  74.     req1.aggregate_size = 6400;
  75.     req1.depth = 2;
  76.     req1.num_contig_chunks = 800;
  77.     req1.ereq = &req3;
  78.     req1.sreq = NULL;
  79.  
  80.     reqs = PINT_new_request_state(&req1);
  81.     rfdata.server_nr = 0;
  82.     rfdata.server_ct = 2;
  83.     rfdata.fsize = 10000000;
  84.     rfdata.dist = PINT_lookup_distribution("simple stripe");
  85.     dparm.strip_size = 1024;
  86.     rfdata.dparm = &dparm;
  87.     rfdata.extend_flag = 0;
  88.     offset_array = (int64_t *)malloc(SEGMAX * sizeof(int64_t));
  89.     size_array = (int64_t *)malloc(SEGMAX * sizeof(int64_t));
  90.     eof_flag = 0;
  91.     offset = 0;
  92.     do {
  93.         segmax = SEGMAX;
  94.         bytemax = BYTEMAX;
  95.         PINT_process_request(reqs, &rfdata, &segmax, offset_array,
  96.                 size_array, &offset, &bytemax, &eof_flag, PINT_CLIENT);
  97.         printf("processed %lld bytes in %d segments\n", bytemax, segmax);
  98.         for (i = 0; i < segmax; i++)
  99.         {
  100.             printf("segment %d: offset=%lld size=%lld\n", i,
  101.                     offset_array[i], size_array[i]);
  102.         }
  103.     } while (offset != -1);
  104. }
  105.  
  106. update_fsize(int64_t fsize)
  107. {
  108.     return (0);
  109. }
  110.