This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncpg | |
async def create_pool(): | |
pool = await asyncpg.create_pool( | |
database="research", | |
user="jwickens", | |
setup=setup_connection, | |
min_size=32, | |
max_size=32 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess, getpass | |
def get_gpu_usage(): | |
""" | |
Returns a dict which contains information about memory usage for each GPU. | |
In the following output, the GPU with id "0" uses 5774 MB of 16280 MB. | |
253 MB are used by other users, which means that we are using 5774 - 253 MB. | |
{ |
OlderNewer