Changeset 1450 for XIOS/dev


Ignore:
Timestamp:
03/08/18 17:30:28 (6 years ago)
Author:
oabramkina
Message:

Adding back light memory tracking to trunk and adding it to dev_cmip6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/make_xios

    r1449 r1450  
    1010netcdf_lib="netcdf4_par" 
    1111compil_mode="prod" 
    12  
     12arch_path="arch" 
     13arch_default_path="arch" 
     14arch_defined="FALSE" 
     15arch_path_defined="FALSE" 
    1316 
    1417# Traitement de la ligne de commande 
     
    2629            echo "       [--avail] : to know available target architectures " 
    2730            echo "       [--full] : to generate dependencies and recompile from scratch" 
    28             echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler" 
     31            echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler"i 
    2932        echo "       [--use_extern_boost : to use external boost library" 
    3033            echo "       [--doc] : to generate Doxygen documentation (not available yet)" 
     
    3841         "--dev")   compil_mode="dev"   ; shift ;; 
    3942         "--debug") compil_mode="debug" ; shift ;; 
    40          "--arch")  arch=$2     ; shift ; shift ;; 
     43         "--arch")  arch=$2     ; arch_defined="TRUE"; shift ; shift ;; 
     44         "--arch_path")  arch_path=$2     ; arch_path_defined="TRUE"; shift ; shift ;; 
    4145         "--avail") ls arch/*.fcm | cut -d"-" -f2 | cut -d"." -f1 ; exit ;;  
    4246         "--full")  compil_full="true"  ; shift ;; 
     
    4650         "--job")   job=$2              ; shift ; shift ;; 
    4751         "--netcdf_lib")   netcdf_lib=$2 ; shift ; shift ;; 
    48          "--memtrack")   use_memtrack="true" ; shift ;; 
     52         "--memtrack")  use_memtrack="true" memtrack=$2  ; shift ; shift ;; 
    4953         *)         code="$1"           ; shift ;; 
    5054      esac 
     
    7478mkdir .void_dir 
    7579 
    76 if [[ !(-z $arch) ]] 
    77    then 
    78       rm -f  $install_dir/arch.path 
    79       rm -f  $install_dir/arch.fcm 
    80       rm -f  $install_dir/arch.env 
    81       ln -s  $install_dir/arch/arch-${arch}.path $install_dir/arch.path 
    82       ln -s  $install_dir/arch/arch-${arch}.fcm  $install_dir/arch.fcm 
    83  
    84       if test -f $install_dir/arch/arch-${arch}.env 
    85       then 
    86         ln -s $install_dir/arch/arch-${arch}.env arch.env 
    87       else 
    88         ln -s $install_dir/.void_file arch.env 
    89       fi 
    90  
    91       source $install_dir/arch.env 
    92       source $install_dir/arch.path 
     80if [[ "$arch_defined" == "TRUE" ]] 
     81then 
     82  rm -f arch.path 
     83  rm -f arch.fcm 
     84  rm -f arch.env 
     85 
     86  if test -f $arch_path/arch-${arch}.path 
     87  then 
     88    ln -s $arch_path/arch-${arch}.path arch.path 
     89  elif test -f $arch_default_path/arch-${arch}.path 
     90  then 
     91    ln -s $arch_default_path/arch-${arch}.path arch.path 
     92  fi 
     93         
     94  if test -f $arch_path/arch-${arch}.fcm 
     95  then 
     96    ln -s $arch_path/arch-${arch}.fcm arch.fcm 
     97  elif test -f $arch_default_path/arch-${arch}.fcm 
     98  then 
     99    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm 
     100  fi 
     101 
     102  if test -f $arch_path/arch-${arch}.env 
     103  then 
     104    ln -s $arch_path/arch-${arch}.env arch.env 
     105  elif test -f $arch_default_path/arch-${arch}.env 
     106  then 
     107    ln -s $arch_default_path/arch-${arch}.env arch.env 
    93108  else 
     109    ln -s .void_file arch.env 
     110  fi 
     111  source arch.env 
     112  source arch.path 
     113else 
    94114      echo "Please choose a target achitecture --> list all available architecture using make_xios --avail!" 
    95115      exit 1 
     
    151171    XIOS_FINCDIR="$OASIS_INCDIR $XIOS_FINCDIR" 
    152172    XIOS_LIB="$OASIS_LIBDIR $OASIS_LIB $XIOS_LIB" 
    153 fi 
     173fi  
    154174 
    155175# Setting path for boost 
     
    158178   ln -s $PWD/.void_dir $PWD/extern/boost 
    159179else 
    160    ln -s $PWD/extern/boost $PWD/extern/boost 
    161180   export BOOST_INCDIR="-I${PWD}/extern/boost" 
    162181   export BOOST_LIBDIR="" 
     
    164183fi 
    165184 
    166  
    167185if [[ "$use_memtrack" == "true" ]] 
    168186   then 
    169    XIOS_LIB="$ADDR2LINE_LIBDIR $ADDR2LINE_LIB $XIOS_LIB" 
    170187   XIOS_CPPKEY="$XIOS_CPPKEY XIOS_MEMTRACK" 
     188 
     189    if [[ "$memtrack" == "light" ]] 
     190    then 
     191        XIOS_CPPKEY="$XIOS_CPPKEY XIOS_MEMTRACK_LIGHT" 
     192    elif [[ "$memtrack" == "FULL"  ]] 
     193    then 
     194      XIOS_LIB="$ADDR2LINE_LIBDIR $ADDR2LINE_LIB $XIOS_LIB" 
     195      XIOS_CPPKEY="$XIOS_CPPKEY XIOS_MEMTRACK_FULL" 
     196    else 
     197        echo "Bad choice for --memtrack argument : choose between 'light','full'" 
     198        exit 
     199    fi 
    171200fi  
    172201 
    173 XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR $BOOST_INCDIR" 
    174 XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR $BOOST_INCDIR" 
     202XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR" 
     203XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR" 
    175204 
    176205XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB" 
Note: See TracChangeset for help on using the changeset viewer.