User Tools

Site Tools


june_1-2_2014_detailed_installation_steps_for_parallel_vh-1_and_required_libraries

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
june_1-2_2014_detailed_installation_steps_for_parallel_vh-1_and_required_libraries [2014/06/03 00:03]
willcox
june_1-2_2014_detailed_installation_steps_for_parallel_vh-1_and_required_libraries [2014/06/03 00:27] (current)
willcox
Line 1: Line 1:
 +Back to WGV Group Logbook: [[wgv|Welcome to the WGV Group Logbook]]
 +
 +----
 +====== Setting up Parallel VH-1 with NetCDF ======
 +===== Getting the NetCDF Libraries (v4.2) =====
 +==== Setting Up NetCDF From Source ====
 +===== Modifying the Parallel VH-1 Files =====
 +----
 +
 +June 1-2, 2014: Donald Willcox
 +
 +----
 +
 ====== Setting up Parallel VH-1 with NetCDF ====== ====== Setting up Parallel VH-1 with NetCDF ======
 The parallel version of VH-1 uses netcdf, and configuring mpich and netcdf and compiling the parallel version requires installing the following libraries. On Fedora, I installed all of these via ''​yum install <​library>''​ and they are likely available via ''​apt-get''​ if your Linux distribution uses Synaptic. The parallel version of VH-1 uses netcdf, and configuring mpich and netcdf and compiling the parallel version requires installing the following libraries. On Fedora, I installed all of these via ''​yum install <​library>''​ and they are likely available via ''​apt-get''​ if your Linux distribution uses Synaptic.
Line 81: Line 94:
  
  
-==== Modifying the Parallel VH-1 Files ====+===== Modifying the Parallel VH-1 Files =====
 The next step is to modify the Makefile in VH1/​src/​Parallel because it expects to be compiled with Intel'​s ifort and I'm using gfortran and also because I need to compile mergeslabs.f90,​ which takes the multiple netcdf files output per timestep and merges them into one. The first modification is to set these flags as follows: The next step is to modify the Makefile in VH1/​src/​Parallel because it expects to be compiled with Intel'​s ifort and I'm using gfortran and also because I need to compile mergeslabs.f90,​ which takes the multiple netcdf files output per timestep and merges them into one. The first modification is to set these flags as follows:
  
Line 111: Line 124:
  
 Now ''​make''​ will put the executable vh1-mpi in the VH1 directory and ''​make mlabs-mpi''​ will put the executable mlabs-mpi in the VH1/output directory. Run vh1-mpi using ''​mpiexec -np 4 ./​vh1-mpi''​ and then go to VH1/output and run mlabs-mpi. Voila, I've got output for the default 3D Sod shock tube problem and now comes visualizing the data... Now ''​make''​ will put the executable vh1-mpi in the VH1 directory and ''​make mlabs-mpi''​ will put the executable mlabs-mpi in the VH1/output directory. Run vh1-mpi using ''​mpiexec -np 4 ./​vh1-mpi''​ and then go to VH1/output and run mlabs-mpi. Voila, I've got output for the default 3D Sod shock tube problem and now comes visualizing the data...
- 
-===== Visualizing NetCDF Files with Python ===== 
-Once you've installed netcdf, you can access data in netcdf files from Python by installing numpy and ScientificPython. You should be able to get these by searching your package manager of choice or visiting their project sites: 
- 
-  * [[http://​www.numpy.org/​]] 
-  * [[https://​sourcesup.renater.fr/​projects/​scientific-py/​]] 
- 
-I go into more detail on building and installing ScientificPython in the following section for adding it to yt if you're interested in using yt to plot your data. Otherwise you can use python to access the netcdf files by referencing the NetCDF/​python documentation here:  
- 
-  * [[http://​gfesuite.noaa.gov/​developer/​netCDFPythonInterface.html]] 
- 
-To load the necessary modules in your python script, use the following: 
- 
-''​import Scientific.IO.NetCDF''​ 
- 
-''​from numpy import *''​ 
- 
-''​from Scientific.IO.NetCDF import *''​ 
- 
-==== Configuring YT for NetCDF Files ==== 
-yt is great for visualizing large multidimensional datasets from astrophysics codes such as FLASH, and it can be obtained from [[yt-project.org]]. yt returned errors in interpreting the netcdf files output by VH-1 when I tried opening them using its ''​load''​ function, so here's how I added NetCDF support to my yt distribution. 
- 
-First, make sure you've set the ''​NETCDF_PREFIX''​ environment variable as in the section on configuring NetCDF. I installed the NetCDF libraries so my include and lib directories are as follows: 
- 
-Include dir: ''/​home/​dwillcox/​local/​netcdf/​include''​ 
- 
-Lib dir: ''/​home/​dwillcox/​local/​netcdf/​lib''​ 
- 
-So I set the following environment variable to point to the netcdf directory: 
- 
-''​export NETCDF_PREFIX=/​home/​dwillcox/​local/​netcdf''​ 
- 
-I have installed yt to the following location: ''/​home/​dwillcox/​codes/​local/​yt-x86_64''​ 
- 
-To use NetCDF, yt needs numpy and ScientificPython installed, and it already comes with numpy. So the only thing to do is download ScientificPython: ​ 
- 
-[[https://​sourcesup.renater.fr/​frs/​download.php/​4411/​ScientificPython-2.8.1.tar.gz]] 
- 
-Extract the tarball and ''​cd''​ into its directory. Activate the yt package by executing: 
- 
-''​source /​home/​dwillcox/​codes/​local/​yt-x86_64/​bin/​activate''​ 
- 
-Now execute the following: 
- 
-''​python setup.py build''​ 
- 
-''​python setup.py install''​ 
- 
-And ScientificPython should be added to your yt distribution! 
- 
-For a sample script using NetCDF with yt, see plotnc.py in my github repo:  
- 
-[[https://​github.com/​dwillcox/​VH1-solarwind/​blob/​master/​scripts/​plotnc.py]] 
- 
- 
- 
- 
- 
- 
- 
- 
june_1-2_2014_detailed_installation_steps_for_parallel_vh-1_and_required_libraries.1401768216.txt.gz ยท Last modified: 2014/06/03 00:03 by willcox