509 {
512 if(fPartitioning) {
513 fDeterministic = false;
514 pNtk->Sweep();
515 par.AssignNetwork(pNtk);
516 while(nCreatedJobs < nJobs) {
517 assert(nParallelPartitions > 0);
518 if(nCreatedJobs < nFinishedJobs + nParallelPartitions) {
519 Ntk *
pSubNtk = par.Extract(iSeed + nCreatedJobs);
522 Print(1,
pJob->prefix,
"created ",
":",
"i/o",
"=",
pJob->pNtk->GetNumPis(),
"/",
pJob->pNtk->GetNumPos(),
",",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=",
pJob->costInitial);
523 continue;
524 }
525 }
526 if(nCreatedJobs == nFinishedJobs) {
528 break;
529 }
530 while(nFinishedJobs < nCreatedJobs) {
532 double cost = CostFunction(
pJob->pNtk);
533 Print(1,
pJob->prefix,
"finished",
":",
"i/o",
"=",
pJob->pNtk->GetNumPis(),
"/",
pJob->pNtk->GetNumPos(),
",",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=",
cost);
534 Print(0,
"",
"job",
pJob->id,
"(", nFinishedJobs + 1,
"/", nJobs,
")",
":",
"i/o",
"=",
pJob->pNtk->GetNumPis(),
"/",
pJob->pNtk->GetNumPos(),
",",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=",
cost,
"(", 100 * (
cost -
pJob->costInitial) /
pJob->costInitial,
"%",
")",
",",
"duration",
"=",
pJob->duration,
"s",
",",
"elapsed",
"=", GetElapsedTime(),
"s");
535 par.Insert(
pJob->pNtk);
536 });
537 }
538 if(fOptOnInsert) {
540 CallAbc(pNtk,
std::string(
"&put; ") + pCompress2rs +
"; dc2; &get");
542 par.AssignNetwork(pNtk);
543 double cost = CostFunction(pNtk);
544 Print(0,
"",
"c2rs; dc2",
":",
std::string(34,
' '),
"node",
"=", pNtk->GetNumInts(),
",",
"level",
"=", pNtk->GetNumLevels(),
",",
"cost",
"=",
cost,
"(", 100 * (
cost -
costStart) /
costStart,
"%",
")",
",",
"duration",
"=",
Duration(
timeStartLocal,
timeEndLocal),
"s",
",",
"elapsed",
"=", GetElapsedTime(),
"s");
545 }
546 }
547 while(nFinishedJobs < nCreatedJobs) {
549 double cost = CostFunction(
pJob->pNtk);
550 Print(1,
pJob->prefix,
"finished",
":",
"i/o",
"=",
pJob->pNtk->GetNumPis(),
"/",
pJob->pNtk->GetNumPos(),
",",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=", CostFunction(
pJob->pNtk));
551 Print(0,
"",
"job",
pJob->id,
"(", nFinishedJobs + 1,
"/", nJobs,
")",
":",
"i/o",
"=",
pJob->pNtk->GetNumPis(),
"/",
pJob->pNtk->GetNumPos(),
",",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=",
cost,
"(", 100 * (
cost -
pJob->costInitial) /
pJob->costInitial,
"%",
")",
",",
"duration",
"=",
pJob->duration,
"s",
",",
"elapsed",
"=", GetElapsedTime(),
"s");
552 par.Insert(
pJob->pNtk);
553 });
554 }
555 if(fOptOnInsert) {
556 CallAbc(pNtk,
std::string(
"&put; ") + pCompress2rs +
"; dc2; &get");
557 par.AssignNetwork(pNtk);
558 }
559 } else if(nJobs > 1) {
561 for(
int i = 0;
i < nJobs;
i++) {
564 }
565 for(
int i = 0;
i < nJobs;
i++) {
567 double cost = CostFunction(
pJob->pNtk);
568 Print(0,
"",
"job",
pJob->id,
"(", nFinishedJobs + 1,
"/", nJobs,
")",
":",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=",
cost,
"(", 100 * (
cost -
pJob->costInitial) /
pJob->costInitial,
"%",
")",
",",
"duration",
"=",
pJob->duration,
"s",
",",
"elapsed",
"=", GetElapsedTime(),
"s");
571 *pNtk = *(
pJob->pNtk);
572 }
574 });
575 }
576 } else {
579 double cost = CostFunction(
pJob->pNtk);
580 Print(0,
"",
"job",
pJob->id,
"(", nFinishedJobs + 1,
"/", nJobs,
")",
":",
"node",
"=",
pJob->pNtk->GetNumInts(),
",",
"level",
"=",
pJob->pNtk->GetNumLevels(),
",",
"cost",
"=",
cost,
"(", 100 * (
cost -
pJob->costInitial) /
pJob->costInitial,
"%",
")",
",",
"duration",
"=",
pJob->duration,
"s",
",",
"elapsed",
"=", GetElapsedTime(),
"s");
581 });
582 }
583 double cost = CostFunction(pNtk);
585 Print(0, "\n", "stats summary", ":");
587 Print(0,
"\t",
SW{30,
true},
key,
":",
SW{10}, mStatsSummary[
key]);
588 }
589 Print(0, "", "runtime summary", ":");
591 Print(0,
"\t",
SW{30,
true},
key,
":", mTimesSummary[
key],
"s",
"(", 100 * mTimesSummary[
key] /
duration,
"%",
")");
592 }
593 Print(0,
"",
"end",
":",
"cost",
"=",
cost,
"(", 100 * (
cost -
costStart) /
costStart,
"%",
")",
",",
"time",
"=",
duration,
"s");
594 }