int main(int argc, char **argv) { // Do example doCalculation(2, 9999, 4); // Do real doCalculation(2, 999999, 5); return 0; }
int main() { int i; for (i=0; i<10000; i++) { doCalculation(); } return 0; }
void CPUBoundProc(void){ int niceval[4] = {19, 10, 0, -12}; int i, pid, n = 100; for(i=0; i < 4; i++){ if((pid = fork()) < 0){ printf(2, "Error forking!\n"); exit(); } else if(pid == 0){ nice(niceval[i]); doCalculation(niceval[i], n); exit(); } } while(wait() >= 0) ; printf(2, "\n\n\n\n"); }
void MultiColvarBase::performTask( const unsigned& task_index, const unsigned& current, MultiValue& myvals ) const { AtomValuePack myatoms( myvals, this ); // Retrieve the atom list if( !setupCurrentAtomList( current, myatoms ) ) return; // Do a quick check on the size of this contribution calculateWeight( myatoms ); if( myatoms.getValue(0)<getTolerance() ){ updateActiveAtoms( myatoms ); return; } // Compute everything double vv=doCalculation( task_index, myatoms ); myatoms.setValue( 1, vv ); return; }
void MultiColvarBase::performTask(){ // Currently no atoms have derivatives so deactivate those that are active atoms_with_derivatives.deactivateAll(); // Currently no central atoms have derivatives so deactive them all atomsWithCatomDer.deactivateAll(); // Retrieve the atom list if( !setupCurrentAtomList( getCurrentTask() ) ) return; // Do a quick check on the size of this contribution calculateWeight(); // printf("HELLO WEIGHT %f \n",getElementValue(1) ); if( getElementValue(1)<getTolerance() ){ updateActiveAtoms(); return; } // Compute everything double vv=doCalculation(); // Set the value of this element in ActionWithVessel setElementValue( 0, vv ); return; }