Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mps readme file #34

Merged
merged 3 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Examples/MPS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# NVIDIA-MPS
* MPS starts for **Multi-Process Service**
* Read more about this [here](https://docs.nvidia.com/deploy/mps/)

# What does it do?
* a single GCMC simulation may not fully utilize a GPU card
* :memo: use `nvidia-smi` command to check GPU usage
* Using MPS, you can run multiple GCMC simulations (processes) on the same GPU card to **improve utility**

# How to use?

* Start with the MPS Example (here in this folder!)
```
chmod 777 mps_run start_as_root.sh stop_as_root.sh
./mps_run
```
* You can open `mps_run` and take a look:
```
#!/bin/bash
runs=3
currentdir=$(pwd)

./start_as_root.sh

for ((i = 0; i < $runs; i++)); do
echo $i
mkdir $i
cp $currentdir/*.def $i/; cp $currentdir/simulation.input $i/; cp $currentdir/*.cif $i/
cd $currentdir/$i
sed -i 's/xxx/'$i'/g' simulation.input
../../../src_clean/nvc_main.x > result &
cd ../
done

wait

./stop_as_root.sh
```
* The process goes like the following:
1. start the MPS daemon
2. create `3` folders, generate input files in each of them, and run them
3. once every simulation is done, shut down the MPS daemon
* :memo: NOTE: use `watch -n0.5 nvidia-smi` in a separate terminal to monitor GPU usage while running jobs with MPS.
2 changes: 0 additions & 2 deletions Examples/MPS/mps_run
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ for ((i = 0; i < $runs; i++)); do
cp $currentdir/*.def $i/; cp $currentdir/simulation.input $i/; cp $currentdir/*.cif $i/
cd $currentdir/$i
sed -i 's/xxx/'$i'/g' simulation.input
#sed -i 's/aaa/'$i'/g' simulation.input
#sed -i 's/bbb/'$nexti'/g' simulation.input
../../../src_clean/nvc_main.x > result &
cd ../
done
Expand Down
Loading