CGNS

Compilation

[@vision CGNS]$ git remote -v
origin    https://github.com/CGNS/CGNS.git (fetch)
origin    https://github.com/CGNS/CGNS.git (push)
[@vision CGNS]$ mkdir build
[@vision CGNS]$ cd  build
[@vision CGNS]$ module add compilers/intel/compilers_2020u2 mpi/hpempi-1.6/mpt/2.22 lib/hdf5/1.10/hpmpt_gcc48 
[@vision CGNS]$ cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DCGNS_ENABLE_FORTRAN:BOOL=ON -DCGNS_ENABLE_HDF5:BOOL=ON -DCGNS_ENABLE_PARALLEL:BOOL=ON -DCMAKE_INSTALL_PREFIX=/softs/lib/CGNS/hpmpt_gcc48_ifort/ -DCMAKE_Fortran_FLAGS:STRING=-fPIC ..

Module

[@vision CGNS]$ module help lib/cgns/4.20/hpmpt_gcc48
-------------------------------------------------------------------
Module Specific Help for /zfs/softs/modulefiles/lib/cgns/4.20/hpmpt_gcc48:

        modules - loads the CGNS library environment

        This adds /softs/lib/CGNS/hpmpt_gcc48_ifort//* to several of the

        environment variables.

        Compiled w HPE MPI (gcc48);

        and CGNS_ENABLE_PARALLEL=ON (with HPE MPT)

        and CGNS_ENABLE_FORTRAN=ON (ifort)

        and CGNS_ENABLE_HDF5=ON

         Version : 4.20

         usage : module load compilers/intel/compilers_2020u2 mpi/hpempi-1.6/mpt/2.22
                lib/hdf5/1.10/hpmpt_gcc48
-------------------------------------------------------------------
[@vision CGNS]$ module show lib/cgns/4.20/hpmpt_gcc48
-------------------------------------------------------------------
/zfs/softs/modulefiles/lib/cgns/4.20/hpmpt_gcc48:

module-whatis   {loads HDF5 environment}
prereq          compilers/intel/compilers_2020u2
prereq          mpi/hpempi-1.6/mpt/2.22
setenv          CGNS_ROOT /softs/lib/CGNS/hpmpt_gcc48_ifort/
setenv          CGNS_DIR /softs/lib/CGNS/hpmpt_gcc48_ifort/
prepend-path    INCLUDE /softs/lib/CGNS/hpmpt_gcc48_ifort//include
prepend-path    LD_LIBRARY_PATH /softs/lib/CGNS/hpmpt_gcc48_ifort//lib
prepend-path    CPATH /softs/lib/CGNS/hpmpt_gcc48_ifort//include
prepend-path    PATH /softs/lib/CGNS/hpmpt_gcc48_ifort//bin

Usage

[@vision CGNS]$  module load compilers/intel/compilers_2020u2 mpi/hpempi-1.6/mpt/2.22
                lib/hdf5/1.10/hpmpt_gcc48 lib/cgns/4.20/hpmpt_gcc48
[@vision scratch]$ cgnslist
usage  : cgnslist [options] CGNSfile [node]
options:
   -b      = brief - file summary only
   -i<cnt> = set indent level (default 2)
   -f      = follow links
   -l      = print node label
   -t      = print node data type
   -d      = print node dimensions
   -s      = print node size in bytes
   -a      = print all -ltds

Test

  • Compilation
    [@vision scratch]$ module load compilers/intel/compilers_2020u2 mpi/hpempi-1.6/mpt/2.22
    [@vision scratch]$ module add  lib/hdf5/1.10/hpmpt_gcc48 lib/cgns/4.20/hpmpt_gcc48
    [@vision scratch]$ mpicc -o cgns_test -L/softs/lib/CGNS/hpmpt_gcc48_ifort/lib -lcgns cgns_test.c
    
  • Run
    [@vision scratch]$ mpirun -n 2 ./cgns_test
    writing 125 coordinates and 64 hex elements to cexample.cgns
    
  • View
[@vision scratch]$ cgnslist -a cexample.cgns
HDF5 MotherNode  -- Root Node of HDF5 File MT () 0
  +-CGNSLibraryVersion  -- CGNSLibraryVersion_t R4 (1) 4
  +-Base  -- CGNSBase_t I4 (2) 8
    +-Zone  -- Zone_t I8 (1,3) 24
      +-ZoneType  -- ZoneType_t C1 (12) 12
      +-GridCoordinates  -- GridCoordinates_t MT () 0
      | +-CoordinateX  -- DataArray_t R4 (125) 500
      | +-CoordinateY  -- DataArray_t R4 (125) 500
      | +-CoordinateZ  -- DataArray_t R4 (125) 500
      +-Hex  -- Elements_t I4 (2) 8
      | +-ElementRange  -- IndexRange_t I8 (2) 16
      | +-ElementConnectivity  -- DataArray_t I8 (512) 4096
      +-Solution  -- FlowSolution_t MT () 0
      | +-GridLocation  -- GridLocation_t C1 (10) 10
      | +-CellIndex  -- DataArray_t R4 (64) 256
      +-User Data  -- UserDefinedData_t MT () 0
        +-CellIndex  -- DataArray_t R4 (64) 256

References