Changeset 2529 for XIOS3/trunk/make_xios


Ignore:
Timestamp:
07/18/23 15:12:50 (12 months ago)
Author:
jderouillat
Message:

Enable parallel compression regarding NetCDF & HDF5 configurations at compile time. Implement an API to use HDF5 lossy compression plugins (SZ is available for now).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/make_xios

    r2213 r2529  
    212212fi  
    213213 
     214 
     215# Detecting if parallel compression is available : 
     216#   - NetCDF is HDF5 based and >= 4.7.4  ? 
     217#   - HDF5   is parallel   and >= 1.10.3 ? 
     218USE_HDF5=0 
     219if [[ ! -z $NETCDF_INCDIR ]] 
     220then 
     221    NETCDF_LOOKUP=`echo ${NETCDF_INCDIR} | sed 's/\-I/\ /g'` 
     222    netcdf_meta_file=`find $NETCDF_LOOKUP -name netcdf_meta.h 2> /dev/null` 
     223else 
     224    for dir in `echo $CPATH | sed 's/\:/\ /g'` ; do 
     225        if [ -f "$dir/netcdf_meta.h" ] 
     226        then 
     227            netcdf_meta_file=$dir/netcdf_meta.h 
     228            break 
     229        fi 
     230    done 
     231fi 
     232if [[ ! -z $netcdf_meta_file ]] 
     233then 
     234    NC_MAJOR=`grep "NC_VERSION_MAJOR" $netcdf_meta_file | awk '{ print $3 }'` 
     235    NC_MINOR=`grep "NC_VERSION_MINOR" $netcdf_meta_file | awk '{ print $3 }'` 
     236    NC_PATCH=`grep "NC_VERSION_PATCH" $netcdf_meta_file | awk '{ print $3 }'` 
     237    if ( [[ "$NC_MAJOR" -ge 5 || ( "$NC_MAJOR" -eq 4 &&  "$NC_MINOR" -ge 8 )|| ( "$NC_MAJOR" -eq 4 && "$NC_MINOR" -eq 7 && "$NC_PATCH" -ge 4 ) ]] ) 
     238    then 
     239        USE_HDF5=`grep NC_HAS_HDF5 $netcdf_meta_file | awk '{ print $3 }'` 
     240    fi 
     241fi 
     242 
     243if [ "$USE_HDF5" == "1" ] 
     244then 
     245    # https://forum.hdfgroup.org/t/parallel-compression-support-detection/5398     
     246    if [[ ! -z $HDF5_LIBDIR ]] 
     247    then 
     248        HDF5_LOOKUP=`echo ${HDF5_LIBDIR} | sed 's/\-L/\ /g'` 
     249        hdf5_settings_file=`find $HDF5_LOOKUP -name libhdf5.settings 2> /dev/null` 
     250    else 
     251        for dir in `echo $LD_LIBRARY_PATH | sed 's/\:/\ /g'` ; do 
     252            if [ -f "$dir/libhdf5.settings" ] 
     253            then 
     254                hdf5_settings_file=$dir/libhdf5.settings 
     255                break 
     256            fi 
     257        done 
     258    fi 
     259    HDF5_VERSION=`grep "HDF5 Version" $hdf5_settings_file | awk -F  ':' '{ print $2 }'` 
     260    HDF5_MAJOR_VERSION=`echo $HDF5_VERSION | awk -F  '.' '{ print $2 }'` 
     261    HDF5_MINOR_VERSION=`echo $HDF5_VERSION | awk -F  '.' '{ print $3 }'` 
     262    HDF5_PARALLEL=`grep "Parallel HDF5" $hdf5_settings_file | awk -F  ':' '{ print $2 }'` 
     263    HDF5_DEFLATE=`grep "I/O filters (external)" $hdf5_settings_file | awk -F  ':' '{ print $2 }'` 
     264    if ( [[ "$HDF5_MAJOR_VERSION" -ge 11 || ( "$HDF5_MAJOR_VERSION" -eq 10 &&  "$HDF5_MINOR_VERSION" -ge 3 ) ]] ) 
     265    then 
     266        if [[ "$HDF5_PARALLEL" =~ "yes" && "$HDF5_DEFLATE" =~ "zlib" ]] 
     267        then  
     268            XIOS_CPPKEY="$XIOS_CPPKEY PARALLEL_COMPRESSION" 
     269        fi 
     270    fi           
     271fi 
     272if [[ "$XIOS_CPPKEY" =~ "PARALLEL_COMPRESSION" ]] 
     273then 
     274    echo "->Parallel compression is available" 
     275else 
     276    echo "->Parallel compression is NOT available"     
     277fi 
     278# End "Detecting if parallel compression is available" 
     279 
     280 
    214281# Setting path for boost 
    215282if [[ "$use_extern_boost" == "true" ]] 
Note: See TracChangeset for help on using the changeset viewer.