| @@ -40,6 +40,7 @@ void torusinit(int *pmyproc, const int pnprocs); · 39 unmodified lines |
| 40 | 40 | void ranktoxyz(int rank, int *x, int *y, int *z); |
| 41 | 41 | int xyztorank(int x, int y, int z); |
| 42 | 42 | extern int x, y, z, xsize, ysize, zsize; |
| 43 | +u64int tbget(void); |
| 43 | 44 | |
| 44 | 45 | void |
| 45 | 46 | buf_add(struct bufpacket *new) |
| @@ -282,7 +283,7 @@ int reduce_end ( void *buf, int num, MPI_Datatype datatype, int /*root*/, · 236 unmodified lines |
| 282 | 283 | torustag[TAGtag] = reducetag; |
| 283 | 284 | torustag[TAGsource] = myproc; |
| 284 | 285 | |
| 285 | | − if(rompidebug&4) print("%lld reduce_end: %d(%d, %d, %d)\n", nsec(), myproc, x, y, z); |
| 286 | + if(rompidebug&4) print("%lld reduce_end: %d(%d, %d, %d)\n", tbget(), myproc, x, y, z); |
| 286 | 287 | if (myproc) { |
| 287 | 288 | /* who we get it from depends on who we are. */ |
| 288 | 289 | /* this shows some bad design. We compute x,y,z, turn it into rank, |
| @@ -298,9 +299,9 @@ int reduce_end ( void *buf, int num, MPI_Datatype datatype, int /*root*/, · 9 unmodified lines |
| 298 | 299 | else if (x) |
| 299 | 300 | fromz = fromy = fromx = 0; |
| 300 | 301 | fromrank = xyztorank(fromx, fromy, fromz); |
| 301 | | − if(rompidebug&4) print("%lld reduce_end: %d(%d,%d,%d): wait from (%d, %d, %d)\n", nsec(), myproc, x, y, z, fromx, fromy, fromz); |
| 302 | + if(rompidebug&4) print("%lld reduce_end: %d(%d,%d,%d): wait from (%d, %d, %d)\n", tbget(), myproc, x, y, z, fromx, fromy, fromz); |
| 302 | 303 | MPI_Recv(buf, 1, MPI_INT, fromrank, reducetag, MPI_COMM_WORLD, status); |
| 303 | | − if(rompidebug&4) print("%lld reduce_end: %d: Got from %d\n", nsec(), myproc, fromrank); |
| 304 | + if(rompidebug&4) print("%lld reduce_end: %d: Got from %d\n", tbget(), myproc, fromrank); |
| 304 | 305 | } |
| 305 | 306 | |
| 306 | 307 | /* OK, we got it, we just need to do one send to our "axis" (of evil?) */ |
| @@ -311,24 +312,24 @@ int reduce_end ( void *buf, int num, MPI_Datatype datatype, int /*root*/, · 4 unmodified lines |
| 311 | 312 | */ |
| 312 | 313 | if (z) { |
| 313 | 314 | } else if (y) { |
| 314 | | − if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", nsec(), myproc, x, y, z, x, y, zsize-1); |
| 315 | + if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", tbget(), myproc, x, y, z, x, y, zsize-1); |
| 315 | 316 | torustag[TAGsource] = myproc; |
| 316 | 317 | torussend(buf, count, x, y, zsize-1, 1, torustag, sizeof(torustag)); |
| 317 | 318 | } |
| 318 | 319 | else if (x) { |
| 319 | 320 | /* send down BOTH our y and z axis */ |
| 320 | 321 | torustag[TAGsource] = myproc; |
| 321 | | − if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", nsec(), myproc, x, y, z, x, ysize-1, 0); |
| 322 | + if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", tbget(), myproc, x, y, z, x, ysize-1, 0); |
| 322 | 323 | torussend(buf, count, x, ysize-1, 0, 1, torustag, sizeof(torustag)); |
| 323 | | − if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", nsec(), myproc, x, y, z, x, y, zsize-1); |
| 324 | + if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", tbget(), myproc, x, y, z, x, y, zsize-1); |
| 324 | 325 | torussend(buf, count, x, y, zsize-1, 1, torustag, sizeof(torustag)); |
| 325 | 326 | } else { |
| 326 | 327 | /* send down x, y, z */ |
| 327 | | − if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", nsec(), myproc, x, y, z, xsize-1, 0, 0); |
| 328 | + if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", tbget(), myproc, x, y, z, xsize-1, 0, 0); |
| 328 | 329 | torussend(buf, count, xsize-1, 0, 0, 1, torustag, sizeof(torustag)); |
| 329 | | − if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", nsec(), myproc, x, y, z, x, ysize-1, 0); |
| 330 | + if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", tbget(), myproc, x, y, z, x, ysize-1, 0); |
| 330 | 331 | torussend(buf, count, x, ysize-1, 0, 1, torustag, sizeof(torustag)); |
| 331 | | − if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", nsec(), myproc, x, y, z, x, y, zsize-1); |
| 332 | + if(rompidebug&4) print("%lld reduce_end %d(%d, %d, %d): send to (%d, %d, %d)\n", tbget(), myproc, x, y, z, x, y, zsize-1); |
| 332 | 333 | torussend(buf, count, x, y, zsize-1, 1, torustag, sizeof(torustag)); |
| 333 | 334 | } |
| 334 | 335 | |
| @@ -344,7 +345,7 @@ opsum(void *dst, void *src, int) · 9 unmodified lines |
| 344 | 345 | int *is = src; |
| 345 | 346 | int *id = dst; |
| 346 | 347 | int tmp = *is; |
| 347 | | − if (rompidebug & 4) print("%lld %d(%d,%d,%d): SUM %d+%d=%d\n", nsec(), myproc, x,y,z,*id, *is, *id+tmp); |
| 348 | + if (rompidebug & 4) print("%lld %d(%d,%d,%d): SUM %d+%d=%d\n", tbget(), myproc, x,y,z,*id, *is, *id+tmp); |
| 348 | 349 | *id += tmp; |
| 349 | 350 | return *id; |
| 350 | 351 | } |
| @@ -397,7 +398,7 @@ int MPI_Reduce ( void *sendbuf, void *recvbuf, int count, · 46 unmodified lines |
| 397 | 398 | if (z) { |
| 398 | 399 | torank = xyztorank(x,y,0); |
| 399 | 400 | if (rompidebug&4) |
| 400 | | − print("%lld %d:(%d,%d,%d) sends %d to %d\n", nsec(), myproc, x, y, z, myproc, torank); |
| 401 | + print("%lld %d:(%d,%d,%d) sends %d to %d\n", tbget(), myproc, x, y, z, myproc, torank); |
| 401 | 402 | MPI_Send(tmp, 1, datatype, torank, 1, comm); |
| 402 | 403 | } else { |
| 403 | 404 | /* gather up all our z >0 data */ |
| @@ -407,14 +408,14 @@ int MPI_Reduce ( void *sendbuf, void *recvbuf, int count, · 3 unmodified lines |
| 407 | 408 | op(tmp, recvbuf, count); |
| 408 | 409 | } |
| 409 | 410 | if (rompidebug&4) |
| 410 | | − print("%lld AFTER Z: %d(%d, %d, %d): %d\n", nsec(), myproc, x, y, z, sum[0]); |
| 411 | + print("%lld AFTER Z: %d(%d, %d, %d): %d\n", tbget(), myproc, x, y, z, sum[0]); |
| 411 | 412 | |
| 412 | 413 | /* y? y o y? */ |
| 413 | 414 | if (y) { |
| 414 | 415 | torank = xyztorank(x,0,0); |
| 415 | 416 | /* send to our parent */ |
| 416 | 417 | if (rompidebug&4) |
| 417 | | − print("%lld %d:(%d,%d,%d) sends %d to %d\n", nsec(), myproc, x, y, z, sum[0], torank); |
| 418 | + print("%lld %d:(%d,%d,%d) sends %d to %d\n", tbget(), myproc, x, y, z, sum[0], torank); |
| 418 | 419 | MPI_Send(tmp, 1, datatype, torank, 1, comm); |
| 419 | 420 | } else { |
| 420 | 421 | /* This is the vector along the X axis. All myprocs, including (0,0,0), gather up along |
| @@ -429,11 +430,11 @@ int MPI_Reduce ( void *sendbuf, void *recvbuf, int count, · 8 unmodified lines |
| 429 | 430 | op(tmp, recvbuf, count); |
| 430 | 431 | } |
| 431 | 432 | if (rompidebug&4) |
| 432 | | − print("%lld %d:(%d,%d,%d) gets %d accum %d\n", nsec(), myproc, x, y, z, nsum[0], sum[0]); |
| 433 | + print("%lld %d:(%d,%d,%d) gets %d accum %d\n", tbget(), myproc, x, y, z, nsum[0], sum[0]); |
| 433 | 434 | if (x) { |
| 434 | 435 | /* send to our parent */ |
| 435 | 436 | if (rompidebug&4) |
| 436 | | − print("%lld %d:(%d,%d,%d) sends %d to %d\n", nsec(), myproc, x, y, z, sum[0], torank); |
| 437 | + print("%lld %d:(%d,%d,%d) sends %d to %d\n", tbget(), myproc, x, y, z, sum[0], torank); |
| 437 | 438 | MPI_Send(tmp, 1, datatype, torank, 1, comm); |
| 438 | 439 | } else { |
| 439 | 440 | /* sum contains the sum from our y axis above */ |
| @@ -441,7 +442,7 @@ int MPI_Reduce ( void *sendbuf, void *recvbuf, int count, · 1 unmodified line |
| 441 | 442 | MPI_Recv(recvbuf, 1, datatype, i, 1, comm, &status); |
| 442 | 443 | op(tmp, recvbuf, count); |
| 443 | 444 | if (rompidebug&4) |
| 444 | | − print("%lld %d:(%d,%d,%d) recv %d to %d\n", nsec(), myproc, x, y, z, sum[0], i); |
| 445 | + print("%lld %d:(%d,%d,%d) recv %d to %d\n", tbget(), myproc, x, y, z, sum[0], i); |
| 445 | 446 | } |
| 446 | 447 | } |
| 447 | 448 | } |
| @@ -450,7 +451,7 @@ int MPI_Reduce ( void *sendbuf, void *recvbuf, int count, · 2 unmodified lines |
| 450 | 451 | if (! myproc){ |
| 451 | 452 | memmove(recvbuf, tmp, nbytes); |
| 452 | 453 | if (rompidebug&4) |
| 453 | | − print("%lld reduce: %d(%d,%d,%d): gather done, send SUM %d\n", nsec(), myproc, x, y, z, sum[0]); |
| 454 | + print("%lld reduce: %d(%d,%d,%d): gather done, send SUM %d\n", tbget(), myproc, x, y, z, sum[0]); |
| 454 | 455 | } |
| 455 | 456 | |
| 456 | 457 | return reduce_end (recvbuf, count, datatype, root, comm, &status); |