Changeset 96

Show
Ignore:
Timestamp:
03/18/07 03:20:04
Author:
kunxi
Message:

Update the guts.sh, the integer test would open src/read_int.test.
NOTE: this is a quick-n-dirty hack, this file is supposed to be created by rw_combound
Add validation for io_fread_shared_ind.

TODO: cleanup the dump.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • guts.sh

    r95 r96  
    7979 
    8080FILE=read.test 
     81FILE_INT=read_int.test 
    8182touch write_test.txt 
    8283 
     
    155156                fi 
    156157 
    157                 RUN_int0=`eval echo "upcrun -qn ${NP} ${SUNIT}.int0 ${FILE}"` 
     158                RUN_int0=`eval echo "upcrun -qn ${NP} ${SUNIT}.int0 ${FILE_INT}"` 
    158159                echo ${RUN_int0} 
    159160                exe_output=`${RUN_int0}` 
     
    170171                fi 
    171172 
    172                 RUN_int1=`eval echo "upcrun -qn ${NP} ${SUNIT}.int1 ${FILE}"` 
     173                RUN_int1=`eval echo "upcrun -qn ${NP} ${SUNIT}.int1 ${FILE_INT}"` 
    173174                echo ${RUN_int1} 
    174175                exe_output=`${RUN_int1}` 
     
    185186                fi 
    186187 
    187                 RUN_int4=`eval echo "upcrun -qn ${NP} ${SUNIT}.int4 ${FILE}"` 
     188                RUN_int4=`eval echo "upcrun -qn ${NP} ${SUNIT}.int4 ${FILE_INT}"` 
    188189                echo ${RUN_int4} 
    189190                exe_output=`${RUN_int4}` 
  • src/io_fread_shared_ind.upc

    r93 r96  
    4949        upc_barrier; 
    5050         
    51         upc_all_fseek(fd, offsets[MYTHREAD]*sizeof(int), UPC_SEEK_SET); 
     51        upc_all_fseek(fd, offsets[MYTHREAD]*sizeof(TYPE), UPC_SEEK_SET); 
    5252        ssize_t bytes = upc_all_fread_shared(fd, buffer+offset, blocksize, sizeof(TYPE), nmemb, UPC_IN_NOSYNC | UPC_OUT_NOSYNC); 
    5353 
     
    6262        upc_barrier; 
    6363} 
     64 
     65        /* Validation for data integrity */ 
     66        for (i = 0; i < nmemb; i++) { 
     67                if (buffer[offset + i] != (offsets[MYTHREAD] + i) % 0x80) 
     68                        GULA_FAIL("Data integrity is violated!"); 
     69        } 
     70 
     71 
    6472        offset = upc_all_fseek(fd, 0, UPC_SEEK_CUR); 
    65         fprintf(stderr, "TH%d: origin = %d, read %d bytes, cur =%d \n", MYTHREAD, sizeof(TYPE)*offsets[MYTHREAD], bytes, offset); 
    66         /* TODO: Add check for return value and offset */ 
     73        if (offset != (offsets[MYTHREAD] + nmemb) * sizeof(TYPE)) 
     74                GULA_FAIL("Fail to setup the file pointer"); 
     75                 
    6776 
    6877#if BLOCKSIZE != 0 
     
    7281        return 0; 
    7382} 
    74  
  • src/units

    r81 r96  
    11io_rw_compound 
    2 io_fopen 
    3 io_fclose 
    4 io_fseek 
    5 io_fset_size 
    6 io_fget_size 
    7 io_fpreallocate 
    8 io_fcntl 
    9 io_fread_local 
    10 io_fwrite_local 
    11 io_rw_compound 
    12 io_fread_list_local 
    13 io_fwrite_list_local 
    14 io_fwrite_local_async 
    15 io_rw_compound 
    16 io_fread_local_async 
    17 io_rw_compound 
    18 io_fread_list_local_async 
    19 io_fwrite_list_local_async 
    20 io_fwait_async 
    21 io_ftest_async