Exemple #1
0
int main()
{
  int A[100];
  int B[100];
  int i;
  int temp;
  
#pragma mem_fault_tolerance (A:<0:100>) (B:<0:100>) (Chunksize=10)
  for (i = 0; i < 100; i++) {
    int _memTemp0 = A[i];
    A[i] = 5;
    updateElem("A",A[i],i,_memTemp0,10);
    int _memTemp1 = B[i];
    B[i] = 0;
    updateElem("B",B[i],i,_memTemp1,10);
  }
  clearHashTable();
  
#pragma mem_fault_tolerance (A:<0:100>) (B:<0:100>) (Chunksize=10)
  updateArray("A",A + 0,0,100,10);
  updateArray("B",B + 0,0,100,10);
  for (i = 0; i < 100; i++) {
    int _memTemp2 = B[i];
    B[i] = B[i] + A[i];
    updateElem("B",B[i],i,_memTemp2,10);
  }
  validateArray("A",A + 0,0,100,10);
  validateArray("B",B + 0,0,100,10);
  clearHashTable();
}
Exemple #2
0
int main()
{
  int i;
  int A[100UL];
  int B[100UL][100UL];
  int C[100UL];
  
#pragma mem_fault_tolerance ( Chunksize = 8 )
  for (i = 0; i < 10; i++) {
    A[i] = 0;
  }
  clearHashTable();
  
#pragma mem_fault_tolerance ( A : < 0 : 100 > ) ( B : < 0 : 100 > < 0 : 100 > ) ( C : < 0 : 100 > ) ( Chunksize = 8 )
  updateArray("A",A + 0,0,100,8);
  updateArray("B",B[0] + 0,0,100,0,100,8);
  for (i = 0; i < 10; i++) {
    int _memTemp0 = B[i + 1][i + 5];
    B[i + 1][i + 5] = A[i];
    updateElem("B",B[i + 1][i + 5],i + 1,i + 5,_memTemp0,8);
    int _memTemp1 = C[i];
    C[i] = B[i][i + 2];
    updateElem("C",C[i],i,_memTemp1,8);
  }
  validateArray("A",A + 0,0,100,8);
  validateArray("B",B[0] + 0,0,100,0,100,8);
  clearHashTable();
  return 0;
}
bool ClassRoomController::update(ClassRoom classRoom) {
    //Get the element in the tree
    for(int i=0; i<this->m_classrooms.length (); i++) {
        if(this->m_classrooms.item (i).toElement ().attribute ("id").toInt ()==classRoom.getId ()) {
            QDomElement updateElem(this->m_classrooms.item (i).toElement ());
            updateElem.setAttribute ("title",classRoom.getTitle ());
            return true;
        }
    }
    return false;
}
int main()
{
  int A[100];
  int i;
  
#pragma mem_fault_tolerance (A:<0:100>)
  for (i = 0; i < 100; i++) {
    int _memTemp0 = A[i];
    A[i] = 5;
    updateElem("A",A[i],i,_memTemp0,1);
  }
  clearHashTable();
}