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-request.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. #include <pvfs-distribution.h>
  15. #include <pint-request.h>
  16. #include <pvfs-request.h>
  17.  
  18. extern PVFS_Distribution default_dist;
  19.  
  20. #define SEGMAX 32
  21. #define BYTEMAX 250
  22.  
  23. main(int argc, char **argv)
  24. {
  25.     int i;
  26.     PINT_Request req1;
  27.     PINT_Request req2;
  28.     PINT_Request req3;
  29.  
  30.     // PVFS_Process_request arguments
  31.     PINT_Request_state *reqs;
  32.     PVFS_Dist_parm *dparm;
  33.     PINT_Request_file_data rfdata;
  34.     int32_t segmax;
  35.     PVFS_offset *offset_array;
  36.     PVFS_size *size_array;
  37.     PVFS_offset offset;
  38.     PVFS_size bytemax;
  39.     PVFS_boolean eof_flag;
  40.  
  41.     // Turn on debugging
  42.     gossip_enable_stderr();
  43.     gossip_set_debug_mask(1,REQUEST_DEBUG);
  44.  
  45.     req2.offset = 0; // This is a byte type
  46.     req2.num_ereqs = 1;
  47.     req2.stride = 0;
  48.     req2.num_blocks = 1;
  49.     req2.ub = 1;
  50.     req2.lb = 0;
  51.     req2.aggregate_size = 1;
  52.     req2.depth = 0;
  53.     req2.num_contig_chunks = 1;
  54.     req2.ereq = NULL;
  55.     req2.sreq = NULL;
  56.  
  57.     req3.offset = 0;
  58.     req3.num_ereqs = 8;
  59.     req3.stride = 20;
  60.     req3.num_blocks = 20;
  61.     req3.ub = 400;
  62.     req3.lb = 0;
  63.     req3.aggregate_size = 160;
  64.     req3.depth = 1;
  65.     req3.num_contig_chunks = 20;
  66.     req3.ereq = &req2;
  67.     req3.sreq = NULL;
  68.  
  69.     req1.offset = 0;
  70.     req1.num_ereqs = 4;
  71.     req1.stride = 2000;
  72.     req1.num_blocks = 10;
  73.     req1.ub = 19600;
  74.     req1.lb = 0;
  75.     req1.aggregate_size = 6400;
  76.     req1.depth = 2;
  77.     req1.num_contig_chunks = 800;
  78.     req1.ereq = &req3;
  79.     req1.sreq = NULL;
  80.  
  81.     reqs = PINT_new_request_state(&req1);
  82.     rfdata.server_nr = 0;
  83.     rfdata.server_ct = 1;
  84.     rfdata.fsize = 10000000;
  85.     rfdata.dist = &default_dist;
  86.     rfdata.dparm = NULL;
  87.     rfdata.extend_flag = 0;
  88.     offset_array = (PVFS_offset *)malloc(SEGMAX * sizeof(PVFS_offset));
  89.     size_array = (PVFS_size *)malloc(SEGMAX * sizeof(PVFS_size));
  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_SERVER);
  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.