Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/fpm_backend.F90
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,14 @@ subroutine build_target(model,target,verbose,dry_run,table,stat)

integer :: fh

!$omp critical
! mkdir shells out (is_dir 'test -d' and 'mkdir -p'), which forks. Serialize
! it on the same run_command lock as every other shell fork so it cannot run
! concurrently with a link/archive/compile shell fallback on another thread.
!$omp critical (run_command)
if (.not.exists(dirname(target%output_file)) .and. .not.dry_run) then
call mkdir(dirname(target%output_file),verbose)
end if
!$omp end critical
!$omp end critical (run_command)

select case(target%target_type)

Expand Down
Loading