thomasmoelhave / tpie

Templated Portable I/O Environment
Other
112 stars 24 forks source link

Getting too many open files exception #197

Closed chjose closed 8 years ago

chjose commented 8 years ago

I am writing an algorithm to perform matrix multiplication on higher dimensions. This program requires many streams open at a time. But when i have more than 500 streams open i am getting an exception:

terminate called after throwing an instance of 'tpie::io_exception' what(): Too many open files Path:

Any option to increase this limit?

Mortal commented 8 years ago

Which operating system are you running TPIE on? Typically Linux restricts processes to 1024 open file handles (meaning 1021 open files when you subtract stdin, stdout, stderr).

You can change this limit in Linux using sysctl I believe. I don't know about other operating systems.

chjose commented 8 years ago

Operating system is Ubuntu/Linux. Tried the command below:

bash-4.3~/repos/tpie/example/stats_files$ sysctl fs.file-max fs.file-max = 401116

Not sure why TPIE is giving such an exception here.

antialize commented 8 years ago

This is the number of files the filesystem support. The number of open files allowed can be checked with "ulimit -n", and changed with "ulimit -n 4000". See here for more information

http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/

chjose commented 8 years ago

It is working. Thank you.