Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/charm++/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3304,6 +3304,22 @@ charm/lib, named as *libcldb-foo.a*, where *foo* is the strategy name
used above. Now one can use **-balance foo** as compile time option to
**charmc** to link with the *foo* seed load balancer.

Global Location Update
~~~~~~~~~~~~~~~~~~~~~~

When Charm++ is built with the ``CMK_GLOBAL_LOCATION_UPDATE`` option(``-DCMK_GLOBAL_LOCATION_UPDATE=1``), the
runtime broadcasts updated object locations to all processors during each load
balancing step. This eliminates the need for hop-count-based location discovery
after migrations.

.. important::

With ``CMK_GLOBAL_LOCATION_UPDATE`` enabled, **object migrations must
occur during global load balancing steps**. Anytime migration (e.g., via
``migrateMe()``) is not supported in this mode. Applications must use the
``AtSync()`` method to trigger load balancing.


.. _lbexample:

Simple Load Balancer Usage Example - Automatic with Sync LB
Expand Down
18 changes: 14 additions & 4 deletions src/ck-core/cklocation.C
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,18 @@ void UpdateLocation(MigrateInfo& migData)
{
return;
}

CkLocMgr* localLocMgr = (CkLocMgr*)CkLocalBranch(locMgrGid);
// CkLocMgr only uses element IDs, so extract just that part from the ObjID
localLocMgr->updateLocation(ck::ObjID(migData.obj.id).getElementID(), migData.to_pe);
}
CkLocCache *cache = (CkLocCache *)CkLocalBranch(localLocMgr->getLocationCache());

CmiUInt8 elementID = ck::ObjID(migData.obj.id).getElementID();
CkArrayIndex idx = localLocMgr->lookupIdx(elementID);

CkLocEntry entry;
entry.id = elementID;
entry.pe = migData.to_pe;
entry.epoch = cache->getEpoch(elementID) + 1;

localLocMgr->updateLocation(idx, entry);}
# endif

#endif
Expand Down Expand Up @@ -2794,6 +2801,9 @@ void CkLocMgr::multiHop(CkArrayMessage* msg)
{ // Send a routing message letting original sender know new element location
DEBS((AA "Sending update back to %d for element %" PRIu64 "\n" AB, srcPe,
msg->array_element_id()));
#if CMK_GLOBAL_LOCATION_UPDATE
CkAssert(false && "Hop-count based location update should not occur with CMK_GLOBAL_LOCATION_UPDATE; all migrations must happen at load balancing steps via AtSync()");
#endif
cache->requestLocation(msg->array_element_id(), srcPe);
}
}
Expand Down
8 changes: 3 additions & 5 deletions src/ck-ldb/CentralLB.C
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,9 @@ void CentralLB::ProcessReceiveMigration()
future_migrates_expected = 0;
for(i=0; i < m->n_moves; i++) {
MigrateInfo& move = m->moves[i];
#if CMK_GLOBAL_LOCATION_UPDATE
UpdateLocation(move);
#endif
const int me = CkMyPe();
if (move.from_pe == me && move.to_pe != me) {
#if CMK_DRONE_MODE
Expand All @@ -1020,11 +1023,6 @@ void CentralLB::ProcessReceiveMigration()
if (!move.async_arrival) migrates_expected++;
else future_migrates_expected++;
}
else {
#if CMK_GLOBAL_LOCATION_UPDATE
UpdateLocation(move);
#endif
}

}

Expand Down
Loading