Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infomap 2.7.1 results differ between binary and compiled version despite seed #342

Open
astruck opened this issue Jul 27, 2023 · 1 comment

Comments

@astruck
Copy link

astruck commented Jul 27, 2023

The binary version output looks like this

# v2.7.1
# ./Infomap -v -o tree --out-name <fileName> --two-level --directed --seed 2501 <graph> <directory>
# started at 2023-07-25 17:41:35
# completed in 4.5618 s
# partitioned into 2 levels with 3606 top modules
# codelength 9.47955 bits
# relative codelength savings 29.0945%

The compiled version has this output

# v2.7.1
# ./Infomap -v -o tree --out-name <fileName_compiled> --two-level --directed --seed 2501 <graph> <directory>
# started at 2023-07-25 19:57:13
# completed in 2.70225 s
# partitioned into 2 levels with 3614 top modules
# codelength 9.48069 bits
# relative codelength savings 29.086%

The machine (Apple M1max on Ventura) has OpenMP enabled. The graph is a simple unweighted graph.

Is the slightly different output behavior somehow to be expected or should I use different parameters? Thank you.

Additional information: The binary behaved the same on three different Macs and the compiled Infomap was consistent with a compilation on another Mac. Just in case it's relevant, the compilation produced a warning:

➜  infomap-master make
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/MetaMapEquation.cpp -o build/Infomap/core/MetaMapEquation.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/MemMapEquation.cpp -o build/Infomap/core/MemMapEquation.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/InfoEdge.cpp -o build/Infomap/core/InfoEdge.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/BiasedMapEquation.cpp -o build/Infomap/core/BiasedMapEquation.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/StateNetwork.cpp -o build/Infomap/core/StateNetwork.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/iterators/InfomapIterator.cpp -o build/Infomap/core/iterators/InfomapIterator.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/InfomapBase.cpp -o build/Infomap/core/InfomapBase.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/core/InfoNode.cpp -o build/Infomap/core/InfoNode.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/io/Network.cpp -o build/Infomap/io/Network.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/io/ClusterMap.cpp -o build/Infomap/io/ClusterMap.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/io/ProgramInterface.cpp -o build/Infomap/io/ProgramInterface.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/io/Output.cpp -o build/Infomap/io/Output.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/io/Config.cpp -o build/Infomap/io/Config.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/utils/Log.cpp -o build/Infomap/utils/Log.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/utils/FileURI.cpp -o build/Infomap/utils/FileURI.o
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/utils/FlowCalculator.cpp -o build/Infomap/utils/FlowCalculator.o
src/utils/FlowCalculator.cpp:245:84: warning: unused parameter 'config' [-Wunused-parameter]
void FlowCalculator::usePrecomputedFlow(const StateNetwork& network, const Config& config)
                                                                                   ^
1 warning generated.
c++ -Wall -Wextra -pedantic -Wnon-virtual-dtor -std=c++14 -Wshadow -O3 -Xpreprocessor -fopenmp -c src/main.cpp -o build/Infomap/main.o
Linking object files to target Infomap...
c++  -lomp -o Infomap build/Infomap/core/MetaMapEquation.o build/Infomap/core/MemMapEquation.o build/Infomap/core/InfoEdge.o build/Infomap/core/BiasedMapEquation.o build/Infomap/core/StateNetwork.o build/Infomap/core/iterators/InfomapIterator.o build/Infomap/core/InfomapBase.o build/Infomap/core/InfoNode.o build/Infomap/io/Network.o build/Infomap/io/ClusterMap.o build/Infomap/io/ProgramInterface.o build/Infomap/io/Output.o build/Infomap/io/Config.o build/Infomap/utils/Log.o build/Infomap/utils/FileURI.o build/Infomap/utils/FlowCalculator.o build/Infomap/main.o
-- Link finished --
@Farewe
Copy link

Farewe commented Oct 13, 2024

Hi, I'd like to comment on this issue to state that I have seen it happen as well.
I have been using infomap in teachings for several years now, and I am always facing this issue that there is a difference in clustering results between mac and windows users, despite using the same seed. I think the expected behaviour should be that giving a seed ensures reproducibility of results. This issue has been happening across many versions of infomap (up to 2.7.2, I have not yet tried 2.8.0). Most of my students that have a macos do not use the open MP version. I have not taken time to investigate if there is a difference between open / no open mp versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants