{"id":16247744,"url":"https://github.com/mbdevpl/transpyle-flash","last_synced_at":"2026-01-16T07:54:17.207Z","repository":{"id":77620302,"uuid":"114189102","full_name":"mbdevpl/transpyle-flash","owner":"mbdevpl","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-21T06:45:15.000Z","size":120,"stargazers_count":0,"open_issues_count":9,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-08T04:26:03.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbdevpl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-14T01:54:18.000Z","updated_at":"2019-05-09T05:33:27.000Z","dependencies_parsed_at":"2023-03-08T15:15:54.703Z","dependency_job_id":null,"html_url":"https://github.com/mbdevpl/transpyle-flash","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbdevpl%2Ftranspyle-flash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbdevpl%2Ftranspyle-flash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbdevpl%2Ftranspyle-flash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbdevpl%2Ftranspyle-flash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbdevpl","download_url":"https://codeload.github.com/mbdevpl/transpyle-flash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246819781,"owners_count":20839095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:38:24.719Z","updated_at":"2026-01-16T07:54:17.169Z","avatar_url":"https://github.com/mbdevpl.png","language":"Jupyter Notebook","readme":"# Docker container: Transpyle + FLASH\n\n\n## Recommended knowledge\n\nUser must know how to use [FLASH](http://flash.uchicago.edu/site/flashcode/).\n\nFamiliarity at elementary level with the following will help:\n\n* docker command-line interface\n* Spack package manager\n* `screen` linux command\n* python\n* jupyter notebook\n\n\n## Using the Docker container\n\n\n### Building the images\n\nRebuilding images is only necessary when:\n\n* FLASH is updated (then, rebuild the main container image)\n* dependencies are updated (then, rebuild the dependencies image and the main container image)\n* transpyle framework is updated (changes in the [`Dockerfile`](dependencies/Dockerfile#L1)\n  of the dependencies image plus rebuild of all of the above is required)\n\n\n#### Rebuild the main container image\n\nOn the host, go to the root directory of this repository, and, first of all, update git submodules\nwith FLASH if necessary, as they will be copied into the image:\n\n    git submodule update --init --remote\n\nThis requires access to FLASH repositories.\n\nIf you any modifications were made to submodules, you can revert them using:\n\n    git submodule foreach git clean -f -d -x\n    git submodule foreach git reset --hard HEAD\n\nThen, build the image by running the following:\n\n    sudo docker build --pull --no-cache -t mbdevpl/transpyle-flash:build-$(date +\"%Y-%m-%d\") .\n    sudo docker push mbdevpl/transpyle-flash:build-$(date +\"%Y-%m-%d\")\n\n    sudo docker tag mbdevpl/transpyle-flash:{build-$(date +\"%Y-%m-%d\"),latest}\n    sudo docker push mbdevpl/transpyle-flash:latest\n\nThe, `--pull` option makes sure that image on which building this container depends, is also up to date.\n\n\n#### Rebuilding the dependencies image\n\nNormally you wouldn't need to do this, but if you want to update the dependencies image:\n\n    cd dependencies\n    sudo docker build --pull --no-cache -t mbdevpl/transpyle-flash:dependencies-$(date +\"%Y-%m-%d\") .\n    sudo docker push mbdevpl/transpyle-flash:dependencies-$(date +\"%Y-%m-%d\")\n\nAnd after that please update the 1st line of the main [`Dockerfile`](Dockerfile#L1) to mention\nthe latest dependencies image.\n\n\n### Run the container\n\nOn the host, execute the following:\n\n    sudo docker run -h transmachine -it mbdevpl/transpyle-flash:latest\n\n\n## Using FLASH within the container\n\n\n### Load Spack modules\n\nWe rely on Spack for FLASH dependencies. They have been already installed,\nbut necessary modules need to be loaded after starting the container.\n\nFor FLASH 4.4, 4.5 as well as FLASH subset:\n\n    spack load mpich@3.2.1 hdf5@1.8.20 openblas@0.3.0 hypre@2.14.0\n\n\n### Choose AMReX build\n\nAdditionally, FLASH subset depends on AMReX, which was also installed but outside of Spack due to\nconfiguration issues with the version provided via Spack.\n\nAMReX can be built:\n\n- with or without MPI support,\n- with or without OpenMP support,\n- in debug or release mode, and\n- for 2D or 3D grids.\n\nThe image comes with pre-built all 16 variants of AMReX. They are stored in `~/Software/` folder.\n\nTo choose a version to be used with FLASH, simply set the following environment variable before\nrunning `setup` for FLASH.\n\n    export AMREX_PATH=~/Software/AMReX_2d_noomp\n\n\n### Run FLASH in the container\n\nIn the container, go to the directory containing FLASH, then set up and run the simulation.\nSome examples of how to do this are in file [`flash_setup_examples.sh`](flash_setup_examples.sh).\n\nYou can, for example, run that file:\n\n    ./flash_setup_examples.sh\n\nOr, the following will pick up and test functions from [`test_flash.py`](test_flash.py):\n\n    python3 -m unittest discover --verbose\n    python3 -m unittest test_flash.Flash45Tests.test_eos_idealGamma\n    python3 -m unittest test_flash.Flash45Tests.test_hy_8wv_sweep\n    python3 -m unittest test_flash.FlashSubsetTests\n\n\n### Transpile FLASH in the container\n\nIn the container, do the following:\n\n    cd ~/Projects/transpyle-flash\n    screen -S \"TranspyleNotebook\" python3 -m jupyter notebook --ip=$(hostname -i) --port=8080\n\nThen, point your host browser to the address of the notebook which should be printed in the terminal.\nAfter that, you can detach from the notebook's screen in the container (using `Ctrl+A+D`).\nIf at any time you want to return to the notebook console, type `screen -r TranspyleNotebook`.\n\nIn your host's browser, you should see jupyter notebook index page `http://container-ip:8080/tree`.\nOpen [`transpyle_flash.ipynb`](transpyle_flash.ipynb). To test default transpilation scenario,\nexecute all cells in the notebook.\n\nAfter transpilation is finihsed, you can setup, build and run FLASH again to test it.\n\n\n### Transpile host's FLASH from the container\n\nYou can also mount a directory with FLASH (or other Fortran code) into the container from your host,\nvia `--mount` comandline option of `docker run`. So instead of initial command, execute for example:\n\n    sudo docker run -h transmachine --mount src=~/my-flash,target=/home/user/Projects/my-flash,type=bind -it transpyle-flash\n\nThat way the container is used only for transpilation, but building and execution of FLASH\ncan be done on pre-configured host.\n\nRemark: when mounting, the mounted folder is owned by root within the container - and changing it's\nownership breaks ownership of files in the host system. Therefore it's best to mount files from\nhost with read-only intentions. See: https://github.com/moby/moby/issues/2259\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbdevpl%2Ftranspyle-flash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbdevpl%2Ftranspyle-flash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbdevpl%2Ftranspyle-flash/lists"}