Skip to content

In the function read_input_graph, treat STDIN and files in the same way. #13

@cyberang3l

Description

@cyberang3l

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions