Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
0a9939c
Adding a MT Queue and thread pool
jayeshkrishna Sep 30, 2024
0a02593
Moving C unit test sources to CPP
jayeshkrishna Sep 30, 2024
12cb666
Moving internal types from pio.h to pio_types.hpp
jayeshkrishna Sep 30, 2024
2c5e93b
Replacing custom lists with C++ STL ds
jayeshkrishna Oct 1, 2024
5911eac
Add missing free for file in cunit test
jayeshkrishna Nov 18, 2024
9ec1f68
Explicitly delete stale files after finalize
jayeshkrishna Nov 18, 2024
756a559
Adding a GPTL wrapper
jayeshkrishna Nov 18, 2024
643decd
Adding gather/scatter/alltoall utils
jayeshkrishna Nov 18, 2024
81bcf16
Adding some debug utils
jayeshkrishna Nov 18, 2024
990fee7
Adding a new rearranger, PIO_REARR_CONTIG
jayeshkrishna Nov 18, 2024
b05a68e
Build/export PIO_REARR_CONTIG rearranger
jayeshkrishna Nov 18, 2024
a0c92f0
Adding tests for PIO_REARR_CONTIG and coll utils
jayeshkrishna Nov 18, 2024
e016e7f
Adding a simple wrapper for ltimers
jayeshkrishna Nov 19, 2024
3653d92
Using GPTL and timer wrappers in pioc.cpp
jayeshkrishna Nov 19, 2024
1560623
Code reformatting initdecomp func
jayeshkrishna Nov 19, 2024
3484f8a
Code reformatting malloc_iodesc func
jayeshkrishna Nov 19, 2024
f900ca3
Moving alloc of map/dimlens to malloc_iodesc
jayeshkrishna Nov 20, 2024
782f094
Refactor initdecomp func to support 0/1 based maps
jayeshkrishna Nov 20, 2024
77ba018
Using GPTL and Ltimer wrapper for write_darray
jayeshkrishna Nov 20, 2024
a287248
Code reformatting write darray funcs
jayeshkrishna Nov 20, 2024
49e8c09
Expose decomp/rearranger info for contig rearr
jayeshkrishna Nov 28, 2024
f433cee
Using GPTL & Ltimer wrappers for read
jayeshkrishna Nov 28, 2024
efc6c9f
Code reformatting read darray func
jayeshkrishna Nov 28, 2024
3a686d7
Adding support for PIO_REARR_CONTIG for rd/wr
jayeshkrishna Nov 28, 2024
3f260e5
Adding support for fillvalues in contig rearr
jayeshkrishna Jan 10, 2025
e06c830
Ensure that hs buffer is valid in gatherw util
jayeshkrishna Jan 10, 2025
1d5de5b
Re-order tested rearr types to mv contig
jayeshkrishna Jan 13, 2025
37a01aa
Adding some simple PnetCDF tests
jayeshkrishna Jan 15, 2025
c2db107
Chunking proc off range to contig dim range
jayeshkrishna Jan 15, 2025
4b598fe
When dispersing n vars fix stride of type
jayeshkrishna Jan 17, 2025
7ee9201
Sync nvars unit test with the latest code
jayeshkrishna Jan 17, 2025
1e5399a
Adding CONTIG/ANY rearr support in replay tool
jayeshkrishna Jan 17, 2025
68a9167
Adding log level to replay tool args
jayeshkrishna Jan 17, 2025
74c8a5b
Using C++ min in pio_darray_int.cpp
jayeshkrishna Jan 17, 2025
b788ed3
Adding dbg info for I/O desc
jayeshkrishna Jan 17, 2025
c26c545
Rm limit on log msg size
jayeshkrishna Apr 16, 2025
d98692e
Adding iodesc info in log when put fails
jayeshkrishna Jan 20, 2025
f608b81
Adding util to convert 1d vec to str
jayeshkrishna Jan 21, 2025
318c9ea
Avoid logging map when getting iodesc info
jayeshkrishna Jan 21, 2025
1855152
Rm unused func and add some logs in contig init
jayeshkrishna Jan 21, 2025
e980e40
Adding func to convert off range to cont range
jayeshkrishna Jan 21, 2025
6abd9bd
Fix type of elem mpi type in contig rearr
jayeshkrishna Jan 22, 2025
21cdf50
Adding a meta data file for decomp files
jayeshkrishna Jan 22, 2025
e674bfb
Util script for decomp meta data file
jayeshkrishna Jan 24, 2025
6397f56
Add iosysid to decomp map info file name
jayeshkrishna Jan 25, 2025
6a4b417
Adding an example of replay tool usage
jayeshkrishna Jan 26, 2025
7c1fe87
Minor cleanup of replay tool
jayeshkrishna Jan 26, 2025
52cef7f
Adding a node local comm to I/O sys
jayeshkrishna Feb 3, 2025
9552003
Adding a decomp logger class
jayeshkrishna Feb 4, 2025
0887f2e
Adding decomp logger class to dump I/O decomps
jayeshkrishna Feb 4, 2025
596add1
Support logging map regions
jayeshkrishna Feb 19, 2025
d2bcbba
Adding missing pio_internal.h hdr
jayeshkrishna Mar 5, 2025
71700b3
Adding some GPTL timers in contig rearr
jayeshkrishna Mar 5, 2025
6508978
Adding a kway merge sort util
jayeshkrishna Mar 24, 2025
606eb9b
Fix buffer sizes passed to contig for rearr
jayeshkrishna Mar 26, 2025
ee863d6
Fix generation of compmap from range
jayeshkrishna Apr 15, 2025
1b0f9af
Free iodesc in decomp logger tests
jayeshkrishna Apr 15, 2025
4b5415d
Add missing frees for map in test_pioc
jayeshkrishna Apr 15, 2025
1da79fd
Handle type related compiler warnings
jayeshkrishna Apr 22, 2025
2c5f221
Adding a comparator and consec range checker
jayeshkrishna Apr 24, 2025
6f22b56
Adding kway sort test via indices
jayeshkrishna Apr 25, 2025
438cc8f
Cache the data chunk size in agg process
jayeshkrishna May 4, 2025
05fd7e8
Use version range for CMake min ver
jayeshkrishna May 4, 2025
371db14
Moving timers for functions to API layer
jayeshkrishna May 15, 2025
afc7a12
Add map sorter
jayeshkrishna May 18, 2025
534d626
Move to new map sorter class
jayeshkrishna May 18, 2025
69b8fa8
Simplify sort when setting up agg info
jayeshkrishna May 19, 2025
563b317
Adding NetCDF support for contig rearr
jayeshkrishna Dec 1, 2025
2076ec5
Fix hdf5 redef issue
jayeshkrishna Dec 2, 2025
92c88a2
Adding a test for multiple redefs
jayeshkrishna Dec 2, 2025
70209dc
Adding a datatype converter util
jayeshkrishna Dec 3, 2025
00e6d9b
Adding local data conversion for hdf5 output
jayeshkrishna Dec 3, 2025
73e3f42
Adding option to enable async thread
jayeshkrishna Dec 5, 2025
adeca52
Adding opt to init threads in tests
jayeshkrishna Dec 5, 2025
fb3490d
Create mt tests when async wr is enabled
jayeshkrishna Dec 5, 2025
a3660ab
Rm extern C around internal hdr
jayeshkrishna Dec 5, 2025
9042f84
Adding a util func to get desc of async op
jayeshkrishna Dec 5, 2025
d9cba8a
Add mt init for e3sm test app
jayeshkrishna Dec 5, 2025
d148c25
Adding async I/O for HDF5 writes
jayeshkrishna Dec 5, 2025
b35c93b
Rm const qualifier for queue size
jayeshkrishna Dec 5, 2025
e39c65f
Fix ADIOS zfp comp rate typo
jayeshkrishna Dec 5, 2025
4a6ab1b
Rm conditionals on async sources
jayeshkrishna Dec 5, 2025
6873db5
Disable ZFP for HDF5 vars with only unlimited dims
jayeshkrishna Dec 8, 2025
27feaab
Adding a 1D put/get test for var with unlim dims
jayeshkrishna Dec 8, 2025
1685fcf
Rewrite the async hdf5 write func
jayeshkrishna Dec 10, 2025
431d84f
Handle async I/O procs with 0 bytes to write
jayeshkrishna Dec 11, 2025
3dfab23
Avoid freeing I/O desc with pending ops
jayeshkrishna Dec 11, 2025
b18b705
Adding stringify for HDF5[C] types
jayeshkrishna Dec 11, 2025
d697bcc
Adding timeout for soft close wait
jayeshkrishna Dec 12, 2025
abc684a
Free hdf5 struct names when freeing file
jayeshkrishna Dec 12, 2025
7c3a5ba
Expose datatype converter for all I/O types
jayeshkrishna Dec 12, 2025
aeea246
Disabling waiting on close for read-only files
jayeshkrishna Dec 15, 2025
ccd289c
Disable zfp compression for scalar vars
jayeshkrishna Dec 15, 2025
b2acf6f
Disable HDF5+ZFP compression for >4D vars
jayeshkrishna Dec 15, 2025
e0d4efd
Adding test for writing a 6d var
jayeshkrishna Dec 15, 2025
526352a
Free I/O desc list one at a time
jayeshkrishna Dec 18, 2025
310ea95
Wait for async hdf5 ops before sync ops
jayeshkrishna Dec 19, 2025
abaadcf
Adding a sanity check for timer level
jayeshkrishna Dec 19, 2025
51e95eb
ifdef HDF5 async code out
jayeshkrishna Dec 19, 2025
22e88de
Move freeing iodescs before iostats are freed
jayeshkrishna Dec 19, 2025
cd63118
Adding util to capture backtrace
jayeshkrishna Dec 20, 2025
a06a4dd
Stop timer when exiting freedecomp
jayeshkrishna Dec 20, 2025
3745611
Adding opt to capture stack trace for timers
jayeshkrishna Dec 20, 2025
04031d9
Moving HDF5 utils to a separate file
jayeshkrishna Jan 9, 2026
c0bf4ea
Code refactoring - hdf5 utils
jayeshkrishna Jan 10, 2026
dd438f4
Moving async hdf5 utils to a separate file
jayeshkrishna Jan 13, 2026
5a8c547
Async offload creating HDF5 files
jayeshkrishna Jan 13, 2026
62545a7
Async offload HDF5 def var
jayeshkrishna Jan 13, 2026
792013d
Adding chk for empty in dt converter
jayeshkrishna Jan 14, 2026
cd2778e
Clear dt converter before deleting
jayeshkrishna Jan 14, 2026
b7f098d
Async offload HDF5 enddef
jayeshkrishna Jan 14, 2026
031cfff
Async offload HDF5 put att
jayeshkrishna Jan 14, 2026
8dcebd3
Offload HDF5 put var
jayeshkrishna Jan 14, 2026
eae7d4b
Disable file sync for HDF5 on anl compute nodes
jayeshkrishna Jan 14, 2026
41ed316
Add util for data type conversion without caching
jayeshkrishna Jan 15, 2026
5dfbf79
Config setting for async timeout
jayeshkrishna Jan 21, 2026
38ba67b
Warn on pending async I/O events every 2s
jayeshkrishna Jan 21, 2026
c15ecd8
Avoid type conv from nc_type to int in dtype conv
jayeshkrishna Jan 21, 2026
79f59fc
Avoid type conv from nc_type to int in hdf5 utils
jayeshkrishna Jan 21, 2026
cc8dd4b
Explicit dtype conversion for HDF5 puts
jayeshkrishna Jan 21, 2026
73cecb4
Move num async threads to configure
jayeshkrishna Jan 21, 2026
1793ed5
Adding thread local comms
jayeshkrishna Jan 26, 2026
efb1ea0
Update pio err & warn to use tlocal comms
jayeshkrishna Jan 27, 2026
35e6f6b
Util to create tlocal MPI infos
jayeshkrishna Jan 27, 2026
87960e7
Updating HDF5 utils to use tlocal comms
jayeshkrishna Jan 27, 2026
2cba4b0
Adding missing stdint hdr
jayeshkrishna Jan 21, 2026
7849bc8
Adding test with empty string att
jayeshkrishna Jan 27, 2026
88c0d43
Allow empty string att for async HDF5 writes
jayeshkrishna Jan 27, 2026
3ee3cd3
Avoid file del on async close on compute procs
jayeshkrishna Jan 30, 2026
7004706
Sync all procs after waiting on a soft close
jayeshkrishna Jan 30, 2026
8328d5b
Skip partially init files in enddef
jayeshkrishna Jan 30, 2026
088af64
Commenting out wait on async hdf5 calls
jayeshkrishna Jan 30, 2026
27bb4ab
Async offload HDF5 set frame
jayeshkrishna Jan 31, 2026
2a472f0
Fix async compile-time checks
jayeshkrishna Feb 1, 2026
189dfa1
Avoid calling user apis in PIOc_inq_vardimid
jayeshkrishna Feb 2, 2026
63df1d9
Skip wait on close for read only files
jayeshkrishna Feb 4, 2026
6676070
Code reformatting
jayeshkrishna Feb 11, 2026
d59958b
Warn when we switch hdf5 iotype during open
jayeshkrishna Feb 11, 2026
0fb2656
Adding Queue exceptions to multi-threaded queue
jayeshkrishna Feb 26, 2026
d499f95
Using an Async_op class for async ops
jayeshkrishna Feb 26, 2026
23b86cf
Moving api build logic to subdir
jayeshkrishna Mar 1, 2026
52e25f1
Code restructring - to core, util
jayeshkrishna Mar 3, 2026
4478c62
More code reorganization - core/iolib
jayeshkrishna Mar 4, 2026
e6fa13e
Code reorg - core/rearr
jayeshkrishna Mar 4, 2026
bea1bdf
Core reorg - core/util core/progress_engine
jayeshkrishna Mar 5, 2026
3d87632
Adding gptl timers and cond timers
jayeshkrishna Mar 9, 2026
f2e2537
Using GPTL C++ wrapper timer
jayeshkrishna Mar 9, 2026
7c0553f
Fix ADIOS bld issues after using interface libs
jayeshkrishna Mar 12, 2026
752b3d8
Add asctime_r() decl is available for pnetcdf test
jayeshkrishna Mar 12, 2026
aec8cce
Build test_common.cpp as a CMake object library
Copilot Mar 11, 2026
0b87ee5
Moving logger to lib util
jayeshkrishna Mar 23, 2026
2ae8247
Adding log level to mpi logger
jayeshkrishna Mar 25, 2026
6ac2c00
Use shared ptr for streams in logger
jayeshkrishna Mar 25, 2026
f47c8e5
Add more utils for log levels
jayeshkrishna Mar 27, 2026
9cc97cf
Log by default to stdout
jayeshkrishna Mar 27, 2026
33305f3
Adding new C++ unit testing framework
jayeshkrishna Mar 27, 2026
3f20562
New testing framework for testing contig rearr
jayeshkrishna Mar 27, 2026
f152a3c
Add config option for dim chunk info
jayeshkrishna Mar 28, 2026
7c7adf6
Config options to constrain chunking
jayeshkrishna Mar 28, 2026
d28924d
Changing delim for dim chunk info
jayeshkrishna Mar 28, 2026
a0fe13a
Using warnings instead of dbg output for hdf5
jayeshkrishna Mar 28, 2026
25a97a0
Enable testing workflow for all branches
jayeshkrishna Apr 8, 2026
5df3dd5
Fix narrowing conversions in test_darray_1d
jayeshkrishna Apr 8, 2026
68b0389
Fix return in void func in testing fwk
jayeshkrishna Apr 8, 2026
9cd2a8b
Enable workflow explicitly for copilot
jayeshkrishna Apr 8, 2026
ce7f453
Using C++ strings to avoid trunc of C strings
jayeshkrishna Apr 9, 2026
d6d302e
Process coord hdf5 vars before non-coord ones
jayeshkrishna Apr 15, 2026
7cbd163
Adding put/get with coord vars
jayeshkrishna Apr 15, 2026
8c60a56
Skip adios for rd/wr with diff decomps
jayeshkrishna Apr 22, 2026
cac99c1
Avoid appending in get/put tests
jayeshkrishna Apr 23, 2026
0210c79
Skip put of 4d vars for ADIOS
jayeshkrishna Apr 23, 2026
b4a2899
Skip put of 6D vars for ADIOS
jayeshkrishna Apr 23, 2026
7422e7f
Skip more ADIOS put tests:4d cvar, multiple writes
jayeshkrishna Apr 27, 2026
dddcebf
Avoid append in misc str tests
jayeshkrishna Apr 29, 2026
9d513f2
Skip modifying string at idx for ADIOS
jayeshkrishna Apr 29, 2026
791a3cd
Rm obsolete func to close soft closed files
jayeshkrishna Apr 30, 2026
3df6110
Fix warning in bget : missing const in char*
jayeshkrishna Apr 30, 2026
b5eebfc
Fix warning in bget : set bufsize to size_t
jayeshkrishna Apr 30, 2026
89779dc
Missing free for mtx when open/create fails
jayeshkrishna Apr 30, 2026
9984636
Global check on fail in create/open
jayeshkrishna May 1, 2026
85cb4f8
Avoid memset of file_desc since it has C++ ds
jayeshkrishna May 1, 2026
8612f47
Rm invalid file if unlim dim chk fails
jayeshkrishna May 1, 2026
b2850d3
Add fillval support for HDF5
jayeshkrishna May 1, 2026
1cc1ba2
Increasing default timeout for tests to 30m
jayeshkrishna May 1, 2026
d1f2c19
Refactor spio_change_def() util function
jayeshkrishna May 1, 2026
3d51844
Explicit check for define mode for non-PnetCDF
jayeshkrishna May 1, 2026
05c9c25
Handle hdf5 close without enddef
jayeshkrishna May 4, 2026
d19b425
Avoid wr mode when checking file in iosystem tests
jayeshkrishna May 5, 2026
b36f099
Adding support for copying HDF5 atts
jayeshkrishna May 5, 2026
cf75043
Increasing timelimit for hdf5 test
jayeshkrishna May 5, 2026
b4dca5c
Add an AUTHORS.md file
jayeshkrishna May 6, 2026
2bf2036
Adding a simple AGENTS.md
jayeshkrishna May 6, 2026
1e893c2
ifdef pnetcdf calls in async utils
jayeshkrishna May 6, 2026
637acf1
Disable pnetcdf tests if its not available
jayeshkrishna May 6, 2026
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
3 changes: 3 additions & 0 deletions .github/workflows/spio_pnetcdf_testing_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on: # yamllint disable-line rule:truthy
push:
branches:
- master
# Includes all branches starting with "copilot/"
# A "*" matches any char except "/", so use "**" to handle all branch names
- 'copilot/**'
pull_request:
branches:
- master
Expand Down
49 changes: 49 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# AGENTS.md

SCORPIO (Software for Caching Output and Reads for Parallel I/O) is a high-level Parallel I/O Library for structured grid applications.

## Project Overview

SCORPIO (Software for Caching Output and Reads for Parallel I/O) is a high-level Parallel I/O Library. The library is used by the E3SM (Energy Exascale Earth System Model) earth system model for all I/O.

- **Website:** https://github.com/E3SM-Project/scorpio
- **Documentation:** https://docs.e3sm.org/scorpio/
- **DOI:** https://www.osti.gov/doecode/biblio/36752

## Architecture

- The Fortran interface library source is in src/flib directory
- The C (main/core library) library source is in src/clib directory
- The tests are in tests/general and tests/cunit directories
- The examples are in the examples directory

## Build Commands

SCORPIO uses CMake for configuring the library. The library requires a C, C++ and Fortran compiler and an MPI library. SCORPIO uses low-level I/O libraries like PnetCDF (https://parallel-netcdf.github.io), NetCDF (https://www.unidata.ucar.edu/software/netcdf), HDF5 (https://www.hdfgroup.org/solutions/hdf5/) and ADIOS (https://adios2.readthedocs.io/en/latest/) for I/O.

To configure SCORPIO (source in /path/to/scorpio/source directory) using CMake with the PnetCDF library (installed at /path/to/pnetcdf) use the command below,

```
CC=mpicc CXX=mpicxx FC=mpif90 cmake -DPnetCDF_PATH=/path/to/pnetcdf /path/to/scorpio/source
```

After configuring the library to build it use make,

```
make
```

## Development Workflow
- All changes are made on a development branch off master
- The development branches are named using the pattern : ```<github username>/<feature description>```
- The changes in a branch are merged to the develop branch for nightly testing (Run using Jenkins and results published on CDASH at http://my.cdash.org/index.php?project=E3SM\_SCORPIO)
- Once the nightly testing is successful the PR is manually merged to the master branch
- Code formatting for C++ sources is mentioned in the library documentation (https://docs.e3sm.org/scorpio/html/contributing_code.html)

## Testing instructions
- Find the CI (Github Actions workflow) plan in the .github/workflows directory
- Add/update tests for the code that you change

## PR instructions
- Run the CI workflow (SCORPIO + PnetCDF - build and test) in the .github/workflows directory before committing any changes
- Do not automatically merge PRs to master or develop branch
14 changes: 14 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Authors
** Current Authors **

* Jayesh Krishna [email](jayesh@anl.gov)
* Danqing Wu [email](DanqingWu@hotmail.com)

** Past Contributors **

* Norbert Podhorszki
* Tahsin Kurc
* Dmitry Ganyushin
* Jim Edwards
* Ed Hartnett

65 changes: 64 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.7)
cmake_minimum_required (VERSION 3.7...4.0.1)
project (SCORPIO C CXX Fortran)
#cmake_policy(VERSION 3.5.2)

Expand Down Expand Up @@ -49,6 +49,7 @@ option (PIO_USE_MALLOC "Use native malloc (instead of bget package)" OFF)
option (PIO_USE_INDEP_MODE "Use PnetCDF independent data mode" ON)
option (PIO_MICRO_TIMING "Enable internal micro timers" OFF)
option (PIO_SAVE_DECOMPS "Dump the decomposition information" OFF)
option (PIO_USE_ASYNC_WR_THREAD "Use an asynchronous thread for writes (Requires C++11 support)" OFF)
option (PIO_LIMIT_CACHED_IO_REGIONS "Limit the number of non-contiguous regions in an IO process" OFF)
option (WITH_PNETCDF "Require the use of PnetCDF" ON)
option (WITH_NETCDF "Require the use of NetCDF" ON)
Expand Down Expand Up @@ -158,6 +159,12 @@ else()
message (STATUS "Disabling saving I/O decompositions (default)")
endif()

set(USE_ASYNC_WR_THREAD 0)
if(PIO_USE_ASYNC_WR_THREAD)
message(STATUS "Using asynchronous I/O thread for writes")
set(USE_ASYNC_WR_THREAD 1)
endif()

if(PIO_LIMIT_CACHED_IO_REGIONS)
set(LIMIT_CACHED_IO_REGIONS 1)
if(NOT DEFINED PIO_MAX_CACHED_IO_REGIONS)
Expand Down Expand Up @@ -211,6 +218,14 @@ else()
endif()
endif()

# Default - Do not disable MPI file syncing for HDF5 output files
set(SPIO_DISABLE_HDF5_MPI_FILE_SYNC 0)
if(FQDN_SITENAME MATCHES "^compute-386")
# On ANL compute nodes with NFS+ROMIO, disable MPI file syncing for HDF5 output
message(STATUS "Disabling HDF5 file syncing")
set(SPIO_DISABLE_HDF5_MPI_FILE_SYNC 1)
endif()

set(USE_INDEP_MODE 0)
if(PIO_USE_INDEP_MODE)
if(FQDN_SITENAME MATCHES "^chrlogin" OR FQDN_SITENAME MATCHES "^compute-240" OR FQDN_SITENAME MATCHES "^compute-386")
Expand Down Expand Up @@ -251,6 +266,28 @@ else()
message(STATUS "Setting chunk size (in bytes) for HDF5/PnetCDF chunked variables, requested bytes = " ${PIO_CHUNK_SIZE} " (default)")
endif()

# Expected format for SPIO_DIM_CHUNK_INFO = "DIM1_NAME:DIM1_CHUNK_SZ;DIM2_NAME:DIM2_CHUNK_SZ;"
# e.g. "time:1;lev:8;" ---> Each chunk has 1 time dimension (time) and 8 levels (lev)
if(DEFINED SPIO_DIM_CHUNK_INFO)
message(STATUS "Using user-specified dimension chunk info, " ${SPIO_DIM_CHUNK_INFO})
endif()

# Add more constraints on where chunking is enabled. Specify a regex that matches the variable and file name where chunking
# is enabled. Chunking will be disabled for all other variables
# The regex is same as the one used to save decompositions
# e.g. -DSPIO_ENABLE_CHUNKING_REGEX:STRING='(VAR=\".*U.*\")&&(FILE=\".*e3sm_fgi.*\")'
# Chunking is enabled only on variables with names that match ".*U.*" in files with names that match ".*e3sm_fgi.*"
if(DEFINED SPIO_ENABLE_CHUNKING_REGEX)
if(DEFINED SPIO_DIM_CHUNK_INFO)
message(STATUS "Using user-specified regex," ${SPIO_ENABLE_CHUNKING_REGEX} " to decide when to enable chunking of variables")
else()
message(STATUS "WARNING: SPIO_ENABLE_CHUNKING_REGEX was defined but SPIO_DIM_CHUNK_INFO was not defined, disabling SPIO_ENABLE_CHUNKING_REGEX")
set(SPIO_ENABLE_CHUNKING_REGEX "*")
endif()
else()
set(SPIO_ENABLE_CHUNKING_REGEX "*")
endif()

if(WITH_ADIOS2)
# Maximum number of I/O decompositions registered with ADIOS type
set(DEF_SPIO_MAX_ADIOS_DECOMPS 65536)
Expand Down Expand Up @@ -325,6 +362,32 @@ else()
endif()
endif()

# Asynchronous I/O options
# Maximum wait for asynchronous I/O operations (in milliseconds)
if(NOT DEFINED SPIO_ASYNC_OP_WAIT_TIMEOUT)
# 2 minutes = 2 * 60 * 1000 milliseconds
set(SPIO_ASYNC_OP_WAIT_TIMEOUT 120000)
if(PIO_USE_ASYNC_WR_THREAD)
message(STATUS "Setting timeout for asynchronous I/O operations to ${SPIO_ASYNC_OP_WAIT_TIMEOUT} ms (default)")
endif()
else()
if(PIO_USE_ASYNC_WR_THREAD)
message(STATUS "Setting timeout for asynchronous I/O operations to ${SPIO_ASYNC_OP_WAIT_TIMEOUT} ms")
endif()
endif()

# Maximum number of threads performing asynchronous I/O operations
if(NOT DEFINED SPIO_ASYNC_NTHREADS)
set(SPIO_ASYNC_NTHREADS 1)
if(PIO_USE_ASYNC_WR_THREAD)
message(STATUS "Setting number of asynchronous I/O threads to ${SPIO_ASYNC_NTHREADS} (default)")
endif()
else()
if(PIO_USE_ASYNC_WR_THREAD)
message(STATUS "Setting number of asynchronous I/O threads to ${SPIO_ASYNC_NTHREADS}")
endif()
endif()

if(DEFINED SPIO_OVERRIDE_HDF5_COMPRESSION_VNAME_REGEX)
if(WITH_HDF5 AND HDF5_USE_COMPRESSION)
message(STATUS "Overriding HDF5 compression for variables matching regex: ${SPIO_OVERRIDE_HDF5_COMPRESSION_VNAME_REGEX}")
Expand Down
8 changes: 7 additions & 1 deletion cmake/SPIOUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# Prereq: MPI (MPI serial) & GPTL libraries are searched for (find_library() )
# prior to invoking this macro to add SCORPIO applications
macro (add_spio_executable EXE_NAME IS_C_SRC EXE_LINKER_LANGUAGE)
add_executable(${EXE_NAME} ${ARGN})
cmake_parse_arguments (_SPIO_EXE "" "" "OBJ_LIBS" ${ARGN})
add_executable(${EXE_NAME} ${_SPIO_EXE_UNPARSED_ARGUMENTS})
if (${IS_C_SRC})
target_link_libraries(${EXE_NAME} PRIVATE pioc)
else ()
Expand Down Expand Up @@ -47,5 +48,10 @@ macro (add_spio_executable EXE_NAME IS_C_SRC EXE_LINKER_LANGUAGE)
if (NOT ("${EXE_LINKER_LANGUAGE}" STREQUAL ""))
set_property(TARGET ${EXE_NAME} PROPERTY LINKER_LANGUAGE ${EXE_LINKER_LANGUAGE})
endif ()
if (_SPIO_EXE_OBJ_LIBS)
foreach (_spio_obj_lib ${_SPIO_EXE_OBJ_LIBS})
target_link_libraries (${EXE_NAME} PRIVATE $<TARGET_OBJECTS:${_spio_obj_lib}>)
endforeach ()
endif ()
endmacro ()

19 changes: 11 additions & 8 deletions examples/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ endif ()
#==============================================================================
# DEFINE THE TARGETS AND TESTS
#==============================================================================
# Test timeout to 180s
set (DEFAULT_TEST_TIMEOUT 180)

add_spio_executable(examplePio TRUE "" examplePio.c)
add_spio_executable(example1 TRUE "" example1.c)
add_spio_executable(darray_no_async TRUE "" darray_no_async.c)
Expand Down Expand Up @@ -101,18 +104,18 @@ if (PIO_USE_MPISERIAL)
add_test(NAME example1 COMMAND example1)
add_test(NAME put_var COMMAND put_var)
else ()
add_mpi_test(examplePio EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/examplePio NUMPROCS 4 TIMEOUT 60)
add_mpi_test(example1 EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/example1 NUMPROCS 4 TIMEOUT 60)
add_mpi_test(put_var EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/put_var NUMPROCS 4 TIMEOUT 60)
#add_mpi_test(darray_async EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/darray_async NUMPROCS 5 TIMEOUT 60)
add_mpi_test(darray_no_async EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/darray_no_async NUMPROCS 4 TIMEOUT 60)
add_mpi_test(examplePio EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/examplePio NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
add_mpi_test(example1 EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/example1 NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
add_mpi_test(put_var EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/put_var NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
#add_mpi_test(darray_async EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/darray_async NUMPROCS 5 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
add_mpi_test(darray_no_async EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/darray_no_async NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
if (WITH_HDF5)
add_mpi_test(test_hdf5 EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_hdf5 NUMPROCS 4 TIMEOUT 60)
add_mpi_test(test_hdf5 EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_hdf5 NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
endif ()
if (WITH_ADIOS2)
add_mpi_test(test_adios EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_adios NUMPROCS 4 TIMEOUT 60)
add_mpi_test(test_adios EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_adios NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
endif ()
if (WITH_NETCDF)
add_mpi_test(test_netcdf4p EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_netcdf4p NUMPROCS 4 TIMEOUT 60)
add_mpi_test(test_netcdf4p EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_netcdf4p NUMPROCS 4 TIMEOUT ${DEFAULT_TEST_TIMEOUT})
endif ()
endif ()
6 changes: 5 additions & 1 deletion examples/cxx/e3sm_fgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,13 @@ static int get_user_options(

int main(int argc, char *argv[])
{
int ret = 0, rank = 0;
int ret = 0, rank = 0, tmode;

#if PIO_USE_ASYNC_WR_THREAD
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &tmode);
#else
MPI_Init(&argc, &argv);
#endif

Util::GVars::logger = Util::Logging::Logger::get_logger(MPI_COMM_WORLD, "STDOUT");
Util::GVars::logger->set_log_level(Util::Logging::LogLevel::STATUS);
Expand Down
Loading
Loading