OpenMC setup Google Colab

Hello! Is it possible to run OpenMC using Google Colab? If yes, can anyone tell me how setup it step by step? Thanks!

@fsabab,

Take a look though it’s pretty outdated. But thanks to @Jose_Ignacio_Marquez. If you see any difficulties, let me know.

I was busy a little bit and now came up with another solution, simple, where you don’t have to install OpenMC from the source rather we will use Miniconda to install OpenMC. :grinning:

! wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
! chmod +x Miniconda3-latest-Linux-x86_64.sh
! bash Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local/
# will setup our conda package installation path as ‘/usr/local/lib/python3.6/site-packages/’. 
import sys
sys.path.append(‘/usr/local/lib/python3.6/site-packages/’)
# Let's clone openmc repo
! git clone --recurse-submodules https://github.com/openmc-dev/openmc.git
# Download nndc_hdf5 data library
! wget https://anl.box.com/shared/static/teaup95cqv8s9nn56hfn7ku8mmelr95p.xz | tar -C /content -xJ
! rm -rf teaup95cqv8s9nn56hfn7ku8mmelr95p.xz
# Cross Section Env variable
import os
os.environ['OPENMC_CROSS_SECTIONS'] = "/content/nndc_hdf5/cross_sections.xml"
! conda create -n openmc -y
! source activate openmc && conda config --add channels conda-forge
! source activate openmc && conda install openmc -y
! source activate openmc && python openmc/examples/pincell/build_xml.py
! source activate openmc && openmc

If you want to work from terminal, Just type

! bash

Voila!

@Pranto Thanks. I have been using miniconda since I first started doing codes in OpenMC. I was just interested in whether using Google CoLab makes things easy or not.

@fsabab In my opinion, It’s super cool. In case of

  • Full core simulation
  • Data processing
  • Depletion

I use Colab because of 13 GB RAM :star_struck: