Changeset 8228
- Timestamp:
- 02/03/10 11:59:50 (3 years ago)
- Location:
- branches/as-branch
- Files:
-
- 8 modified
-
src/client/sysint/client-state-machine.c (modified) (1 diff)
-
src/common/misc/state-machine-fns.c (modified) (1 diff)
-
src/io/bmi/bmi_tcp/bmi-tcp.c (modified) (4 diffs)
-
src/server/io.sm (modified) (7 diffs)
-
src/server/kmeans.sm (modified) (4 diffs)
-
src/server/pipeline.sm (modified) (9 diffs)
-
test/active-storage/simple.c (modified) (9 diffs)
-
test/active-storage/test_kmeans.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/as-branch/src/client/sysint/client-state-machine.c
r7633 r8228 450 450 } 451 451 gen_mutex_unlock(&test_mutex); 452 return js.error_code; 453 } 452 return js.error_code;} 453 454 454 455 455 PVFS_error PINT_client_state_machine_release( -
branches/as-branch/src/common/misc/state-machine-fns.c
r7830 r8228 11 11 #include <string.h> 12 12 #include <assert.h> 13 #include <stdlib.h> /* sson */14 13 15 14 #include "gossip.h" -
branches/as-branch/src/io/bmi/bmi_tcp/bmi-tcp.c
r7872 r8228 392 392 { 393 393 TCP_MODE_EAGER_LIMIT = 16384, /* 16K */ 394 TCP_MODE_REND_LIMIT = 16777216* 6/* 16M */ /* sson: 96MB */394 TCP_MODE_REND_LIMIT = 16777216*32 /* 16M */ /* sson: 96MB */ 395 395 }; 396 396 … … 1448 1448 bmi_tcp_pid, NULL, query_op->event_id, 1449 1449 query_op->actual_size); 1450 #if 0 1451 struct timeval tv; 1452 gettimeofday(&tv, NULL); 1453 double t1 = tv.tv_sec+(tv.tv_usec/1000000.0); 1454 printf("end(%s): %f\n", ((query_op->send_recv==BMI_SEND)?"BMI_SEND":"BMI_RECV"), t1); 1455 #endif 1456 1450 1457 1451 1458 dealloc_tcp_method_op(query_op); … … 2543 2550 PINT_HINT_GET_OP_ID(hints), 2544 2551 expected_size); 2545 2552 #if 0 2553 /* sson */ 2554 struct timeval tv; 2555 gettimeofday(&tv, NULL); 2556 double t1 = tv.tv_sec+(tv.tv_usec/1000000.0); 2557 printf("start(%s): %f\n", "BMI_RECV", t1); 2558 #endif 2546 2559 tcp_addr_data = src->method_data; 2547 2560 … … 3958 3971 PINT_HINT_GET_OP_ID(hints), 3959 3972 total_size); 3973 #if 0 3974 /* sson */ 3975 struct timeval tv; 3976 gettimeofday(&tv, NULL); 3977 double t1 = tv.tv_sec+(tv.tv_usec/1000000.0); 3978 if(bmi_tracing==1) 3979 printf("start(%s): %f(event_id=%d,tcp_id=%d)\n", "BMI_SEND", t1, bmi_tcp_send_event_id, bmi_tcp_pid); 3980 #endif 3960 3981 3961 3982 /* Three things can happen here: -
branches/as-branch/src/server/io.sm
r8137 r8228 25 25 #define NUM_OF_PARALLEL_SMS 1 26 26 #define BUFFER_SIZE (1024*1024) /* 1MB */ 27 28 double bmi_time, trove_time, io_time; 29 double sio, eio; 30 int iotype=0; /* 1: READ, 2: WRITE */ 27 31 28 32 %% … … 180 184 s_op->u.io.file_data.server_nr = s_op->req->u.io.server_nr; 181 185 s_op->u.io.file_data.server_ct = s_op->req->u.io.server_ct; 186 187 if(iotype != s_op->req->u.io.io_type) { 188 iotype = s_op->req->u.io.io_type; 189 bmi_time = trove_time = 0.0; 190 io_time = 0.0; 191 printf("\n\n%s\n", (iotype==1)?"READ":"WRITE"); 192 } 182 193 183 194 /* on writes, we allow the bstream to be extended at EOF */ … … 362 373 } 363 374 375 struct timeval tv; 376 gettimeofday(&tv, NULL); 377 sio = tv.tv_sec+(tv.tv_usec/1000000.0); 378 364 379 js_p->error_code = 0; 365 380 return SM_ACTION_COMPLETE; … … 377 392 { 378 393 pipeline_op = PINT_sm_pop_frame(smcb, &task_id, &tmp_err, 379 &remaining);394 &remaining); 380 395 gossip_debug(GOSSIP_SERVER_DEBUG, 381 "io: nested sm returned error code: %d\n", tmp_err);396 "io: nested sm returned error code: %d\n", tmp_err); 382 397 if(pipeline_op->u.pipeline.buffer) { 383 398 if(s_op->req->u.io.io_type == PVFS_IO_READ) { 384 399 if(pipeline_op->u.pipeline.op != 0 && 385 400 pipeline_op->u.pipeline.op != (0x5800000f)) 386 memcpy(s_op->u.io.tmp_buffer, 387 pipeline_op->u.pipeline.buffer, 388 sizeof(double)); /* FIXME */ 401 if(s_op->u.io.tmp_buffer != NULL) 402 memcpy(s_op->u.io.tmp_buffer, 403 pipeline_op->u.pipeline.buffer, 404 sizeof(double)); 389 405 BMI_memfree(pipeline_op->u.pipeline.address, 390 406 pipeline_op->u.pipeline.buffer, … … 404 420 } 405 421 406 407 422 /* 408 423 * Function: io_release() … … 436 451 } 437 452 438 /* 453 454 /* 439 455 * Function: io_cleanup() 440 456 * … … 468 484 free(s_op->u.io.tmp_buffer); /* FIXME */ 469 485 470 gen_mutex_destroy(&s_op->u.io.mutex); /* FIXME: */ 471 486 gen_mutex_destroy(&s_op->u.io.mutex); /* FIXME */ 487 488 //printf("event_id=%d\n", s_op->event_id); // always 0 489 printf("bmi_time=%f, trove_time=%f, total=%f\n", bmi_time, trove_time, bmi_time+trove_time); 490 struct timeval tv; 491 gettimeofday(&tv, NULL); 492 eio = tv.tv_sec+(tv.tv_usec/1000000.0); 493 io_time = eio - sio; 494 printf("io_time=%f\n", io_time); 472 495 /* let go of our encoded response buffer, if we appear to have 473 496 * made one -
branches/as-branch/src/server/kmeans.sm
r8129 r8228 16 16 #include <assert.h> 17 17 #include <math.h> 18 #include <time.h> 18 19 19 20 #include "server-config.h" … … 28 29 #include "kmeans.h" 29 30 30 #include <cuda.h>31 #include <cuda_runtime.h>31 //#include <cuda.h> 32 //#include <cuda_runtime.h> 32 33 33 34 extern void initGPU (float* objects, int numDataPoints, … … 50 51 int device_initialized=0; 51 52 #define MAX_ITERATIONS 500 53 54 struct timeval td_start, td_end; 52 55 53 56 %% … … 311 314 /* initialize GPU device and allocate memory on it */ 312 315 if(device_initialized == 0) { 316 time_t start, end; 313 317 /* initDevice(argc, argv, numObjs, numCoords, numClusters) */ 318 gossip_debug(GOSSIP_IO_DEBUG, "before initGPU\n"); 319 time(&start); 314 320 initGPU(s_op->u.kmeans.objects[0], s_op->u.kmeans.numObjs, 315 321 s_op->u.kmeans.numCoords, s_op->u.kmeans.numClusters); 322 time(&end); 323 gossip_debug(GOSSIP_IO_DEBUG, "after initGPU: elapsed=%lf ms\n", 324 difftime(end, start)*1000); 316 325 /* FIXME: I don't know why this is called twice */ 317 326 device_initialized = 1; -
branches/as-branch/src/server/pipeline.sm
r8137 r8228 45 45 int NUM_CLUSTERS; /* for kmeans only */ 46 46 #define TMP_BUF_SIZ 128 47 48 extern double bmi_time, trove_time; /* sson */ 49 double bs1, bs2, br1, br2, tr1, tr2, tw1, tw2; 47 50 48 51 %% … … 165 168 s_op->u.pipeline.segs = count; 166 169 167 if(s_op->u.pipeline.io_type == PVFS_IO_READ) { 170 if(s_op->u.pipeline.io_type == PVFS_IO_READ) { 171 struct timeval tv; 172 gettimeofday(&tv, NULL); 173 tr1 = tv.tv_sec+(tv.tv_usec/1000000.0); 174 //printf("start(%s): %f\n", "TROVE_READ", t1); 168 175 ret = job_trove_bstream_read_list 169 176 (s_op->u.pipeline.fs_id, … … 186 193 } 187 194 else if (s_op->u.pipeline.io_type == PVFS_IO_WRITE) { 195 struct timeval tv; 196 gettimeofday(&tv, NULL); 197 br1 = tv.tv_sec+(tv.tv_usec/1000000.0); 198 //printf("start(%s): %f\n", "BMI_RECV", t1); 188 199 ret = job_bmi_recv(s_op->u.pipeline.address, 189 200 (void *)s_op->u.pipeline.buffer, … … 191 202 s_op->u.pipeline.tag, 192 203 BMI_PRE_ALLOC, 193 smcb,204 smcb, 194 205 0, /* unsigned long status_user_tag = 0 */ 195 206 js_p, … … 197 208 server_job_context, 198 209 user_opts->server_job_flow_timeout, 199 (bmi_hint)s_op->u.pipeline.hints);210 (bmi_hint)s_op->u.pipeline.hints); 200 211 } 201 212 … … 235 246 struct server_configuration_s *user_opts = get_server_config_struct(); 236 247 248 struct timeval tv; 249 gettimeofday(&tv, NULL); 250 if(s_op->u.pipeline.io_type==PVFS_IO_READ) { 251 tr2 = tv.tv_sec+(tv.tv_usec/1000000.0); 252 //printf("end(%s): %f\n", "TROVE_READ", tr2); 253 trove_time += tr2-tr1; 254 } 255 else if(s_op->u.pipeline.io_type==PVFS_IO_WRITE) { 256 br2 = tv.tv_sec+(tv.tv_usec/1000000.0); 257 //printf("end(%s): %f\n", "BMI_RECV", br2); 258 bmi_time += br2-br1; 259 } 260 237 261 if(s_op->u.pipeline.segs == 0) { 238 262 js_p->error_code = 0; … … 258 282 assert(s_op->u.pipeline.buffer_used); 259 283 284 struct timeval tv; 285 gettimeofday(&tv, NULL); 286 bs1 = tv.tv_sec+(tv.tv_usec/1000000.0); 287 //printf("start(%s): %f\n", "BMI_SEND", bs1); 288 260 289 if(s_op->u.pipeline.op != 0) { /* AS: when op is specified */ 261 290 ret = DO_COMP; /* AS: skip sending if op is specified */ 262 gossip_debug(GOSSIP_IO_DEBUG, "%s: parent->op != 0\n", __func__);291 gossip_debug(GOSSIP_IO_DEBUG, "%s: s_op->u.pipeline->op != 0\n", __func__); 263 292 js_p->error_code = ret; 264 293 return SM_ACTION_COMPLETE; 265 294 } 266 else 295 else { 267 296 ret = job_bmi_send(s_op->u.pipeline.address, 268 297 s_op->u.pipeline.buffer, … … 278 307 user_opts->server_job_bmi_timeout, 279 308 (bmi_hint)s_op->u.pipeline.hints); 309 } 280 310 281 311 } 282 312 else if(s_op->u.pipeline.io_type == PVFS_IO_WRITE) { 313 struct timeval tv; 314 gettimeofday(&tv, NULL); 315 tw1 = tv.tv_sec+(tv.tv_usec/1000000.0); 316 //printf("start(%s): %f\n", "TROVE_WRITE", t1); 283 317 ret = job_trove_bstream_write_list 284 318 (s_op->u.pipeline.fs_id, … … 1179 1213 js_p->error_code = 0; 1180 1214 1215 struct timeval tv; 1216 gettimeofday(&tv, NULL); 1217 if(s_op->u.pipeline.io_type == PVFS_IO_READ) { 1218 bs2 = tv.tv_sec+(tv.tv_usec/1000000.0); 1219 //printf("end(%s): %f\n", "BMI_SEND", bs2); 1220 //printf("bmi_time=%f\n", bmi_time); 1221 bmi_time += bs2-bs1; 1222 } 1223 else if(s_op->u.pipeline.io_type == PVFS_IO_WRITE) { 1224 tw2 = tv.tv_sec+(tv.tv_usec/1000000.0); 1225 trove_time += tw2-tw1; 1226 } 1227 1181 1228 /* FIMXE: do we really need this lock? */ 1182 1229 gen_mutex_lock(&parent_s_op->u.io.mutex); -
branches/as-branch/test/active-storage/simple.c
r8129 r8228 14 14 " -g : use generated file\n" 15 15 " -s size : file size to generate in MB\n" 16 " -x : test active storage module\n"; 16 " -x : test active storage module\n" 17 " -t : test normal storage module\n"; 17 18 fprintf(stderr, help, argv0); 18 19 } … … 31 32 extern int optind; 32 33 int is_output_timing=0, is_print_usage = 0; 33 int _debug=0, use_gen_file = 0, use_actsto = 0 ;34 int _debug=0, use_gen_file = 0, use_actsto = 0, use_normalsto=0; 34 35 35 36 MPI_Offset disp, offset, file_size; … … 57 58 MPI_Comm_rank( comm, &rank ); 58 59 59 while ( (opt=getopt(argc,argv,"i:s:godhx "))!= EOF) {60 while ( (opt=getopt(argc,argv,"i:s:godhxt"))!= EOF) { 60 61 switch (opt) { 61 62 case 'i': fname = optarg; … … 85 86 case 'x': use_actsto = 1; 86 87 break; 88 case 't': use_normalsto = 1; 89 break; 87 90 default: is_print_usage = 1; 88 91 break; … … 94 97 MPI_Finalize(); 95 98 exit(1); 99 } 100 if(use_normalsto == 1 && use_actsto == 1) { 101 if(rank == 0) 102 printf("Can't test both: either normalsto or actsto\n"); 103 MPI_Finalize(); 104 exit(1); 96 105 } 97 106 … … 133 142 } 134 143 144 stime = MPI_Wtime(); 135 145 /* Write to file */ 136 146 MPI_File_write_all( fh, buf, nitem, MPI_DOUBLE, &status ); 147 etime = MPI_Wtime(); 148 iotime = etime - stime; 149 150 printf("%d: iotime (write) = %10.4f\n", rank, iotime); 137 151 138 152 MPI_Get_count( &status, MPI_DOUBLE, &count ); … … 149 163 MPI_File_close(&fh); 150 164 } 151 152 MPI_File_open( comm, fname, MPI_MODE_RDWR, MPI_INFO_NULL, &fh );153 /* Read nothing (check status) */154 memset( &status, 0xff, sizeof(MPI_Status) );155 165 156 166 double *tmp = (double *)malloc( nitem * sizeof(double) ); 157 offset = rank * nitem * type_size; 158 159 /* start I/O */ 160 stime = MPI_Wtime(); 161 MPI_File_read_at(fh, offset, tmp, nitem, MPI_DOUBLE, &status); 162 etime = MPI_Wtime(); 163 /* end I/O */ 164 iotime = etime - stime; 165 166 if(_debug==1) printf("%d: iotime = %10.4f\n", rank, iotime); 167 MPI_Reduce(&iotime, &max_iotime, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); 168 169 sum = 0.0; /* reset sum */ 170 171 /* start computation */ 172 stime = MPI_Wtime(); 173 174 for(i=0; i<nitem; i++) { 175 sum += tmp[i]; 176 } 177 178 MPI_Reduce(&sum, &global_sum, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); 179 etime = MPI_Wtime(); 180 /* end computation */ 181 182 comptime = etime - stime; 183 184 if(_debug==1) printf("%d: comptime = %10.4f\n", rank, comptime); 185 186 MPI_Reduce(&comptime, &max_comptime, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); 187 188 if(rank == 0) { 189 elapsed_time = max_comptime + max_iotime; 190 printf("<<Result (SUM) with normal read>>\n" 191 "SUM = %10.4f \n" 192 "Computation time = %10.4f sec\n" 193 "I/O time = %10.4f sec\n" 194 "total time = %10.4f sec\n\n", 195 global_sum, max_comptime, max_iotime, elapsed_time); 196 } 197 198 MPI_File_close(&fh); 167 168 if(use_normalsto == 1) { 169 MPI_File_open( comm, fname, MPI_MODE_RDWR, MPI_INFO_NULL, &fh ); 170 /* Read nothing (check status) */ 171 memset( &status, 0xff, sizeof(MPI_Status) ); 172 173 offset = rank * nitem * type_size; 174 175 /* start I/O */ 176 stime = MPI_Wtime(); 177 MPI_File_read_at(fh, offset, tmp, nitem, MPI_DOUBLE, &status); 178 etime = MPI_Wtime(); 179 /* end I/O */ 180 iotime = etime - stime; 181 182 if(_debug==1) printf("%d: iotime = %10.4f\n", rank, iotime); 183 MPI_Reduce(&iotime, &max_iotime, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); 184 185 sum = 0.0; /* reset sum */ 186 187 /* start computation */ 188 stime = MPI_Wtime(); 189 190 for(i=0; i<nitem; i++) { 191 sum += tmp[i]; 192 } 193 194 MPI_Reduce(&sum, &global_sum, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); 195 etime = MPI_Wtime(); 196 /* end computation */ 197 198 comptime = etime - stime; 199 200 if(_debug==1) printf("%d: comptime = %10.4f\n", rank, comptime); 201 202 MPI_Reduce(&comptime, &max_comptime, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); 203 204 if(rank == 0) { 205 elapsed_time = max_comptime + max_iotime; 206 printf("<<Result (SUM) with normal read>>\n" 207 "SUM = %10.4f \n" 208 "Computation time = %10.4f sec\n" 209 "I/O time = %10.4f sec\n" 210 "total time = %10.4f sec\n\n", 211 global_sum, max_comptime, max_iotime, elapsed_time); 212 } 213 214 MPI_File_close(&fh); 215 } 199 216 200 217 if(use_actsto == 1) { 218 memset(&status, 0xff, sizeof(MPI_Status)); 219 offset = rank * nitem * type_size; 220 #if 0 201 221 /* MPI_MAX */ 202 222 MPI_File_open( comm, fname, MPI_MODE_RDWR, MPI_INFO_NULL, &fh ); … … 221 241 222 242 MPI_File_close(&fh); 223 243 #endif 224 244 /* MPI_SUM */ 225 245 MPI_File_open( comm, fname, MPI_MODE_RDWR, MPI_INFO_NULL, &fh ); … … 229 249 etime = MPI_Wtime(); 230 250 elapsed_time = etime - stime; 231 printf ("sum=%lf (in %10.4f sec)\n", tmp[0], elapsed_time); 251 printf ("<<Result with active storage>>\n" 252 "sum=%lf (in %10.4f sec)\n", tmp[0], elapsed_time); 232 253 233 254 MPI_File_close( &fh ); -
branches/as-branch/test/active-storage/test_kmeans.c
r8137 r8228 37 37 MPI_Info info; 38 38 float threshold = 0.0; 39 double stime, etime; 39 40 40 41 /* for KMEANS */ … … 118 119 objects[i] = objects[i-1] + (numCoords); 119 120 120 121 stime = MPI_Wtime(); 121 122 MPI_File_read_ex(fh, objects[0], (numObjs)*(numCoords), 122 123 MPI_FLOAT, MPI_KMEANS, &status); 123 124 125 etime = MPI_Wtime(); 126 printf("%d: time =%10.4f\n", rank, etime-stime); 124 127 //printf ("kmean=%lf\n", objects[0]); 125 128
