Skip to content

Commit

Permalink
Converse: conditionalize CsdPeriodic, idle tracing, and interop
Browse files Browse the repository at this point in the history
If users build with '-DCSD_NO_IDLE_TRACING=1 -DCSD_NO_PERIODIC=1
-DCMK_NO_INTEROP=1', the Converse scheduling loop is simplified, and
overhead from calling timers (for idle tracing and for periodic
callbacks) is eliminated. However, defining these breaks tracing and
load balancing and other features. Also semi-related to these options
is '-DCMK_NO_MSG_PRIOS=1' which is already supported in Converse.

Change-Id: Id0409b27a0bfed48811418484e4e45ae4818d6e3
  • Loading branch information
stwhite91 authored and evan-charmworks committed Feb 28, 2019
1 parent fd855db commit d59ba2d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/conv-core/convcore.C
Original file line number Diff line number Diff line change
Expand Up @@ -1878,13 +1878,17 @@ int CsdScheduler(int maxmsgs)
if (*CsdStopFlag_ptr != cycle) break;

/*No message available-- go (or remain) idle*/
#if CSD_NO_IDLE_TRACING
#define SCHEDULE_IDLE /* do nothing */
#else
#define SCHEDULE_IDLE \
if (!isIdle) {isIdle=1;CsdBeginIdle();}\
else CsdStillIdle();\
if (*CsdStopFlag_ptr != cycle) {\
CsdEndIdle();\
break;\
}
#endif

/*
EVAC
Expand All @@ -1905,13 +1909,15 @@ void CsdScheduleForever(void)
int isIdle=0;
SCHEDULE_TOP
while (1) {
#if !CMK_NO_INTEROP
/* The interoperation will cost this little overhead in scheduling */
if(CharmLibInterOperate) {
if(CpvAccess(interopExitFlag)) {
CpvAccess(interopExitFlag) = 0;
break;
}
}
#endif
#if CMK_CUDA
// check if any GPU work needs to be processed
if (CpvAccess(n_hapi_events) > 0) {
Expand All @@ -1920,7 +1926,9 @@ void CsdScheduleForever(void)
#endif
msg = CsdNextMessage(&state);
if (msg!=NULL) { /*A message is available-- process it*/
#if !CSD_NO_IDLE_TRACING
if (isIdle) {isIdle=0;CsdEndIdle();}
#endif
SCHEDULE_MESSAGE

#if CMK_CELL
Expand All @@ -1940,7 +1948,9 @@ void CsdScheduleForever(void)
progressCount = CMK_CELL_PROGRESS_FREQ;
#endif
}
#if !CSD_NO_PERIODIC
CsdPeriodic();
#endif
}
}
int CsdScheduleCount(int maxmsgs)
Expand All @@ -1950,14 +1960,18 @@ int CsdScheduleCount(int maxmsgs)
while (1) {
msg = CsdNextMessage(&state);
if (msg!=NULL) { /*A message is available-- process it*/
#if !CSD_NO_IDLE_TRACING
if (isIdle) {isIdle=0;CsdEndIdle();}
#endif
maxmsgs--;
SCHEDULE_MESSAGE
if (maxmsgs==0) break;
} else { /*No message available-- go (or remain) idle*/
SCHEDULE_IDLE
}
#if !CSD_NO_PERIODIC
CsdPeriodic();
#endif
}
return maxmsgs;
}
Expand All @@ -1967,7 +1981,9 @@ void CsdSchedulePoll(void)
SCHEDULE_TOP
while (1)
{
#if !CSD_NO_PERIODIC
CsdPeriodic();
#endif
/*CmiMachineProgressImpl(); ??? */
if (NULL!=(msg = CsdNextMessage(&state)))
{
Expand Down Expand Up @@ -1999,7 +2015,9 @@ void CmiDeliverSpecificMsg(int handler)

side = 0;
while (1) {
#if !CSD_NO_PERIODIC
CsdPeriodic();
#endif
side ^= 1;
if (side) msg = (int *)CmiGetNonLocal();
else msg = (int *)CdsFifo_Dequeue(localqueue);
Expand Down

0 comments on commit d59ba2d

Please sign in to comment.