Tabla de Contenidos

INSTALACIÓN DE FLASH

EN COMPUTADORA PERSONAL

1. Registrarse en la Universidad de Chicago: FLASH

2. Luego, se enviará por mail la aceptación y se podrá bajar el código: FLASH

3. Descomprimir el tar.gz bajado en el lugar donde se va a querer trabajar.

4. Instalar fortran, c, mpif90. Para éste último, instalar mpich.

5. Flash necesita la librería hdf5 1.8.12. Instalación como root: bajar, descomprimir, y hacer


EN LOS CLUSTERS

1. Ya está instalado. Sólo levantar los módulos que se detallan en la sección “Uso de Flash”


USO DE FLASH

Manual de usuario: manual de FLASH

1. El Makefile.h que usa para compilar el programa está en: /lugardeinstalacion/FLASHX.X/sites/Prototypes/Linux Allí hay varios ejemplos de makefiles. Para nuestro ejemplo utilizaremos un makefile que llamaremos Makefile.h.escogido. Iremos a la carpeta “site”.


Ejecutar el siguiente comando.


Eso creará una carpeta que se llama como el nombre de la maquina en /sites. Copiar en esa carpeta el Makefile.h elegido. Renombrar este archivo a Makefile.h.


2. Módulos a cargar en las diferentes máquinas:


clemente


  • Nombre del archivo: Makefile.h
  • Servidor: clemente

Makefile.h
  1. #FLASH makefile definitions for x86-64 Linux (GNU compilers)
  2. #----------------------------------------------------------------------------
  3. # Set the HDF5/MPI library paths -- these need to be updated for your system
  4. #----------------------------------------------------------------------------
  5. # sites/clemente/Makefile.h
  6.  
  7.  
  8. MPI_PATH = /opt/spack/0.16.2/opt/spack/linux-centos7-broadwell/gcc-10.2.0/openmpi-4.0.5-jdedu5ob5yuqtaujmqw7l3fyzfaatzqm/
  9. HDF4_PATH =
  10. HDF5_PATH = /opt/spack/0.16.2/opt/spack/linux-centos7-broadwell/gcc-10.2.0/hdf5-1.10.7-6v6h3jwmez6mhhfg5vrhp2odezq7kdat/
  11. HYPRE_PATH = /opt/spack/0.16.2/opt/spack/linux-centos7-broadwell/gcc-10.2.0/hypre-2.20.0-izz4brayoocfvlz2u3z76avmrlvls2gi/
  12. ZLIB_PATH = /opt/spack/0.16.2/opt/spack/linux-centos7-broadwell/gcc-10.2.0/zlib-1.2.11-nk6k5unszfepso6b4zvivtimoeped7if/
  13.  
  14.  
  15.  
  16. PAPI_PATH =
  17. PAPI_FLAGS =
  18.  
  19. NCMPI_PATH = /usr/local/netcdf
  20. MPE_PATH =
  21.  
  22. #----------------------------------------------------------------------------
  23. # Compiler and linker commands
  24. #
  25. # Use the MPICH wrappers around the compilers -- these will automatically
  26. # load the proper libraries and include files. Version of MPICH prior
  27. # to 1.2.2 (?) do not recognize .F90 as a valid Fortran file extension.
  28. # You need to edit mpif90 and add .F90 to the test of filename extensions,
  29. # or upgrade your MPICH.
  30. #----------------------------------------------------------------------------
  31.  
  32. FCOMP = ${MPI_PATH}/bin/mpif90
  33. CCOMP = ${MPI_PATH}/bin/mpicc
  34. CPPCOMP = ${MPI_PATH}/bin/mpic++
  35. LINK = ${MPI_PATH}/bin/mpif90
  36.  
  37. # pre-processor flag
  38. PP = -D
  39.  
  40. #----------------------------------------------------------------------------
  41. # Compilation flags
  42. #
  43. # Three sets of compilation/linking flags are defined: one for optimized
  44. # code, one for testing, and one for debugging. The default is to use the
  45. # _OPT version. Specifying -debug to setup will pick the _DEBUG version,
  46. # these should enable bounds checking. Specifying _TEST is used for
  47. # flash_test, and is set for quick code generation, and (sometimes)
  48. # profiling. The Makefile generated by setup will assign the generic token
  49. # (ex. FFLAGS) to the proper set of flags (ex. FFLAGS_OPT).
  50. #----------------------------------------------------------------------------
  51.  
  52. OPENMP =
  53. #-fopenmp
  54.  
  55.  
  56. # *************************cambio ********************************
  57. # PATRON
  58. #FFLAGS_OPT = -c -O2 -fdefault-real-8 -fdefault-double-8 \
  59. #-Wuninitialized
  60.  
  61. # OPTIMIZADO
  62. FFLAGS_OPT = -c -O3 -march=broadwell -fdefault-real-8 -fdefault-double-8 \
  63. -Wuninitialized
  64.  
  65. #I explictly add -O0 because I found that compiling source files without
  66. #an optimization flag generates the same object code as compiling source
  67. #files with -O2. The -O0 is required so that gdb no longer shows
  68. #"<value optimized out>" for certain function arguments.
  69.  
  70. FFLAGS_DEBUG = -ggdb -c -O0 -fdefault-real-8 -fdefault-double-8 \
  71. -pedantic -Wall -Waliasing \
  72. -Wsurprising -Wconversion -Wunderflow \
  73. -ffpe-trap=invalid,zero,overflow -fbounds-check \
  74. -fimplicit-none -fstack-protector-all
  75.  
  76. FFLAGS_TEST = -ggdb -c -O0 -fdefault-real-8 -fdefault-double-8
  77.  
  78. FFLAGS_HYPRE = -I${HYPRE_PATH}/include
  79.  
  80.  
  81. F90FLAGS = -w -fallow-argument-mismatch
  82.  
  83.  
  84. #The macro _FORTIFY_SOURCE adds some lightweight checks for buffer
  85. #overflows at both compile time and run time (only active at -O1 or higher)
  86. #http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
  87.  
  88.  
  89. # *****************************cambios***********************************
  90. # FLAGS PATRON
  91. #CFLAGS_OPT = -ggdb -c -O2 -Wuninitialized -D_FORTIFY_SOURCE=2
  92.  
  93. # FLAGS OPTIMIZADO
  94. CFLAGS_OPT = -c -O3 -march=broadwell -Wuninitialized -D_FORTIFY_SOURCE=2
  95.  
  96. CFLAGS_DEBUG = -ggdb -c -O0 -Wno-div-by-zero -Wundef \
  97. -Wconversion -Wstrict-prototypes -Wunreachable-code \
  98. -pedantic -Wall -Winit-self -ftree-vrp -Wfloat-equal \
  99. -Wunsafe-loop-optimizations -Wpadded -fstack-protector-all
  100.  
  101. CFLAGS_TEST = -ggdb -O0 -c
  102.  
  103.  
  104. # if we are using HDF5, we need to specify the path to the include files
  105. CFLAGS_HDF5 = -I${HDF5_PATH}/include -DH5_USE_16_API
  106. CFLAGS_NCMPI = -I${NCMPI_PATH}/include
  107.  
  108. #----------------------------------------------------------------------------
  109. # Linker flags
  110. #
  111. # There is a seperate version of the linker flags for each of the _OPT,
  112. # _DEBUG, and _TEST cases.
  113. #----------------------------------------------------------------------------
  114.  
  115. LFLAGS_OPT = -o
  116. LFLAGS_DEBUG = -ggdb -O0 -o
  117. LFLAGS_TEST = -ggdb -O0 -o
  118.  
  119.  
  120. #----------------------------------------------------------------------------
  121. # Library specific linking
  122. #
  123. # If a FLASH module has a 'LIBRARY xxx' line in its Config file, we need to
  124. # create a macro in this Makefile.h for LIB_xxx, which will be added to the
  125. # link line when FLASH is built. This allows us to switch between different
  126. # (incompatible) libraries. We also create a _OPT, _DEBUG, and _TEST
  127. # library macro to add any performance-minded libraries (like fast math),
  128. # depending on how FLASH was setup.
  129. #----------------------------------------------------------------------------
  130.  
  131. LIB_OPT =
  132. LIB_DEBUG =
  133. LIB_TEST =
  134.  
  135. LIB_HDF4 =
  136. LIB_HDF5 = -L ${HDF5_PATH}/lib -lhdf5 -lz
  137.  
  138. LIB_PAPI =
  139. LIB_MATH =
  140.  
  141. LIB_MPI =
  142. LIB_NCMPI = -L ${NCMPI_PATH}/lib -lpnetcdf
  143. LIB_MPE =
  144.  
  145. LIB_HYPRE = -L${HYPRE_PATH}/lib -lHYPRE
  146.  
  147. # Uncomment the following line to use electic fence memory debugger.
  148. # export EF_ALLOW_MALLOC_0=1
  149. #CONFIG_LIB = -L/usr/lib64 -lefence
  150.  
  151. #----------------------------------------------------------------------------
  152. # Additional machine-dependent object files
  153. #
  154. # Add any machine specific files here -- they will be compiled and linked
  155. # when FLASH is built.
  156. #----------------------------------------------------------------------------
  157.  
  158. MACHOBJ =
  159.  
  160. #----------------------------------------------------------------------------
  161. # Additional commands
  162. #----------------------------------------------------------------------------
  163.  
  164. MV = mv -f
  165. AR = ar -r
  166. RM = rm -f
  167. CD = cd
  168. RL = ranlib
  169. ECHO = echo
  170.  
  171.  
  172. #----------------------------------------------------------------------------
  173. # Fake existence of iso_c_bindings module to prevent unnecessary recompilations.
  174. #----------------------------------------------------------------------------
  175. ifeq ($(FLASHBINARY),true)
  176. iso_c_binding.mod :
  177. touch $@
  178. endif


mulatona (mulatona.ccad.unc.edu.ar)


mendieta (mendieta.ccad.unc.edu.ar)


3. Cómo compilar el programa: En /lugardeinstalacion/FLASHX.X/./setup magnetoHD/proyecto -auto -parfile=flash.par +usm threadBlockList=True -objdir=object -site=clemente -2d -maxblocks=5000 -nxb=20 -nyb=10

Luego compilar haciendo:



4. Cómo correr el programa

a) Máquinas con trabajos en cola → clemente, mulatona (uso exclusivo del IATE) y mendieta (cluster UNC) Para correr el programa, usar los diferentes script según la maquina . Se deben copiar los submit_job_maquina.sh en las carpetas donde se crean los objetos de la compilación. Luego correrlos con: sbatch submit_job_maquina.sh

Tips: antes de correr verificar los cores y nodos disponibles:

Tutorial de Slurm

b) Para correr en las máquinas sin trabajos en cola: