Changeset 122
- Timestamp:
- 03/22/07 03:29:00
- Files:
-
- src/io_fread_local_async.upc (modified) (4 diffs)
- src/io_fwrite_local_async.upc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/io_fread_local_async.upc
r74 r122 75 75 nmemb = BUFLEN / (MYTHREAD + 1); 76 76 buffer = (void*) pd; 77 size = sizeof(char); 77 78 78 79 … … 81 82 size = sizeof(int); 82 83 } 84 upc_barrier; 83 85 84 86 fd = upc_all_fopen( fname, … … 94 96 /* Now, we are going to launch upc_fread */ 95 97 upc_all_fread_local_async(fd, buffer, size, nmemb, sync); 96 upc_barrier;97 98 98 ret = upc_all_fwait_async(fd); 99 99 100 if( ret == -1 ){ 100 101 GULA_FAIL("failed on fwait_async"); … … 114 115 upc_barrier; 115 116 116 /* To check that this function only works for individual file pointer */ 117 118 fd = upc_all_fopen( fname, 119 UPC_RDONLY | UPC_COMMON_FP, 0, NULL); 120 if( fd == NULL ) 121 GULA_FAIL("failed to open the file"); 117 /* 118 * To check that this function only works for individual file pointer 119 * This test is intentially deleted since the spec does not specify the behavior 120 */ 122 121 123 upc_barrier; 124 125 ret = upc_all_fwait_async(fd); 126 if( ret != -1 ) 127 GULA_FAIL("failed to return an error while COMMON_FP is used with this function"); 128 upc_barrier; 129 130 if( upc_all_fclose(fd) != 0 ) 131 GULA_FAIL("failed to close the file"); 132 133 upc_barrier; 134 135 /* To check that this function only works for the file handle that is open for reading */ 136 fd = upc_all_fopen( fname, 137 UPC_WRONLY | UPC_COMMON_FP, 0, NULL); 138 if( fd == NULL ) 139 GULA_FAIL("failed to open the file"); 140 141 upc_barrier; 142 143 /* Now, we are going to launch upc_fread */ 144 upc_all_fread_local_async(fd, NULL, 1, 0, sync); 145 upc_barrier; 146 147 ret = upc_all_fwait_async(fd); 148 if( ret != -1 ) 149 GULA_FAIL("failed to return an error while an attempt to read from a WRONLY file "); 150 upc_barrier; 151 152 if( upc_all_fclose(fd) != 0 ) 153 GULA_FAIL("failed to close the file"); 154 155 upc_barrier; 156 122 /* To check that this function only works for the file handle that is open for reading 123 * This test is intentially deleted since the spec does not specify the behavior */ 157 124 return 0; 158 125 } src/io_fwrite_local_async.upc
r72 r122 167 167 } 168 168 169 /* To check that this function only works for individual file pointer */ 170 fd = upc_all_fopen( fname, 171 UPC_RDWR | UPC_CREATE | UPC_TRUNC | UPC_COMMON_FP, 1, &hints); 172 if( fd == NULL ) 173 GULA_FAIL("failed to create the file"); 169 /* 170 * To check that this function only works for individual file pointer 171 * This test is intentially deleted since the spec does not specify the behavior 172 */ 174 173 175 /* dummy write */176 upc_all_fwrite_local(fd, NULL, 1, 0, sync);177 upc_barrier;178 179 ret = upc_all_fwait_async(fd);180 if( ret != -1 )181 GULA_FAIL("failed to prevent write on COMMON_FP");182 183 174 if( upc_all_fclose(fd) != 0 ) 184 175 GULA_FAIL("failed to close the file");
