Commit 6560638c authored by Misbah Mubarak's avatar Misbah Mubarak

Modifying python scripts and MPI sim layer to support multiple ranks per network node

parent 0547a991
3564 3565 3566 3567 3200 3201 3202 3203 1776 1777 1778 1779 1092 1093 1094 1095 2156 2157 2158 2159 1708 1709 1710 1711 3308 3309 3310 3311 1280 1281 1282 1283 2012 2013 2014 2015 2464 2465 2466 2467 3832 3833 3834 3835 2128 2129 2130 2131 1188 1189 1190 1191 3192 3193 3194 3195 2608 2609 2610 2611 1056 1057 1058 1059 3840 3841 3842 3843 4148 4149 4150 4151 3420 3421 3422 3423 3808 3809 3810 3811 1308 1309 1310 1311 3080 3081 3082 3083 3796 3797 3798 3799 2888 2889 2890 2891 1992 1993 1994 1995 424 425 426 427 1832 1833 1834 1835 2580 2581 2582 2583 3856 3857 3858 3859 4080 4081 4082 4083 3652 3653 3654 3655 1100
891 892 893 894 800 801 802 803 444 445 446 447 273 274 275 276 539 540 541 542 427 428 429 430 827 828 829 830 320 321 322 323 503 504 505 506 616 617 618 619 958 959 960 961 532 533 534 535 297 298 299 300 798 799 800 801 652 653 654 655 264 265 266 267 960 961 962 963 1037 1038 1039 1040 855 856 857 858 952 953 954 955 327 328 329 330 770 771 772 773 949 950 951 952 722 723 724 725 498 499 500 501 106 107 108 109 458 459 460 461 645 646 647 648 964 965 966 967 1020 1021 1022 1023 913 914 915 916 275 276 277 278 850 851 852 853 579 580 581 582 14 15 16 17 760 761 762 763 421 422 423 424 871 872 873 874 705 706 707 708 1 2 3 4 521 522 523 524 916 917 918 919 257 258 259 260 343 344 345 346 919 920 921 922 201 202 203 204 599 600 601 602 251 252 253 254 1021 1022 1023 1024 848 849 850 851 473 474 475 476 84 85 86 87 337 338 339 340 536 537 538 539
891 800 444 273 539
426 827 319 502 616 959 532 297 797 652
260 962 1038 856 953 325 769 949 722 496 104 456 644 965 1021
141 894 806 269 523
474 687 832 98 29 882 456 804 2 470
761 242 999 953 33 27 572 992 401 229 444 32 234 461 525
1009 1000 59 89 882
775 705 325 638 639 612 168 454 415 761
1050 1002 572 469 282 37 28 489 335 399 941 553 589 248 24
251 574 390 637 660
68 13 885 273 246 1051 496 884 502 676
158 671 917 552 783 710 67 801 624 318 33 915 499 760 928
249 108 418 163 70
427 969 846 809 236 569 294 184 113 228
980 876 853 847 206 331 664 773 903 930 91 642 711 537 190
3566 3201 1776 1093 2159 1710 3310 1281 2013 2464 3835 2131 1190 3192 2611 1058 3842 4151 3422 3810 1310 3082 3796 2889 1994 425 1833 2580 3856 4082 2014 3655 1100 3400 2317 59 3040 1684 3484 2822 4 2084 3664 1030 1373 3676 807 2397 1007 4086 3392 1892 339 1351 2145 3940 460 2328 2984 2312 3440 2282 4071 2547 2482 1879 2518 1625 2431 1226 799 788 2588 2773 2012 379 3200 3703 3900 3558 3793 3899 2283 1652 2979 1164 3428 3588 3780 2491 4011 2448 1903 2788 4208 3873 3351 347 2054 2661 3569 1026 3089 494 931 3356 1404 3446 424 618 2946 191 2424 3843 2256 2874 112 2682 2561 2432 1563 4141 153 91 4059
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699
...@@ -2,7 +2,7 @@ import sys ...@@ -2,7 +2,7 @@ import sys
import random import random
alloc_file = 'testrest.conf' alloc_file = 'testrest.conf'
def contiguous_alloc(job_ranks, total_nodes): def contiguous_alloc(job_ranks, total_nodes, cores_per_node):
f = open(alloc_file,'w') f = open(alloc_file,'w')
start=0 start=0
for num_rank in range(len(job_ranks)): for num_rank in range(len(job_ranks)):
...@@ -12,7 +12,7 @@ def contiguous_alloc(job_ranks, total_nodes): ...@@ -12,7 +12,7 @@ def contiguous_alloc(job_ranks, total_nodes):
start += job_ranks[num_rank] start += job_ranks[num_rank]
f.closed f.closed
def cube_alloc(job_ranks, total_nodes): def cube_alloc(job_ranks, total_nodes, cores_per_node):
job_dim = [6,6,6] job_dim = [6,6,6]
sys_dim_x = 16 sys_dim_x = 16
sys_dim_y =16 sys_dim_y =16
...@@ -47,7 +47,7 @@ def cube_alloc(job_ranks, total_nodes): ...@@ -47,7 +47,7 @@ def cube_alloc(job_ranks, total_nodes):
def permeate_alloc(job_ranks, total_nodes): def permeate_alloc(job_ranks, total_nodes, cores_per_node):
f = open(alloc_file,'w') f = open(alloc_file,'w')
start=0 start=0
node_list = range(0, int(total_nodes)) node_list = range(0, int(total_nodes))
...@@ -63,7 +63,7 @@ def permeate_alloc(job_ranks, total_nodes): ...@@ -63,7 +63,7 @@ def permeate_alloc(job_ranks, total_nodes):
f.write("\n") f.write("\n")
f.closed f.closed
def random_alloc(job_rank, total_nodes, num_seed ): def random_alloc(job_rank, total_nodes, num_seed, cores_per_node):
filename_substr='allocation-'+str(total_nodes)+'-' filename_substr='allocation-'+str(total_nodes)+'-'
for jobsize in job_rank: for jobsize in job_rank:
filename_substr += str(jobsize)+'_' filename_substr += str(jobsize)+'_'
...@@ -75,17 +75,28 @@ def random_alloc(job_rank, total_nodes, num_seed ): ...@@ -75,17 +75,28 @@ def random_alloc(job_rank, total_nodes, num_seed ):
f = open(filename_substr+'.conf', 'w') f = open(filename_substr+'.conf', 'w')
node_list = range(0, int(total_nodes)) node_list = range(0, int(total_nodes))
random.seed(seed) random.seed(seed)
for rankid in range(len(job_rank)): for rankid in range(len(job_rank)):
alloc_list = random.sample(node_list, job_rank[rankid]) rem = job_rank[rankid]/cores_per_node
if(job_rank[rankid] % cores_per_node):
rem=rem+1
alloc_list = random.sample(node_list, rem)
node_list = [i for i in node_list if (i not in alloc_list)] node_list = [i for i in node_list if (i not in alloc_list)]
#print "length of alloc list", len(alloc_list), "\n", alloc_list,"\n" #print "length of alloc list", len(alloc_list), "\n", alloc_list,"\n"
count = 0
for idx in range(len(alloc_list)): for idx in range(len(alloc_list)):
f.write("%s " % alloc_list[idx]) for coreid in range(cores_per_node):
if(count == job_rank[rankid]):
break
f.write("%s " % ((alloc_list[idx] * cores_per_node) + coreid))
count=count+1
f.write("\n") f.write("\n")
f.closed f.closed
filename_substr=filename_substr[:-2] filename_substr=filename_substr[:-2]
def hybrid_alloc(job_rank, total_nodes): def hybrid_alloc(job_rank, total_nodes, cores_per_node):
#1st job get contiguous allocation , the other job get random allocation #1st job get contiguous allocation , the other job get random allocation
f = open(alloc_file, 'w') f = open(alloc_file, 'w')
node_list = range(0, int(total_nodes)) node_list = range(0, int(total_nodes))
...@@ -107,7 +118,7 @@ def hybrid_alloc(job_rank, total_nodes): ...@@ -107,7 +118,7 @@ def hybrid_alloc(job_rank, total_nodes):
f.write("\n") f.write("\n")
f.closed f.closed
def hybrid_alloc_2 (job_rank, total_nodes): def hybrid_alloc_2 (job_rank, total_nodes, cores_per_node):
#1st and 2nd job get contiguous allocation , 3rd job get random allocation #1st and 2nd job get contiguous allocation , 3rd job get random allocation
f = open(alloc_file, 'w') f = open(alloc_file, 'w')
node_list = range(0, int(total_nodes)) node_list = range(0, int(total_nodes))
...@@ -132,7 +143,7 @@ def hybrid_alloc_2 (job_rank, total_nodes): ...@@ -132,7 +143,7 @@ def hybrid_alloc_2 (job_rank, total_nodes):
def stripe_alloc(job_ranks, total_nodes): def stripe_alloc(job_ranks, total_nodes, cores_per_node):
#print "the num of nodes of each Job", job_ranks #print "the num of nodes of each Job", job_ranks
f = open(alloc_file,'w') f = open(alloc_file,'w')
node_list = range(0, int(total_nodes)) node_list = range(0, int(total_nodes))
...@@ -163,28 +174,28 @@ def stripe_alloc(job_ranks, total_nodes): ...@@ -163,28 +174,28 @@ def stripe_alloc(job_ranks, total_nodes):
f.write("\n") f.write("\n")
f.closed f.closed
def policy_select(plcy, job_ranks, total_nodes, num_seed): def policy_select(plcy, job_ranks, total_nodes, num_seed, cores_per_node):
if plcy == "CONT": if plcy == "CONT":
print "contiguous alloction!" print "contiguous alloction!"
contiguous_alloc(job_ranks, total_nodes) contiguous_alloc(job_ranks, total_nodes, cores_per_node)
elif plcy == "rand": elif plcy == "rand":
print "random allocation!" print "random allocation!"
random_alloc(job_ranks, total_nodes, num_seed) random_alloc(job_ranks, total_nodes, num_seed, cores_per_node)
elif plcy == "STRIPE": elif plcy == "STRIPE":
print "stripe allcation!" print "stripe allcation!"
stripe_alloc(job_ranks, total_nodes) stripe_alloc(job_ranks, total_nodes, cores_per_node)
elif plcy == "PERMEATE": elif plcy == "PERMEATE":
print "permeate allocation!" print "permeate allocation!"
permeate_alloc(job_ranks, total_nodes) permeate_alloc(job_ranks, total_nodes, cores_per_node)
elif plcy == "CUBE": elif plcy == "CUBE":
print "cube allocation!" print "cube allocation!"
cube_alloc(job_ranks, total_nodes) cube_alloc(job_ranks, total_nodes, cores_per_node)
elif plcy == "hybrid": elif plcy == "hybrid":
print "hybrid allocation!" print "hybrid allocation!"
hybrid_alloc(job_ranks, total_nodes) hybrid_alloc(job_ranks, total_nodes, cores_per_node)
elif plcy == "hybrid-2": elif plcy == "hybrid-2":
print "hybrid 2 allocation!" print "hybrid 2 allocation!"
hybrid_alloc_2(job_ranks, total_nodes) hybrid_alloc_2(job_ranks, total_nodes, cores_per_node)
else: else:
print "NOT Supported yet!" print "NOT Supported yet!"
...@@ -201,9 +212,11 @@ if __name__ == "__main__": ...@@ -201,9 +212,11 @@ if __name__ == "__main__":
alloc_plcy = array.pop(0) alloc_plcy = array.pop(0)
total_nodes = array.pop(0) total_nodes = array.pop(0)
num_seed = int(array.pop(0)) num_seed = int(array.pop(0))
cores_per_node = int(array.pop(0))
print alloc_plcy print alloc_plcy
print cores_per_node
array = map(int, array) array = map(int, array)
#print array #print array
#print num_seed, type(num_seed) #print num_seed, type(num_seed)
policy_select(alloc_plcy, array, total_nodes, num_seed) policy_select(alloc_plcy, array, total_nodes, num_seed, cores_per_node)
...@@ -23,6 +23,6 @@ PARAMS ...@@ -23,6 +23,6 @@ PARAMS
local_bandwidth="5.25"; local_bandwidth="5.25";
global_bandwidth="4.7"; global_bandwidth="4.7";
cn_bandwidth="5.25"; cn_bandwidth="5.25";
message_size="560"; message_size="592";
routing="adaptive"; routing="adaptive";
} }
...@@ -23,6 +23,6 @@ PARAMS ...@@ -23,6 +23,6 @@ PARAMS
local_bandwidth="5.25"; local_bandwidth="5.25";
global_bandwidth="4.7"; global_bandwidth="4.7";
cn_bandwidth="5.25"; cn_bandwidth="5.25";
message_size="576"; message_size="592";
routing="adaptive"; routing="adaptive";
} }
...@@ -2,9 +2,9 @@ LPGROUPS ...@@ -2,9 +2,9 @@ LPGROUPS
{ {
MODELNET_GRP MODELNET_GRP
{ {
repetitions="36"; repetitions="264";
nw-lp="2"; nw-lp="4";
modelnet_dragonfly="2"; modelnet_dragonfly="4";
modelnet_dragonfly_router="1"; modelnet_dragonfly_router="1";
} }
} }
...@@ -14,15 +14,16 @@ PARAMS ...@@ -14,15 +14,16 @@ PARAMS
modelnet_order=( "dragonfly", "dragonfly_router"); modelnet_order=( "dragonfly", "dragonfly_router");
# scheduler options # scheduler options
modelnet_scheduler="fcfs"; modelnet_scheduler="fcfs";
chunk_size="256"; chunk_size="512";
# modelnet_scheduler="round-robin"; # modelnet_scheduler="round-robin";
num_routers="4"; num_routers="8";
local_vc_size="16384"; local_vc_size="16384";
global_vc_size="32768"; global_vc_size="32768";
cn_vc_size="16384"; cn_vc_size="16384";
local_bandwidth="5.25"; local_bandwidth="5.25";
global_bandwidth="4.7"; global_bandwidth="4.7";
cn_bandwidth="5.25"; cn_bandwidth="5.25";
message_size="560"; message_size="592";
routing="minimal"; routing="minimal";
self_msg_overhead = "10";
} }
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "codes/codes-jobmap.h" #include "codes/codes-jobmap.h"
/* turning on track lp will generate a lot of output messages */ /* turning on track lp will generate a lot of output messages */
#define MN_LP_NM "modelnet_dragonfly"
#define TRACK_LP -1 #define TRACK_LP -1
#define TRACE -1 #define TRACE -1
#define MAX_WAIT_REQS 512 #define MAX_WAIT_REQS 512
...@@ -30,6 +32,7 @@ char offset_file[8192]; ...@@ -30,6 +32,7 @@ char offset_file[8192];
static int wrkld_id; static int wrkld_id;
static int num_net_traces = 0; static int num_net_traces = 0;
static int alloc_spec = 0; static int alloc_spec = 0;
static double self_overhead = 10.0;
/* Doing LP IO*/ /* Doing LP IO*/
static char lp_io_dir[256] = {'\0'}; static char lp_io_dir[256] = {'\0'};
...@@ -54,7 +57,7 @@ typedef int32_t dumpi_req_id; ...@@ -54,7 +57,7 @@ typedef int32_t dumpi_req_id;
static int net_id = 0; static int net_id = 0;
static float noise = 5.0; static float noise = 5.0;
static int num_net_lps, num_nw_lps; static int num_net_lps = 0, num_mpi_lps = 0;
FILE * workload_log = NULL; FILE * workload_log = NULL;
FILE * workload_agg_log = NULL; FILE * workload_agg_log = NULL;
...@@ -79,6 +82,9 @@ static double sampling_interval = 5000000; ...@@ -79,6 +82,9 @@ static double sampling_interval = 5000000;
static double sampling_end_time = 3000000000; static double sampling_end_time = 3000000000;
static int enable_debug = 1; static int enable_debug = 1;
/* set group context */
struct codes_mctx group_ratio;
/* MPI_OP_GET_NEXT is for getting next MPI operation when the previous operation completes. /* MPI_OP_GET_NEXT is for getting next MPI operation when the previous operation completes.
* MPI_SEND_ARRIVED is issued when a MPI message arrives at its destination (the message is transported by model-net and an event is invoked when it arrives. * MPI_SEND_ARRIVED is issued when a MPI message arrives at its destination (the message is transported by model-net and an event is invoked when it arrives.
* MPI_SEND_POSTED is issued when a MPI message has left the source LP (message is transported via model-net). */ * MPI_SEND_POSTED is issued when a MPI message has left the source LP (message is transported via model-net). */
...@@ -199,11 +205,12 @@ struct nw_message ...@@ -199,11 +205,12 @@ struct nw_message
// forward message handler // forward message handler
int msg_type; int msg_type;
int op_type; int op_type;
model_net_event_return event_rc;
struct struct
{ {
tw_lpid src_rank; tw_lpid src_rank;
tw_lpid dest_rank; int dest_rank;
int64_t num_bytes; int64_t num_bytes;
int num_matched; int num_matched;
int data_type; int data_type;
...@@ -825,27 +832,12 @@ static void codes_exec_mpi_send(nw_state* s, ...@@ -825,27 +832,12 @@ static void codes_exec_mpi_send(nw_state* s,
global_dest_rank = get_global_id_of_job_rank(mpi_op->u.send.dest_rank, s->app_id); global_dest_rank = get_global_id_of_job_rank(mpi_op->u.send.dest_rank, s->app_id);
} }
//printf("\n Sender rank %d global dest rank %d ", s->nw_id, global_dest_rank);
m->rc.saved_num_bytes = mpi_op->u.send.num_bytes; m->rc.saved_num_bytes = mpi_op->u.send.num_bytes;
/* model-net event */ /* model-net event */
tw_lpid dest_rank; tw_lpid dest_rank = codes_mapping_get_lpid_from_relative(global_dest_rank, NULL, "nw-lp", NULL, 0);
dest_rank = codes_mapping_get_lpid_from_relative(global_dest_rank, NULL, "nw-lp", NULL, 0);
// if(net_id == DRAGONFLY) /* special handling for the dragonfly case */ num_bytes_sent += mpi_op->u.send.num_bytes;
/* {
int num_routers, lps_per_rep, factor;
num_routers = codes_mapping_get_lp_count(lp_group_name, 1,
"modelnet_dragonfly_router", NULL, 1);
lps_per_rep = (2 * num_nw_lps) + num_routers;
factor = global_dest_rank / num_nw_lps;
dest_rank = (lps_per_rep * factor) + (global_dest_rank % num_nw_lps);
}
else
{
*/ /* other cases like torus/simplenet/loggp etc. */
/* codes_mapping_get_lp_id(lp_group_name, lp_type_name, NULL, 1,
global_dest_rank, mapping_offset, &dest_rank);
}
*/
num_bytes_sent += mpi_op->u.send.num_bytes;
s->num_bytes_sent += mpi_op->u.send.num_bytes; s->num_bytes_sent += mpi_op->u.send.num_bytes;
if(enable_sampling) if(enable_sampling)
...@@ -888,7 +880,8 @@ static void codes_exec_mpi_send(nw_state* s, ...@@ -888,7 +880,8 @@ static void codes_exec_mpi_send(nw_state* s,
remote_m = local_m; remote_m = local_m;
remote_m.msg_type = MPI_SEND_ARRIVED; remote_m.msg_type = MPI_SEND_ARRIVED;
model_net_event(net_id, "test", dest_rank, mpi_op->u.send.num_bytes, 0.0, m->event_rc = model_net_event_mctx(net_id, &group_ratio, &group_ratio,
"test", dest_rank, mpi_op->u.send.num_bytes, self_overhead,
sizeof(nw_message), (const void*)&remote_m, sizeof(nw_message), (const void*)&local_m, lp); sizeof(nw_message), (const void*)&remote_m, sizeof(nw_message), (const void*)&local_m, lp);
if(enable_debug) if(enable_debug)
...@@ -1038,6 +1031,8 @@ static void update_arrival_queue(nw_state* s, tw_bf * bf, nw_message * m, tw_lp ...@@ -1038,6 +1031,8 @@ static void update_arrival_queue(nw_state* s, tw_bf * bf, nw_message * m, tw_lp
m->fwd.app_id, s->app_id, s->nw_id); m->fwd.app_id, s->app_id, s->nw_id);
assert(s->app_id == m->fwd.app_id); assert(s->app_id == m->fwd.app_id);
//if(s->local_rank != m->fwd.dest_rank)
// printf("\n Dest rank %d local rank %d ", m->fwd.dest_rank, s->local_rank);
m->rc.saved_recv_time = s->recv_time; m->rc.saved_recv_time = s->recv_time;
s->num_bytes_recvd += m->fwd.num_bytes; s->num_bytes_recvd += m->fwd.num_bytes;
...@@ -1114,9 +1109,9 @@ void nw_test_init(nw_state* s, tw_lp* lp) ...@@ -1114,9 +1109,9 @@ void nw_test_init(nw_state* s, tw_lp* lp)
s->sampling_indx = 0; s->sampling_indx = 0;
if(!num_net_traces) if(!num_net_traces)
num_net_traces = num_net_lps; num_net_traces = num_mpi_lps;
assert(num_net_traces <= num_net_lps); assert(num_net_traces <= num_mpi_lps);
struct codes_jobmap_id lid; struct codes_jobmap_id lid;
...@@ -1133,7 +1128,7 @@ void nw_test_init(nw_state* s, tw_lp* lp) ...@@ -1133,7 +1128,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
} }
else else
{ {
/* Only one job running */ /* Only one job running with contiguous mapping */
lid.job = 0; lid.job = 0;
lid.rank = s->nw_id; lid.rank = s->nw_id;
s->app_id = 0; s->app_id = 0;
...@@ -1148,11 +1143,18 @@ void nw_test_init(nw_state* s, tw_lp* lp) ...@@ -1148,11 +1143,18 @@ void nw_test_init(nw_state* s, tw_lp* lp)
params = (char*)&params_d; params = (char*)&params_d;
s->app_id = lid.job; s->app_id = lid.job;
s->local_rank = lid.rank; s->local_rank = lid.rank;
// printf("network LP nw id %d app id %d generating events, lp gid is %ld \n", s->nw_id, s->app_id, lp->gid); // printf("network LP nw id %d app id %d local rank %d generating events, lp gid is %ld \n", s->nw_id,
// s->app_id, s->local_rank, lp->gid);
} }
wrkld_id = codes_workload_load("dumpi-trace-workload", params, s->app_id, s->local_rank); wrkld_id = codes_workload_load("dumpi-trace-workload", params, s->app_id, s->local_rank);
double overhead;
int rc = configuration_get_value_double(&config, "PARAMS", "self_msg_overhead", NULL, &overhead);
if(overhead)
self_overhead = overhead;
INIT_QLIST_HEAD(&s->arrival_queue); INIT_QLIST_HEAD(&s->arrival_queue);
INIT_QLIST_HEAD(&s->pending_recvs_queue); INIT_QLIST_HEAD(&s->pending_recvs_queue);
INIT_QLIST_HEAD(&s->completed_reqs); INIT_QLIST_HEAD(&s->completed_reqs);
...@@ -1250,7 +1252,7 @@ static void get_next_mpi_operation_rc(nw_state* s, tw_bf * bf, nw_message * m, t ...@@ -1250,7 +1252,7 @@ static void get_next_mpi_operation_rc(nw_state* s, tw_bf * bf, nw_message * m, t
s->cur_interval_end -= sampling_interval; s->cur_interval_end -= sampling_interval;
} }
} }
model_net_event_rc(net_id, lp, m->rc.saved_num_bytes); model_net_event_rc2(lp, &m->event_rc);
if(m->op_type == CODES_WK_ISEND) if(m->op_type == CODES_WK_ISEND)
codes_issue_next_event_rc(lp); codes_issue_next_event_rc(lp);
s->num_sends--; s->num_sends--;
...@@ -1622,6 +1624,9 @@ int main( int argc, char** argv ) ...@@ -1622,6 +1624,9 @@ int main( int argc, char** argv )
sprintf(agg_log_name, "mpi-aggregate-logs-%d.bin", rank); sprintf(agg_log_name, "mpi-aggregate-logs-%d.bin", rank);
workload_agg_log = fopen(agg_log_name, "w+"); workload_agg_log = fopen(agg_log_name, "w+");
workload_meta_log = fopen("mpi-workload-meta-log", "w+"); workload_meta_log = fopen("mpi-workload-meta-log", "w+");
group_ratio = codes_mctx_set_group_ratio(NULL, true);
if(!workload_agg_log || !workload_meta_log) if(!workload_agg_log || !workload_meta_log)
{ {
printf("\n Error logging MPI operations... quitting "); printf("\n Error logging MPI operations... quitting ");
...@@ -1633,10 +1638,9 @@ int main( int argc, char** argv ) ...@@ -1633,10 +1638,9 @@ int main( int argc, char** argv )
codes_mapping_setup(); codes_mapping_setup();
num_net_lps = codes_mapping_get_lp_count("MODELNET_GRP", 0, "nw-lp", NULL, 0); num_mpi_lps = codes_mapping_get_lp_count("MODELNET_GRP", 0, "nw-lp", NULL, 0);
num_net_lps = codes_mapping_get_lp_count("MODELNET_GRP", 1, MN_LP_NM, NULL, 0);
num_nw_lps = codes_mapping_get_lp_count("MODELNET_GRP", 1, printf("\n num net lps %d ", num_net_lps);
"nw-lp", NULL, 1);
if (lp_io_dir[0]){ if (lp_io_dir[0]){
do_lp_io = 1; do_lp_io = 1;
/* initialize lp io */ /* initialize lp io */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment