{"id":22668564,"url":"https://github.com/lanl/clamr","last_synced_at":"2026-03-11T21:18:40.890Z","repository":{"id":2963974,"uuid":"3978649","full_name":"lanl/CLAMR","owner":"lanl","description":"Cell-Based Adaptive Mesh Refinement","archived":false,"fork":false,"pushed_at":"2021-05-05T18:44:34.000Z","size":43525,"stargazers_count":77,"open_issues_count":2,"forks_count":26,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-12T11:08:27.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lanl.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-10T03:45:50.000Z","updated_at":"2025-03-07T21:18:03.000Z","dependencies_parsed_at":"2022-08-30T23:01:23.242Z","dependency_job_id":null,"html_url":"https://github.com/lanl/CLAMR","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/lanl%2FCLAMR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FCLAMR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FCLAMR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2FCLAMR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanl","download_url":"https://codeload.github.com/lanl/CLAMR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248557828,"owners_count":21124167,"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-12-09T15:15:45.786Z","updated_at":"2025-12-17T00:19:38.160Z","avatar_url":"https://github.com/lanl.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"// The LANL computer code number is\n// CLAMR -- LA-CC-11-094\n\n////////////////\n// GIT Commands\n////////////////\n\nTo checkout the code\n\n% git clone git@github.com:lanl/CLAMR.git\n\n////////////////////////\n// Useful bash commands\n////////////////////////\n\n// logistics\nlocate [file]\t// find file in directory\nhistory\t\t// see history of bash commands\nsource [file]\t// read this file (in a shell form)\n\n// code checking\nvalgrind\t// check memory errors\n// To run valgrind with libtool built code\nlibtool --mode=execute valgrind --tool=memcheck --leak-check=full --show-reachable=yes --track-origins=yes --leak-resolution=high --num-callers=20 --log-file=vgdump clamr_cpuonly -n 16 -i 1 -t 1\n\nddd\t\t// debugger\ntotalview (there is a module on yellowrail and turing)\n\n// code compiling\n// We have switched to cmake so the configure step is \ncmake .                         // in-tree build\ncmake \u003cpath-to-src\u003e             // out-of-tree build\ncmake -DCMAKE_BUILD_TYPE=debug \u003cpath-to-src\u003e\ncmake -DCMAKE_BUILD_TYPE=release \u003cpath-to-src\u003e\n\ncmake -DGRAPHICS_TYPE=None   \u003cpath-to-src\u003e  // Turn off real-time graphics\ncmake -DGRAPHICS_TYPE=OpenGL \u003cpath-to-src\u003e  // Default\ncmake -DGRAPHICS_TYPE=MPE    \u003cpath-to-src\u003e  // Alternate real-time graphics\n\ncmake -DPRECISION_TYPE=full_precision     // full double precision\ncmake -DPRECISION_TYPE=mixed_precision    // intermediates double, arrays single\ncmake -DPRECISION_TYPE=minimum_precision  // all single precision\n\n// To build:\nmake\n// or for a specific executable\nmake clamr_cpuonly\n\n// To run the unit tests\nmake check\n// or for a specific package unit tests\nmake MallocPlus_check\n\n// There are two testing systems: ctest and cts\n\n// To run the tests with ctest\nmake test, or\nctest -R ctest\n\n// To run the tests with cts  -- in the CLAMR directory\nmake clamr_tests\n\n// To build the documentation\nmake doc\n// or for a specific package documentation\nmake MallocPlus_doc\n\nFor Cielito (Cray XE6) architecture\n\n// Note that CLAMR has some problems with OpenMPI, but works at least with this version\n// of mpich\n   module swap PrgEnv-pgi PrgEnv-gnu\n   module load cray-mpich2/6.3.1\n   module load cmake/2.8.9\n\ncmake -DCMAKE_BUILD_TYPE=release -DCMAKE_CXX_COMPILER=`which CC` -DCMAKE_C_COMPILER=`which cc` .\n    or the equivalent (graphics and precision types below are currently the defaults)\ncmake -DCMAKE_BUILD_TYPE=release -DGRAPHICS_TYPE=None -DPRECISION_TYPE=full_precision -DCMAKE_CXX_COMPILER=`which CC` -DCMAKE_C_COMPILER=`which cc` .\n\n// To build\n   make\n// There will be complaints about shared libraries. Go to each directory where it complains and\n// edit the CMakeLists.txt and change \"SHARED\" to \"STATIC\"\n   vi genmalloc/CMakeLists.txt\n   vi graphics/CMakeLists.txt\n   vi memstats/CMakeLists.txt\n   vi mesh/hsfc/CMakeLists.txt\n   vi mesh/kdtree/CMakeLists.txt\n   vi mesh/zorder/CMakeLists.txt\n   vi s7/CMakeLists.txt\n   vi timer/CMakeLists.txt\n\n// To run\n   aprun -n 128 -N 16 ../clamr_mpionly -n 128 -t 1000\n\n// Watch-out for memory leaks with open-mpi 1.8.5 on GPU/MPI versions\n\n// Set MPEHOME to location of MPE install or MPE_INCLUDE_DIR and MPE_LIBRARIES to \n// the include path and the location of the MPE libraries\n\n//\n// need to edit configure.ac (b/c using autoconf package)\n//\nmake\t\t\t\t// builds the executable\nmake install\t\t\t// copy the executable to destination\nmake clean\t\t\t// restores to the pre-make step\nmake distclean\t\t\t// restores to the pre-configure step\nmake installcheck\t\t// not always there\nmake dist\t\t\t// builds new distro into a new tar file\n//\n// need to edit Makefile.am (b/c using automake package)\n//\n\n/////////////////////\n// Environment Setup\n/////////////////////\n\n// Update .bashrc by setting editor and loading modules\nexport EDITOR=vim\nmodule load cuda\nmodule load openmpi-gcc/1.4.1-64\n\n\n/////////////////////\n// Darwin\n/////////////////////\nTo build on Darwin, The OpenCL libraries needed to build are only \navailable on back-end nodes.  To get a node do:\n\nGet a list of hardware partitions\n% sinfo \n\nFor a generic tesla. The Kepler can be requested with the \"K20\" partition\n% salloc -p tesla -N 1\n% ssh $SLURM_NODELIST\n\nThe following modules should be loaded. This line can also be added\nto the .login file to make it automatic\n% module load cmake/2.8.10.2 mpi/openmpi-1.6.4-gcc-4.4.7\n\nYou must use a special version of GCC for CUDA that is not the default\ncompiler on Darwin.  To use the correct compiler do:\n\n% export PATH=/home/opt/gcc/4.4.6/bin:$PATH\n\nTotalview on darwin\n% module load totalview/8.11.0-2\n% totalview \u003cexecutable\u003e -a \u003cprogram command line\u003e\n\nExample\n% totalview mpirun -a -n 2 ./clamr_mpionly -n 512 -l 2 -i 100 -t 10000\n\n////////////////\n// Moonlight\n////////////////\n\n%ssh -Y ml-fey\n\nGet a backend node. The -nn is the number of nodes and the -np is the number\nof processors per node\n%llogin -nn 1 -np 8\n\nLoad modules\n% module load gcc/4.7.2 openmpi/1.6.3  opencl/1.1\n\nAdd the following to the .login and you can select the gcc or intel compiler with\nsource ~/.login intel (for intel) or source ~/.login (for gcc)\n\n========== .login file ============\nif (\"$1\" =~ \"intel\") then\n   module load intel/13.0.1\nelse\n   module load gcc/4.7.2\nendif\n\nmodule load openmpi/1.6.3 opencl/1.1\n===================================\n\n********************* graphics and checkpoint restart ****************************\n\nJust a little information on the movie graphics and the checkpoint/restart\n\nThe image and movie capabilities require the python imaging library (PIL or pillow\non Mac OSx) and mplayer (mencode comes with mplayer), respectively. An alternate\ngraphics output is done using the MagickWand library in many different formats.\n\nFor MAC:\nbrew install Homebrew/Python/pillow\nbrew install mplayer\n\nFor the MagickWand graphics library in ImageMagick \nbrew install imagemagick\n\n************************************* clamr *************************************\nThis is all the code I adjusted in CLAMR. Below are notes on the new flags I added.\n\n-R: Restart CLAMR from a specified backup file, so you will need to pass the\n    backup filename along with the path (EX: -R \"checkpoint_output/backup00100.crx\")\n-b: The number of rollback files to maintain. Disk files are maintained with the \n    specified number of symlinks. In-memory images are limited to the specified\n    number of rollback images\n-c: Backup CLAMR states to disk at the specified cycle intervals. They will be\n    put in the checkpoint_output directory\n-C: Backup CLAMR states in-memory disk at the specified cycle intervals\n-g: This generates the graphics files at the specified cycle intervals that are passed\n    in by this flag. The graphics data files .data \u0026 .lin will be dumped in the directory\n    where the executable is running. \n-G: graphics file type. Possible values include none, data, bmp, gif, jpeg, mpeg, pdf,\n    png, and svg. Example -g 100 -G png will dump a graph#.png file in the graphics_output\n    directory every 100 cycles.\n-U: Upper bound for what is the allowable mass percentage difference. This number can\n    be in integer, decimal, or scientific notation (EX: 1.23e-13).  \n\n\n************************************* scripts ************************************\nThis is the code for generating the images and movies. The generate_image.py, \ngenerate_movie.sh, and FreeSansBold.ttf should be placed just outside of the graphics_output\ndirectory. They will go into this directory to generate all image and movie data. The \nmovies that are generated are avi files, but they can be converted to any format using\non-line video converters. I did this, because the best quality for the movies is \ngenerated by first making a avi file. The on-line movie converter I used was at \nvideo.online-convert.com. Mplayer can be used in Linux to just play the movie in an \nX-Terminal if you pass it the avi file.\n\nFreeSansBold.tff: This is just the text file used by the python script to create the\n    lettering for number of iterations and time steps in the images. This file, \n    generate_image.py, and generate_movie.sh are all needed to create the movies. They\n    all just need to be in the same directory as the grahpics_info file that contains\n    the graphics information from the simulation. If you just want to create the images\n    and not the movie, then only this file and generate_image.py are needed in the \n    same directory as the graphics_output directory.\n\ngenerate_image.py: This is python script that is used to generate the images from the\n    CLAMR simulation. The image data needs to be a directory called graphics_output. The\n    python script will go into this directory and generate the png files as well as an\n    text file called image list, which is used to generate a movie. You can pass the y\n    flag to this script if you want to have grid lines in the images as well. All image\n    data is saved in the .data files and all gridlines data is saved in the .lin files.\n    The FreeSansBold.ttf is needed to create the text in each image for the Iteration\n    number and Time Step values.\n\ngenerate_movie.sh: This script uses the python code above to first generate the images,\n    and then generate a movie out the images. This script has a three flags that can be\n    used. They are explained below. The movie that is generated is dumped in the current\n    directory with the label test.avi\n    -y: Defines whether you want gridlines in the images for the movie generated\n        (False by default)\n    -f: How many FPS you want the movie to be (6 by default)\n    -s: What size do you want the images in the movie to be (800x800 by default).\n\nSo hopefully this all makes sense. I might have left something out. If you have any problems or\nissues, just email me at bwa@g.clemson.edu. I will respond ASAP. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fclamr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanl%2Fclamr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fclamr/lists"}