mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-10-11 02:11:30 +02:00
Anthony Scemama
5b6ecfa564
Some checks reported errors
continuous-integration/drone/push Build was killed
30 lines
712 B
Fortran
30 lines
712 B
Fortran
use omp_lib
|
|
|
|
BEGIN_PROVIDER [ integer(omp_lock_kind), file_lock ]
|
|
use f77_zmq
|
|
implicit none
|
|
BEGIN_DOC
|
|
! OpenMP Lock for I/O
|
|
END_DOC
|
|
call omp_init_lock(file_lock)
|
|
END_PROVIDER
|
|
|
|
! These functions need to be called because internal read and write are not thread safe.
|
|
subroutine lock_io()
|
|
implicit none
|
|
BEGIN_DOC
|
|
! Needs to be called because before doing I/O because internal read and write
|
|
! are not thread safe.
|
|
END_DOC
|
|
call omp_set_lock(file_lock)
|
|
end subroutine lock_io()
|
|
|
|
subroutine unlock_io()
|
|
implicit none
|
|
BEGIN_DOC
|
|
! Needs to be called because afterdoing I/O because internal read and write
|
|
! are not thread safe.
|
|
END_DOC
|
|
call omp_unset_lock(file_lock)
|
|
end subroutine lock_io()
|