Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace GOMP. Implement OpenMP in MOM_vert_friction.F90. Fix OpenMP erro... #4

Merged
merged 5 commits into from
Mar 8, 2014
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ FORMULA_TRANSPARENT = YES
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

USE_MATHJAX = NO
USE_MATHJAX = YES

# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
Expand Down
18 changes: 15 additions & 3 deletions config_src/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ program MOM_main
type(time_type) :: energysavedays ! The interval between writing the energies
! and other integral quantities of the run.

integer :: ocean_nthreads = 1 ! Number of Openmp threads
integer :: date_init(6)=0 ! The start date of the whole simulation.
integer :: date(6)=-1 ! Possibly the start date of this run segment.
integer :: years=0, months=0, days=0 ! These may determine the segment run
Expand All @@ -166,12 +167,14 @@ program MOM_main
type(ice_shelf_CS), pointer :: ice_shelf_CSp => NULL()
!-----------------------------------------------------------------------

integer :: get_cpu_affinity, base_cpu, omp_get_num_threads, omp_get_thread_num

character(len=4), parameter :: vers_num = 'v2.0'
! This include declares and sets the variable "version".
#include "version_variable.h"
character(len=40) :: mod = "MOM_main (MOM_driver)" ! This module's name.

namelist /ocean_solo_nml/ date_init, calendar, months, days, hours, minutes, seconds
namelist /ocean_solo_nml/ date_init, calendar, months, days, hours, minutes, seconds, ocean_nthreads

!#######################################################################

Expand All @@ -193,10 +196,10 @@ program MOM_main
call open_file(unit, 'input.nml', form=ASCII_FILE, action=READONLY_FILE)
read(unit, ocean_solo_nml, iostat=io_status)
call close_file(unit)
if (years+months+days+hours+minutes+seconds > 0) then
! if (years+months+days+hours+minutes+seconds > 0) then
ierr = check_nml_error(io_status,'ocean_solo_nml')
if (is_root_pe()) write(*,ocean_solo_nml)
endif
! endif
endif

! Read ocean_solo restart, which can override settings from the namelist.
Expand All @@ -220,6 +223,15 @@ program MOM_main
endif
call set_calendar_type(calendar_type)

#ifndef NOT_SET_AFFINITY
!$ call omp_set_num_threads(ocean_nthreads)
!$ base_cpu = get_cpu_affinity()
!$OMP PARALLEL
!$ call set_cpu_affinity( base_cpu + omp_get_thread_num() )
!$OMP END PARALLEL
#endif


if (sum(date_init) > 0) then
Start_time = set_date(date_init(1),date_init(2), date_init(3), &
date_init(4),date_init(5),date_init(6))
Expand Down
2 changes: 1 addition & 1 deletion examples/.datasets
1 change: 1 addition & 0 deletions examples/coupled_AM2_LM3_SIS/AM2_MOM6i_1deg/INPUT/README
1 change: 1 addition & 0 deletions examples/coupled_AM2_LM3_SIS/AM2_MOM6i_1deg/INPUT/id1ch4n2
1 change: 1 addition & 0 deletions examples/coupled_AM2_LM3_SIS/AM2_MOM6i_1deg/INPUT/id1o3
1 change: 1 addition & 0 deletions examples/coupled_AM2_LM3_SIS/AM2_MOM6i_1deg/INPUT/stdlvls
Loading