Changed so that omp parallel region now enclose itertation loop completly. Added additional barrier for synchronization. Master thread is responsible for checking termination conditions and swapping the matrices.