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

Add a test for collective netcdf mpi io #1647

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

uramirez8707
Copy link
Contributor

Description
Add a test for collective netcdf mpi io

The test creates a 1 undistributed file io_layout of 1,1 using domain decomposed fms2_io then reads the file using collective netcdf (currently collective netcdf only works if the layout and the io_layout are the same when writing)

Fixes # (issue)

How Has This Been Tested?
CI

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

bensonr
bensonr previously approved these changes Feb 19, 2025
. ../test-lib.sh

if [ ! -z $parallel_skip ]; then
SKIP_TESTS="test_collective_io.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rem1776 thanks for helping me figure this out!

Copy link
Contributor

@rem1776 rem1776 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, i think that m4/check_parallel4.c file can probably be removed though. It should be autogenerated during configure so might have been added accidently.

@uramirez8707
Copy link
Contributor Author

Looks good, i think that m4/check_parallel4.c file can probably be removed though. It should be autogenerated during configure so might have been added accidently.

That is not auto generated. It is used for cmake builds.

FMS/CMakeLists.txt

Lines 292 to 294 in 6fea71e

try_compile(NF_HAS_PARALLEL4 ${CMAKE_CURRENT_BINARY_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/m4/check_parallel4.c"
)

I wasn't sure about the best way to do this, so let me know if you have a better idea

@rem1776
Copy link
Contributor

rem1776 commented Feb 27, 2025

The cmake netcdf module should have a check for that already, I think we just weren't using it before:

# This module defines
#
# - NetCDF_FOUND - System has NetCDF
# - NetCDF_INCLUDE_DIRS - the NetCDF include directories
# - NetCDF_VERSION - the version of NetCDF
# - NetCDF_CONFIG_EXECUTABLE - the netcdf-config executable if found
# - NetCDF_PARALLEL - Boolean True if NetCDF4 has parallel IO support via hdf5 and/or pnetcdf

We should be able to use that in the conditional instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants