Search code examples
simgrid

How to change the maximum possible number of open files in SimGrid?


This code, for example, open and try to copy one file 1029 times

for (int i = 0; i < 1029; ++i) {
    MSG_process_create("copy", create_copy, data, MSG_host_self());
}
int create_copy(){
    MSG_file_rcopy(file, src, argv[2]);
}

I have exception:

[dave:copy:(1027) 0.034653] simgrid-master/src/xbt/exception.cpp:45: [xbt_exception/CRITICAL] Uncaught exception xbt_ex by copy/1027: Too much files are opened! Some have to be closed.

Is it possible to change the maximum number of simultaneously opened files? Or this restrictions of my RAM memory?


Solution

  • Indeed there was a hardcoded limit to 1024 files/host, I've just added the storage/max_file_descriptors flag to allow changing this value ( --cfg=storage/max_file_descriptors:2048 to set it to 2048). The commit (c52c503d21e5) is on the gforge and was not yet propagated to github, this should be done soon.