예제 #1
0
// data submitted from child
void ReductionMgr::remoteSubmit(ReductionSubmitMsg *msg) {
  int setID = msg->reductionSetID;
  ReductionSet *set = reductionSets[setID];
  int seqNum = msg->sequenceNumber
	+ set->addToRemoteSequenceNumber[childIndex(msg->sourceNode)];

//iout << "seq " << seqNum << " from " << msg->sourceNode << " received on " << CkMyPe() << "\n" << endi;
  int size = msg->dataSize;
  if ( size != set->dataSize ) {
    NAMD_bug("ReductionMgr::remoteSubmit data sizes do not match.");
  }

  BigReal *newData = msg->data;
  ReductionSetData *data = set->getData(seqNum);
  BigReal *curData = data->data;
#ifdef ARCH_POWERPC
#pragma disjoint (*curData,  *newData)
#pragma unroll(4)
#endif
  for ( int i = 0; i < size; ++i ) {
    curData[i] += newData[i];
  }
//  CkPrintf("[%d] reduction Submit received from node[%d] %d\n",
//    CkMyPe(),childIndex(msg->sourceNode),msg->sourceNode);
  delete msg;

  data->submitsRecorded++;
  if ( data->submitsRecorded == set->submitsRegistered ) {
    mergeAndDeliver(set,seqNum);
  }
}
예제 #2
0
void BtMenuView::buildMenu(QMenu *parentMenu, const QModelIndex &parentIndex) {
    Q_ASSERT(m_model != 0);
    Q_ASSERT(m_actions != 0);

    int children = m_model->rowCount(parentIndex);
    for (int i = 0; i < children; i++) {
        QModelIndex childIndex(m_model->index(i, 0, parentIndex));

        if (m_model->rowCount(childIndex) > 0) {
            QMenu *childMenu = newMenu(parentMenu, childIndex);

            if (childMenu != 0) {
                // Add the child menu and populate it:
                parentMenu->addMenu(childMenu);
                buildMenu(childMenu, childIndex);
            }
        } else {
            QAction *childAction = newAction(parentMenu, childIndex);

            if (childAction != 0) {
                // Map index
                m_indexMap.insert(childAction, childIndex);

                // Add action to action group:
                childAction->setActionGroup(m_actions);

                // Add action to menu:
                parentMenu->addAction(childAction);
            }
        }
    }
}
예제 #3
0
void
SlimeTraceSerializer::addChildrenCursorsToStack(Cursor & childrenArray, const TraceNode & node)
{
    for (uint32_t childIndex(0); childIndex < node.getNumChildren(); childIndex++) {
        Cursor & child(childrenArray.addObject());
        _cursors.push(&child);
    }
}
예제 #4
0
파일: cDynXdl.cpp 프로젝트: 8l/fpgasm
/*=====================================================================
======================================================================*/
void CLASS::xdlContinueWire1(cDyn* prim,int refindex,int busId){
//fprintf(stderr,"%s\n",__func__);
//fprintf(stderr,"xdlContinueWire(%s,%d,%d)\n",prim->hero->name,refindex,busId);
  //using our wires, find the wire from pindex of prim..
  int refinst=childIndex(prim); //index of child primitive we love...
  cMultiWireWalker walker(*hero->type->xwire);
  while(!walker.isEnd()){
    int pinst; int pindex;int busid;
    walker.getInc(pinst,pindex,busid);
    if((pinst==refinst)&&(pindex==refindex)&&(busid==busId)){
      xdlWireInner1(pinst,pindex,busid,walker);
    }
    walker.seekNext();
  }
}
예제 #5
0
파일: cDynXdl.cpp 프로젝트: 8l/fpgasm
/*=====================================================================
======================================================================*/
void CLASS::xdlStartWires1(cDyn* prim){
//fprintf(stderr,"%s\n",__func__);
  int refinst=childIndex(prim); //index of child primitive we love...
  cCollection* pins = prim->hero->pins;
  cMultiWireWalker walker(*hero->type->xwire);
  while(!walker.isEnd()){
    sWireEnd source=walker.getInc();
    if(refinst==source.inst) {//source is our child primitive?
      prim->xdlNetHeader(pins,source.pindex); //go in one
      xdlWireInner1(source.inst,source.pindex,source.busid,walker);
      fprintf(fout,";\n");
    }
    walker.seekNext();
  }
}
예제 #6
0
// register submit from child
void ReductionMgr::remoteRegister(ReductionRegisterMsg *msg) {

  int setID = msg->reductionSetID;
  int size = msg->dataSize;
  ReductionSet *set = getSet(setID,size);
  if ( set->getData(set->nextSequenceNumber)->submitsRecorded ) {
    NAMD_die("ReductionMgr::remoteRegister called while reductions outstanding on parent!");
  }

  set->submitsRegistered++;
  set->addToRemoteSequenceNumber[childIndex(msg->sourceNode)]
					= set->nextSequenceNumber;
//  CkPrintf("[%d] reduction register received from node[%d] %d\n",
//    CkMyPe(),childIndex(msg->sourceNode),msg->sourceNode);
    
  delete msg;
}