Skip to content

Commit

Permalink
Remove un-needed tab characters from all files, and whitespace at end…
Browse files Browse the repository at this point in the history
… of line

Removed the remaining tab characters, except where needed, and all whitespace at the end of lines.
  • Loading branch information
underwoo committed Oct 15, 2019
1 parent ea26c1b commit 7d2541b
Show file tree
Hide file tree
Showing 172 changed files with 3,628 additions and 3,685 deletions.
12 changes: 6 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
ACLOCAL_AMFLAGS = -I m4

# Make targets will be run in each subdirectory. Order is significant.
SUBDIRS = include platform constants tridiagonal mpp memutils fms \
affinity mosaic time_manager diag_manager drifters axis_utils \
horiz_interp time_interp column_diagnostics block_control \
data_override astronomy field_manager coupler diag_integral \
monin_obukhov interpolator fft amip_interp oda_tools exchange \
topography tracer_manager station_data sat_vapor_pres random_numbers \
SUBDIRS = include platform constants tridiagonal mpp memutils fms \
affinity mosaic time_manager diag_manager drifters axis_utils \
horiz_interp time_interp column_diagnostics block_control \
data_override astronomy field_manager coupler diag_integral \
monin_obukhov interpolator fft amip_interp oda_tools exchange \
topography tracer_manager station_data sat_vapor_pres random_numbers \
libFMS test_fms

EXTRA_DIST = README.md
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flexible Modeling System (FMS)

The Flexible Modeling System (FMS) is a software framework for supporting the
The Flexible Modeling System (FMS) is a software framework for supporting the
efficient development, construction, execution, and scientific interpretation
of atmospheric, oceanic, and climate system models.

Expand Down
4 changes: 2 additions & 2 deletions affinity/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ AM_CPPFLAGS += -I${top_builddir}/fms
noinst_LTLIBRARIES = libfms_affinity.la libfms_affinity_c.la

# The convenience library depends on its source.
libfms_affinity_la_SOURCES = fms_affinity.F90
libfms_affinity_c_la_SOURCES = affinity.c
libfms_affinity_la_SOURCES = fms_affinity.F90
libfms_affinity_c_la_SOURCES = affinity.c

# Mod file depends on its .o file, is built and then installed.
fms_affinity_mod.mod: fms_affinity.$(OBJEXT)
Expand Down
8 changes: 4 additions & 4 deletions affinity/affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int get_cpu_affinity_(void) { return get_cpu_affinity(); } /* Fortran inter
int get_cpuset(int fsz, int *output, int pe, _Bool debug)
{
#ifndef __APPLE__
cpu_set_t coremask; /* core affinity mask */
cpu_set_t coremask; /* core affinity mask */

CPU_ZERO(&coremask);
if (sched_getaffinity(gettid(),sizeof(cpu_set_t),&coremask) != 0) {
Expand All @@ -89,7 +89,7 @@ int get_cpuset(int fsz, int *output, int pe, _Bool debug)
count = 0;
for (cpu=0;cpu < CPU_SETSIZE;cpu++) {
if (CPU_ISSET(cpu,&coremask)) {
if (count > fsz) {
if (count > fsz) {
return -1;
}
output[count] = cpu;
Expand All @@ -111,7 +111,7 @@ int get_cpuset_(int *fsz, int *output, int *pe, _Bool *debug) { return get_cpuse
int set_cpu_affinity(int cpu)
{
#ifndef __APPLE__
cpu_set_t coremask; /* core affinity mask */
cpu_set_t coremask; /* core affinity mask */

CPU_ZERO(&coremask);
CPU_SET(cpu,&coremask);
Expand All @@ -122,4 +122,4 @@ int set_cpu_affinity(int cpu)
return 0;
}

int set_cpu_affinity_(int *cpu) { return set_cpu_affinity(*cpu); } /* Fortran interface */
int set_cpu_affinity_(int *cpu) { return set_cpu_affinity(*cpu); } /* Fortran interface */
16 changes: 8 additions & 8 deletions affinity/fms_affinity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ subroutine fms_affinity_init()
integer:: unit

!--- return if module is initialized
if (module_is_initialized) return
if (module_is_initialized) return

!--- ensure fms/mpp has been initialized
call fms_init()

!--- read in namelist
read(input_nml_file, fms_affinity_nml, iostat=io_stat)
ierr = check_nml_error(io_stat,'fms_affinity_nml')
Expand All @@ -76,21 +76,21 @@ subroutine fms_affinity_init()
end subroutine fms_affinity_init


!--- function to get affinity
!--- function to get affinity
function fms_affinity_get () result(affinity)

!--- local declarations for Fortran/C affinity interoperability
integer(c_int):: get_cpu_affinity

!--- local variables
integer:: affinity
integer:: affinity

affinity = get_cpu_affinity()

end function fms_affinity_get


!--- routine to set affinity
!--- routine to set affinity
subroutine fms_affinity_set (component, use_hyper_thread, nthreads)
!--- interface variables
character(len=*), intent(in):: component
Expand Down Expand Up @@ -145,9 +145,9 @@ subroutine fms_affinity_set (component, use_hyper_thread, nthreads)
call error_mesg('fms_affinity_set',trim(component)//': issue setting cpu affinity', FATAL)
endif

!--- set affinity for threads associated with this MPI-rank
!--- set affinity for threads associated with this MPI-rank
!$OMP PARALLEL NUM_THREADS (nthreads) &
!$OMP& DEFAULT (none) &
!$OMP& DEFAULT (none) &
!$OMP& SHARED (use_hyper_thread, cpuset_sz, component, cpu_set, debug_affinity) &
!$OMP& PRIVATE (th_num, indx, retcode, h_name)
!$ th_num = omp_get_thread_num()
Expand All @@ -165,7 +165,7 @@ subroutine fms_affinity_set (component, use_hyper_thread, nthreads)
!$ if (retcode == -1) then
!$ call error_mesg('fms_affinity_set',trim(component)//': issue setting cpu affinity', FATAL)
!$ endif
!--- output affinity placement
!--- output affinity placement
!$ if (debug_affinity) then
!$ call hostnm(h_name)
!$ print *, 'DEBUG:',mpp_pe(),trim(component),' ',trim(h_name),get_cpu_affinity(),th_num
Expand Down
2 changes: 1 addition & 1 deletion affinity/test_affinity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ program test_affinity

!--- print success or failure message
if (mpp_pe() == mpp_root_pe()) print *, '*** SUCCESS!'

end program test_affinity
Loading

0 comments on commit 7d2541b

Please sign in to comment.