-
Notifications
You must be signed in to change notification settings - Fork 1
Description
At the moment, I have an if statement and check if the user provides a topology file from STDIN or a file. If the file is provided from STDIN, because it is not possible to determine the exact size of STDIN I read the file in chunks of READCHAR_BUFFER with fgets and store it in the graph_buffer until I read the EOF character. When a file is provided, I check the size of the file with stat and I read the whole file in graph_buffer at once with fread. Then I broadcast the graph_buffer to all of the participating MPI nodes and preparing the graph with the agmemread command.
Unless the single fread() is significantly faster than reading the file in chunks (even if I know the size of it), the if statement could be dropped and I could be reading both STDIN and files in the same way (by chunks of READCHAR_BUFFER with fgets as if both STDIN and files have an unknown size).