New answers tagged

2

If you're looking for an example, take a look at the MatrixBase class here: https://github.com/dealii/dealii/blob/master/include/deal.II/lac/petsc_matrix_base.h https://github.com/dealii/dealii/blob/master/source/lac/petsc_matrix_base.cc


0

Put the MatDestroy in your destructor. Your logic for setting elements is completely wrong. The easiest solution is: // stuff for ( .... i .... ) for ( ... j ... ) globalnumber = .... i ... j .... if ( globalnumber>=low && globalnumber<high ) MatSetValue


0

spinlocks are bad because other threads in other processes could have used the CPUs. And yes, from the OS point of view, the polling thread is always in the running state which prevents the CPU from tuning down the clock to save electricity. An ideal implementation would make the thread waiting on some sync object and be notified when data arrives.


Top 50 recent answers are included