1288c0443SJeremy L Thompson## libCEED + Nek5000 Examples 286a4271fSThilina Rathnayake 386a4271fSThilina Rathnayake### Prerequisites 486a4271fSThilina Rathnayake 5*4a46e67dSJeremy L ThompsonNek5000 v19.0 or greater must be [installed](https://nek5000.mcs.anl.gov/getstarted/) to run these examples. 617be3a41SJeremy L ThompsonIt is assumed to exist at `../../../Nek5000` (a sibling to the libCEED directory) or at a path defined in the environment variable `NEK5K_DIR`. 786a4271fSThilina RathnayakeFor example, you could set 886a4271fSThilina Rathnayake```sh 986a4271fSThilina Rathnayake export NEK5K_DIR=/scratch/Nek5000 1086a4271fSThilina Rathnayake``` 1186a4271fSThilina Rathnayakeif that is where it is located. 1286a4271fSThilina Rathnayake 1317be3a41SJeremy L ThompsonThe Nek5000 examples depend on the Nek5000 tools: `genbox`, `genmap`, and `reatore2`. 1417be3a41SJeremy L ThompsonThey can be built using 1586a4271fSThilina Rathnayake```sh 1686a4271fSThilina Rathnayake ( cd $NEK5K_DIR/tools && ./maketools genbox genmap reatore2 ) 1786a4271fSThilina Rathnayake``` 1886a4271fSThilina RathnayakeSee also the [Nek5000 documentation](https://nek5000.mcs.anl.gov/getstarted/). 1986a4271fSThilina Rathnayake 2086a4271fSThilina Rathnayake### Building the Nek5000 examples 2186a4271fSThilina Rathnayake 2286a4271fSThilina RathnayakeYou can build the Nek5000 libCEED examples with the command `make bps`. 2386a4271fSThilina Rathnayake 2486a4271fSThilina RathnayakeYou can also build the Nek5000 libCEED examples by invoking `nek-examples.sh` script. 2586a4271fSThilina Rathnayake```sh 2686a4271fSThilina Rathnayake ./nek-examples.sh -m 2786a4271fSThilina Rathnayake``` 2886a4271fSThilina Rathnayake 2917be3a41SJeremy L ThompsonBy default, the examples are built with MPI. 3017be3a41SJeremy L ThompsonTo build the examples without MPI, set the environment variable `MPI=0`. 3186a4271fSThilina Rathnayake 3217be3a41SJeremy L ThompsonNote: Nek5000 examples must be built sequentially. 3317be3a41SJeremy L ThompsonDue to the Nek5000 build process, multiple examples cannot be built in parallel. 3417be3a41SJeremy L ThompsonAt present, there is only one Nek5000 example file to build, which handles both CEED BP 1 and CEED BP 3. 3586a4271fSThilina Rathnayake 3686a4271fSThilina Rathnayake### Running Nek5000 examples 3786a4271fSThilina Rathnayake 3817be3a41SJeremy L ThompsonYou can run the Nek5000 libCEED examples by invoking `nek-examples.sh` script. 3917be3a41SJeremy L ThompsonThe syntax is: 4086a4271fSThilina Rathnayake```sh 4186a4271fSThilina Rathnayake ./nek-examples.sh -c <ceed_backend> -e <example_name> \ 4286a4271fSThilina Rathnayake -n <mpi_ranks> -b <box_geometry> 4386a4271fSThilina Rathnayake``` 4486a4271fSThilina RathnayakeThe different options that can be used for the script are listed below: 4586a4271fSThilina Rathnayake``` 4686a4271fSThilina Rathnayakeoptions: 4786a4271fSThilina Rathnayake -h|-help Print this usage information and exit 4886a4271fSThilina Rathnayake -c|-ceed Ceed backend to be used for the run (optional, default: /cpu/self) 4986a4271fSThilina Rathnayake -e|-example Example name (optional, default: bp1) 5086a4271fSThilina Rathnayake -n|-np Specify number of MPI ranks for the run (optional, default: 1) 5186a4271fSThilina Rathnayake -t|-test Run in test mode (not on by default) 5286a4271fSThilina Rathnayake -b|-box Box case in boxes sub-directory found along with this script (default: 2x2x2) 5386a4271fSThilina Rathnayake -clean clean the examples directory 5486a4271fSThilina Rathnayake -m|-make Make the examples 5586a4271fSThilina Rathnayake``` 5617be3a41SJeremy L ThompsonThe only mandatory argument is `-b` or `-box` which sets the box geometry to be used. 5717be3a41SJeremy L ThompsonThis geometry should be found in `./boxes` directory. 5886a4271fSThilina Rathnayake 5986a4271fSThilina RathnayakeFor example, you can run bp1 as follows: 6086a4271fSThilina Rathnayake```sh 6186a4271fSThilina Rathnayake ./run-nek-example.sh -ceed /cpu/self -e bp1 -n 4 -b 3 6286a4271fSThilina Rathnayake``` 6386a4271fSThilina Rathnayakewhich is the same as running: 6486a4271fSThilina Rathnayake```sh 6586a4271fSThilina Rathnayake ./run-nek-example.sh -b 3 6686a4271fSThilina Rathnayake``` 67