00001 
00002 
00003 
00004 
00005 
00006 
00007 #include <assert.h>
00008 #include "adio.h"
00009 #include "adio_extern.h"
00010 #include "ad_pvfs2.h"
00011 #include "ad_pvfs2_io.h"
00012 #include "ad_pvfs2_common.h"
00013 
00014 #define COALESCE_REGIONS  
00015 #define MAX_OL_COUNT 64
00016 int ADIOI_PVFS2_StridedListIO(ADIO_File fd, void *buf, int count,
00017                   MPI_Datatype datatype, int file_ptr_type,
00018                   ADIO_Offset offset, ADIO_Status *status,
00019                   int *error_code, int rw_type)
00020 {
00021     
00022     int i = -1, ret = -1;
00023     int tmp_filetype_size = -1;
00024     int64_t cur_io_size = 0, io_size = 0;
00025     int etype_size = -1;
00026     int num_etypes_in_filetype = -1, num_filetypes = -1;
00027     int etypes_in_filetype = -1, size_in_filetype = -1;
00028     int bytes_into_filetype = 0;
00029     MPI_Offset total_bytes_accessed = 0;
00030     
00031     
00032     int64_t buf_off_arr[MAX_OL_COUNT];
00033     int32_t buf_len_arr[MAX_OL_COUNT];
00034     int64_t file_off_arr[MAX_OL_COUNT];
00035     int32_t file_len_arr[MAX_OL_COUNT];
00036     int32_t buf_ol_count = 0;
00037     int32_t file_ol_count = 0;
00038     
00039     
00040     int flat_buf_index = 0;
00041     int flat_file_index = 0;
00042     int64_t cur_flat_buf_reg_off = 0;
00043     int64_t cur_flat_file_reg_off = 0;
00044     ADIOI_Flatlist_node *flat_buf_p, *flat_file_p;
00045     int buftype_size = -1, buftype_extent = -1,
00046         filetype_size = -1, filetype_extent = -1;
00047     int buftype_is_contig = -1, filetype_is_contig = -1;
00048     
00049     
00050     PVFS_Request mem_req, file_req;
00051     ADIOI_PVFS2_fs * pvfs_fs;
00052     PVFS_sysresp_io resp_io;
00053     static char myname[] = "ADIOI_PVFS2_STRIDED_LISTIO";
00054 
00055     if (fd->atomicity) {
00056         *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00057                                            MPIR_ERR_RECOVERABLE,
00058                                            myname, __LINE__,
00059                                            MPI_ERR_ARG,
00060                                            "Atomic noncontiguous writes"
00061                        " are not supported by PVFS2", 0);
00062         return -1;
00063     }
00064 
00065     MPI_Type_size(fd->filetype, &filetype_size);
00066     if (filetype_size == 0) {
00067         *error_code = MPI_SUCCESS;
00068         return -1;
00069     }
00070     MPI_Type_extent(fd->filetype, &filetype_extent);
00071     MPI_Type_size(datatype, &buftype_size);
00072     MPI_Type_extent(datatype, &buftype_extent);
00073     io_size = buftype_size*count;
00074 
00075     pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr;
00076     
00077     
00078 
00079 
00080 
00081     ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
00082     ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
00083     if (buftype_is_contig == 0)
00084     {
00085     ADIOI_Flatten_datatype(datatype);
00086     flat_buf_p = ADIOI_Flatlist;
00087     while (flat_buf_p->type != datatype) 
00088         flat_buf_p = flat_buf_p->next;
00089     }
00090     else 
00091     {
00092     
00093     flat_buf_p = (ADIOI_Flatlist_node *) ADIOI_Malloc
00094         (sizeof(ADIOI_Flatlist_node));
00095     flat_buf_p->blocklens = (ADIO_Offset*)ADIOI_Malloc(sizeof(ADIO_Offset));
00096     flat_buf_p->indices = 
00097         (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset));
00098     
00099 
00100     buftype_size = buftype_size*count;
00101     buftype_extent = buftype_size*count;
00102     flat_buf_p->blocklens[0] = buftype_size;
00103     flat_buf_p->indices[0] = 0;
00104     flat_buf_p->count = 1;
00105     }
00106     if (filetype_is_contig == 0)
00107     {
00108         
00109 
00110 
00111     ADIOI_Flatten_datatype(fd->filetype);
00112     flat_file_p = ADIOI_Flatlist;
00113     while (flat_file_p->type != fd->filetype) 
00114         flat_file_p = flat_file_p->next;
00115     }
00116     else
00117     {
00118         
00119         flat_file_p = (ADIOI_Flatlist_node *) ADIOI_Malloc
00120             (sizeof(ADIOI_Flatlist_node));
00121         flat_file_p->blocklens =(ADIO_Offset*)ADIOI_Malloc(sizeof(ADIO_Offset));
00122         flat_file_p->indices = 
00123         (ADIO_Offset *) ADIOI_Malloc(sizeof(ADIO_Offset));
00124         flat_file_p->blocklens[0] = filetype_size;
00125         flat_file_p->indices[0] = 0;
00126         flat_file_p->count = 1;
00127     }
00128         
00129     
00130 
00131 
00132 
00133 
00134 
00135 
00136     etype_size = fd->etype_size;
00137     num_etypes_in_filetype = filetype_size / etype_size;
00138     if (file_ptr_type == ADIO_INDIVIDUAL)
00139     {
00140     int flag = 0;
00141     
00142     num_filetypes = -1;
00143     while (!flag)
00144     {
00145         num_filetypes++;
00146         for (i = 0; i < flat_file_p->count; i++)
00147         {
00148         
00149         if (flat_file_p->blocklens[i])
00150         {
00151             if (fd->disp + flat_file_p->indices[i] +
00152             (num_filetypes * filetype_extent) +
00153             flat_file_p->blocklens[i] > fd->fp_ind &&
00154             fd->disp + flat_file_p->indices[i] <=
00155             fd->fp_ind)
00156             {
00157             flat_file_index = i;
00158             cur_flat_file_reg_off = fd->fp_ind -
00159                 (fd->disp + flat_file_p->indices[i] +
00160                  (num_filetypes * filetype_extent));
00161             flag = 1;
00162             break;
00163             }
00164             else
00165             bytes_into_filetype += flat_file_p->blocklens[i];
00166         }
00167         }
00168     }
00169     
00170     assert(i != flat_file_p->count);
00171     }
00172     else
00173     { 
00174     num_filetypes = (int) (offset / num_etypes_in_filetype);
00175     etypes_in_filetype = (int) (offset % num_etypes_in_filetype);
00176     size_in_filetype = etypes_in_filetype * etype_size;
00177 
00178     tmp_filetype_size = 0;
00179     for (i=0; i<flat_file_p->count; i++) {
00180         tmp_filetype_size += flat_file_p->blocklens[i];
00181         if (tmp_filetype_size > size_in_filetype) 
00182         {
00183         flat_file_index = i;
00184         cur_flat_file_reg_off = flat_file_p->blocklens[i] - 
00185             (tmp_filetype_size - size_in_filetype);
00186         bytes_into_filetype = offset * filetype_size -
00187             flat_file_p->blocklens[i];
00188         break;
00189         }
00190     }
00191     }
00192 #ifdef DEBUG_LIST
00193     fprintf(stderr, "ADIOI_PVFS2_StridedListIO: (fd->fp_ind=%Ld,fd->disp=%Ld,"
00194             " offset=%Ld)\n(flat_file_index=%d,cur_flat_file_reg_off=%Ld,"
00195         "bytes_into_filetype=%d)\n",
00196             fd->fp_ind, fd->disp, offset, flat_file_index, 
00197         cur_flat_file_reg_off, bytes_into_filetype);
00198 #endif
00199 #ifdef DEBUG_LIST2
00200     fprintf(stderr, "flat_buf:\n");
00201     for (i = 0; i < flat_buf_p->count; i++)
00202     fprintf(stderr, "(offset, length) = (%Ld, %d)\n",
00203            flat_buf_p->indices[i],
00204            flat_buf_p->blocklens[i]);
00205     fprintf(stderr, "flat_file:\n");
00206     for (i = 0; i < flat_file_p->count; i++)
00207     fprintf(stderr, "(offset, length) = (%Ld, %d)\n",
00208            flat_file_p->indices[i],
00209            flat_file_p->blocklens[i]);
00210 #endif    
00211 
00212     
00213     cur_io_size = 0;
00214     while (cur_io_size != io_size)
00215     {
00216     
00217 
00218     buf_ol_count = 0;
00219     file_ol_count = 0;
00220     for (i = 0; i < MAX_OL_COUNT; i++)
00221     {
00222         buf_off_arr[i] = 0;
00223         buf_len_arr[i] = 0;
00224         file_off_arr[i] = 0;
00225         file_len_arr[i] = 0;
00226     }
00227 
00228         
00229 
00230     gen_listio_arr(flat_buf_p,
00231                &flat_buf_index,
00232                &cur_flat_buf_reg_off,
00233                buftype_size,
00234                buftype_extent,
00235                flat_file_p,
00236                &flat_file_index,
00237                &cur_flat_file_reg_off,
00238                filetype_size,
00239                filetype_extent,
00240                MAX_OL_COUNT,
00241                fd->disp,
00242                bytes_into_filetype,
00243                &cur_io_size,
00244                io_size,
00245                buf_off_arr,
00246                buf_len_arr,
00247                &buf_ol_count,
00248                file_off_arr,
00249                file_len_arr,
00250                &file_ol_count);
00251 
00252     assert(buf_ol_count <= MAX_OL_COUNT);
00253     assert(file_ol_count <= MAX_OL_COUNT);
00254 #ifdef DEBUG_LIST2
00255     print_buf_file_ol_pairs(buf_off_arr,
00256                 buf_len_arr,
00257                 buf_ol_count,
00258                 file_off_arr,
00259                 file_len_arr,
00260                 file_ol_count,
00261                 buf,
00262                 rw_type);
00263 #endif
00264 #ifdef DEBUG_LIST2
00265     do {
00266         int y, z;
00267         fprintf(stderr, "ad_pvfs2_io_list.c::\n");
00268         for (y = 0; y < buf_ol_count; y++)
00269         {
00270         for (z = 0; z < buf_len_arr[y]; z++)
00271         {
00272             fprintf(stderr, "buf[%d][%d]=%c\n",
00273                 y, z, ((char *) buf + buf_off_arr[y])[z]);
00274         }
00275         }
00276     } while (0);
00277 #endif
00278     
00279     
00280     ret = PVFS_Request_hindexed(buf_ol_count, buf_len_arr,
00281                     buf_off_arr, PVFS_BYTE, &mem_req);
00282 
00283     ret = PVFS_Request_hindexed(file_ol_count, file_len_arr,
00284                     file_off_arr, PVFS_BYTE, &file_req);
00285     if (rw_type == READ)
00286     {
00287         ret = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0,
00288                 buf, mem_req, 
00289                 &(pvfs_fs->credentials), &resp_io);
00290     }
00291     else 
00292     {
00293         ret = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0,
00294                  buf, mem_req, 
00295                  &(pvfs_fs->credentials), &resp_io);
00296     }
00297     if (ret != 0) 
00298     {
00299         fprintf(stderr, "ADIOI_PVFS2_StridedListIO: Warning - PVFS_sys_"
00300             "read/write returned %d and completed %Ld bytes.\n", 
00301             ret, resp_io.total_completed);
00302         *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00303                            MPIR_ERR_RECOVERABLE,
00304                            myname, __LINE__,
00305                            ADIOI_PVFS2_error_convert(ret),
00306                            "Error in PVFS_sys_io \n", 0);
00307         PVFS_Request_free(&mem_req);
00308         PVFS_Request_free(&file_req);
00309         goto error_state;
00310     }
00311     total_bytes_accessed += resp_io.total_completed;
00312 
00313     PVFS_Request_free(&mem_req);
00314     PVFS_Request_free(&file_req);
00315     }
00316     
00317 #ifdef DEBUG_LIST
00318     fprintf(stderr, "ADIOI_PVFS2_StridedListIO: "
00319             "total_bytes_accessed=%Ld,ret=%d\n", 
00320         total_bytes_accessed, ret);
00321 #endif
00322 
00323     if (file_ptr_type == ADIO_INDIVIDUAL) 
00324     fd->fp_ind += total_bytes_accessed;
00325     *error_code = MPI_SUCCESS;
00326 
00327 error_state:
00328 #ifdef HAVE_STATUS_SET_BYTES
00329     
00330     MPIR_Status_set_bytes(status, datatype, (int)total_bytes_accessed);
00331 
00332 
00333 #endif
00334     if (buftype_is_contig == 0)
00335     ADIOI_Delete_flattened(datatype);
00336     else
00337     {
00338     ADIOI_Free(flat_buf_p->blocklens);
00339     ADIOI_Free(flat_buf_p->indices);
00340     ADIOI_Free(flat_buf_p);
00341     }
00342 
00343     if (filetype_is_contig == 0)
00344     ADIOI_Delete_flattened(fd->filetype);
00345     else
00346     {
00347     ADIOI_Free(flat_file_p->blocklens);
00348     ADIOI_Free(flat_file_p->indices);
00349     ADIOI_Free(flat_file_p);
00350     }
00351 
00352     return 0;
00353 }
00354 
00355 
00356 
00357 
00358 
00359 
00360 int gen_listio_arr(ADIOI_Flatlist_node *flat_buf_p,
00361            int *flat_buf_index_p,
00362            int64_t *cur_flat_buf_reg_off_p,
00363            int flat_buf_size,
00364            int flat_buf_extent,
00365            ADIOI_Flatlist_node *flat_file_p,
00366            int *flat_file_index_p,
00367            int64_t *cur_flat_file_reg_off_p,
00368            int flat_file_size,
00369            int flat_file_extent,
00370            int max_ol_count,
00371            ADIO_Offset disp,
00372            int bytes_into_filetype,
00373            int64_t *bytes_completed,
00374            int64_t total_io_size,
00375            int64_t buf_off_arr[],
00376            int32_t buf_len_arr[],
00377            int32_t *buf_ol_count_p,
00378            int64_t file_off_arr[],
00379            int32_t file_len_arr[],
00380            int32_t *file_ol_count_p)
00381 {
00382     int region_size = -1;
00383     
00384     
00385     int64_t cur_flat_buf_reg_left = 0;
00386     int64_t cur_flat_file_reg_left = 0;
00387     
00388 #ifdef DEBUG_LIST2
00389     fprintf(stderr, "gen_list_arr:\n");
00390 #endif
00391 
00392     if ((*buf_ol_count_p) != 0 ||(*file_ol_count_p) != 0)
00393     {
00394     fprintf(stderr, "buf_ol_count != 0 || file_ol_count != 0\n");
00395     return -1;
00396     }
00397     
00398     
00399 
00400 
00401 
00402     while (flat_buf_p->blocklens[(*flat_buf_index_p)] == 0)
00403     {
00404     (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % 
00405         flat_buf_p->count;
00406     }
00407     buf_off_arr[*buf_ol_count_p] =
00408     (*bytes_completed / flat_buf_size) * 
00409     flat_buf_extent + 
00410     flat_buf_p->indices[*flat_buf_index_p] +
00411     *cur_flat_buf_reg_off_p;
00412     buf_len_arr[*buf_ol_count_p] = 0;
00413 
00414     while (flat_file_p->blocklens[(*flat_file_index_p)] == 0)
00415     {
00416     (*flat_file_index_p) = ((*flat_file_index_p) + 1) % 
00417         flat_file_p->count;
00418     }
00419     file_off_arr[*file_ol_count_p] = disp + 
00420     (((bytes_into_filetype + *bytes_completed) / flat_file_size) * 
00421      flat_file_extent) + 
00422     flat_file_p->indices[*flat_file_index_p] +
00423     *cur_flat_file_reg_off_p;
00424     file_len_arr[*file_ol_count_p] = 0;
00425 
00426 #ifdef DEBUG_LIST2
00427     fprintf(stderr, "initial buf_off_arr[%d] = %Ld\n", *buf_ol_count_p,
00428         buf_off_arr[*buf_ol_count_p]);
00429     fprintf(stderr, "initial file_off_arr[%d] = %Ld\n", *file_ol_count_p,
00430         file_off_arr[*file_ol_count_p]);
00431 #endif
00432 
00433     while (*bytes_completed != total_io_size
00434        && (*buf_ol_count_p) < max_ol_count
00435        && (*file_ol_count_p) < max_ol_count)
00436     {
00437     
00438 
00439     cur_flat_buf_reg_left = flat_buf_p->blocklens[*flat_buf_index_p]
00440         - *cur_flat_buf_reg_off_p;
00441     cur_flat_file_reg_left = flat_file_p->blocklens[*flat_file_index_p]
00442         - *cur_flat_file_reg_off_p;
00443 
00444 #ifdef DEBUG_LIST2
00445     fprintf(stderr, 
00446         "flat_buf_index=%d flat_buf->blocklens[%d]=%d\n"
00447         "cur_flat_buf_reg_left=%Ld "
00448         "*cur_flat_buf_reg_off_p=%Ld\n" 
00449         "flat_file_index=%d flat_file->blocklens[%d]=%d\n"
00450         "cur_flat_file_reg_left=%Ld "
00451         "*cur_flat_file_reg_off_p=%Ld\n" 
00452         "bytes_completed=%Ld\n"
00453         "buf_ol_count=%d file_ol_count=%d\n"
00454         "buf_len_arr[%d]=%d file_len_arr[%d]=%d\n\n",
00455         *flat_buf_index_p, *flat_buf_index_p, 
00456         flat_buf_p->blocklens[*flat_buf_index_p],
00457         cur_flat_buf_reg_left,
00458         *cur_flat_buf_reg_off_p,
00459         *flat_file_index_p, *flat_file_index_p, 
00460         flat_file_p->blocklens[*flat_file_index_p],
00461         cur_flat_file_reg_left,
00462         *cur_flat_file_reg_off_p,
00463         *bytes_completed,
00464         *buf_ol_count_p, *file_ol_count_p,
00465         *buf_ol_count_p,
00466         buf_len_arr[*buf_ol_count_p],
00467         *file_ol_count_p,
00468         file_len_arr[*file_ol_count_p]);
00469 #endif
00470 
00471     
00472 
00473 
00474     if (cur_flat_buf_reg_left > cur_flat_file_reg_left)
00475         region_size = cur_flat_file_reg_left;
00476     else
00477         region_size = cur_flat_buf_reg_left;
00478     
00479     if (region_size > total_io_size - *bytes_completed)
00480         region_size = total_io_size - *bytes_completed;
00481     
00482     
00483 
00484 
00485 
00486 
00487     
00488     if (cur_flat_buf_reg_left == region_size)
00489     {
00490 #ifdef DEBUG_LIST2
00491         fprintf(stderr, "reached end of memory block...\n");
00492 #endif
00493         (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % 
00494         flat_buf_p->count;
00495         while (flat_buf_p->blocklens[(*flat_buf_index_p)] == 0)
00496         {
00497         (*flat_buf_index_p) = ((*flat_buf_index_p) + 1) % 
00498             flat_buf_p->count;
00499         }
00500         *cur_flat_buf_reg_off_p = 0;
00501 
00502 #ifdef COALESCE_REGIONS
00503         if (*buf_ol_count_p != 0)
00504         {
00505         if (buf_off_arr[(*buf_ol_count_p) - 1] +
00506             buf_len_arr[(*buf_ol_count_p) - 1] ==
00507             buf_off_arr[*buf_ol_count_p])
00508         {
00509             buf_len_arr[(*buf_ol_count_p) - 1] +=
00510             region_size;
00511         }
00512         else
00513         {
00514             buf_len_arr[*buf_ol_count_p] += region_size;
00515             (*buf_ol_count_p)++;
00516         }
00517         }
00518         else
00519         {
00520 #endif
00521         buf_len_arr[*buf_ol_count_p] += region_size;
00522         (*buf_ol_count_p)++;
00523 #ifdef COALESCE_REGIONS
00524         }
00525 #endif
00526 
00527         
00528 
00529         if ((*buf_ol_count_p) != max_ol_count)
00530         {
00531         buf_off_arr[*buf_ol_count_p] = 
00532             ((*bytes_completed + region_size) / flat_buf_size) * 
00533             flat_buf_extent + 
00534             flat_buf_p->indices[*flat_buf_index_p] +
00535             (*cur_flat_buf_reg_off_p);
00536         buf_len_arr[*buf_ol_count_p] = 0;
00537         }
00538     }
00539     else if (cur_flat_buf_reg_left > region_size)
00540     {
00541 #ifdef DEBUG_LIST2
00542         fprintf(stderr, "advanced %d in memory block...\n",
00543             region_size);
00544 #endif
00545         (*cur_flat_buf_reg_off_p) += region_size;
00546         buf_len_arr[*buf_ol_count_p] += region_size;
00547     }
00548     else
00549     {
00550         fprintf(stderr, "gen_listio_arr: Error\n");
00551     }
00552     
00553     
00554 
00555 
00556 
00557     if (cur_flat_file_reg_left == region_size)
00558     {
00559 #ifdef DEBUG_LIST2
00560         fprintf(stderr, "reached end of file block...\n");
00561 #endif
00562         (*flat_file_index_p) = ((*flat_file_index_p) + 1) % 
00563         flat_file_p->count;
00564         while (flat_file_p->blocklens[(*flat_file_index_p)] == 0)
00565         {
00566         (*flat_file_index_p) = ((*flat_file_index_p) + 1) % 
00567             flat_file_p->count;
00568         }
00569         (*cur_flat_file_reg_off_p) = 0;
00570 
00571 #ifdef COALESCE_REGIONS
00572             if (*file_ol_count_p != 0)
00573             {
00574                 if (file_off_arr[(*file_ol_count_p) - 1] +
00575                     file_len_arr[(*file_ol_count_p) - 1] ==
00576                     file_off_arr[*file_ol_count_p])
00577                 {
00578                     file_len_arr[(*file_ol_count_p) - 1] +=
00579                         region_size;
00580                 }
00581                 else
00582                 {
00583                     file_len_arr[*file_ol_count_p] += region_size;
00584                     (*file_ol_count_p)++;
00585                 }
00586             }
00587             else
00588             {
00589 #endif
00590                 file_len_arr[*file_ol_count_p] += region_size;
00591                 (*file_ol_count_p)++;
00592 #ifdef COALESCE_REGIONS
00593             }
00594 #endif
00595 
00596         
00597 
00598             if ((*file_ol_count_p) != max_ol_count)
00599         {
00600         file_off_arr[*file_ol_count_p] = disp + 
00601             (((bytes_into_filetype + *bytes_completed + region_size) 
00602               / flat_file_size) * 
00603              flat_file_extent) + 
00604             flat_file_p->indices[*flat_file_index_p] +
00605             (*cur_flat_file_reg_off_p);
00606         file_len_arr[*file_ol_count_p] = 0;
00607         }
00608     }
00609     else if (cur_flat_file_reg_left > region_size)
00610     {
00611 #ifdef DEBUG_LIST2
00612         fprintf(stderr, "advanced %d in file block...\n",
00613             region_size);
00614 #endif
00615         (*cur_flat_file_reg_off_p) += region_size;
00616         file_len_arr[*file_ol_count_p] += region_size;
00617     }
00618     else
00619     {
00620         fprintf(stderr, "gen_listio_arr: Error\n");
00621     }
00622 #ifdef DEBUG_LIST2
00623     fprintf(stderr, 
00624         "------------------------------\n\n");
00625 #endif
00626     *bytes_completed += region_size;
00627     }
00628     
00629 
00630     if (*cur_flat_buf_reg_off_p != 0)
00631     (*buf_ol_count_p)++;
00632     if (*cur_flat_file_reg_off_p != 0)
00633     (*file_ol_count_p)++;
00634 
00635     return 0;
00636 }
00637 
00638 void print_buf_file_ol_pairs(int64_t buf_off_arr[],
00639                  int32_t buf_len_arr[],
00640                  int32_t buf_ol_count,
00641                  int64_t file_off_arr[],
00642                  int32_t file_len_arr[],
00643                  int32_t file_ol_count,
00644                  void *buf,
00645                  int rw_type)
00646 {
00647     int i = -1;
00648     
00649     fprintf(stderr, "buf_ol_pairs(offset,length) count = %d\n",
00650         buf_ol_count);
00651     for (i = 0; i < buf_ol_count; i++)
00652     {
00653     fprintf(stderr, "(%Ld, %d) ", buf_off_arr[i], buf_len_arr[i]);
00654     }
00655     fprintf(stderr, "\n");
00656 
00657     fprintf(stderr, "file_ol_pairs(offset,length) count = %d\n",
00658         file_ol_count);
00659     for (i = 0; i < file_ol_count; i++)
00660     {
00661     fprintf(stderr, "(%Ld, %d) ", file_off_arr[i], file_len_arr[i]);
00662     }
00663     fprintf(stderr, "\n\n");
00664 
00665 }