|
Literature
Africa |
GPUAccessNotesNote: Angular brackets, Synchronising GPU accessI have put a Perl script called
This is easiest to use wrapped in a bash script, e.g. #!/bin/bash solo -port=3801 ". /home/daq/miniconda3/etc/profile.d/conda.sh && conda activate py3ml && python <python_script.py>" If we all use the same port, 3801, then only one user can access the GPU at a time. If someone else is currently using the GPU, you will get this message: I looked at other process synchronisation alternatives, like acquiring a lock, making a folder in bash or using the lockrun c app. All of these had various disadvantages, but solo seems to work well. Easily running code on Wolf GPUI have written a bash script that I am using to copy data and code to Wolf, run it, and copy the results back. First up, set up ssh keys to log in to wolf. 1. Generate a key (if you do not already have one).ssh-keygen -t rsa -C "your_email@example.com" Pick a name for the key that will identify you so it is easier to keep track. There is no need to use a passphrase, though you can if you want. 2. Copy the public key to wolfssh-copy-id -i ~/.ssh/<keyname> daq@196.24.76.207 If you don't have ssh-copy-id, then manually copy the .pub file that the 3. Add an entry to ssh config fileOn your own computer, add an entry to Host wolf Hostname 196.24.76.207 User <username> IdentityFile ~/.ssh/<keyname> At this point, you should be able to login with The bash scriptReplace everything within angular brackets
#!/bin/bash
echo "#####################################################################################"
echo " Copying files to wolf"
echo "#####################################################################################"
if rsync --progress -auvx <file1_or_dir1> \
<file1_or_dir2> \
<file1_or_dir3> \
<...> \
--exclude '__pycache__' wolf:<destination_folder> ; then
echo "done."
echo
echo "#####################################################################################"
echo " Running code"
echo "#####################################################################################"
if ssh wolf 'cd <destination_folder> && . run.sh' ; then
echo "done."
echo
echo "#####################################################################################"
echo " Copying results back"
echo "#####################################################################################"
rsync --progress -auvx wolf:<destination_folder>/<results> .
fi
fi
Some comments:This script assumes you have a folder in your home directory, (referred to as You can list several files to
The |