MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TestSched Class Reference

#include <testScheduling.h>

+ Collaboration diagram for TestSched:

Public Member Functions

void process (const Eref &e, ProcPtr p)
 
 TestSched ()
 
void zeroIndex ()
 
 ~TestSched ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 

Private Attributes

int index_
 

Static Private Attributes

static int globalIndex_ = 0
 
static bool isInitPending_ = true
 

Detailed Description

Definition at line 10 of file testScheduling.h.

Constructor & Destructor Documentation

TestSched::TestSched ( )
inline

This may be created as an array, but only on one thread

Definition at line 16 of file testScheduling.h.

References globalIndex_, and isInitPending_.

17  : index_( 0 )
18  {
19  if ( isInitPending_ ) {
20  globalIndex_ = 0;
21  isInitPending_ = 0;
22  }
23  }
static bool isInitPending_
static int globalIndex_
TestSched::~TestSched ( )
inline

Definition at line 24 of file testScheduling.h.

References isInitPending_.

25  {
26  isInitPending_ = 1;
27  }
static bool isInitPending_

Member Function Documentation

const Cinfo * TestSched::initCinfo ( )
static

Definition at line 33 of file testScheduling.cpp.

References processFinfo, and testSchedCinfo.

34 {
35 
36  static Finfo* testSchedFinfos[] = {
38  };
39 
40  static Dinfo< TestSched > dinfo;
41  static Cinfo testSchedCinfo (
42  "testSched",
43  0,
44  testSchedFinfos,
45  sizeof ( testSchedFinfos ) / sizeof( Finfo* ),
46  &dinfo
47  );
48 
49  return &testSchedCinfo;
50 }
static DestFinfo processFinfo("process","handles process call", new EpFunc1< TestSched, ProcPtr >(&TestSched::process))
Definition: Dinfo.h:60
static const Cinfo * testSchedCinfo
Definition: Cinfo.h:18
Definition: Finfo.h:12
void TestSched::process ( const Eref e,
ProcPtr  p 
)

Definition at line 54 of file testScheduling.cpp.

References ProcInfo::currTime, globalIndex_, index_, and Shell::myNode().

55 {
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 };
61  // unsigned int max = sizeof( timings ) / sizeof( int );
62  // cout << Shell::myNode() << " : timing[ " << index_ << " ] = " << timings[ index_ ] << ", time = " << p->currTime << endl;
63  if ( static_cast< int >( p->currTime ) != timings[ index_ ] ) {
64  cout << Shell::myNode() << ":testSchedElement::process: index= " << index_ << ", currTime = " << p->currTime << endl;
65  }
66 
67  assert( static_cast< int >( p->currTime ) == timings[ index_ ] );
68  ++index_;
69 
70  // Check that everything remains in sync
71  assert( ( globalIndex_ - index_ )*( globalIndex_ - index_ ) <= 1 );
73 }
double currTime
Definition: ProcInfo.h:19
static unsigned int myNode()
static int globalIndex_

+ Here is the call graph for this function:

void TestSched::zeroIndex ( )
inline

Definition at line 31 of file testScheduling.h.

References index_.

31  {
32  index_ = 0 ;
33  }

Member Data Documentation

int TestSched::globalIndex_ = 0
staticprivate

Definition at line 38 of file testScheduling.h.

Referenced by process(), and TestSched().

int TestSched::index_
private

Definition at line 37 of file testScheduling.h.

Referenced by process(), and zeroIndex().

bool TestSched::isInitPending_ = true
staticprivate

Definition at line 39 of file testScheduling.h.

Referenced by TestSched(), and ~TestSched().


The documentation for this class was generated from the following files: