Skip to content
Draft
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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ option(ZLIB "Enable zlib support" ON)
option(AMPI_MPICH_TESTS "Enable mpich tests for AMPI" OFF)
option(DRONE_MODE "Enable drone mode" OFF)
option(TASK_QUEUE "Enable task queue" OFF)
option(PRIORITIES_ENABLED "Enable entry method priorities" OFF)


if(TRACING STREQUAL "")
Expand Down Expand Up @@ -262,6 +263,13 @@ else()
set(CMK_TASKQUEUE 0)
endif()

if(${PRIORITIES_ENABLED})
set(CK_ENABLE_MSG_PRIORITIES 1)
else()
set(CK_ENABLE_MSG_PRIORITIES 0)
endif()



if(${AMPI_MPICH_TESTS})
add_definitions(-DAMPI_ERRHANDLER_RETURN=1)
Expand Down
6 changes: 6 additions & 0 deletions src/ck-core/charm.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ typedef enum {
#define CK_MSG_EXPEDITED 0x4
#define CK_MSG_LB_NOTRACE 0x8 /* load balancer doesn't trace */

#if CK_ENABLE_MSG_PRIORITIES
#define PRIORITIES_DISABLED 0
#else
#define PRIORITIES_DISABLED 1
#endif // CK_ENABLE_MSG_PRIORITIES

#ifdef __cplusplus
#define CK_MSGOPTIONAL =0
#else
Expand Down
8 changes: 4 additions & 4 deletions src/ck-core/ck.C
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ void CkSendMsg(int entryIdx, void *msg,const CkChareID *pCid, int opts)
_TRACE_CREATION_1(env);
if (destPE!=-1) {
CpvAccess(_qd)->create();
if (opts & CK_MSG_SKIP_OR_IMM)
if (PRIORITIES_DISABLED || opts & CK_MSG_SKIP_OR_IMM)
_noCldEnqueue(destPE, env);
else
_CldEnqueue(destPE, env, _infoIdx);
Expand Down Expand Up @@ -1824,7 +1824,7 @@ static inline void _sendMsgBranch(int eIdx, void *msg, CkGroupID gID,

_TRACE_ONLY(numPes = (pe==CLD_BROADCAST_ALL?CkNumPes():1));
_TRACE_CREATION_N(env, numPes);
if (opts & CK_MSG_SKIP_OR_IMM)
if (PRIORITIES_DISABLED || opts & CK_MSG_SKIP_OR_IMM)
_noCldEnqueue(pe, env);
else
_skipCldEnqueue(pe, env, _infoIdx);
Expand Down Expand Up @@ -1998,7 +1998,7 @@ static inline void _sendMsgNodeBranch(int eIdx, void *msg, CkGroupID gID,
}
numPes = (node==CLD_BROADCAST_ALL?CkNumNodes():1);
_TRACE_CREATION_N(env, numPes);
if (opts & CK_MSG_SKIP_OR_IMM) {
if (PRIORITIES_DISABLED || opts & CK_MSG_SKIP_OR_IMM) {
_noCldNodeEnqueue(node, env);
}
else
Expand Down Expand Up @@ -2150,7 +2150,7 @@ void CkArrayManagerDeliver(int pe,void *msg, int opts) {
_prepareOutgoingArrayMsg(env,ForArrayEltMsg);
if (opts & CK_MSG_IMMEDIATE)
CmiBecomeImmediate(env);
if (opts & CK_MSG_SKIP_OR_IMM)
if (PRIORITIES_DISABLED || opts & CK_MSG_SKIP_OR_IMM)
_noCldEnqueue(pe, env);
else
_skipCldEnqueue(pe, env, _infoIdx);
Expand Down
4 changes: 2 additions & 2 deletions src/ck-core/ckarray.C
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ void CProxy_ArrayBase::ckBroadcast(CkArrayMessage* msg, int ep, int opts) const
// Broadcast message via serializer node
_TRACE_CREATION_DETAILED(UsrToEnv(msg), ep);
static constexpr int serializer = 0;
int skipsched = opts & CK_MSG_EXPEDITED;
int skipsched = PRIORITIES_DISABLED || (opts & CK_MSG_EXPEDITED);
CProxy_CkArray ap(_aid);

if (CkMyPe() != serializer)
Expand Down Expand Up @@ -1582,7 +1582,7 @@ void CkArray::incrementBcastNoAndSendBack(int srcPe, MsgPointerWrapper w)

void CkArray::sendZCBroadcast(MsgPointerWrapper w)
{
int skipsched = w.opts & CK_MSG_EXPEDITED;
int skipsched = PRIORITIES_DISABLED || (w.opts & CK_MSG_EXPEDITED);
int nokeep = _entryTable[w.ep]->noKeep;
UsrToEnv(w.msg)->setGroupEpoch(w.epoch);
if (skipsched && nokeep)
Expand Down
4 changes: 2 additions & 2 deletions tests/charm++/megatest/priolongtest.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ priolongtest_chare::recv(priolongtest_msg *m)
megatest_finish();
}

#if ! CMK_RANDOMIZED_MSGQ
MEGATEST_REGISTER_TEST(priolongtest,"ebohm",1)
#if !defined(CMK_RANDOMIZED_MSGQ) && !defined(CK_ENABLE_MSG_PRIORITIES)
MEGATEST_REGISTER_TEST(priolongtest,"ebohm",1)
#endif

#include "priolongtest.def.h"
2 changes: 1 addition & 1 deletion tests/charm++/megatest/priotest.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ priotest_chare::recv(priotest_msg *m)
megatest_finish();
}

#if ! CMK_RANDOMIZED_MSGQ
#if !defined(CMK_RANDOMIZED_MSGQ) && !defined(CK_ENABLE_MSG_PRIORITIES)
MEGATEST_REGISTER_TEST(priotest,"mlind",1)
#endif

Expand Down