Skip to content

Installation

Philip Maechling edited this page May 4, 2022 · 5 revisions

UCVM Plotting Installation

UCVM plotting requires to pre-conditions. First, it requires an installation of UCVM. Second, it requires a python2 installation. These are available on USC Discovery cluster.

The ucvm_plotting scripts are written in python2 and the conversion of these scripts to Python3 has not been done yet. They make use of libraries such as basemap which may not be supported, so significant modification to the scripts are needed.

UCVM_plotting Python2 scripts will use the ucvm c-language executables, using the UCVM C API.

The ucvm_plotting scripts have an additional complication in that they use X-windows to display the resulting plots. Ways to display x-windows on systems varies significantly by the system in use. The use of X-windows can be avoided by writing the UCVM plots to *.png files, then displaying the png files with appropriate (non x-windows) utilities.

Overview of Installation

  1. Install Anaconda Python3 on yoru system
  2. Install UCVM on system.
  3. Install Python2 on the system
  4. Move to the UCVM binary directory and clone the ucvm_plotting repo
  5. Build ucvm_plotting
  6. activate python2 environment with command # conda activate python2
  7. run plotting scripts
  8. conda deactivate python3 to return to the more standard python3 environment

Adding Python2 to Python3 anaconda installation

  1. create conda environment
  • conda create -n python2 python=2.7 scipy pip numpy matplotlib basemap basemap-data-hires

Building ucvm_plotting

  1. To Change back to python3 environment - the plot
  • conda deactivate
  1. test ucvm_plotting / get an allocation
  • cd $TEST_UCVM_TARGET/ucvm_plotting/examples
  • salloc --ntasks=1 --time=02:00:00
  • conda activate withPython2
  • ./run-tests
  • conda deactivate

How to Export Image from ucvm_Plotting Docker image

xhost + 127.0.0.1
docker run -e DISPLAY=host.docker.internal:0 --rm -it --mount type=bind,source="$(pwd)"/target,destination=/app/target mpihuisu/py2ucvm:1.2

wait for the bash prompt,

try:

xeyes

which view_png.py

to test,

cd /app/ucvm_plotting/examples/cross_section
./run_cvmh_cross_section_vs.sh

and 
view_png.py -f cvmh_cross_section_vs.png

these steps should work on you mac laptop.

Clone this wiki locally