| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

memory limit and time limit python wrapper

Page history last edited by TianyiGu 3 years, 7 months ago

We have a python script in /home/aifs2/group/code/limitWrapper that constrains the memory usage or time limit of a executable command. It uses /proc/[PID]/smaps to read the memory usage of your program. See details of smaps here.

 

./limitWrapper.py -h                                                                                                                                 

 

usage: ./limitWrapper.py [-h] [-c COMMAND] [-m MEMORY] [-t TIME]

 

optional arguments:

  -h, --help  show this help message and exit

  -c COMMAND  command: (default) ls ~

  -m MEMORY   memory limit:(default) 5 (GB)

  -t TIME     time limit:(default) 600 (seconds)

 

example:

./limitWrapper -c "/home/aifsx/xxx/bin/search" -m 7 -t 10

will run command /home/aifsx/xxx/bin/search with memory limit 7GB and time limit 10 seconds. 

 

It uses a lot of function from DistLRE

 

 

 

Comments (0)

You don't have permission to comment on this page.