fortran & openmp: put multiple do-s and section-s in the same parallel enviroment
问题 I have some serial codes like this: do i=1,N ... end do do j=1,M ... end do ...(1) ...(2) Above showed three blocks of serial codes with two do-s and two independent blocks. and I want to adapt it into parallel codes. One way I know of doing is: !$omp parallel do do i ... !$omp end parallel !$omp parallel do do j ... !$omp end parallel !$omp parallel !$omp section ...(1) !$omp section ...(2) !$omp end parallel Notice that in doing this way, I am threading four times. As a non-expert, I am not