Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow in ParaSolver #5

Open
nariaki3551 opened this issue Oct 23, 2022 · 0 comments
Open

Flow in ParaSolver #5

nariaki3551 opened this issue Oct 23, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@nariaki3551
Copy link
Owner

nariaki3551 commented Oct 23, 2022

commit: e6625d0

  1. Get a task from LC (LoadCoordinator)
    CMapLapParaTask *cmapLapParaTask = dynamic_cast<CMapLapParaTask *>(currentTask);
  2. Execute DeepLLL algorithm implemented in LapTools
    // LLL reduction
    CmapDeepBkz<int, double, double> lllObj{
    L, this, getRank(), getThreadId(), 0, false};
    lllObj.deeplll();
  3. Execute ExDeepBKZ (Extended DeepBKZ)
    CmapExDeepBkz<int, double, double> reductionObj{
    L, this, getRank(), getThreadId(), verbose, mergeBasisFromLC};
    // reduction (DeepBKZ)
    int startBlocksize = paraParams->getIntParamValue(DeepBkzStartBlockSize);
    int endBlocksize = paraParams->getIntParamValue(DeepBkzEndBlockSize);
    int intervalBlocksize = paraParams->getIntParamValue(DeepBkzBlockSizeInterval);
    int blocksize;
    int _start = 1, _end = L->n, gamma = L->n, abort = 4;
    double alpha = 0.99;
    for( blocksize = startBlocksize; blocksize <= endBlocksize; blocksize += intervalBlocksize )
    {
    if( blocksize > endBlocksize ){ break; }
    reductionObj.DeepBKZ(_start, _end, blocksize, alpha, gamma, abort);
    }

    3-1. Run a tour of DeepBKZ (by DeepBKZ/DeepBKZ.h)
    3-2. Enter receiving phase per tour
    communicate(shouldAbort);
    if (shouldAbort) return true;

    3-3. Fetch the global sub basis when ParaSolver has received if from LC, and merge it to own basis using LapTools::Lattice::merge() function. Then, synchronize merged basis to NLT matrix in DeepBKZ::Lattice class by syncBasisToNTL()
    // check that it has received basis
    if( mergeBasisFromLC & cmapLapParaSolver->hasReceivedBasis() )
    {
    LapTools::LatticeBasis<BasisFloat> receivedSubBasis(cmapLapParaSolver->getReceivedBasis<BasisFloat>());
    LapTools::Lattice<BasisFloat, GSFloat> receivedSubLattice{receivedSubBasis};
    int index = 0;
    if( receivedSubLattice.isMoreReducedThan(*L, index) )
    {
    // double startMergeTime = LapTools::Timer::getElapsedTime();
    L->merge(receivedSubLattice);
    syncBasisToNTL();
    // this->mergeTime += LapTools::Timer::getElapsedTime() - startMergeTime;
    // updateBestObjectiveValue('U');
    }
    }

    3-4. Send status message to LC
    // check to be necessary to send the status
    if( cmapLapParaSolver->notificationIsNecessary() )
    {
    sendStatus();
    }
@nariaki3551 nariaki3551 added the documentation Improvements or additions to documentation label Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant