17 #include "../builtins/Arith.h"
18 #include "../shell/Shell.h"
29 "handles process call",
36 static Finfo* testSchedFinfos[] = {
45 sizeof ( testSchedFinfos ) /
sizeof(
Finfo* ),
56 static const int timings[] = { 1, 2, 2, 2, 3, 3, 4, 4, 4,
57 5, 5, 5, 6, 6, 6, 6, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 10,
58 11, 12, 12, 12, 12, 13, 14, 14, 14, 15, 15, 15, 15,
59 16, 16, 16, 17, 18, 18, 18, 18, 19, 20, 20, 20, 20, 20,
60 21, 21, 22, 22, 22, 23, 24, 24, 24, 24, 25, 25, 25 };
64 cout <<
Shell::myNode() <<
":testSchedElement::process: index= " << index_ <<
", currTime = " << p->
currTime << endl;
67 assert( static_cast< int >( p->
currTime ) == timings[ index_ ] );
82 const double runtime = 20.0;
147 shell->
doAddMsg(
"oneToAll", clock,
"process0", test,
"process" );
148 shell->
doAddMsg(
"oneToAll", clock,
"process1", test,
"process" );
149 shell->
doAddMsg(
"oneToAll", clock,
"process2", test,
"process" );
150 shell->
doAddMsg(
"oneToAll", clock,
"process3", test,
"process" );
151 shell->
doAddMsg(
"oneToAll", clock,
"process4", test,
"process" );
152 shell->
doAddMsg(
"oneToAll", clock,
"process7", test,
"process" );
168 cout <<
"." << flush;
175 Id syns = shell->
doCreate(
"SimpleSynHandler",
Id(),
"syns0", 10 );
176 Id fire = shell->
doCreate(
"IntFire",
Id(),
"fire0", 10 );
180 cout <<
"." << flush;
void testClockMessaging()
static bool set(const ObjId &dest, const string &field, L index, A arg)
static const unsigned int numTicks
void handleReinit(const Eref &e)
dest function for message to trigger reinit.
double getCurrentTime() const
static DestFinfo processFinfo("process","handles process call", new EpFunc1< TestSched, ProcPtr >(&TestSched::process))
static bool set(const ObjId &dest, const string &field, A arg)
void handleStart(const Eref &e, double runtime, bool notify)
dest function for message to run simulation for specified time
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
vector< unsigned int > activeTicks_
bool doubleEq(double x, double y)
static const Cinfo * testSchedCinfo
void process(const Eref &e, ProcPtr p)
void testSchedulingProcess()
void buildTicks(const Eref &e)
vector< unsigned int > ticks_
static bool isInitPending_
ObjId doAddMsg(const string &msgType, ObjId src, const string &srcField, ObjId dest, const string &destField)
static unsigned int myNode()
static const Cinfo * initCinfo()