mapequation / infomap

Multi-level network clustering based on the Map Equation
https://mapequation.org/infomap
GNU General Public License v3.0
425 stars 88 forks source link

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

Open astruck opened 1 year ago

astruck commented 1 year ago

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