1*288c0443SJeremy L Thompson## libCEED + Nek5000 Examples 286a4271fSThilina Rathnayake 386a4271fSThilina Rathnayake### Prerequisites 486a4271fSThilina Rathnayake 586a4271fSThilina RathnayakeNek5000 v18.0 or greater must be [installed](https://nek5000.mcs.anl.gov/getstarted/) to run 686a4271fSThilina Rathnayakethese examples. It is assumed to exist at `../../../Nek5000` (a sibling to the 786a4271fSThilina RathnayakelibCEED directory) or at a path defined in the environment variable `NEK5K_DIR`. 886a4271fSThilina RathnayakeFor example, you could set 986a4271fSThilina Rathnayake```sh 1086a4271fSThilina Rathnayake export NEK5K_DIR=/scratch/Nek5000 1186a4271fSThilina Rathnayake``` 1286a4271fSThilina Rathnayakeif that is where it is located. 1386a4271fSThilina Rathnayake 1486a4271fSThilina RathnayakeThe Nek5000 examples depend on the Nek5000 tools: `genbox`, `genmap`, 1586a4271fSThilina Rathnayakeand `reatore2`. They can be built using 1686a4271fSThilina Rathnayake```sh 1786a4271fSThilina Rathnayake ( cd $NEK5K_DIR/tools && ./maketools genbox genmap reatore2 ) 1886a4271fSThilina Rathnayake``` 1986a4271fSThilina RathnayakeSee also the [Nek5000 documentation](https://nek5000.mcs.anl.gov/getstarted/). 2086a4271fSThilina Rathnayake 2186a4271fSThilina Rathnayake### Building the Nek5000 examples 2286a4271fSThilina Rathnayake 2386a4271fSThilina RathnayakeYou can build the Nek5000 libCEED examples with the command `make bps`. 2486a4271fSThilina Rathnayake 2586a4271fSThilina RathnayakeYou can also build the Nek5000 libCEED examples by invoking `nek-examples.sh` script. 2686a4271fSThilina Rathnayake```sh 2786a4271fSThilina Rathnayake ./nek-examples.sh -m 2886a4271fSThilina Rathnayake``` 2986a4271fSThilina Rathnayake 3086a4271fSThilina RathnayakeBy default, the examples are built with MPI. To build the examples without MPI, 3186a4271fSThilina Rathnayakeset the environment variable `MPI=0`. 3286a4271fSThilina Rathnayake 3386a4271fSThilina RathnayakeNote: Nek5000 examples must be built sequentially. Due to the Nek5000 build 3486a4271fSThilina Rathnayakeprocess, multiple examples cannot be built in parallel. At present, there is 3586a4271fSThilina Rathnayakeonly one Nek5000 example file to build, which handles both CEED BP 1 and 3686a4271fSThilina RathnayakeCEED BP 3. 3786a4271fSThilina Rathnayake 3886a4271fSThilina Rathnayake### Running Nek5000 examples 3986a4271fSThilina Rathnayake 4086a4271fSThilina RathnayakeYou can run the Nek5000 libCEED examples by invoking `nek-examples.sh` 4186a4271fSThilina Rathnayakescript. The syntax is: 4286a4271fSThilina Rathnayake```sh 4386a4271fSThilina Rathnayake ./nek-examples.sh -c <ceed_backend> -e <example_name> \ 4486a4271fSThilina Rathnayake -n <mpi_ranks> -b <box_geometry> 4586a4271fSThilina Rathnayake``` 4686a4271fSThilina RathnayakeThe different options that can be used for the script are listed below: 4786a4271fSThilina Rathnayake``` 4886a4271fSThilina Rathnayakeoptions: 4986a4271fSThilina Rathnayake -h|-help Print this usage information and exit 5086a4271fSThilina Rathnayake -c|-ceed Ceed backend to be used for the run (optional, default: /cpu/self) 5186a4271fSThilina Rathnayake -e|-example Example name (optional, default: bp1) 5286a4271fSThilina Rathnayake -n|-np Specify number of MPI ranks for the run (optional, default: 1) 5386a4271fSThilina Rathnayake -t|-test Run in test mode (not on by default) 5486a4271fSThilina Rathnayake -b|-box Box case in boxes sub-directory found along with this script (default: 2x2x2) 5586a4271fSThilina Rathnayake -clean clean the examples directory 5686a4271fSThilina Rathnayake -m|-make Make the examples 5786a4271fSThilina Rathnayake``` 5886a4271fSThilina RathnayakeThe only mandatory argument is `-b` or `-box` which sets the box geometry to be 5986a4271fSThilina Rathnayakeused. This geometry should be found in `./boxes` directory. 6086a4271fSThilina Rathnayake 6186a4271fSThilina RathnayakeFor example, you can run bp1 as follows: 6286a4271fSThilina Rathnayake```sh 6386a4271fSThilina Rathnayake ./run-nek-example.sh -ceed /cpu/self -e bp1 -n 4 -b 3 6486a4271fSThilina Rathnayake``` 6586a4271fSThilina Rathnayakewhich is the same as running: 6686a4271fSThilina Rathnayake```sh 6786a4271fSThilina Rathnayake ./run-nek-example.sh -b 3 6886a4271fSThilina Rathnayake``` 69