| 39 | | upc_all_fseek(fd, 20, UPC_SEEK_SET); |
|---|
| 40 | | upc_all_fread_shared_async(fd, buffer+offset, blocksize, sizeof(int), nmemb, UPC_IN_NOSYNC | UPC_OUT_NOSYNC); |
|---|
| 41 | | ssize_t bytes = upc_all_fwait_async(fd); |
|---|
| 42 | | upc_off_t vo = upc_all_fseek(fd, 0, UPC_SEEK_CUR); |
|---|
| 43 | | fprintf(stderr, "th%d: origin = 20 read %d bytes, offset = %d \n", MYTHREAD, bytes, vo); |
|---|
| 44 | | upc_barrier; |
|---|
| | 42 | upc_all_fseek(fd, fileoff * sizeof(TYPE), UPC_SEEK_SET); |
|---|
| | 43 | upc_all_fread_shared_async(fd, buffer+ memoff , blocksize, sizeof(TYPE), nmemb, UPC_IN_NOSYNC | UPC_OUT_NOSYNC); |
|---|
| | 44 | bytes = upc_all_fwait_async(fd); |
|---|
| 46 | | if( MYTHREAD == 0) { |
|---|
| 47 | | for(i = 0; i < nmemb; i++ ) |
|---|
| 48 | | fprintf( stderr, "%d ", buffer[i+offset] ); |
|---|
| 49 | | fprintf(stderr, "\n"); |
|---|
| 50 | | } |
|---|
| | 46 | /* Validation for data integrity */ |
|---|
| | 47 | if( MYTHREAD == 0 ) { |
|---|
| | 48 | for (i = 0; i < nmemb; i++) { |
|---|
| | 49 | if (buffer[memoff + i] != (fileoff + i) % 0x80) |
|---|
| | 50 | GULA_FAIL("Data integrity is violated!"); |
|---|
| | 51 | } |
|---|
| | 52 | } |
|---|
| | 53 | |
|---|
| | 54 | offset = upc_all_fseek(fd, 0, UPC_SEEK_CUR); |
|---|
| | 55 | if (offset != (fileoff + nmemb) * sizeof(TYPE)) |
|---|
| | 56 | GULA_FAIL("Fail to setup the file pointer"); |
|---|
| | 57 | |
|---|