Changeset 744 for codes/icosagcm/devel
- Timestamp:
- 10/03/18 17:58:55 (6 years ago)
- Location:
- codes/icosagcm/devel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/src/setup.py
r694 r744 2 2 from distutils.extension import Extension 3 3 from Cython.Build import cythonize 4 5 from ctypes import cdll, c_bool 6 libicosa = cdll.LoadLibrary('libicosa.so') 7 mixed_prec=c_bool.in_dll(libicosa, 'mixed_precision').value 8 9 if mixed_prec: 10 extra_flags=["-DCPP_MIXED_PREC"] 11 else: 12 extra_flags=None 13 4 14 setup( name = "DYNAMICO kernels for unstructured mesh", 5 15 ext_modules = cythonize([ 6 16 Extension("cxios",["cxios.pyx"],libraries=["xios"]), 7 Extension("unstructured",["unstructured.pyx"],libraries=["icosa","xios"] )8 ] )17 Extension("unstructured",["unstructured.pyx"],libraries=["icosa","xios"], extra_compile_args=extra_flags) 18 ], compile_time_env={'CPP_MIXED_PREC': mixed_prec} ) 9 19 ) -
codes/icosagcm/devel/make_icosa
r743 r744 44 44 -physics lmdz_generic : use LMDZ generic physics (planets) 45 45 -external_physics : allows external physics 46 -mixed_prec : compiles unstructured dynamics in single precision (float32) 46 47 fin 47 48 exit;; … … 86 87 external_physics="TRUE" ; shift ;; 87 88 89 "-mixed_prec") 90 mixed_prec="TRUE" ; shift ;; 88 91 *) 89 92 code="$1" ; shift ;; … … 183 186 fi 184 187 188 if [[ "$mixed_prec" == "TRUE" ]] 189 then 190 CPP_KEY="$CPP_KEY CPP_MIXED_PREC" 191 fi 192 185 193 if [[ "$no_io_defined" == "FALSE" ]] 186 194 then -
codes/icosagcm/devel/src/unstructured/data_unstructured.F90
r700 r744 13 13 caldyn_vert_variant=caldyn_vert_cons, nb_threads=0, nb_stage=0 14 14 LOGICAL(C_BOOL), BIND(C) :: hydrostatic=.TRUE., debug_hevi_solver=.TRUE. 15 16 #ifdef CPP_MIXED_PREC 17 LOGICAL(C_BOOL), BIND(C) :: mixed_precision=.TRUE. 18 #else 19 LOGICAL(C_BOOL), BIND(C) :: mixed_precision=.FALSE. 20 #endif 15 21 16 22 INDEX, BIND(C) :: llm, nqdyn, edge_num, primal_num, dual_num, & -
codes/icosagcm/devel/src/unstructured/unstructured.h90
r688 r744 1 #undef PREC_DOUBLE2 3 1 #define DBL REAL(C_DOUBLE) 4 2 #define FLT REAL(C_FLOAT) 5 3 #define TIME DBL 6 4 7 #ifdef PREC_DOUBLE 5 #ifdef CPP_MIXED_PREC 6 #define NUM FLT 7 #define MPI_NUM MPI_REAL4 8 #else 8 9 #define NUM DBL 9 10 #define MPI_NUM MPI_REAL8 10 #else11 #define NUM FLT12 #define MPI_NUM MPI_REAL413 11 #endif 14 12
Note: See TracChangeset
for help on using the changeset viewer.