Skip to content

Commit

Permalink
Squashed 'src/externals/pio2/' changes from 6f0afaa..20457f9
Browse files Browse the repository at this point in the history
20457f9 Merge pull request ESMCI#1578 from jedwards4b/fixtimerstop
2400bcc remove hardcoded timer name
24addf9 Merge pull request ESMCI#1575 from NCAR/ejh_netcdf_includes
e4a4501 now using only public netcdf headers for netcdf integration
b4c7416 getting to work with latest netcdf-c
74e12ba adjusting to changes in netcdf-c with netcdf integration
8a91d30 test cleanup
1a11dbf changed open/create to use ncid as final parameter instead of NC *
b28779c removed include of internal netcdf file nc4dispatch.h
cc5832b Merge pull request ESMCI#1574 from NCAR/ejh_fortran_test_2
bbe6927 now getting darrays working from fortran with netcdf integration
c64584f fixed plain old PIO fortran program
6d92938 cleanup
7dd23b6 added C test to guide fortran test building
f067353 Merge pull request ESMCI#1573 from NCAR/ejh_example
1ef2e37 Merge branch 'master' into ejh_example
49399c4 fixed example Makefile.am for C only builds
9ecf617 fixed example Makefile.am for C only builds
6922609 fixed example Makefile.am for C only builds
f625222 got fortran example working
5404452 Merge pull request ESMCI#1571 from NCAR/ejh_fncint_more_2
9f975e9 working on vard
21bced8 getting darray write working
47a4e5e starting to add first vard
3279fd0 test development
a8d2040 further test development
041316b further improvement of test - now adding dims and var
8619790 better error handling
b20cbf2 better error handling
5542408 moving to use of iosysid
85ab319 moving to use of iosysid
c0dd8f4 Merge pull request ESMCI#1570 from NCAR/ejh_fncint_decomp
934e193 now use decompid in nf_def_decomp
fcf2f7d working version of nf_def_decomp
fc4d65e Merge pull request ESMCI#1569 from NCAR/ejh_ncint_decomp
739c49e cleanup and documentation
f47f9b1 working on nf_free_decomp
bc125f8 more docs
f004b23 more work on ncint, with inq_format functions
f29d6b5 Merge pull request ESMCI#1567 from NCAR/ejh_ncint_mem
0d892ef more documentation for netcdf integration
b6591ec beginning to add docs for netcdf integration
7408927 changed nc_init_decomp to nc_def_decomp
233a8c9 changed nc_init_intracom to nc_def_iosystem
fb21d5d changed name from nf_init_intracom to nf_def_iosystem
463740a better memory checking for C ncint
91c0564 Merge pull request ESMCI#1566 from NCAR/ejh_ncint_fortran_decomp
b657f85 fixed memory leak in ncint layer
2cfad5e calling PIO_InitDecomp and PIO_freedecomp
65df82b working on initdecomp in fortran
9566912 Merge pull request ESMCI#1565 from NCAR/ejh_fncint_more
f1a3fe7 made nf_init_intracomm() into a function
91754ab made nf_feee_iosystem into function
c8e5381 Merge pull request ESMCI#1564 from NCAR/ejh_ncint_get_iosystem
c14f8b7 getting nf_free_iosystem working better
ec594c3 better handling of nf_free_iosystem
94d4b87 Merge pull request ESMCI#1563 from NCAR/ejh_ncint_next
f71c1e9 adding nc_get_iosystem()
cc3d531 working on nf_free_iosystem
804aac2 adding nf_free_iosystem
227a81c Merge pull request ESMCI#1562 from NCAR/ejh_ncint_fortran_next
1683f0d moving fortran ncint functions to their own mod file
b35c6bb moving fortran ncint functions to their own mod file
f9a064e Merge pull request ESMCI#1559 from NCAR/ejh_ncint_fortran
70a219c Merge branch 'master' into ejh_ncint_fortran
213084b Merge pull request ESMCI#1561 from NCAR/ejh_ncint_fortran_3
b4882a3 commenting out
31e6c8c trying cmake change
7692571 trying cmake change
9731682 trying cmake change
f66530f trying cmake change
ba83404 trying cmake change
5b77692 trying cmake change
e3ca52b trying cmake change
e45c9e4 trying cmake change
6eed431 trying cmake change
576be21 trying cmake change
3ae508c trying cmake change
d212fe6 Merge branch 'master' into ejh_ncint_fortran
b1ffbf1 Merge pull request ESMCI#1560 from NCAR/ejh_ncint_fortran_2
d2add2e better handling of netcdf integration in C lirbary
2469a2b better handling of netcdf integration in C lirbary
e3d1a21 better handling of netcdf integration in C lirbary
e6991ab trying to fix cmake build
1fffdf8 trying to fix cmake build
22e36e0 trying to fix cmake build
f7cc7a4 trying to fix cmake build
a9832f8 turning off netcdf integration in Fortran if NETCDF_INTEGRATION is not set by configure.ac
a48cd4a turning off netcdf integration in Fortran if NETCDF_INTEGRATION is not set by configure.ac
946c2fc getting netcdf integration working in fortran
e12d55a cleanup
392fb39 cleanup
3b08eb8 finally got fortran working with netcdf integration!
c08f691 now linking fncint test to netcdf fortran library
b0649ba further test development
2596223 developing fortran test of ncint
e03d43f adding run_tests.sh script in fncint test directory
116f7de starting to test ncint in fortran
ed9f6c5 adding directories and Makefile.am changes to support fortran netcdf integration
08e7b2b Merge pull request ESMCI#1558 from NCAR/ejh_netcdf_3
acb666d more PIO_NCINT functions
f5cc645 more PIO_NCINT functions
42f58b2 more PIO_NCINT functions
e005177 more PIO_NCINT functions
c984299 more PIO_NCINT functions
c68712d more functions for netcdf integration layer
ae66446 Merge pull request ESMCI#1557 from NCAR/ejh_netcdf_2
5c43ff5 adding more functions to netcdf integration layer
d8ff280 adding more functions to netcdf integration layer
647baa2 adding more functions to netcdf integration layer
61cc130 adding more functions to netcdf integration layer
267b96b adding more functions to netcdf integration layer
4b8dcd4 changed function names from NC_NCINT to PIO_NCINT
bc3de41 moving functions around
8cd22e5 move UDF initialization
974ed66 moved init of UDF to nc_init_intercomm()
4d3e937 made ncint test case 3D, now also reading and checking results
9852c2a Merge pull request ESMCI#1556 from NCAR/ejh_pio_netcdf
6c704c5 added ncint_vard.c
7610f38 merged master
eaccc55 now writing darrays with netcdf intergration
153ba17 Merge pull request ESMCI#1552 from NCAR/ejh_uthash_include
ff6a067 added nc_free_decomp
746f327 added nc_init_decomp
1205baa made test use 2D var
45ccb61 added def_dim
92dd174 got create working with netcdf integration layer
ff53bf5 working on nc_create and the netcdf integration layer
2570fb4 adding create to netcdf integration layer
20bd34f now builds with logging
f8c9710 merged master
1b08a2b Merge branch 'master' into ejh_uthash_include
a29a28c Merge pull request ESMCI#1554 from NCAR/ejh_rename_log
ffd5b57 Merge branch 'master' into ejh_uthash_include
ad2c869 fixed stray character
ad9409f changed LOG to PLOG
8140b5b changed BAIL to PBAIL
dbec519 now close the file with PIOc_closefile()
886fee6 is it working?
a3f925b adding argument to openfile_retry to tell it not to set ncid for netcdf integration layer files
d72e8fb further test development
d9014ad further test development
100af62 further progress on netcdf integration
168edc6 now setting macro HDF5_PARALLEL for ncint builds to please ncdispatch.h
218f8e2 now running tst_pio_udf with mpiexec on 4 processors
0734bad more work on netcdf integration layer
36e51e7 further development of netcdf integration layer
2ad312e further progress on netcdf integration layer
50a24e2 more netcdf integration test development
1791291 now running tst_pio_udf.c
bfc2062 added tst_pio_udf.c
fb66aa3 working on netcdf integration layer!
df9d5ed starting to add netcdf integration
07d2784 Merge pull request ESMCI#1549 from NCAR/ejh_clean
904b56a now install uthash.h
f43cf80 fixed warning
b3e94d7 commented out some dead code
f3bd166 Merge pull request ESMCI#1548 from NCAR/ejh_travis_4
c646399 turning on -Werror in FCFLAGS
b8b52b9 Merge pull request ESMCI#1547 from NCAR/ejh_travis_3
a0b4d54 fixed example
2ad4aae turning on -Werror for C compiler
1994cde Merge pull request ESMCI#1545 from NCAR/ejh_travis_2
9026e79 Merge branch 'master' into ejh_travis_2
dfae365 Merge pull request ESMCI#1544 from NCAR/ejh_travis_c_warning_check
b8721df Merge branch 'master' into ejh_travis_c_warning_check
909be5d Merge pull request ESMCI#1543 from NCAR/ejh_more_warn
8d1a6bd travis is a pain!
29da024 changed name of C library to libpioc.la
ed19304 trying a warning checking build in travis
f9fa38b removed some dead code
82d900a fixed warnings in piodarray.F90.in
ddb92ef fixed warnings in pio_decomp_frame_tests.F90.in
4f0c73b fixed warning in driver.F90
80c569d Merge pull request ESMCI#1541 from NCAR/ejh_warn_more_4
9ab5f53 Merge pull request ESMCI#1540 from NCAR/ejh_warn_more_3
db8b291 Merge pull request ESMCI#1539 from NCAR/ejh_warn_more_2
0623647 fixed travis warning check
f7641a9 fixed travis warning check
d6b6a74 fixed warnings in pio_support.F90, turned on -Werror for C compiler in travis
78c88d2 fixed warnings in pio_nf.F90
b1dc7b2 fixed warnings in pio_tutil.F90
baf3bcb fix documentation problem
803c585 fixed warnings in piolib_mod.F90
7ba85bd fixing more of piolib_mod.F90 warnings
14e2a55 Merge pull request ESMCI#1536 from NCAR/ejh_err
4b766be Merge branch 'master' into ejh_err
ab6c5fe Merge pull request ESMCI#1535 from NCAR/ejh_warn_6
56d9152 Merge pull request ESMCI#1533 from NCAR/ejh_warn_5
b059b6d now find_region() returns error code, and takes pointer to regionlen as a parameter
3f3d5cb fixed a warning in pio_support.F90
776e542 fixed warnings in pionfput_mod.F90.in
8df467e fixed warnings in ncdf_inq.F90.in
04af202 fixed warnings in ncdf_get_put.F90.in
4fddb0b fixed warnings in pio_rearr.F90.in, some warnings from pio_decomp_frame_tests.F90.in
001640d Merge pull request ESMCI#1529 from NCAR/ejh_warn_4
d5aa624 Merge branch 'master' into ejh_warn_4
9a6b5eb Merge pull request ESMCI#1525 from NCAR/ejh_warn_3
5f4769b Merge branch 'master' into ejh_warn_3
2928ce3 Merge pull request ESMCI#1517 from NCAR/ejh_warn2
8f3fe00 fixed warnings in pio_rearr_opts.F90.in
3c6cea0 fixed warnings in pio_rearr_opts2.F90.in
6a6e814 fixed some more warnings in pio_decomp_frame_tests.F90.in
4e08185 fixed warnings in pio_decomp_tests.F90.in
3b1b0b0 fixed warnings in pio_decomp_tests_1d.F90.in
3537624 fixed warnings in pio_decomp_tests_2d.F90.in
32aaa7b fixed warnings in pio_decomp_tests_3d.F90.in
ad0c193 fixed some warnings in pio_decomp_frame_tests.F90.in
85c7a4c fixed warnings in pio_decomp_fillval.F90
860807c fixed warnings in pio_iosystem_tests2.F90.in
b1eec45 fixed warnings in pio_iosystem_tests3.F90.in
45bed2c fixed warnings in darray_no_async.c
32a1f48 fixing warnings in pionfatt_mod.F90.in
d648c55 changes that should not work
12d73c2 fixed warning in pionfatt_mod.F90
fa12cc2 fixed warnings in basic_tests.F90
e007308 fixing warnings in piolib_mod.F90
c287ae7 fixed warnings in ncdf_tests.F90
393c5da Merge pull request ESMCI#1502 from NCAR/ejh_bail
d95813a using new EXIT macro for error handling
1886bc8 comment and whitespace cleanup
cb23428 moving more error handling macros to pio_error.h
7fbdb02 moving more error handling macros to pio_error.h
2695b4b move error macros to pio_error.h
bdfbb41 removed MPI_Finalize() call from BAIL and MPIBAIL macros
43f7269 Merge pull request ESMCI#1498 from NCAR/ejh_mpe_4
78b0a4d finished getting mpe working with test_async_perf
c4cb0a1 adding more mpe logging to test_async_perf
57f23f2 adding more mpe logging to test_async_perf
5b46dab adding more mpe logging to test_async_perf
2704459 adding more mpe logging to test_async_perf
a01cea3 more progress adding mpe logging to test_async_perf
d751fe7 moved test mpe logging code to test_common.c
fcef805 Merge pull request ESMCI#1497 from NCAR/ejh_mpe_3
2a0c8fc more mpe logging work in test_perf2
2459f3a ifdef protecting mep log functions in pio_internal.h to prefent doxygen warning
dba0dba doc fixes
3987068 more mpe work
06b4172 fixed mpe logging problem
c834641 more MPE changes
cebb73d fixing mpe build
e7ca362 fixing LD problem
05eef3e mpe logging works
ad4fd9a more mpe logging
e8efdb4 more mpe logging
bcbfecc more mpe logging
6c20479 more MPE logging
3d9a113 more MPE logging
4ce0b71 more instrumenting with MPE
0e0643b now logging init_async with MPE
1747d7f running mpe with tests when available
3c32fbb starting to bring MPE logging into PIO library

git-subtree-dir: src/externals/pio2
git-subtree-split: 20457f9
  • Loading branch information
jedwards4b committed Aug 6, 2019
1 parent 41c0649 commit bf2d204
Show file tree
Hide file tree
Showing 93 changed files with 7,497 additions and 2,098 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ env:
- LDFLAGS='-L/usr/lib'

script:
- ls -l /usr/include
- autoreconf -i
- export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer'
- export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror'
- export FFLAGS='-fsanitize=address -fno-omit-frame-pointer'
- export FCFLAGS='-fsanitize=address -fno-omit-frame-pointer'
- export FCFLAGS='-fsanitize=address -fno-omit-frame-pointer -Werror'
- export DISTCHECK_CONFIGURE_FLAGS='--enable-fortran'
- ./configure --enable-fortran --enable-developer-docs
- make
- make -j distcheck
- make -j distclean
- rm -rf build
- mkdir build
- cd build
Expand Down
75 changes: 57 additions & 18 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AC_SUBST([VERSION_PATCH], [4])
AC_CONFIG_MACRO_DIR([m4])

# Libtool initialisation.
LD=ld # Required for MPE to work.
LT_INIT

# Find and learn about the C compiler.
Expand Down Expand Up @@ -52,22 +53,6 @@ if test "x$enable_logging" = xyes; then
AC_DEFINE([PIO_ENABLE_LOGGING], 1, [If true, turn on logging.])
fi

# Does the user want to use MPE library?
AC_MSG_CHECKING([whether use of MPE library is enabled])
AC_ARG_ENABLE([mpe],
[AS_HELP_STRING([--enable-mpe],
[enable use of MPE library for timing and diagnostic info (may negatively impact performance).])])
test "x$enable_mpe" = xyes || enable_mpe=no
AC_MSG_RESULT([$enable_mpe])
if test "x$enable_mpe" = xyes; then
AC_SEARCH_LIBS([MPE_Log_get_event_number], [mpe], [HAVE_LIBMPE=yes], [HAVE_LIBMPE=no], [-lpthread -lm])
AC_CHECK_HEADERS([mpe.h], [HAVE_MPE=yes], [HAVE_MPE=no])
if test "x$HAVE_LIBMPE" = xno -o "x$HAVE_MPE" = xno; then
AC_MSG_ERROR([MPE not found but --enable-mpe used.])
fi
AC_DEFINE([USE_MPE], 1, [If true, use MPE timing library.])
fi

# Does the user want to enable timing?
AC_MSG_CHECKING([whether GPTL timing library is used])
AC_ARG_ENABLE([timing],
Expand Down Expand Up @@ -104,6 +89,32 @@ test "x$enable_fortran" = xyes || enable_fortran=no
AC_MSG_RESULT([$enable_fortran])
AM_CONDITIONAL(BUILD_FORTRAN, [test "x$enable_fortran" = xyes])

# Does the user want to use MPE library?
AC_MSG_CHECKING([whether use of MPE library is enabled])
AC_ARG_ENABLE([mpe],
[AS_HELP_STRING([--enable-mpe],
[enable use of MPE library for timing and diagnostic info (may negatively impact performance).])])
test "x$enable_mpe" = xyes || enable_mpe=no
AC_MSG_RESULT([$enable_mpe])
if test "x$enable_mpe" = xyes; then

AC_SEARCH_LIBS([pthread_setspecific], [pthread], [], [], [])
dnl AC_SEARCH_LIBS([MPE_Log_get_event_number], [mpe], [HAVE_LIBMPE=yes], [HAVE_LIBMPE=no], [])
dnl AC_SEARCH_LIBS([MPE_Init_mpi_core], [lmpe], [HAVE_LIBLMPE=yes], [HAVE_LIBLMPE=no], [])
AC_CHECK_HEADERS([mpe.h], [HAVE_MPE=yes], [HAVE_MPE=no])
dnl if test "x$HAVE_LIBMPE" != xyes; then
dnl AC_MSG_ERROR([-lmpe not found but --enable-mpe used.])
dnl fi
dnl if test "x$HAVE_LIBLMPE" != xyes; then
dnl AC_MSG_ERROR([-llmpe not found but --enable-mpe used.])
dnl fi
if test $enable_fortran = yes; then
AC_MSG_ERROR([MPE not implemented in Fortran tests and examples. Build without --enable-fortran])
fi
AC_DEFINE([USE_MPE], 1, [If true, use MPE timing library.])

fi

# Does the user want to disable pnetcdf?
AC_MSG_CHECKING([whether pnetcdf is to be used])
AC_ARG_ENABLE([pnetcdf],
Expand Down Expand Up @@ -150,9 +161,9 @@ if test "x$enable_docs" = xyes; then
fi
AC_SUBST([FORTRAN_SRC_FILES], ["../src/flib/piodarray.f90 ../src/flib/pio.F90 ../src/flib/pio_kinds.F90 ../src/flib/piolib_mod.f90 ../src/flib/pionfatt_mod_2.f90 ../src/flib/pio_nf.F90 ../src/flib/pionfget_mod_2.f90 ../src/flib/pionfput_mod.f90 ../src/flib/pio_support.F90 ../src/flib/pio_types.F90"])
if test "x$enable_developer_docs" = xyes; then
AC_SUBST([C_SRC_FILES], ["../src/clib"])
AC_SUBST([C_SRC_FILES], ["../src/clib ../src/ncint"])
else
AC_SUBST([C_SRC_FILES], ["../src/clib/pio_nc.c ../src/clib/pio_nc4.c ../src/clib/pio_darray.c ../src/clib/pio_get_nc.c ../src/clib/pio_put_nc.c ../src/clib/pioc_support.c ../src/clib/pioc.c ../src/clib/pio_file.c ../src/clib/pio.h ../src/clib/pio_get_vard.c ../src/clib/pio_put_vard.c"])
AC_SUBST([C_SRC_FILES], ["../src/clib/pio_nc.c ../src/clib/pio_nc4.c ../src/clib/pio_darray.c ../src/clib/pio_get_nc.c ../src/clib/pio_put_nc.c ../src/clib/pioc_support.c ../src/clib/pioc.c ../src/clib/pio_file.c ../src/clib/pio.h ../src/clib/pio_get_vard.c ../src/clib/pio_put_vard.c ../src/ncint/ncint_pio.c ../src/ncint/nc_put_vard.c ../src/ncint/nc_get_vard.c"])
fi
AC_CONFIG_FILES([doc/Doxyfile])
fi
Expand Down Expand Up @@ -251,6 +262,30 @@ if test "x$enable_timing" = xyes; then
fi
AM_CONDITIONAL([HAVE_PAPI], [test "x$have_papi" = xyes])

# Does the user want to build netcdf-c integration layer?
AC_MSG_CHECKING([whether netcdf-c integration layer should be build])
AC_ARG_ENABLE([netcdf-integration],
[AS_HELP_STRING([--enable-netcdf-integration],
[enable building of netCDF C API integration.])])
test "x$enable_netcdf_integration" = xyes || enable_netcdf_integration=no
AC_MSG_RESULT([$enable_netcdf_integration])
if test "x$enable_netcdf_integration" = xyes -a "x$enable_timing" = xyes; then
AC_MSG_ERROR([Cannot use GPTL timing library with netCDF interation.])
fi
if test "x$enable_netcdf_integration" = xyes -a "x$have_netcdf_par" = xno; then
AC_MSG_ERROR([Cannot use netCDF integration unless netCDF library was built for parallel I/O.])
fi
# These are needed by ncdispatch.h. Only build with HDF5 parallel
# versions of netCDF. */
if test "x$enable_netcdf_integration" = xyes; then
AC_DEFINE([HDF5_PARALLEL],[1],[Does HDF5 library provide parallel access])
AC_DEFINE([USE_NETCDF4],[1],[Does HDF5 library provide parallel access])
AC_DEFINE([NETCDF_INTEGRATION],[1],[Are we building with netCDF integration])
fi

AM_CONDITIONAL(BUILD_NCINT, [test "x$enable_netcdf_integration" = xyes])
AM_CONDITIONAL(NETCDF_INTEGRATION, [test "x$enable_netcdf_integration" = xyes])

AC_CONFIG_FILES([tests/general/pio_tutil.F90:tests/general/util/pio_tutil.F90])

AC_CONFIG_LINKS([tests/unit/input.nl:tests/unit/input.nl])
Expand All @@ -262,10 +297,13 @@ AC_CONFIG_HEADERS([config.h])
AC_OUTPUT(Makefile
src/Makefile
src/clib/Makefile
src/ncint/Makefile
src/flib/Makefile
src/gptl/Makefile
tests/Makefile
tests/cunit/Makefile
tests/ncint/Makefile
tests/fncint/Makefile
tests/unit/Makefile
tests/general/Makefile
tests/general/util/Makefile
Expand All @@ -275,4 +313,5 @@ AC_OUTPUT(Makefile
doc/images/Makefile
examples/Makefile
examples/c/Makefile
examples/f03/Makefile
scripts/Makefile)
22 changes: 22 additions & 0 deletions doc/source/netcdf_integration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** @page netcdf_integration NetCDF API Integration

The netCDF integration feature allows existing netCDF codes, in C or
Fortran, to be easily converted to use PIO.

# Building and Using PIO with NetCDF Integration

In order to use netCDF integration:

* The PIO configure must use the option --enable-netcdf-integration.

* The latest master of the netcdf-c library must be built and used,
and the PIO build must include the netcdf-c/include directory in its
CPPFLAGS, in order to find internal netCDF header files needed for
netCDF integration. (The netcdf-c library is being modified to export
publically everything needed, so future releases of netcdf-c will no
longer require this.)

Once PIO is build for netCDF integration, it provides the nc_* and
nf_* functions required to fully integrate PIO and netCDF.

*/
1 change: 1 addition & 0 deletions doc/source/users_guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ releases.
- @ref decomp
- @ref error
- @ref examp
- @ref netcdf_integration
- @ref faq
- @ref api
- @ref c_api
Expand Down
5 changes: 4 additions & 1 deletion examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

# Ed Hartnett

SUBDIRS = c
if BUILD_FORTRAN
F03 = f03
endif # BUILD_FORTRAN

SUBDIRS = c ${F03}
4 changes: 2 additions & 2 deletions examples/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Ed Hartnett 5/7/18

# Link to our assembled library.
AM_LDFLAGS = ${top_builddir}/src/clib/libpio.la
LDADD = ${top_builddir}/src/clib/libpioc.la
AM_CPPFLAGS = -I$(top_srcdir)/src/clib

# Build the tests for make check.
Expand All @@ -19,4 +19,4 @@ endif # RUN_TESTS
EXTRA_DIST = run_tests.sh

# Clean up files produced during testing.
CLEANFILES = *.nc *.log
CLEANFILES = *.nc *.log *.clog2 *.slog2
25 changes: 0 additions & 25 deletions examples/c/darray_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,6 @@ int dim_len[NDIM3] = {NC_UNLIMITED, DIM_LEN_X, DIM_LEN_Y};
/* Names of dimensions. */
char dim_name[NDIM3][PIO_MAX_NAME + 1] = {"unlimted", "x", "y"};

/* Handle MPI errors. This should only be used with MPI library
* function calls. */
#define MPIERR(e) do { \
MPI_Error_string(e, err_buffer, &resultlen); \
printf("MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
MPI_Finalize(); \
return 2; \
} while (0)

/* Handle non-MPI errors by finalizing the MPI library and exiting
* with an exit code. */
#define ERR(e) do { \
MPI_Finalize(); \
return e; \
} while (0)

/* Global err buffer for MPI. When there is an MPI error, this buffer
* is used to store the error message that is associated with the MPI
* error. */
char err_buffer[MPI_MAX_ERROR_STRING];

/* This is the length of the most recent MPI error message, stored
* int the global error string. */
int resultlen;

/* @brief Check the output file.
*
* Use netCDF to check that the output is as expected.
Expand Down
54 changes: 24 additions & 30 deletions examples/c/darray_no_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include <gptl.h>
#endif

/* The name of this program. */
#define TEST_NAME "darray_no_async"

/* The number of possible output netCDF output flavors available to
* the ParallelIO library. */
#define NUM_NETCDF_FLAVORS 4
Expand Down Expand Up @@ -64,22 +67,6 @@ char dim_name[NDIM3][PIO_MAX_NAME + 1] = {"unlimted", "x", "y"};
#define DECOMP_TITLE "Example Decomposition from darray_no_async.c"
#define DECOMP_HISTORY "This file is created by the program darray_no_async in the PIO C library"

/* Handle MPI errors. This should only be used with MPI library
* function calls. */
#define MPIERR(e) do { \
MPI_Error_string(e, err_buffer, &resultlen); \
printf("MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
MPI_Finalize(); \
return 2; \
} while (0)

/* Handle non-MPI errors by finalizing the MPI library and exiting
* with an exit code. */
#define ERR(e) do { \
MPI_Finalize(); \
return e; \
} while (0)

/* Global err buffer for MPI. When there is an MPI error, this buffer
* is used to store the error message that is associated with the MPI
* error. */
Expand Down Expand Up @@ -117,9 +104,9 @@ int check_file(int iosysid, int ntasks, char *filename, int iotype,
/* int expected[DIM_LEN_X]; /\* Data values we expect to find. *\/ */

/* Open the file. */
if ((ret = PIOc_openfile_retry(iosysid, &ncid, &iotype, filename, 0, 0)))
if ((ret = PIOc_openfile_retry(iosysid, &ncid, &iotype, filename, 0, 0, 0)))
return ret;
printf("opened file %s ncid = %d\n", filename, ncid);
/* printf("opened file %s ncid = %d\n", filename, ncid); */

/* Check the metadata. */
if ((ret = PIOc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)))
Expand Down Expand Up @@ -250,11 +237,17 @@ int main(int argc, char* argv[])
if ((ret = MPI_Comm_size(MPI_COMM_WORLD, &ntasks)))
MPIERR(ret);

#ifdef USE_MPE
/* If MPE logging is being used, then initialize it. */
if ((ret = MPE_Init_log()))
return ret;
#endif /* USE_MPE */

/* Check that a valid number of processors was specified. */
if (ntasks != TARGET_NTASKS)
fprintf(stderr, "Number of processors must be 16!\n");
printf("%d: ParallelIO Library darray_no_async example running on %d processors.\n",
my_rank, ntasks);
/* printf("%d: ParallelIO Library darray_no_async example running on %d processors.\n", */
/* my_rank, ntasks); */

/* Turn on logging. */
if ((ret = PIOc_set_log_level(LOG_LEVEL)))
Expand All @@ -281,8 +274,8 @@ int main(int argc, char* argv[])
/* Create the PIO decomposition for this example. Since this
* is a variable with an unlimited dimension, we want to
* create a 2-D composition which represents one record. */
printf("rank: %d Creating decomposition, elements_per_pe %lld...\n", my_rank,
elements_per_pe);
/* printf("rank: %d Creating decomposition, elements_per_pe %lld...\n", my_rank, */
/* elements_per_pe); */
if ((ret = PIOc_init_decomp(iosysid, PIO_INT, NDIM3 - 1, &dim_len[1], elements_per_pe,
compdof, &ioid, PIO_REARR_SUBSET, NULL, NULL)))
ERR(ret);
Expand Down Expand Up @@ -310,13 +303,13 @@ int main(int argc, char* argv[])
sprintf(filename, "darray_no_async_iotype_%d.nc", format[fmt]);

/* Create the netCDF output file. */
printf("rank: %d Creating sample file %s with format %d...\n",
my_rank, filename, format[fmt]);
/* printf("rank: %d Creating sample file %s with format %d...\n", */
/* my_rank, filename, format[fmt]); */
if ((ret = PIOc_createfile(iosysid, &ncid, &(format[fmt]), filename, PIO_CLOBBER)))
ERR(ret);

/* Define netCDF dimension and variable. */
printf("rank: %d Defining netCDF metadata...\n", my_rank);
/* printf("rank: %d Defining netCDF metadata...\n", my_rank); */
for (int d = 0; d < NDIM3; d++)
if ((ret = PIOc_def_dim(ncid, dim_name[d], dim_len[d], &dimid[d])))
ERR(ret);
Expand All @@ -336,7 +329,7 @@ int main(int argc, char* argv[])
buffer[i] = 100 * t + START_DATA_VAL + my_rank;

/* Write data to the file. */
printf("rank: %d Writing sample data...\n", my_rank);
/* printf("rank: %d Writing sample data...\n", my_rank); */
if ((ret = PIOc_setframe(ncid, varid, t)))
ERR(ret);
if ((ret = PIOc_write_darray(ncid, varid, ioid, elements_per_pe, buffer, NULL)))
Expand All @@ -348,7 +341,7 @@ int main(int argc, char* argv[])
ERR(ret);

/* Close the netCDF file. */
printf("rank: %d Closing the sample data file...\n", my_rank);
/* printf("rank: %d Closing the sample data file...\n", my_rank); */
if ((ret = PIOc_closefile(ncid)))
ERR(ret);

Expand All @@ -359,12 +352,12 @@ int main(int argc, char* argv[])
}

/* Free the PIO decomposition. */
printf("rank: %d Freeing PIO decomposition...\n", my_rank);
/* printf("rank: %d Freeing PIO decomposition...\n", my_rank); */
if ((ret = PIOc_freedecomp(iosysid, ioid)))
ERR(ret);

/* Finalize the IO system. */
printf("rank: %d Freeing PIO resources...\n", my_rank);
/* printf("rank: %d Freeing PIO resources...\n", my_rank); */
if ((ret = PIOc_free_iosystem(iosysid)))
ERR(ret);

Expand All @@ -377,6 +370,7 @@ int main(int argc, char* argv[])
return ret;
#endif

printf("rank: %d SUCCESS!\n", my_rank);
if (!my_rank)
printf("rank: %d SUCCESS!\n", my_rank);
return 0;
}
Loading

0 comments on commit bf2d204

Please sign in to comment.