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

update minimum cmake version, based on the oldest I can access #1920

Merged
merged 7 commits into from
Apr 2, 2022
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 .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
cd build
cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so \
-DNetCDF_C_INCLUDE_DIR=/usr/include -DPnetCDF_PATH='/home/runner/pnetcdf' \
-DPIO_ENABLE_FORTRAN=Off -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On \
-DPIO_ENABLE_FORTRAN=Off \
-DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off -DMPIEXEC_PREFLAGS="--oversubscribe" ..
make VERBOSE=1
make tests VERBOSE=1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_ncint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
cmake -Wno-dev -DPIO_ENABLE_NETCDF_INTEGRATION=OFF \
-DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so \
-DNetCDF_C_INCLUDE_DIR=/usr/include -DPnetCDF_PATH='/home/runner/pnetcdf' \
-DPIO_HDF5_LOGGING=On -DPIO_ENABLE_FORTRAN=OFF -DPIO_USE_MALLOC=On \
-DPIO_ENABLE_FORTRAN=OFF \
-DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off -DMPIEXEC_PREFLAGS="--oversubscribe" ..
make VERBOSE=1
make tests VERBOSE=1
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

# Jim Edwards

cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 3.9.1)
project (PIO C)
#cmake_policy(VERSION 3.5.2)

# The project version number.
set(VERSION_MAJOR 2 CACHE STRING "Project major version number.")
Expand Down Expand Up @@ -107,9 +106,6 @@ else()
set(USE_VARD 0)
endif()

# Set a variable that appears in the config.h.in file.
set(USE_MALLOC 1)

# Set a variable that appears in the config.h.in file.
if(PIO_ENABLE_LOGGING)
set(ENABLE_LOGGING 1)
Expand Down Expand Up @@ -281,7 +277,11 @@ add_subdirectory (src)

# Custom "piotests" target (builds the test executables)
add_custom_target (tests)
add_dependencies (tests pioc piof)
if (PIO_ENABLE_FORTRAN)
add_dependencies (tests pioc piof)
else()
add_dependencies (tests pioc)
endif()

# Custom "check" target that depends upon "tests"
add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND})
Expand Down
4 changes: 0 additions & 4 deletions cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
/** The patch part of the version number. */
#define PIO_VERSION_PATCH @VERSION_PATCH@

/** Set to non-zero to use native malloc. By defauly the PIO library
* will use the included bget() package for memory management. */
#define PIO_USE_MALLOC @USE_MALLOC@

/** Set to non-zero to turn on logging. Output may be large. */
#define PIO_ENABLE_LOGGING @ENABLE_LOGGING@

Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ if test -n "$fc_version_info"; then
FC_VERSION="$FC_VERSION ( $fc_version_info)"
fi

# Always use malloc in autotools builds.
AC_DEFINE([PIO_USE_MALLOC], [1], [use malloc for memory])

AC_MSG_CHECKING([whether a PIO_BUFFER_SIZE was specified])
AC_ARG_WITH([piobuffersize],
[AS_HELP_STRING([--with-piobuffersize=<integer>],
Expand Down
4 changes: 0 additions & 4 deletions ctest/CTestEnvironment-anlworkstation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ if (DEFINED ENV{VALGRIND_CHECK})
set (CTEST_CONFIGURE_OPTIONS "${CTEST_CONFIGURE_OPTIONS} -DPIO_VALGRIND_CHECK=ON")
endif ()

# If USE_MALLOC environment variable is set, then use native malloc (instead of bget package)
if (DEFINED ENV{USE_MALLOC})
set (CTEST_CONFIGURE_OPTIONS "${CTEST_CONFIGURE_OPTIONS} -DPIO_USE_MALLOC=ON")
endif ()
5 changes: 3 additions & 2 deletions src/clib/pio_rearrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,8 +2174,9 @@ subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compmap,
}
// PLOG((2,"At line %d rdispls[%d]=%d rcount=%d",__LINE__,1,rdispls[0], iodesc->rcount[0]));
/* Determine whether fill values will be needed. */
if ((ret = determine_fill(ios, iodesc, gdimlen, compmap)))
return pio_err(ios, NULL, ret, __FILE__, __LINE__);
if(! iodesc->readonly)
if ((ret = determine_fill(ios, iodesc, gdimlen, compmap)))
return pio_err(ios, NULL, ret, __FILE__, __LINE__);

/* Pass the sindex from each compute task to its associated IO task. */
if ((mpierr = MPI_Gatherv(iodesc->sindex, iodesc->scount[0], PIO_OFFSET,
Expand Down
8 changes: 4 additions & 4 deletions src/clib/pioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,6 @@ PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, int ma
/* Remember the maplen. */
iodesc->maplen = maplen;

/* check if the decomp is valid for write or is read-only */
/* this check is expensive and memory intensive on compute task 0 */
// iodesc->readonly = check_compmap(ios, iodesc, compmap);

/* Remember the map. */
if (!(iodesc->map = malloc(sizeof(PIO_Offset) * maplen)))
return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__);
Expand Down Expand Up @@ -661,6 +657,10 @@ PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, int ma
/* Is this the subset rearranger? */
if (iodesc->rearranger == PIO_REARR_SUBSET)
{
/* check if the decomp is valid for write or is read-only */
/* this check is expensive and may be memory intensive on compute task 0 */
iodesc->readonly = check_compmap(ios, iodesc, compmap);

iodesc->num_aiotasks = ios->num_iotasks;
PLOG((2, "creating subset rearranger iodesc->num_aiotasks = %d",
iodesc->num_aiotasks));
Expand Down
16 changes: 8 additions & 8 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ bool check_compmap(iosystem_desc_t *ios, io_desc_t *iodesc,const PIO_Offset *com
if(ios->compproc)
{
int *gmaplen;
if(ios->compmaster)
if(ios->compmaster == MPI_ROOT)
gmaplen = malloc(ios->num_comptasks * sizeof(int));
else
gmaplen = NULL;
Expand All @@ -3292,9 +3292,9 @@ bool check_compmap(iosystem_desc_t *ios, io_desc_t *iodesc,const PIO_Offset *com
return check_mpi(ios, NULL, ierr, __FILE__,__LINE__);

int *displs;
int gcompmaplen;
int gcompmaplen=0;
int *gcompmaps;
if(ios->compmaster)
if(ios->compmaster == MPI_ROOT)
{
displs = malloc(ios->num_comptasks * sizeof(int));
displs[0] = 0;
Expand All @@ -3304,16 +3304,16 @@ bool check_compmap(iosystem_desc_t *ios, io_desc_t *iodesc,const PIO_Offset *com
}
gcompmaplen = displs[ios->num_comptasks-1] + gmaplen[ios->num_comptasks-1];
gcompmaps = malloc(gcompmaplen * sizeof(PIO_Offset));
printf("gcompmaplen %d\n",gcompmaplen);
for(int i=0;i<ios->num_comptasks; i++)
printf("gmaplen=%d displs[%d]=%d\n",gmaplen[i], i,displs[i]);
// printf("gcompmaplen %d\n",gcompmaplen);
// for(int i=0;i<ios->num_comptasks; i++)
// printf("gmaplen=%d displs[%d]=%d\n",gmaplen[i], i,displs[i]);
}

/* next gather the compmap arrays */
if ((ierr = MPI_Gatherv(compmap, iodesc->maplen, MPI_OFFSET, gcompmaps, gmaplen, displs, MPI_OFFSET, 0, ios->comp_comm)))
return check_mpi(ios, NULL, ierr, __FILE__,__LINE__);

if(ios->compmaster)
if(ios->compmaster == MPI_ROOT)
{
/* sort */
qsort(gcompmaps, gcompmaplen, sizeof(MPI_OFFSET), offsetsort);
Expand All @@ -3332,6 +3332,6 @@ bool check_compmap(iosystem_desc_t *ios, io_desc_t *iodesc,const PIO_Offset *com
}

}
MPI_Bcast(&readonly, 1, MPI_CHAR, ios->compmaster, ios->intercomm);
MPI_Bcast(&readonly, 1, MPI_CHAR, ios->comproot, ios->my_comm);
return readonly;
}