diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 03199fcb2d..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,31 +0,0 @@ -inputs/cora filter=lfs diff=lfs merge=lfs -text -inputs/tester filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora_edgelist.txt filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-labels.txt filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora.sgr filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora.csgr filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-dims.txt filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora_full.npz filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora_labels.txt filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-val_mask.txt filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora.el filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora.features filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora.ft filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-train_mask.txt filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-feat.bin filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-feats.bin filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora.gr filter=lfs diff=lfs merge=lfs -text -inputs/cora/cora-test_mask.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-test-feats.bin filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-test-labels.bin filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-test-labels-dims.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-test_mask.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-dims.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester.el filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-feats.bin filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-mlabels.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-train_mask.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester.csgr filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-labels.txt filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-test-mapping.bin filter=lfs diff=lfs merge=lfs -text -inputs/tester/tester-val_mask.txt filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7ecf6046fc..a95f29e42e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -53,11 +53,11 @@ jobs: shell: bash -l {0} strategy: matrix: - build-type: ['Release'] - sanitizer-type: ['nosan'] - # exclude: - # - build-type: 'Debug' - # sanitizer-type: 'san' + build-type: ['Release', 'Debug'] + sanitizer-type: ['nosan', 'san'] + exclude: + - build-type: 'Debug' + sanitizer-type: 'san' needs: docker-create-ubuntu-2204 steps: @@ -105,9 +105,9 @@ jobs: make docker - name: Run Tests - timeout-minutes: 15 + timeout-minutes: 5 run: | - CONTAINER_CMD="bash -lc 'source /opt/intel/oneapi/setvars.sh && make run-tests'" \ + CONTAINER_CMD="make run-tests" \ IMAGE_NAME="${{ env.IMAGE_NAME }}" \ VERSION="${{ env.IMAGE_VERSION }}" \ make docker diff --git a/Makefile b/Makefile index 9259620058..a0544b1c2c 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,6 @@ run-tests: @ctest --test-dir build -R wmd --verbose @ctest --test-dir build -R large-vec --verbose @ctest --test-dir build -R compile-lscsr --verbose - @ctest --test-dir build/libgnn/test --verbose # this command is slow since hooks are not stored in the container image # this is mostly for CI use @@ -125,4 +124,4 @@ docker-pre-commit: @docker --context ${CONTAINER_CONTEXT} run --rm \ -v ${SRC_DIR}/:${CONTAINER_SRC_DIR} --privileged \ --workdir=${CONTAINER_WORKDIR} -t \ - ${IMAGE_NAME}:${VERSION} bash -lc "git config --global --add safe.directory /galois && make hooks && make pre-commit" + ${IMAGE_NAME}:${VERSION} bash -lc "git config --global --add safe.directory /pando-galois && make hooks && make pre-commit" diff --git a/inputs/cora/cora-dims.txt b/inputs/cora/cora-dims.txt deleted file mode 100644 index a92cf3378c..0000000000 --- a/inputs/cora/cora-dims.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbb10c2013c41f9395f2ed0bac8c17bbd5e6114c0fc22737d3e5e757f37ad579 -size 10 diff --git a/inputs/cora/cora-feat.bin b/inputs/cora/cora-feat.bin deleted file mode 100644 index ec044f57ce..0000000000 --- a/inputs/cora/cora-feat.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:718d06f9d0ee6f7568d9fa9c67c53cc206cdb594fa7ef857295604dd97ea0948 -size 15522256 diff --git a/inputs/cora/cora-feats.bin b/inputs/cora/cora-feats.bin deleted file mode 100644 index ec044f57ce..0000000000 --- a/inputs/cora/cora-feats.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:718d06f9d0ee6f7568d9fa9c67c53cc206cdb594fa7ef857295604dd97ea0948 -size 15522256 diff --git a/inputs/cora/cora-labels.txt b/inputs/cora/cora-labels.txt deleted file mode 100644 index c7b71c890b..0000000000 --- a/inputs/cora/cora-labels.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5a9a43663c60084738f6f42f625c7bed529b2e87bb5ba37851b9bdca0d401845 -size 37919 diff --git a/inputs/cora/cora-test_mask.txt b/inputs/cora/cora-test_mask.txt deleted file mode 100644 index 21b79a3e9c..0000000000 --- a/inputs/cora/cora-test_mask.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41ac837719e878b0b55edb8ac57f68fc875197505ded161d27ed2da70015be69 -size 5426 diff --git a/inputs/cora/cora-train_mask.txt b/inputs/cora/cora-train_mask.txt deleted file mode 100644 index 2197485a30..0000000000 --- a/inputs/cora/cora-train_mask.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:30746c81e77730da65200f597f5db42e3234e1e0c36ae19a327c0172aba9cb2a -size 5422 diff --git a/inputs/cora/cora-val_mask.txt b/inputs/cora/cora-val_mask.txt deleted file mode 100644 index c858137960..0000000000 --- a/inputs/cora/cora-val_mask.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c396d702e58eac6309fdd73f222ae4881c0572e80eed760979096bf44d2ea31b -size 5424 diff --git a/inputs/cora/cora.csgr b/inputs/cora/cora.csgr deleted file mode 100644 index 9619c232cc..0000000000 --- a/inputs/cora/cora.csgr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a1e691f65460fab765fea2e679e0ac345aaaa9139e9c8d3f2fb78c7fd8f12fd -size 63920 diff --git a/inputs/cora/cora.el b/inputs/cora/cora.el deleted file mode 100644 index b64d9fa9c0..0000000000 --- a/inputs/cora/cora.el +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1555fbbb3226bf7f23c25a4b797ffc1bc2be9377f400badcb4ec4f0db6cb985 -size 48447 diff --git a/inputs/cora/cora.features b/inputs/cora/cora.features deleted file mode 100644 index c13b57d217..0000000000 --- a/inputs/cora/cora.features +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ddbf810e46d3d34b899ecf242e8a6e51f5b3490edb46dc134fbd00db20f54f2 -size 15534686 diff --git a/inputs/cora/cora.ft b/inputs/cora/cora.ft deleted file mode 100644 index b07aebda57..0000000000 --- a/inputs/cora/cora.ft +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7f75a72d201d81ae8c2570b13518f2671f664829e4220ba98ce9207c88bf3d78 -size 881186 diff --git a/inputs/cora/cora.gr b/inputs/cora/cora.gr deleted file mode 100644 index 6d23c326de..0000000000 --- a/inputs/cora/cora.gr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9385f97e6df599f6a0799cbfb51fa4a66d8f3fa7be5bf74cb41ada9195ff3820 -size 42808 diff --git a/inputs/cora/cora.sgr b/inputs/cora/cora.sgr deleted file mode 100644 index 5e1ae9b299..0000000000 --- a/inputs/cora/cora.sgr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:09ff43f169d8225dc11cf3bfbea022045dde1628444282fc39f95780a24cfad3 -size 63920 diff --git a/inputs/cora/cora_edgelist.txt b/inputs/cora/cora_edgelist.txt deleted file mode 100644 index d256d6c72e..0000000000 --- a/inputs/cora/cora_edgelist.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c41cf0e8321332492dd345ba54bee94817f217c19ca90a697050700235b12999 -size 99636 diff --git a/inputs/cora/cora_full.npz b/inputs/cora/cora_full.npz deleted file mode 100644 index 3a5cd5d7f7..0000000000 --- a/inputs/cora/cora_full.npz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4e0516cf23ec24eca1ecc57e627414350219fa94337b5b2e232ab58acaf2df7 -size 11159872 diff --git a/inputs/cora/cora_labels.txt b/inputs/cora/cora_labels.txt deleted file mode 100644 index 2d796ac922..0000000000 --- a/inputs/cora/cora_labels.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f6abf39402ba4af3b629d7da7504788d4dec289ef15aac2cb393d499e0e907f5 -size 17846 diff --git a/inputs/tester/tester-dims.txt b/inputs/tester/tester-dims.txt deleted file mode 100644 index 6efce4258e..0000000000 --- a/inputs/tester/tester-dims.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82001c16a68129ec5cc4b6872b731382b3fca6743cb12e347c4abc53461c01d4 -size 4 diff --git a/inputs/tester/tester-feats.bin b/inputs/tester/tester-feats.bin deleted file mode 100644 index 40f1f29599..0000000000 --- a/inputs/tester/tester-feats.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dfe39ec72535e9a520bb9c45eb67a02f36dc69f0bfb0fc0897dfecf82c4ac407 -size 84 diff --git a/inputs/tester/tester-labels.txt b/inputs/tester/tester-labels.txt deleted file mode 100644 index a426b05466..0000000000 --- a/inputs/tester/tester-labels.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48f6c88b057415789f68575575b9dd4aa4ea2312f9abf225ca054b8bcf41c500 -size 102 diff --git a/inputs/tester/tester-mlabels.txt b/inputs/tester/tester-mlabels.txt deleted file mode 100644 index 5b1990880f..0000000000 --- a/inputs/tester/tester-mlabels.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e5805372e013db8dacec5484204e0869b7a0863251182ce454b3a4976717475a -size 102 diff --git a/inputs/tester/tester-test-feats.bin b/inputs/tester/tester-test-feats.bin deleted file mode 100644 index 9295ab95a4..0000000000 --- a/inputs/tester/tester-test-feats.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6acb4190d3968d32e91de159dc392aaf7ca0e2fd0bef7e356cab1b2091f17f2e -size 84 diff --git a/inputs/tester/tester-test-labels-dims.txt b/inputs/tester/tester-test-labels-dims.txt deleted file mode 100644 index a426b05466..0000000000 --- a/inputs/tester/tester-test-labels-dims.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48f6c88b057415789f68575575b9dd4aa4ea2312f9abf225ca054b8bcf41c500 -size 102 diff --git a/inputs/tester/tester-test-labels.bin b/inputs/tester/tester-test-labels.bin deleted file mode 100644 index 7f33ed88cd..0000000000 --- a/inputs/tester/tester-test-labels.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fa1cb0d91b12f9dbf6f71942de069ab32da656af609d66c43176d91f1f69b9db -size 7 diff --git a/inputs/tester/tester-test-mapping.bin b/inputs/tester/tester-test-mapping.bin deleted file mode 100644 index 088fd99b84..0000000000 --- a/inputs/tester/tester-test-mapping.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82139343869744ad102ef59bc54c18f2d02dadbf5009cb96fcb9dc354247917e -size 28 diff --git a/inputs/tester/tester-test_mask.txt b/inputs/tester/tester-test_mask.txt deleted file mode 100644 index de6a786db0..0000000000 --- a/inputs/tester/tester-test_mask.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a7b2807f11023bbbe72e2931922888938d08b32be2b1c39e8f4da05220b90b3 -size 18 diff --git a/inputs/tester/tester-train_mask.txt b/inputs/tester/tester-train_mask.txt deleted file mode 100644 index a7ef547705..0000000000 --- a/inputs/tester/tester-train_mask.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b09f398f55218d9db8e9fbbaf8ecdcd568fd490febac1d88054142c98df40c48 -size 18 diff --git a/inputs/tester/tester-val_mask.txt b/inputs/tester/tester-val_mask.txt deleted file mode 100644 index 3d120ebe70..0000000000 --- a/inputs/tester/tester-val_mask.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:77c1800ef77bc11ca9ee04a7dea03884d818b76a449b4b93712e0ff0ec2d45c7 -size 18 diff --git a/inputs/tester/tester.csgr b/inputs/tester/tester.csgr deleted file mode 100644 index 11776ac3b4..0000000000 --- a/inputs/tester/tester.csgr +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4e0bcbe036176c15f61d673c8a1acfb0dd8970fd56c68ad9f345f331297156d -size 136 diff --git a/inputs/tester/tester.el b/inputs/tester/tester.el deleted file mode 100644 index 3fad0f3a3e..0000000000 --- a/inputs/tester/tester.el +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f46e73a8c721cef981bb7ea0595da475203f674fb1da841d2d9cfc3900e7dd11 -size 48 diff --git a/libcusp/test/shad-dist-graph.cpp b/libcusp/test/shad-dist-graph.cpp index 42e4fc6645..492bfeb2ad 100644 --- a/libcusp/test/shad-dist-graph.cpp +++ b/libcusp/test/shad-dist-graph.cpp @@ -53,10 +53,13 @@ int main() { sumGlobalNodes += graph->numMasters(); sumGlobalEdges += graph->sizeEdges(); - assert(sumGlobalNodes.reduce() == numNodes); - assert(sumGlobalNodes.reduce() == graph->globalSize()); - assert(sumGlobalEdges.reduce() == numEdges); - assert(sumGlobalEdges.reduce() == graph->globalSizeEdges()); + uint64_t reducedSumGlobalNodes = sumGlobalNodes.reduce(); + uint64_t reducedSumGlobalEdges = sumGlobalEdges.reduce(); + + assert(reducedSumGlobalNodes == numNodes); + assert(reducedSumGlobalNodes == graph->globalSize()); + assert(reducedSumGlobalEdges == numEdges); + assert(reducedSumGlobalEdges == graph->globalSizeEdges()); std::cout << "Num. nodes/edges tests has been passed\n"; diff --git a/libgnn/include/galois/graphs/GNNGraph.h b/libgnn/include/galois/graphs/GNNGraph.h index e8a28f8429..525df23a1e 100644 --- a/libgnn/include/galois/graphs/GNNGraph.h +++ b/libgnn/include/galois/graphs/GNNGraph.h @@ -24,8 +24,7 @@ namespace galois { // TODO remove the need to hardcode this path //! Path to location of all gnn files static const std::string default_gnn_dataset_path = - //"/net/ohm/export/iss/inputs/Learning/"; - " nope"; + "/home/hochan/inputs/Learning/"; //! Helper struct to maintain start/end/size of any particular range. Mostly //! used for mask ranges. @@ -71,9 +70,6 @@ class GNNGraph { std::string("[") + std::to_string(galois::runtime::getSystemNetworkInterface().ID) + std::string("] "); - - std::cout << "input directory:" << input_directory_ << ", " - << " data set name:" << dataset_name << "\n"; // load partition partitioned_graph_ = LoadPartition(input_directory_, dataset_name, partition_scheme); @@ -1661,15 +1657,6 @@ class GNNGraph { } GALOIS_LOG_VERBOSE("Partition loading: File to read is {}", input_file); - std::cout << "input file:" << input_file << "\n"; - if (FILE* fp = fopen(input_file.c_str(), "r")) { - std::cout << "succeeded to read the input file:" << input_file << "\n" - << std::flush; - fclose(fp); - } else { - std::cout << "failed to read the input file:" << input_file << "\n" - << std::flush; - } // load partition switch (partition_scheme) { case galois::graphs::GNNPartitionScheme::kOEC: @@ -2411,6 +2398,23 @@ class GNNGraph { num_correct_.reset(); total_checked_.reset(); +#if 0 + std::cout << "single accuracy print:\n"; + for (int i = *begin_owned(); i < *end_owned(); ++i) { + if (!IsValidForPhase(i, GNNPhase::kBatch)) { + continue; + } + //std::cout << subgraph_->SIDToLID(i) << ", " << galois::MaxIndex(num_label_classes_, &predictions[i * num_label_classes_]) << + std::cout << "accuracy:" << subgraph_->SIDToLID(i) << ", " << + predictions[i * num_label_classes_] << ", " << + predictions[i * num_label_classes_ + 1] << ", " << + predictions[i * num_label_classes_ + 2] << ", " << + predictions[i * num_label_classes_ + 3] << ", " << + predictions[i * num_label_classes_ + 4] << "-> " << + galois::MaxIndex(num_label_classes_, &predictions[i * num_label_classes_]) << + " vs " << GetSingleClassLabel(i) << "\n"; + } +#endif galois::do_all( // will only loop over sampled nodes if sampling is on galois::iterate(begin_owned(), end_owned()), diff --git a/libgnn/test/CMakeLists.txt b/libgnn/test/CMakeLists.txt index acc04cbb66..40efcfa0e3 100644 --- a/libgnn/test/CMakeLists.txt +++ b/libgnn/test/CMakeLists.txt @@ -1,11 +1,7 @@ find_package(OpenMP) -set(TESTINPUT "${Galois_SOURCE_DIR}/inputs") -add_definitions("-DTESTER_DIR=\"${TESTINPUT}/tester/\"") -add_definitions("-DCORA_DIR=\"${TESTINPUT}/cora/\"") - set(hosts) -set(host 6) +set(host 12) while (${host} GREATER 1) list(APPEND hosts ${host}) math(EXPR host "${host} - 1") @@ -21,7 +17,7 @@ if (NOT GALOIS_ENABLE_GPU) ${GALOIS_TESTS} convlayer-test sage-layer-test - # l2norm-layer-test TODO(hc): L2Norm is not maintained + l2norm-layer-test softmaxlayer-test sigmoidlayer-test gnnconstruct-test @@ -31,7 +27,7 @@ if (NOT GALOIS_ENABLE_GPU) epoch-test multilabel-epoch-test multilabel-read - # f1-test TODO(hc): it is a multilable test and will be fixed later + f1-test sample-bit-test gcn-sample-edge-test ) diff --git a/libgnn/test/accuracy-test.cpp b/libgnn/test/accuracy-test.cpp index ae6b201d89..f2d34c0403 100644 --- a/libgnn/test/accuracy-test.cpp +++ b/libgnn/test/accuracy-test.cpp @@ -14,8 +14,7 @@ int main() { // load test graph auto test_graph = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); std::vector layer_types = { galois::GNNLayerType::kGraphConvolutional}; @@ -35,22 +34,23 @@ int main() { ////////////////////////////////////////////////////////////////////////////// galois::PointerWithSize distributions = gnn->DoInference(); - + // accuracy will be 0.2: everything chooses the first 1 as the entire row + // is the same float pred_accuracy = gnn->GetGlobalAccuracy(distributions); GALOIS_LOG_VERBOSE("{}", pred_accuracy); - GALOIS_LOG_ASSERT(static_cast(pred_accuracy * 1000) == 333); + GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0.2)); // validation mode gnn->SetLayerPhases(galois::GNNPhase::kValidate); galois::PointerWithSize dist2 = gnn->DoInference(); pred_accuracy = gnn->GetGlobalAccuracy(dist2); - GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0)); + GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0.0)); // test mode gnn->SetLayerPhases(galois::GNNPhase::kTest); galois::PointerWithSize dist3 = gnn->DoInference(); pred_accuracy = gnn->GetGlobalAccuracy(dist3); - GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0)); + GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0.0)); // manufactured predictions to make sure it predicts things correctly based // on mode @@ -62,11 +62,11 @@ int main() { gnn->SetLayerPhases(galois::GNNPhase::kTrain); pred_accuracy = gnn->GetGlobalAccuracy(mpred); GALOIS_LOG_VERBOSE("{}", pred_accuracy); - GALOIS_LOG_ASSERT(static_cast(pred_accuracy * 1000) == 666); + GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0.8)); gnn->SetLayerPhases(galois::GNNPhase::kValidate); pred_accuracy = gnn->GetGlobalAccuracy(mpred); - GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0.5)); + GALOIS_LOG_ASSERT(pred_accuracy == static_cast(0.0)); gnn->SetLayerPhases(galois::GNNPhase::kTest); pred_accuracy = gnn->GetGlobalAccuracy(mpred); diff --git a/libgnn/test/aggregate-sync-test.cpp b/libgnn/test/aggregate-sync-test.cpp index 19ff3e993e..549e6c7c53 100644 --- a/libgnn/test/aggregate-sync-test.cpp +++ b/libgnn/test/aggregate-sync-test.cpp @@ -10,8 +10,7 @@ int main() { } auto test_graph = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); // print edges for sanity for (size_t node = 0; node < test_graph->size(); node++) { @@ -208,8 +207,7 @@ int main() { } ////////////////////////////////////////////////////////////////////////////// auto test_graph_2 = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kCVC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kCVC, true, false); // print edges for sanity for (size_t node = 0; node < test_graph_2->size(); node++) { for (auto e = test_graph_2->edge_begin(node); diff --git a/libgnn/test/back-conv-test.cpp b/libgnn/test/back-conv-test.cpp index 2cb348658b..df3dfe915e 100644 --- a/libgnn/test/back-conv-test.cpp +++ b/libgnn/test/back-conv-test.cpp @@ -12,8 +12,7 @@ int main() { num_threads); // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kCVC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kCVC, true, false); galois::PointerWithSize feats = test_graph.GetLocalFeatures(); for (size_t row = 0; row < test_graph.size(); row++) { diff --git a/libgnn/test/convlayer-test.cpp b/libgnn/test/convlayer-test.cpp index cb485112ac..6170e87d50 100644 --- a/libgnn/test/convlayer-test.cpp +++ b/libgnn/test/convlayer-test.cpp @@ -15,8 +15,7 @@ int main() { num_threads); // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); galois::PointerWithSize feats = test_graph.GetLocalFeatures(); diff --git a/libgnn/test/epoch-test.cpp b/libgnn/test/epoch-test.cpp index 68edfa4a18..c0b4ede716 100644 --- a/libgnn/test/epoch-test.cpp +++ b/libgnn/test/epoch-test.cpp @@ -14,7 +14,7 @@ int main() { // load graph auto test_graph = std::make_unique>( - CORA_DIR, "cora", galois::graphs::GNNPartitionScheme::kCVC, true, false); + "cora", galois::graphs::GNNPartitionScheme::kCVC, true, false); std::vector layer_types = { galois::GNNLayerType::kGraphConvolutional, diff --git a/libgnn/test/f1-test.cpp b/libgnn/test/f1-test.cpp index d284464047..363c12861b 100644 --- a/libgnn/test/f1-test.cpp +++ b/libgnn/test/f1-test.cpp @@ -9,8 +9,7 @@ int main() { // load test graph; false at end = multilabel galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, false, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, false, false); // perfect precision and recall std::vector prediction = { diff --git a/libgnn/test/gcn-sample-edge-test.cpp b/libgnn/test/gcn-sample-edge-test.cpp index f04b8fb7d4..c612639d10 100644 --- a/libgnn/test/gcn-sample-edge-test.cpp +++ b/libgnn/test/gcn-sample-edge-test.cpp @@ -29,17 +29,16 @@ int main() { galois::DistMemSys G; + size_t num_threads = 1; // tester graph: 0 - 1 - 2 - 3 - 4 - 5 - 6 galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); test_graph.InitializeSamplingData(); galois::GNNLayerConfig dcon; dcon.disable_aggregate_after_update = false; dcon.disable_normalization = false; dcon.DebugConfig(); - // Choose a few sample nodes test_graph.SetSampledNode(0); test_graph.SetSampledNode(4); @@ -89,7 +88,6 @@ int main() { layer_1->InitAllWeightsTo1(); layer_1->EnableSampling(); - layer_1->SetGraphUserLayerNumber(0); galois::PointerWithSize features = test_graph.GetLocalFeatures(); @@ -123,9 +121,9 @@ int main() { GALOIS_LOG_ASSERT(layer_1_backward_output[3] == 2); GALOIS_LOG_ASSERT(layer_1_backward_output[4] == 2); GALOIS_LOG_ASSERT(layer_1_backward_output[5] == 2); - GALOIS_LOG_ASSERT(layer_1_backward_output[6] == 2); - GALOIS_LOG_ASSERT(layer_1_backward_output[7] == 2); - GALOIS_LOG_ASSERT(layer_1_backward_output[8] == 2); + GALOIS_LOG_ASSERT(layer_1_backward_output[6] == 0); + GALOIS_LOG_ASSERT(layer_1_backward_output[7] == 0); + GALOIS_LOG_ASSERT(layer_1_backward_output[8] == 0); GALOIS_LOG_ASSERT(layer_1_backward_output[9] == 0); GALOIS_LOG_ASSERT(layer_1_backward_output[10] == 0); GALOIS_LOG_ASSERT(layer_1_backward_output[11] == 0); @@ -136,12 +134,12 @@ int main() { galois::PointerWithSize layer_1_weight_gradients = layer_1->GetLayerWeightGradients(); - GALOIS_LOG_ASSERT(layer_1_weight_gradients[0] == 9); - GALOIS_LOG_ASSERT(layer_1_weight_gradients[1] == 9); - GALOIS_LOG_ASSERT(layer_1_weight_gradients[2] == 9); - GALOIS_LOG_ASSERT(layer_1_weight_gradients[3] == 9); - GALOIS_LOG_ASSERT(layer_1_weight_gradients[4] == 9); - GALOIS_LOG_ASSERT(layer_1_weight_gradients[5] == 9); + GALOIS_LOG_ASSERT(layer_1_weight_gradients[0] == 6); + GALOIS_LOG_ASSERT(layer_1_weight_gradients[1] == 6); + GALOIS_LOG_ASSERT(layer_1_weight_gradients[2] == 6); + GALOIS_LOG_ASSERT(layer_1_weight_gradients[3] == 6); + GALOIS_LOG_ASSERT(layer_1_weight_gradients[4] == 6); + GALOIS_LOG_ASSERT(layer_1_weight_gradients[5] == 6); return 0; } diff --git a/libgnn/test/gnnconstruct-test.cpp b/libgnn/test/gnnconstruct-test.cpp index 59c07ee286..aa1513ca91 100644 --- a/libgnn/test/gnnconstruct-test.cpp +++ b/libgnn/test/gnnconstruct-test.cpp @@ -15,8 +15,7 @@ int main() { num_threads); // load test graph auto test_graph = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); // 2 layer test with softmax std::vector layer_types = { diff --git a/libgnn/test/gnnfb-test.cpp b/libgnn/test/gnnfb-test.cpp index b9b57ede70..eb74ffb78a 100644 --- a/libgnn/test/gnnfb-test.cpp +++ b/libgnn/test/gnnfb-test.cpp @@ -15,8 +15,7 @@ int main() { num_threads); // load test graph auto test_graph = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); // 2 layer test with softmax std::vector layer_types = { @@ -115,7 +114,7 @@ int main() { // train mode = last 2 should be masked off for (size_t c = 35; c < 49; c += 7) { for (size_t i = 0; i < 6; i++) { - GALOIS_LOG_ASSERT(static_cast(fo_out[c + i] * 1000) == 142); + GALOIS_LOG_ASSERT(fo_out[c + i] == 0); } } @@ -141,12 +140,12 @@ int main() { // first 5 and last should be 0s for (size_t c = 0; c < 35; c += 7) { for (size_t i = 0; i < 6; i++) { - GALOIS_LOG_ASSERT(static_cast(fo_out_val[c + i] * 1000) == 142); + GALOIS_LOG_ASSERT(fo_out_val[c + i] == 0); } } for (size_t c = 42; c < 49; c += 7) { for (size_t i = 0; i < 6; i++) { - GALOIS_LOG_ASSERT(static_cast(fo_out_val[c + i] * 1000) == 142); + GALOIS_LOG_ASSERT(fo_out_val[c + i] == 0); } } @@ -162,7 +161,7 @@ int main() { // first 5 and last should be 0s for (size_t c = 0; c < 42; c += 7) { for (size_t i = 0; i < 6; i++) { - GALOIS_LOG_ASSERT(static_cast(fo_out_test[c + i] * 1000) == 142); + GALOIS_LOG_ASSERT(fo_out_test[c + i] == 0); } } @@ -173,8 +172,7 @@ int main() { GALOIS_LOG_VERBOSE("Running with different congifuration"); test_graph = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); galois::GraphNeuralNetworkConfig gnn_config2( 2, layer_types, layer_output_sizes, galois::GNNOutputLayerType::kSoftmax, dcon); diff --git a/libgnn/test/gnngraph-test.cpp b/libgnn/test/gnngraph-test.cpp index 0fdf7c05c0..b8a05fc8cc 100644 --- a/libgnn/test/gnngraph-test.cpp +++ b/libgnn/test/gnngraph-test.cpp @@ -17,10 +17,10 @@ int main() { // note multi level reading tested in another test GALOIS_LOG_VERBOSE("reddit with single label, oec"); galois::graphs::GNNGraph( - CORA_DIR, "cora", galois::graphs::GNNPartitionScheme::kOEC, true, false); + "cora", galois::graphs::GNNPartitionScheme::kOEC, true, false); GALOIS_LOG_VERBOSE("reddit with single label, cvc"); galois::graphs::GNNGraph( - CORA_DIR, "cora", galois::graphs::GNNPartitionScheme::kCVC, true, false); + "cora", galois::graphs::GNNPartitionScheme::kCVC, true, false); // below for when I want to check the remapper // galois::graphs::GNNGraph remapper("ogbn-papers100M", diff --git a/libgnn/test/l2norm-layer-test.cpp b/libgnn/test/l2norm-layer-test.cpp index 9e291ef1ef..d2b659f238 100644 --- a/libgnn/test/l2norm-layer-test.cpp +++ b/libgnn/test/l2norm-layer-test.cpp @@ -11,8 +11,7 @@ int main() { // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); // input/output columns must be same in softmax galois::GNNLayerDimensions dimension_0; diff --git a/libgnn/test/multilabel-epoch-test.cpp b/libgnn/test/multilabel-epoch-test.cpp index 625ebe5100..b0a2430bd1 100644 --- a/libgnn/test/multilabel-epoch-test.cpp +++ b/libgnn/test/multilabel-epoch-test.cpp @@ -14,8 +14,7 @@ int main() { // load graph auto test_graph = std::make_unique>( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, false, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, false, false); std::vector layer_types = { galois::GNNLayerType::kGraphConvolutional, diff --git a/libgnn/test/multilabel-read.cpp b/libgnn/test/multilabel-read.cpp index 2e846b5aca..56b8b42071 100644 --- a/libgnn/test/multilabel-read.cpp +++ b/libgnn/test/multilabel-read.cpp @@ -9,8 +9,7 @@ int main() { // load test graph; false at end = multilabel galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, false, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, false, false); const galois::GNNLabel* labels = test_graph.GetMultiClassLabel(0); unsigned i = 0; diff --git a/libgnn/test/sage-layer-test.cpp b/libgnn/test/sage-layer-test.cpp index e0bc766465..3f53921795 100644 --- a/libgnn/test/sage-layer-test.cpp +++ b/libgnn/test/sage-layer-test.cpp @@ -15,8 +15,7 @@ int main() { num_threads); // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); galois::GNNLayerDimensions dimension_0; dimension_0.input_rows = 7; diff --git a/libgnn/test/sample-bit-test.cpp b/libgnn/test/sample-bit-test.cpp index cd08eab7ac..b53860d950 100644 --- a/libgnn/test/sample-bit-test.cpp +++ b/libgnn/test/sample-bit-test.cpp @@ -14,8 +14,7 @@ int main() { num_threads); galois::graphs::GNNGraph graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); graph.InitializeSamplingData(3, false); // first, assert all edges are not sampled (should come with all 0s) diff --git a/libgnn/test/sample-test.cpp b/libgnn/test/sample-test.cpp index 6f8060051c..d875a72ee4 100644 --- a/libgnn/test/sample-test.cpp +++ b/libgnn/test/sample-test.cpp @@ -34,8 +34,7 @@ int main() { num_threads); // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); galois::GNNLayerDimensions dimension_0; dimension_0.input_rows = 7; @@ -204,8 +203,7 @@ int main() { // sigmoid ////////////////////////////////////////////////////////////////////////////// galois::graphs::GNNGraph multi_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, false, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, false, false); auto sigmoid_layer = std::make_unique>( 3, multi_graph, &p_back_2, dimension_out); diff --git a/libgnn/test/sigmoidlayer-test.cpp b/libgnn/test/sigmoidlayer-test.cpp index fd24b49823..9fd861deff 100644 --- a/libgnn/test/sigmoidlayer-test.cpp +++ b/libgnn/test/sigmoidlayer-test.cpp @@ -16,8 +16,7 @@ int main() { // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, false, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, false, false); // input/output columns must be same in softmax galois::GNNLayerDimensions dimension_0; diff --git a/libgnn/test/softmaxlayer-test.cpp b/libgnn/test/softmaxlayer-test.cpp index 97a3220ba3..1ca2740729 100644 --- a/libgnn/test/softmaxlayer-test.cpp +++ b/libgnn/test/softmaxlayer-test.cpp @@ -18,8 +18,7 @@ int main() { // load test graph galois::graphs::GNNGraph test_graph( - TESTER_DIR, "tester", galois::graphs::GNNPartitionScheme::kOEC, true, - false); + "tester", galois::graphs::GNNPartitionScheme::kOEC, true, false); // input/output columns must be same in softmax galois::GNNLayerDimensions dimension_0; @@ -54,6 +53,16 @@ int main() { GALOIS_LOG_ASSERT(galois::MaxIndex(7, &(prediction_distribution[i * 7])) == i); } + // train mode means last 2 vertices should be empty + for (size_t i = 5; i < 7; i++) { + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 0] == 0.0); + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 1] == 0.0); + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 2] == 0.0); + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 3] == 0.0); + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 4] == 0.0); + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 5] == 0.0); + GALOIS_LOG_ASSERT(prediction_distribution[i * 7 + 6] == 0.0); + } // NOTE: checked before backward because backward overwrites this matrix @@ -71,6 +80,24 @@ int main() { // validate vertex is index 5 GALOIS_LOG_ASSERT(galois::MaxIndex(7, &(pd2[5 * 7])) == 5); + for (size_t i = 0; i < 5; i++) { + GALOIS_LOG_ASSERT(pd2[i * 7 + 0] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 1] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 2] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 3] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 4] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 5] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 6] == 0.0); + } + for (size_t i = 6; i < 7; i++) { + GALOIS_LOG_ASSERT(pd2[i * 7 + 0] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 1] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 2] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 3] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 4] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 5] == 0.0); + GALOIS_LOG_ASSERT(pd2[i * 7 + 6] == 0.0); + } asdf = output_layer->BackwardPhase(softmax_input, nullptr); printf("Output 2\n========\n"); @@ -84,6 +111,16 @@ int main() { output_layer->ForwardPhase(softmax_input); // validate vertex is index 6 GALOIS_LOG_ASSERT(galois::MaxIndex(7, &(pd3[6 * 7])) == 6); + // all but last are empty distributions + for (size_t i = 0; i < 6; i++) { + GALOIS_LOG_ASSERT(pd3[i * 7 + 0] == 0.0); + GALOIS_LOG_ASSERT(pd3[i * 7 + 1] == 0.0); + GALOIS_LOG_ASSERT(pd3[i * 7 + 2] == 0.0); + GALOIS_LOG_ASSERT(pd3[i * 7 + 3] == 0.0); + GALOIS_LOG_ASSERT(pd3[i * 7 + 4] == 0.0); + GALOIS_LOG_ASSERT(pd3[i * 7 + 5] == 0.0); + GALOIS_LOG_ASSERT(pd3[i * 7 + 6] == 0.0); + } asdf = output_layer->BackwardPhase(softmax_input, nullptr); printf("Output 3\n========\n"); diff --git a/libgpu/include/csr_graph.h b/libgpu/include/csr_graph.h index e08b425cb0..7fff0750e4 100644 --- a/libgpu/include/csr_graph.h +++ b/libgpu/include/csr_graph.h @@ -15,7 +15,7 @@ #define LSG_CSR_GRAPH // TODO: original branch has this include; revert it back eventually -// #include "graph_gpu.h" +//#include "graph_gpu.h" #include #include "checker.h" diff --git a/libgpu/include/graph_gpu.h b/libgpu/include/graph_gpu.h index 24ca4a353d..d208a3328c 100644 --- a/libgpu/include/graph_gpu.h +++ b/libgpu/include/graph_gpu.h @@ -48,9 +48,13 @@ struct CSRGraph { unsigned deallocOnDevice(); void dealloc(); - CUDA_HOSTDEV bool valid_node(index_type node) { return (node < nnodes); } + CUDA_HOSTDEV bool valid_node(index_type node) { + return (node < nnodes); + } - CUDA_HOSTDEV bool valid_edge(index_type edge) { return (edge < nedges); } + CUDA_HOSTDEV bool valid_edge(index_type edge) { + return (edge < nedges); + } CUDA_HOSTDEV index_type getOutDegree(unsigned src) { assert(src < nnodes); @@ -94,114 +98,101 @@ struct CSRGraph { return edge_data[abs_edge]; }; - void print_neighbors(index_type vid) { - printf("Vertex %d neighbors: [ ", vid); - index_type start = row_start[vid]; - index_type end = row_start[vid + 1]; - for (index_type e = start; e != end; e++) { - index_type dst = edge_dst[e]; - printf("%d ", dst); - } - printf("]\n"); - } - void add_selfloop() { - // print_neighbors(nnodes-1); - // print_neighbors(0); - index_type* new_edge_dst = new index_type[nnodes + nedges]; - for (index_type i = 0; i < nnodes; i++) { - index_type start = row_start[i]; - index_type end = row_start[i + 1]; - bool selfloop_inserted = false; - if (start == end) { - new_edge_dst[start + i] = i; - continue; - } - for (index_type e = start; e != end; e++) { - index_type dst = edge_dst[e]; - if (!selfloop_inserted) { - if (i < dst) { - selfloop_inserted = true; - new_edge_dst[e + i] = i; - new_edge_dst[e + i + 1] = dst; - } else if (e + 1 == end) { - selfloop_inserted = true; - new_edge_dst[e + i + 1] = i; - new_edge_dst[e + i] = dst; - } else - new_edge_dst[e + i] = dst; - } else - new_edge_dst[e + i + 1] = dst; - } - } - for (index_type i = 0; i <= nnodes; i++) - row_start[i] += i; - delete edge_dst; - edge_dst = new_edge_dst; - nedges += nnodes; + void print_neighbors(index_type vid) { + printf("Vertex %d neighbors: [ ", vid); + index_type start = row_start[vid]; + index_type end = row_start[vid+1]; + for (index_type e = start; e != end; e++) { + index_type dst = edge_dst[e]; + printf("%d ", dst); + } + printf("]\n"); + } + void add_selfloop() { + //print_neighbors(nnodes-1); + //print_neighbors(0); + index_type *new_edge_dst = new index_type[nnodes+nedges]; + for (index_type i = 0; i < nnodes; i++) { + index_type start = row_start[i]; + index_type end = row_start[i+1]; + bool selfloop_inserted = false; + if (start == end) { + new_edge_dst[start+i] = i; + continue; + } + for (index_type e = start; e != end; e++) { + index_type dst = edge_dst[e]; + if (!selfloop_inserted) { + if (i < dst) { + selfloop_inserted = true; + new_edge_dst[e+i] = i; + new_edge_dst[e+i+1] = dst; + } else if (e+1 == end) { + selfloop_inserted = true; + new_edge_dst[e+i+1] = i; + new_edge_dst[e+i] = dst; + } else new_edge_dst[e+i] = dst; + } else new_edge_dst[e+i+1] = dst; + } + } + for (index_type i = 0; i <= nnodes; i++) row_start[i] += i; + delete edge_dst; + edge_dst = new_edge_dst; + nedges += nnodes; printf("nnodes = %d, nedges = %d\n", nnodes, nedges); - // print_neighbors(nnodes-1); - // print_neighbors(0); - } - - CUDA_HOSTDEV index_type getEdgeDst(unsigned edge) { - assert(edge < nedges); - return edge_dst[edge]; - }; - CUDA_HOSTDEV node_data_type getData(unsigned vid) { return node_data[vid]; } - CUDA_HOSTDEV index_type edge_begin(unsigned src) { - assert(src <= nnodes); - return row_start[src]; - }; - CUDA_HOSTDEV index_type edge_end(unsigned src) { - assert(src <= nnodes); - return row_start[src + 1]; - }; - CUDA_HOSTDEV index_type* row_start_host_ptr() { return row_start; } - CUDA_HOSTDEV index_type* row_start_ptr() { return row_start; } - CUDA_HOSTDEV const index_type* row_start_ptr() const { return row_start; } - CUDA_HOSTDEV index_type* edge_dst_ptr() { return edge_dst; } - CUDA_HOSTDEV const index_type* edge_dst_ptr() const { return edge_dst; } - CUDA_HOSTDEV node_data_type* node_data_ptr() { return node_data; } - CUDA_HOSTDEV const node_data_type* node_data_ptr() const { return node_data; } - CUDA_HOSTDEV edge_data_type* edge_data_ptr() { return edge_data; } - CUDA_HOSTDEV const edge_data_type* edge_data_ptr() const { return edge_data; } - CUDA_HOSTDEV void fixEndEdge(index_type vid, index_type row_end) { - row_start[vid + 1] = row_end; - } - CUDA_HOSTDEV void constructEdge(index_type eid, index_type dst, - edge_data_type edata = 0) { + //print_neighbors(nnodes-1); + //print_neighbors(0); + } + + CUDA_HOSTDEV index_type getEdgeDst(unsigned edge) { + assert(edge < nedges); + return edge_dst[edge]; + }; + CUDA_HOSTDEV node_data_type getData(unsigned vid) { + return node_data[vid]; + } + CUDA_HOSTDEV index_type edge_begin(unsigned src) { + assert(src <= nnodes); + return row_start[src]; + }; + CUDA_HOSTDEV index_type edge_end(unsigned src) { + assert(src <= nnodes); + return row_start[src+1]; + }; + CUDA_HOSTDEV index_type *row_start_host_ptr() { return row_start; } + CUDA_HOSTDEV index_type *row_start_ptr() { return row_start; } + CUDA_HOSTDEV const index_type *row_start_ptr() const { return row_start; } + CUDA_HOSTDEV index_type *edge_dst_ptr() { return edge_dst; } + CUDA_HOSTDEV const index_type *edge_dst_ptr() const { return edge_dst; } + CUDA_HOSTDEV node_data_type *node_data_ptr() { return node_data; } + CUDA_HOSTDEV const node_data_type *node_data_ptr() const { return node_data; } + CUDA_HOSTDEV edge_data_type *edge_data_ptr() { return edge_data; } + CUDA_HOSTDEV const edge_data_type *edge_data_ptr() const { return edge_data; } + CUDA_HOSTDEV void fixEndEdge(index_type vid, index_type row_end) { row_start[vid + 1] = row_end; } + CUDA_HOSTDEV void constructEdge(index_type eid, index_type dst, edge_data_type edata = 0) { assert(dst < nnodes); assert(eid < nedges); edge_dst[eid] = dst; - if (edge_data) - edge_data[eid] = edata; + if (edge_data) edge_data[eid] = edata; } void malloc_index_device(index_type n, index_type*& ptr); void free_index_device(index_type*& ptr); - void set_index(index_type pos, index_type value, index_type* ptr); + void set_index(index_type pos, index_type value, index_type *ptr); void allocateFrom(index_type nv, index_type ne) { bool need_realloc = false; - if (nedges < ne) - need_realloc = true; + if (nedges < ne) need_realloc = true; nnodes = nv; nedges = ne; - if (max_size < nnodes) - max_size = nnodes; - // printf("allocating memory on gpu nnodes %d nedges %d\n", max_size, - // nedges); + if (max_size < nnodes) max_size = nnodes; + //printf("allocating memory on gpu nnodes %d nedges %d\n", max_size, nedges); if (need_realloc) { - if (edge_dst) - free_index_device(edge_dst); + if (edge_dst) free_index_device(edge_dst); malloc_index_device(nedges, edge_dst); } - if (!row_start) - malloc_index_device(max_size + 1, row_start); + if (!row_start) malloc_index_device(max_size+1, row_start); set_index(0, 0, row_start); } - void set_max_size(index_type max) { - assert(max > 0); - max_size = max; - } + void set_max_size(index_type max) { assert(max>0); max_size = max; } size_t size() { return size_t(nnodes); } size_t sizeEdges() { return size_t(nedges); } void degree_counting() {} @@ -213,6 +204,6 @@ struct CSRGraph { node_data_type* node_data; bool device_graph; index_type max_size; // this is for reallocation; avoid re-malloc - bool is_allocated; // this is for reallocation + bool is_allocated; // this is for reallocation }; #endif diff --git a/libgpu/include/internal.h b/libgpu/include/internal.h index f21a043553..7d8e6f8a9a 100644 --- a/libgpu/include/internal.h +++ b/libgpu/include/internal.h @@ -24,10 +24,8 @@ struct multiple_sum { T el[items]; // https://nvlabs.github.io/cub/classcub_1_1_block_scan.html#a6ed3f77795e582df31d3d6d9d950615e - // "This operation assumes the value of obtained by the T's default - // constructor (or by zero-initialization if no user-defined default - // constructor exists) is suitable as the identity value zero for addition." - __device__ __host__ multiple_sum() : multiple_sum(T()) {} + // "This operation assumes the value of obtained by the T's default constructor (or by zero-initialization if no user-defined default constructor exists) is suitable as the identity value zero for addition." + __device__ __host__ multiple_sum() : multiple_sum(T()) { } __device__ __host__ multiple_sum(const T e) { for (int i = 0; i < items; i++) diff --git a/libpangolin/include/pangolin/canonical_graph.h b/libpangolin/include/pangolin/canonical_graph.h index 5797887054..ec7a18a14d 100644 --- a/libpangolin/include/pangolin/canonical_graph.h +++ b/libpangolin/include/pangolin/canonical_graph.h @@ -31,8 +31,8 @@ std::ostream& operator<<(std::ostream& strm, template class CanonicalGraph { friend std::ostream& - operator<< <>(std::ostream& strm, - const CanonicalGraph& cg); + operator<<<>(std::ostream& strm, + const CanonicalGraph& cg); public: CanonicalGraph() : number_of_vertices(0), hash_value(0) {} diff --git a/libpangolin/include/pangolin/edge_embedding.h b/libpangolin/include/pangolin/edge_embedding.h index 849021ebad..94af94e9c4 100644 --- a/libpangolin/include/pangolin/edge_embedding.h +++ b/libpangolin/include/pangolin/edge_embedding.h @@ -10,8 +10,8 @@ std::ostream& operator<<(std::ostream& strm, template class EdgeInducedEmbedding : public Embedding { - friend std::ostream& - operator<< <>(std::ostream& strm, const EdgeInducedEmbedding& emb); + friend std::ostream& operator<<<>(std::ostream& strm, + const EdgeInducedEmbedding& emb); public: EdgeInducedEmbedding() { qp_id = 0xFFFFFFFF; } diff --git a/libpangolin/include/pangolin/embedding.h b/libpangolin/include/pangolin/embedding.h index cdd37087e4..3a45d43168 100644 --- a/libpangolin/include/pangolin/embedding.h +++ b/libpangolin/include/pangolin/embedding.h @@ -2,9 +2,9 @@ #define EMBEDDING_HPP_ // bliss headers -// #include "bliss/defs.hh" -// #include "bliss/utils.hh" -// #include "bliss/bignum.hh" +//#include "bliss/defs.hh" +//#include "bliss/utils.hh" +//#include "bliss/bignum.hh" #include "pangolin/element.h" diff --git a/libpangolin/include/pangolin/quick_pattern.h b/libpangolin/include/pangolin/quick_pattern.h index e8002b2e1a..65b3262645 100644 --- a/libpangolin/include/pangolin/quick_pattern.h +++ b/libpangolin/include/pangolin/quick_pattern.h @@ -22,8 +22,8 @@ std::ostream& operator<<(std::ostream& strm, template class QuickPattern { - friend std::ostream& operator<< <>(std::ostream& strm, - const QuickPattern& qp); + friend std::ostream& operator<<<>(std::ostream& strm, + const QuickPattern& qp); public: QuickPattern() {} diff --git a/lonestar/analytics/cpu/betweennesscentrality/OuterStructs.h b/lonestar/analytics/cpu/betweennesscentrality/OuterStructs.h index 1b959e1fd9..36e795c015 100644 --- a/lonestar/analytics/cpu/betweennesscentrality/OuterStructs.h +++ b/lonestar/analytics/cpu/betweennesscentrality/OuterStructs.h @@ -245,7 +245,7 @@ class BCOuter { */ template void deleteArray(T** addr) { - delete[] *addr; + delete[] * addr; } /** diff --git a/lonestar/analytics/cpu/bipart/Coarsening.cpp b/lonestar/analytics/cpu/bipart/Coarsening.cpp index c5ad54ae34..96d17671dd 100644 --- a/lonestar/analytics/cpu/bipart/Coarsening.cpp +++ b/lonestar/analytics/cpu/bipart/Coarsening.cpp @@ -29,7 +29,7 @@ #include #include -constexpr static const unsigned CHUNK_SIZE = 512U; +constexpr static const unsigned CHUNK_SIZE = 512U; int TOTALW; int LIMIT; @@ -44,40 +44,40 @@ int hash(unsigned val) { void parallelRand(MetisGraph* graph, int) { GGraph* fineGGraph = graph->getFinerGraph()->getGraph(); - - galois::StatTimer T_RAND("RAND"); + + galois::StatTimer T_RAND("RAND"); T_RAND.start(); - galois::do_all( - galois::iterate((uint64_t)0, fineGGraph->hedges), + galois::do_all( + galois::iterate((uint64_t) 0, fineGGraph->hedges), [&fineGGraph](uint64_t item) { - unsigned netnum = fineGGraph->getData(item, flag_no_lock).netnum; - netnum = hash(netnum); + unsigned netnum = fineGGraph->getData(item, flag_no_lock).netnum; + netnum= hash(netnum); fineGGraph->getData(item, flag_no_lock).netrand = netnum; }, - galois::steal(), - // galois::chunk_size()); - galois::loopname("rand")); - T_RAND.stop(); + galois::steal(), +// galois::chunk_size()); + galois::loopname("rand")); + T_RAND.stop(); - // std::cout <<"hedges: " << fineGGraph->hedges << std::endl; + //std::cout <<"hedges: " << fineGGraph->hedges << std::endl; - galois::StatTimer T_INDEX("INDEX"); - T_INDEX.start(); - galois::do_all( - galois::iterate((uint64_t)0, fineGGraph->hedges), + galois::StatTimer T_INDEX("INDEX"); + T_INDEX.start(); + galois::do_all( + galois::iterate((uint64_t) 0, fineGGraph->hedges), [&fineGGraph](uint64_t item) { unsigned netnum = fineGGraph->getData(item, flag_no_lock).index; - netnum = hash(1); + netnum= hash(1); fineGGraph->getData(item, flag_no_lock).index = netnum; }, galois::steal(), - // galois::chunk_size()); + // galois::chunk_size()); galois::loopname("rand_index")); - T_INDEX.stop(); + T_INDEX.stop(); - // std::cout <<"rand: " << T_RAND.get() << std::endl; - // std::cout << "rand_index: " << T_INDEX.get() << std::endl; + //std::cout <<"rand: " << T_RAND.get() << std::endl; + //std::cout << "rand_index: " << T_INDEX.get() << std::endl; } using MatchingPolicy = void(GNode, GGraph*); @@ -201,10 +201,10 @@ void parallelHMatchAndCreateNodes(MetisGraph* graph, int iter, GNodeBag& bag, typedef galois::substrate::PerThreadStorage ThreadLocalData; ThreadLocalData edgesThreadLocal; std::string name = "phaseI"; - + galois::GAccumulator hedge; - - galois::InsertBag hedge_bag; + + galois::InsertBag hedge_bag; galois::do_all( galois::iterate(size_t{0}, fineGGraph->hedges), @@ -237,8 +237,8 @@ void parallelHMatchAndCreateNodes(MetisGraph* graph, int iter, GNodeBag& bag, return; fineGGraph->getData(item).setMatched(); if (flag) - hedge_bag.push(item); - + hedge_bag.push(item); + bag.push(nodeid); unsigned ww = 0; for (auto pp : edges) { @@ -246,16 +246,15 @@ void parallelHMatchAndCreateNodes(MetisGraph* graph, int iter, GNodeBag& bag, fineGGraph->getData(pp).setMatched(); fineGGraph->getData(pp).setParent(nodeid); fineGGraph->getData(pp).netnum = fineGGraph->getData(item).netnum; - // fineGGraph->getData(pp).netnum = - // fineGGraph->getData(item).netnum.load(); - } + //fineGGraph->getData(pp).netnum = fineGGraph->getData(item).netnum.load(); + } weight[nodeid - fineGGraph->hedges] = ww; } }, galois::loopname("phaseI")); - for (auto item : hedge_bag) - hedges[item] = true; + for(auto item: hedge_bag) + hedges[item] = true; } void moreCoarse(MetisGraph* graph, galois::LargeArray& weight) { @@ -311,9 +310,8 @@ void moreCoarse(MetisGraph* graph, galois::LargeArray& weight) { fineGGraph->getData(e).setMatched(); fineGGraph->getData(e).setParent(nn); fineGGraph->getData(e).netnum = fineGGraph->getData(b).netnum; - // fineGGraph->getData(e).netnum = - // fineGGraph->getData(b).netnum.load(); - } + //fineGGraph->getData(e).netnum = fineGGraph->getData(b).netnum.load(); + } } } }, @@ -342,7 +340,7 @@ void coarsePhaseII(MetisGraph* graph, std::vector& hedges, galois::GAccumulator hnode; moreCoarse(graph, weight); - galois::InsertBag hedge_bag; + galois::InsertBag hedge_bag; galois::do_all( galois::iterate(size_t{0}, fineGGraph->hedges), @@ -371,36 +369,38 @@ void coarsePhaseII(MetisGraph* graph, std::vector& hedges, fineGGraph->getData(item).setMatched(); } else { - // auto& vec = *edgesThreadLocalV.getLocal(); - // vec.push_back(item); - hedge_bag.push(item); - fineGGraph->getData(item).setMatched(); + // auto& vec = *edgesThreadLocalV.getLocal(); + //vec.push_back(item); + hedge_bag.push(item); + fineGGraph->getData(item).setMatched(); } - }, - galois::steal(), galois::loopname("count # Hyperedges")); + },galois::steal(), + galois::loopname("count # Hyperedges")); - for (auto item : hedge_bag) - hedges[item] = true; + for(auto item:hedge_bag) + hedges[item] = true; } -// find nodes that are not incident to any hyperedge -void findLoneNodes(GGraph& graph) { - - galois::do_all( - galois::iterate((uint64_t)graph.hedges, graph.size()), - [&](GNode n) { graph.getData(n).notAlone = false; }, galois::steal(), - galois::loopname("initialize not alone variables")); - - galois::do_all( - galois::iterate((uint64_t)0, graph.hedges), - [&](GNode h) { - for (auto n : graph.edges(h)) - graph.getData(graph.getEdgeDst(n)).notAlone = true; - }, - galois::steal(), galois::loopname("set not alone variables")); +//find nodes that are not incident to any hyperedge +void findLoneNodes(GGraph& graph){ + + galois::do_all( + galois::iterate((uint64_t) graph.hedges, graph.size()), + [&](GNode n){ + + graph.getData(n).notAlone = false; + }, galois::steal(), galois::loopname("initialize not alone variables")); + + galois::do_all( + galois::iterate((uint64_t) 0, graph.hedges), + [&](GNode h){ + + for(auto n:graph.edges(h)) + graph.getData(graph.getEdgeDst(n)).notAlone = true; + }, galois::steal(), galois::loopname("set not alone variables")); } -// create coarsened graphs +//create coarsened graphs void parallelCreateEdges(MetisGraph* graph, GNodeBag& bag, std::vector& hedges, galois::LargeArray& weight) { @@ -416,68 +416,68 @@ void parallelCreateEdges(MetisGraph* graph, GNodeBag& bag, hg += 1; }, galois::steal(), galois::loopname("number of hyperedges loop")); + + //find lone nodes + findLoneNodes(*fineGGraph); + - // find lone nodes - findLoneNodes(*fineGGraph); - - galois::do_all( + galois::do_all( galois::iterate(fineGGraph->hedges, fineGGraph->size()), [&](GNode ii) { - if (!fineGGraph->getData(ii) - .isMatched()) { // && fineGGraph->getData(ii).notAlone) { + if (!fineGGraph->getData(ii).isMatched()){// && fineGGraph->getData(ii).notAlone) { bag.push(ii); fineGGraph->getData(ii).setMatched(); fineGGraph->getData(ii).setParent(ii); fineGGraph->getData(ii).netnum = INT_MAX; weight[ii - fineGGraph->hedges] = fineGGraph->getData(ii).getWeight(); - } + + } }, galois::steal(), galois::loopname("noedgebag match")); - galois::StatTimer T_BAG("BAG"); - T_BAG.start(); - std::vector inNodeBag(1000, false); - std::vector nodeid(1000, INT_MAX); - - for (GNode ii = fineGGraph->hedges; ii < fineGGraph->size(); ii++) { - - if (!fineGGraph->getData(ii).isMatched() && - !fineGGraph->getData(ii).notAlone) { - int index = ii % 1000; - inNodeBag[index] = true; - if (ii < nodeid[index]) - nodeid[index] = ii; - } - } - - for (int i = 0; i < 1000; i++) { - - if (inNodeBag[i]) { - bag.push(nodeid[i]); - weight[nodeid[i] - fineGGraph->hedges] = 0; - } - } - - for (GNode ii = fineGGraph->hedges; ii < fineGGraph->size(); ii++) { - - if (!fineGGraph->getData(ii).isMatched() && - !fineGGraph->getData(ii).notAlone) { - int index = ii % 1000; - fineGGraph->getData(ii).setMatched(); + + galois::StatTimer T_BAG("BAG"); + T_BAG.start(); + std::vector inNodeBag(1000, false); + std::vector nodeid(1000, INT_MAX); + + for(GNode ii = fineGGraph->hedges; iisize();ii++){ + + if(!fineGGraph->getData(ii).isMatched() && !fineGGraph->getData(ii).notAlone){ + int index = ii%1000; + inNodeBag[index] = true; + if(ii < nodeid[index]) + nodeid[index] = ii; + + } + } + + for(int i=0;i<1000;i++){ + + if(inNodeBag[i]){ + bag.push(nodeid[i]); + weight[nodeid[i]-fineGGraph->hedges] = 0; + } + } + + for(GNode ii = fineGGraph->hedges; iisize();ii++){ + + if(!fineGGraph->getData(ii).isMatched() && !fineGGraph->getData(ii).notAlone){ + int index = ii%1000; + fineGGraph->getData(ii).setMatched(); fineGGraph->getData(ii).setParent(nodeid[index]); - fineGGraph->getData(ii).netnum = INT_MAX; - - weight[nodeid[index] - fineGGraph->hedges] += - fineGGraph->getData(ii).getWeight(); + fineGGraph->getData(ii).netnum = INT_MAX; + + weight[nodeid[index]-fineGGraph->hedges] += fineGGraph->getData(ii).getWeight(); } } - T_BAG.stop(); + T_BAG.stop(); - // std::cout <<"bag time: "<< T_BAG.get() << std::endl; - unsigned hnum = hg.reduce(); + //std::cout <<"bag time: "<< T_BAG.get() << std::endl; + unsigned hnum = hg.reduce(); unsigned nodes = std::distance(bag.begin(), bag.end()); // + numnodes; unsigned newval = hnum; - + std::vector idmap(fineGGraph->hnodes); std::vector newrand(nodes); std::vector newWeight(nodes); @@ -485,18 +485,18 @@ void parallelCreateEdges(MetisGraph* graph, GNodeBag& bag, Tloop.start(); std::vector v; - galois::LargeArray inBag; + galois::LargeArray inBag; - inBag.allocateBlocked(fineGGraph->size()); - for (GNode n = fineGGraph->hedges; n < fineGGraph->size(); n++) - inBag[n] = false; + inBag.allocateBlocked(fineGGraph->size()); + for(GNode n = fineGGraph->hedges;nsize() ; n++) + inBag[n] = false; for (auto n : bag) - inBag[n] = true; - - for (GNode n = fineGGraph->hedges; n < fineGGraph->size(); n++) - if (inBag[n]) - v.push_back(n); + inBag[n] = true; + + for(GNode n = fineGGraph->hedges; nsize(); n++) + if(inBag[n]) + v.push_back(n); for (auto n : v) { newrand[newval - hnum] = n; @@ -519,40 +519,43 @@ void parallelCreateEdges(MetisGraph* graph, GNodeBag& bag, galois::gstl::Vector> edges_id( num_nodes_next); std::vector> edges_data(num_nodes_next); - std::vector old_id(hnum); - - unsigned h_id = 0; + std::vector old_id(hnum); + + unsigned h_id = 0; + for (GNode n = 0; n < fineGGraph->hedges; n++) { - if (hedges[n]) { - old_id[h_id] = fineGGraph->getData(n).netnum; - fineGGraph->getData(n).nodeid = h_id++; - } - } + if (hedges[n]) { + old_id[h_id] = fineGGraph->getData(n).netnum; + fineGGraph->getData(n).nodeid = h_id++; + } + } galois::do_all( galois::iterate(size_t{0}, fineGGraph->hedges), [&](GNode n) { if (!hedges[n]) return; - // auto data = fineGGraph->getData(n, flag_no_lock); + //auto data = fineGGraph->getData(n, flag_no_lock); unsigned id = fineGGraph->getData(n).nodeid; for (auto ii : fineGGraph->edges(n)) { - GNode dst = fineGGraph->getEdgeDst(ii); - // auto dst_data = fineGGraph->getData(dst, flag_no_lock); - // unsigned pid = dst_data.getParent(); - unsigned pid = fineGGraph->getData(dst).getParent(); + GNode dst = fineGGraph->getEdgeDst(ii); + // auto dst_data = fineGGraph->getData(dst, flag_no_lock); + //unsigned pid = dst_data.getParent(); + unsigned pid = fineGGraph->getData(dst).getParent(); auto f = std::find(edges_id[id].begin(), edges_id[id].end(), pid); - if (f == edges_id[id].end()) { + if (f == edges_id[id].end()) { edges_id[id].push_back(pid); } } // End edge loop + }, galois::steal(), galois::loopname("BuildGrah: Find edges")); + std::vector prefix_edges(num_nodes_next); galois::GAccumulator num_edges_acc; galois::do_all( @@ -578,19 +581,20 @@ void parallelCreateEdges(MetisGraph* graph, GNodeBag& bag, if (ii < hnum) { coarseGGraph->getData(ii).netval = INT_MAX; coarseGGraph->getData(ii).netnum = old_id[ii]; - } else { + } else { coarseGGraph->getData(ii).netval = INT_MAX; coarseGGraph->getData(ii).netnum = INT_MAX; coarseGGraph->getData(ii).netrand = INT_MAX; - coarseGGraph->getData(ii).nodeid = ii; + coarseGGraph->getData(ii).nodeid = + ii; coarseGGraph->getData(ii).setWeight( newWeight[ii - coarseGGraph->hedges]); } }, galois::steal(), galois::loopname("noedgebag match")); - inBag.destroy(); - inBag.deallocate(); + inBag.destroy(); + inBag.deallocate(); } void findMatching(MetisGraph* coarseMetisGraph, scheduleMode sch, int iter) { @@ -599,7 +603,7 @@ void findMatching(MetisGraph* coarseMetisGraph, scheduleMode sch, int iter) { int sz = coarseMetisGraph->getFinerGraph()->getGraph()->hedges; std::vector hedges(sz, false); galois::LargeArray weight; - weight.allocateBlocked(fineMetisGraph->getGraph()->hnodes); + weight.allocateBlocked(fineMetisGraph->getGraph()->hnodes); switch (sch) { case PLD: @@ -644,8 +648,8 @@ void findMatching(MetisGraph* coarseMetisGraph, scheduleMode sch, int iter) { coarsePhaseII(coarseMetisGraph, hedges, weight); parallelCreateEdges(coarseMetisGraph, nodes, hedges, weight); - weight.destroy(); - weight.deallocate(); + weight.destroy(); + weight.deallocate(); } MetisGraph* coarsenOnce(MetisGraph* fineMetisGraph, scheduleMode sch, @@ -661,12 +665,14 @@ MetisGraph* coarsen(MetisGraph* fineMetisGraph, unsigned coarsenTo, scheduleMode sch) { MetisGraph* coarseGraph = fineMetisGraph; - unsigned size = fineMetisGraph->getGraph()->hnodes; - unsigned hedgeSize = 0; - const float ratio = 55.0 / 45.0; - const float tol = std::max(ratio, 1 - ratio) - 1; - const int hi = (1 + tol) * size / (2 + tol); - LIMIT = hi / 4; + unsigned size = + fineMetisGraph->getGraph() + ->hnodes; + unsigned hedgeSize = 0; + const float ratio = 55.0 / 45.0; + const float tol = std::max(ratio, 1 - ratio) - 1; + const int hi = (1 + tol) * size / (2 + tol); + LIMIT = hi / 4; unsigned Size = size; unsigned iterNum = 0; @@ -675,16 +681,15 @@ MetisGraph* coarsen(MetisGraph* fineMetisGraph, unsigned coarsenTo, if (iterNum > coarsenTo) break; if (Size - newSize <= 0 && iterNum > 2) - break; + break; newSize = coarseGraph->getGraph()->hnodes; coarseGraph = coarsenOnce(coarseGraph, sch, iterNum); Size = coarseGraph->getGraph()->hnodes; hedgeSize = coarseGraph->getGraph()->hedges; - // std::cout << "SIZE IS " << coarseGraph->getGraph()->hnodes << " and net - // is " - // << hedgeSize << "\n"; + //std::cout << "SIZE IS " << coarseGraph->getGraph()->hnodes << " and net is " + // << hedgeSize << "\n"; if (hedgeSize < 1000) - break; + break; ++iterNum; } diff --git a/lonestar/analytics/cpu/bipart/Refine.cpp b/lonestar/analytics/cpu/bipart/Refine.cpp index 7397f907d8..112dc06277 100644 --- a/lonestar/analytics/cpu/bipart/Refine.cpp +++ b/lonestar/analytics/cpu/bipart/Refine.cpp @@ -539,7 +539,7 @@ void refine(MetisGraph* coarseGraph, unsigned K, double imbalance) { float tol = 0.0f; bool flag = isPT(K); if (flag) { - ratio = (50.0f + (double)imbalance) / (50.0f - (double)imbalance); + ratio = (50.0f + (double) imbalance)/(50.0f - (double) imbalance); tol = std::max(ratio, 1 - ratio) - 1; } else { ratio = ((float)((K + 1) / 2)) / ((float)(K / 2)); // change if needed diff --git a/lonestar/analytics/cpu/bipart/bipart.cpp b/lonestar/analytics/cpu/bipart/bipart.cpp index 321afd11fa..27761209ea 100644 --- a/lonestar/analytics/cpu/bipart/bipart.cpp +++ b/lonestar/analytics/cpu/bipart/bipart.cpp @@ -121,9 +121,9 @@ void Partition(MetisGraph* metisGraph, unsigned coarsenTo, unsigned K) { T3.start(); refine(mcg, K, imbalance); T3.stop(); - Ctime += (T.get() / 1000.0f); - Ptime += (T2.get() / 1000.0f); - Rtime += (T3.get() / 1000.0f); + Ctime += (T.get()/1000.0f); + Ptime += (T2.get()/1000.0f); + Rtime += (T3.get()/1000.0f); execTime.stop(); } @@ -154,7 +154,7 @@ int computingBalance(GGraph& g) { unsigned pp = g.getData(c).getPart(); parts[pp]++; } - for (unsigned i = 0; i < numPartitions; i++) { + for (unsigned i = 0; i max) max = parts[i]; } @@ -415,13 +415,13 @@ int main(int argc, char** argv) { galois::steal(), galois::loopname("populate edge ids")); uint64_t num_edges_acc = 0; - // galois::do_all( - // galois::iterate(uint32_t{0}, totalnodes), - for (uint32_t c = 0; c < totalnodes; c++) { - pre_edges[c] = edges_ids[c].size(); - num_edges_acc += pre_edges[c]; - } - // galois::steal(), galois::loopname("set pre edges")); + //galois::do_all( + // galois::iterate(uint32_t{0}, totalnodes), + for(uint32_t c = 0;c> parts(numPartitions); + std::vector >parts(numPartitions); for (GNode n = graph.hedges; n < graph.size(); n++) { unsigned p = graph.getData(n).getPart(); @@ -511,9 +511,9 @@ int main(int argc, char** argv) { std::ofstream outputFile(outfile.c_str()); for (unsigned i = 0; i < numPartitions; i++) { - outputFile << i + 1 << " "; - for (auto v : parts[i]) - outputFile << v << " "; + outputFile << i+1 << " "; + for (auto v : parts[i]) + outputFile << v << " "; outputFile << "\n"; } outputFile.close(); diff --git a/lonestar/analytics/cpu/bipart/bipart.h b/lonestar/analytics/cpu/bipart/bipart.h index e99241adce..ee69dfa29b 100644 --- a/lonestar/analytics/cpu/bipart/bipart.h +++ b/lonestar/analytics/cpu/bipart/bipart.h @@ -28,8 +28,8 @@ typedef uint32_t EdgeTy; struct GGraph : public galois::graphs::LC_CSR_Graph::with_no_lockable< - true>::type::with_numa_alloc::type { - // false>::type::with_numa_alloc::type { + true>::type::with_numa_alloc::type { + //false>::type::with_numa_alloc::type { size_t hedges; size_t hnodes; }; @@ -80,16 +80,17 @@ class MetisNode { galois::CopyableAtomic netval; galois::CopyableAtomic degree; /*std::atomic FS; - std::atomic TE; - std::atomic netnum; - std::atomic netrand; - std::atomic netval; - std::atomic degree; -*/ uint32_t index; - bool notAlone; - - void initPartition() { pd.locked = false; } - + std::atomic TE; + std::atomic netnum; + std::atomic netrand; + std::atomic netval; + std::atomic degree; +*/ uint32_t index; + bool notAlone; + + void initPartition() { pd.locked = false; } + + // int num; explicit MetisNode(int weight) : _weight(weight) { initCoarsen(); diff --git a/lonestar/analytics/cpu/clustering/louvainClustering.cpp b/lonestar/analytics/cpu/clustering/louvainClustering.cpp index c74901fd57..ef7ebb1fd3 100644 --- a/lonestar/analytics/cpu/clustering/louvainClustering.cpp +++ b/lonestar/analytics/cpu/clustering/louvainClustering.cpp @@ -440,7 +440,7 @@ double algoLouvainWithLockingDelayUpdate(Graph& graph, double lower, double e_xx = 0; double a2_x = 0; curr_mod = calModularityDelay(graph, c_info, c_update, e_xx, a2_x, - constant_for_second_term, local_target); + constant_for_second_term, local_target); galois::gPrint(num_iter, " ", e_xx, " ", a2_x, " ", lower, " ", prev_mod, " ", curr_mod, "\n"); diff --git a/lonestar/analytics/cpu/gmetis/Coarsening.cpp b/lonestar/analytics/cpu/gmetis/Coarsening.cpp index 2f7c33545e..f35e725faf 100644 --- a/lonestar/analytics/cpu/gmetis/Coarsening.cpp +++ b/lonestar/analytics/cpu/gmetis/Coarsening.cpp @@ -387,7 +387,7 @@ MetisGraph* coarsen(MetisGraph* fineMetisGraph, unsigned coarsenTo, bool verbose) { MetisGraph* coarseGraph = fineMetisGraph; unsigned size = std::distance(fineMetisGraph->getGraph()->begin(), - fineMetisGraph->getGraph()->end()); + fineMetisGraph->getGraph()->end()); unsigned iterNum = 0; bool with2Hop = false; unsigned stat = 0; diff --git a/lonestar/analytics/cpu/gmetis/GMetis.cpp b/lonestar/analytics/cpu/gmetis/GMetis.cpp index 981478a227..145ac63930 100644 --- a/lonestar/analytics/cpu/gmetis/GMetis.cpp +++ b/lonestar/analytics/cpu/gmetis/GMetis.cpp @@ -31,7 +31,7 @@ #include "Metis.h" #include "galois/graphs/ReadGraph.h" #include "galois/Timer.h" -// #include "GraphReader.h" +//#include "GraphReader.h" #include "Lonestar/BoilerPlate.h" #include "galois/graphs/FileGraph.h" #include "galois/LargeArray.h" diff --git a/lonestar/analytics/cpu/k-core/kcore.cpp b/lonestar/analytics/cpu/k-core/kcore.cpp index 8b1da0dfc0..f07fc7153a 100644 --- a/lonestar/analytics/cpu/k-core/kcore.cpp +++ b/lonestar/analytics/cpu/k-core/kcore.cpp @@ -29,9 +29,9 @@ constexpr static const char* const REGION_NAME = "k-core"; constexpr static const char* const name = "k-core"; constexpr static const char* const desc = "Finds the k-core of a graph, " - "defined as the subgraph where" - " all vertices have degree at " - "least k."; + "defined as the subgraph where" + " all vertices have degree at " + "least k."; /******************************************************************************* * Declaration of command line arguments diff --git a/lonestar/analytics/cpu/matrixcompletion/matrixCompletion.h b/lonestar/analytics/cpu/matrixcompletion/matrixCompletion.h index 38ec2f6e8d..a47f245069 100644 --- a/lonestar/analytics/cpu/matrixcompletion/matrixCompletion.h +++ b/lonestar/analytics/cpu/matrixcompletion/matrixCompletion.h @@ -172,7 +172,7 @@ T doGradientUpdate(T* __restrict__ itemLatent, T* __restrict__ userLatent, T step = stepSize; T rating = edgeRating; T error = innerProduct(itemLatent, itemLatent + LATENT_VECTOR_SIZE, - userLatent, -rating); + userLatent, -rating); // Take gradient step to reduce error for (int i = 0; i < LATENT_VECTOR_SIZE; i++) { diff --git a/lonestar/analytics/distributed/betweennesscentrality/bc_level.cpp b/lonestar/analytics/distributed/betweennesscentrality/bc_level.cpp index 95b1486123..edf4a331b8 100644 --- a/lonestar/analytics/distributed/betweennesscentrality/bc_level.cpp +++ b/lonestar/analytics/distributed/betweennesscentrality/bc_level.cpp @@ -22,7 +22,7 @@ * avoid the overheads of having 2 extra accumulator variables. */ -// #define BCDEBUG +//#define BCDEBUG #include "DistBench/Output.h" #include "DistBench/Start.h" @@ -91,12 +91,12 @@ struct NodeData { float dependency; float betweeness_centrality; - // #ifdef BCDEBUG + //#ifdef BCDEBUG void dump() { galois::gPrint("DUMP: ", current_length.load(), " ", num_shortest_paths.load(), " ", dependency, "\n"); } - // #endif + //#endif }; // reading in list of sources to operate on if provided diff --git a/lonestar/analytics/distributed/betweennesscentrality/bc_mr.cpp b/lonestar/analytics/distributed/betweennesscentrality/bc_mr.cpp index 7c9d162d87..5f175b93eb 100644 --- a/lonestar/analytics/distributed/betweennesscentrality/bc_mr.cpp +++ b/lonestar/analytics/distributed/betweennesscentrality/bc_mr.cpp @@ -541,7 +541,7 @@ std::vector makeResults(std::unique_ptr& hg) { constexpr static const char* const name = "Min-Rounds Betweeness Centrality"; constexpr static const char* const desc = "Min-Rounds Betweeness " "Centrality on Distributed Galois."; -constexpr static const char* const url = nullptr; +constexpr static const char* const url = nullptr; uint64_t macroRound = 0; // macro round, i.e. number of batches done so far diff --git a/lonestar/analytics/distributed/bfs/bfs_push.cpp b/lonestar/analytics/distributed/bfs/bfs_push.cpp index 51cd6e0da8..34aa8031a3 100644 --- a/lonestar/analytics/distributed/bfs/bfs_push.cpp +++ b/lonestar/analytics/distributed/bfs/bfs_push.cpp @@ -61,9 +61,9 @@ static cll::opt cll::init(0)); static cll::opt - rseed("rseed", - cll::desc("The random seed for choosing the hosts (default value 0)"), - cll::init(0)); + rseed("rseed", + cll::desc("The random seed for choosing the hosts (default value 0)"), + cll::init(0)); enum Exec { Sync, Async }; @@ -102,7 +102,8 @@ struct InitializeGraph { uint64_t local_src_node; Graph* graph; - InitializeGraph(uint64_t& _src_node, const uint32_t& _infinity, Graph* _graph) + InitializeGraph(uint64_t& _src_node, const uint32_t& _infinity, + Graph* _graph) : local_infinity(_infinity), local_src_node(_src_node), graph(_graph) {} void static go(Graph& _graph) { @@ -274,12 +275,12 @@ struct BFS { void operator()(GNode src) const { NodeData& snode = graph->getData(src); - // stack_capture->capture_stack_info(); + //stack_capture->capture_stack_info(); cyg_profile_func_stack(nullptr, nullptr); if (snode.dist_old > snode.dist_current) { active_vertices += 1; - // stack_capture->capture_stack_info(); + //stack_capture->capture_stack_info(); cyg_profile_func_stack(nullptr, nullptr); if (local_priority > snode.dist_current) { @@ -294,10 +295,10 @@ struct BFS { uint32_t old_dist = galois::atomicMin(dnode.dist_current, new_dist); if (old_dist > new_dist) bitset_dist_current.set(dst); - // stack_capture->capture_stack_info(); + //stack_capture->capture_stack_info(); cyg_profile_func_stack(nullptr, nullptr); } - // stack_capture->capture_stack_info(); + //stack_capture->capture_stack_info(); cyg_profile_func_stack(nullptr, nullptr); } } @@ -435,8 +436,8 @@ int main(int argc, char** argv) { galois::runtime::reportParam(REGION_NAME, "Source Node ID", src_node); } - // Setup Seeding information - uint64_t* src_nodes = (uint64_t*)malloc(sizeof(uint64_t) * numRuns); + //Setup Seeding information + uint64_t* src_nodes = (uint64_t*) malloc(sizeof(uint64_t) * numRuns); std::mt19937 generator(rseed); galois::StatTimer StatTimer_total("TimerTotal", REGION_NAME); @@ -457,18 +458,21 @@ int main(int argc, char** argv) { galois::DGAccumulator DGAccumulator_sum; galois::DGReduceMax m; - // get the src_nodes of the runs + //get the src_nodes of the runs galois::StatTimer StatTimer_select("VertexSelection", REGION_NAME); StatTimer_select.start(); - for (auto run = 0; run < numRuns; ++run) { + for(auto run = 0; run < numRuns; ++run) + { uint64_t degree = 0; - auto num_nodes = hg->globalSize(); - uint64_t cand = 0; - while (degree < 1) { + auto num_nodes = hg->globalSize(); + uint64_t cand = 0; + while(degree < 1) + { DGAccumulator_sum.reset(); cand = generator() % num_nodes; - if (hg->isOwned(cand) || hg->isLocal(cand)) { + if(hg->isOwned(cand) || hg->isLocal(cand)) + { auto lcand = hg->getLID(cand); DGAccumulator_sum += hg->localDegree(lcand); } @@ -522,20 +526,18 @@ int main(int argc, char** argv) { writeOutput(outputLocation, "level", results.data(), results.size(), globalIDs.data()); } + } StatTimer_total.stop(); - galois::gPrint("[", net.ID, "] Max Stack Size ", stack_capture.get_max(), - " bytes\n"); + galois::gPrint("[", net.ID, "] Max Stack Size ", stack_capture.get_max(), " bytes\n"); + struct rusage r_usage; - getrusage(RUSAGE_SELF, &r_usage); + getrusage(RUSAGE_SELF,&r_usage); galois::gPrint("[", net.ID, "] Memory usage: ", r_usage.ru_maxrss, " KB\n"); auto en = std::chrono::high_resolution_clock::now(); - galois::gPrint( - "[", net.ID, "] E2ETime: ", - std::chrono::duration_cast(en - st).count(), - " ns\n"); + galois::gPrint("[", net.ID, "] E2ETime: ", std::chrono::duration_cast(en - st).count(), " ns\n"); return 0; } diff --git a/lonestar/analytics/distributed/connected-components/cc_pull.cpp b/lonestar/analytics/distributed/connected-components/cc_pull.cpp index 2ba9f9ed25..f1460fd517 100644 --- a/lonestar/analytics/distributed/connected-components/cc_pull.cpp +++ b/lonestar/analytics/distributed/connected-components/cc_pull.cpp @@ -288,7 +288,7 @@ constexpr static const char* const name = "ConnectedComp Pull - Distributed " "Heterogeneous"; constexpr static const char* const desc = "ConnectedComp pull on Distributed " "Galois."; -constexpr static const char* const url = nullptr; +constexpr static const char* const url = nullptr; int main(int argc, char** argv) { galois::DistMemSys G; diff --git a/lonestar/analytics/distributed/pagerank/pagerank_pull.cpp b/lonestar/analytics/distributed/pagerank/pagerank_pull.cpp index 1ac988a4d5..6b31a12631 100644 --- a/lonestar/analytics/distributed/pagerank/pagerank_pull.cpp +++ b/lonestar/analytics/distributed/pagerank/pagerank_pull.cpp @@ -479,7 +479,7 @@ constexpr static const char* const name = "PageRank - Compiler Generated " "Distributed Heterogeneous"; constexpr static const char* const desc = "PageRank Residual Pull version on " "Distributed Galois."; -constexpr static const char* const url = nullptr; +constexpr static const char* const url = nullptr; int main(int argc, char** argv) { galois::DistMemSys G; diff --git a/lonestar/analytics/distributed/pagerank/pagerank_push.cpp b/lonestar/analytics/distributed/pagerank/pagerank_push.cpp index ecda4e7582..2b9b3e4e13 100644 --- a/lonestar/analytics/distributed/pagerank/pagerank_push.cpp +++ b/lonestar/analytics/distributed/pagerank/pagerank_push.cpp @@ -480,7 +480,7 @@ constexpr static const char* const name = "PageRank - Compiler Generated " "Distributed Heterogeneous"; constexpr static const char* const desc = "Residual PageRank on Distributed " "Galois."; -constexpr static const char* const url = 0; +constexpr static const char* const url = 0; int main(int argc, char** argv) { galois::DistMemSys G; diff --git a/lonestar/analytics/distributed/sssp/sssp_push.cpp b/lonestar/analytics/distributed/sssp/sssp_push.cpp index c530c130e7..8cbdb87b69 100644 --- a/lonestar/analytics/distributed/sssp/sssp_push.cpp +++ b/lonestar/analytics/distributed/sssp/sssp_push.cpp @@ -410,7 +410,7 @@ constexpr static const char* const name = "SSSP - Distributed Heterogeneous " "with worklist."; constexpr static const char* const desc = "Variant of Chaotic relaxation SSSP " "on Distributed Galois."; -constexpr static const char* const url = nullptr; +constexpr static const char* const url = nullptr; int main(int argc, char** argv) { galois::DistMemSys G; diff --git a/lonestar/analytics/gpu/matrixcompletion/SGDAsyncEdgeCu.h b/lonestar/analytics/gpu/matrixcompletion/SGDAsyncEdgeCu.h index 887b9e714f..c386947db8 100644 --- a/lonestar/analytics/gpu/matrixcompletion/SGDAsyncEdgeCu.h +++ b/lonestar/analytics/gpu/matrixcompletion/SGDAsyncEdgeCu.h @@ -703,7 +703,7 @@ struct SGDAsynEdgeCudaFunctor { */ _P_DATA1 = (int*)malloc(sizeof(int) * (users / C + movies / R)); _P1 = (struct a_list**)malloc(sizeof(struct a_list*) * - (users / C + movies / R - 1)); + (users / C + movies / R - 1)); _P_DATA1[0] = 0; _P_DATA3 = (( struct mk*)(malloc(sizeof(struct mk) * (users / C + movies / R - 1)))); @@ -782,6 +782,6 @@ struct SGDAsynEdgeCudaFunctor { // fprintf(stderr, "Destroying SGDAsynEdgeCudaFunctor object.\n"); } }; -// ###################################################################// +//###################################################################// #endif /* GALOISGPU_APPS_SGD_CUDA_SGDASYNCEDGECU_H_ */ diff --git a/lonestar/analytics/gpu/matrixcompletion/SGDCommonCu.h b/lonestar/analytics/gpu/matrixcompletion/SGDCommonCu.h index e7c1c704bc..96654978da 100644 --- a/lonestar/analytics/gpu/matrixcompletion/SGDCommonCu.h +++ b/lonestar/analytics/gpu/matrixcompletion/SGDCommonCu.h @@ -44,7 +44,7 @@ typedef float FeatureType; float SGD_STEP_SIZE(int X) { return SGD_LEARNING_RATE * 1.5f / (1.0f + SGD_DECAY_RATE * pow(X + 1, 1.5f)); } // Purdue. -// #define SGD_STEP_SIZE(X) (0.001f *1.5f/(1.0+0.9* pow(X+1,1.5))) //Intel. +//#define SGD_STEP_SIZE(X) (0.001f *1.5f/(1.0+0.9* pow(X+1,1.5))) //Intel. /************************************************ * *************************************************/ diff --git a/lonestar/analytics/gpu/matrixcompletion/SGDGraphCu.h b/lonestar/analytics/gpu/matrixcompletion/SGDGraphCu.h index ea143abcf4..17b2f5286f 100644 --- a/lonestar/analytics/gpu/matrixcompletion/SGDGraphCu.h +++ b/lonestar/analytics/gpu/matrixcompletion/SGDGraphCu.h @@ -116,9 +116,9 @@ struct SGD_LC_LinearArray_Undirected_Graph { size_t masterLength = buf.st_size; int _MAP_BASE = MAP_PRIVATE; - // #ifdef MAP_POPULATE - // _MAP_BASE |= MAP_POPULATE; - // #endif + //#ifdef MAP_POPULATE + // _MAP_BASE |= MAP_POPULATE; + //#endif void* m = mmap(0, masterLength, PROT_READ, _MAP_BASE, masterFD, 0); if (m == MAP_FAILED) { diff --git a/lonestar/analytics/gpu/pointstoanalysis/andersen.h b/lonestar/analytics/gpu/pointstoanalysis/andersen.h index 3144cea486..81ca5b808b 100644 --- a/lonestar/analytics/gpu/pointstoanalysis/andersen.h +++ b/lonestar/analytics/gpu/pointstoanalysis/andersen.h @@ -123,12 +123,12 @@ typedef unsigned long int ulongint; // number of threads per block for each rule. The thread count is based on the // amount of shared memory available and empirical measures. -// #define DEF_THREADS_PER_BLOCK (1024) -// #define UPDATE_THREADS_PER_BLOCK (1024) -// #define HCD_THREADS_PER_BLOCK (512) -// #define COPY_INV_THREADS_PER_BLOCK (864) -// #define STORE_INV_THREADS_PER_BLOCK (864) -// #define GEP_INV_THREADS_PER_BLOCK (1024) +//#define DEF_THREADS_PER_BLOCK (1024) +//#define UPDATE_THREADS_PER_BLOCK (1024) +//#define HCD_THREADS_PER_BLOCK (512) +//#define COPY_INV_THREADS_PER_BLOCK (864) +//#define STORE_INV_THREADS_PER_BLOCK (864) +//#define GEP_INV_THREADS_PER_BLOCK (1024) #include "pta_tuning.h" diff --git a/lonestar/eda/cpu/aig-rewriting/algorithms/RewriteManager.cpp b/lonestar/eda/cpu/aig-rewriting/algorithms/RewriteManager.cpp index 46afe9067a..99d6da44cb 100644 --- a/lonestar/eda/cpu/aig-rewriting/algorithms/RewriteManager.cpp +++ b/lonestar/eda/cpu/aig-rewriting/algorithms/RewriteManager.cpp @@ -29,7 +29,7 @@ #include "galois/worklists/Chunk.h" -// #include "galois/runtime/profile.h" +//#include "galois/runtime/profile.h" #include #include diff --git a/lonestar/eda/cpu/aig-rewriting/functional/FunctionHandler.h b/lonestar/eda/cpu/aig-rewriting/functional/FunctionHandler.h index d15f075a48..fcb92a0a38 100644 --- a/lonestar/eda/cpu/aig-rewriting/functional/FunctionHandler.h +++ b/lonestar/eda/cpu/aig-rewriting/functional/FunctionHandler.h @@ -203,7 +203,7 @@ inline void createLiterals( literals.insert(std::make_pair("1", std::make_pair(constOne, 0))); // std::cout << std::endl << "############################## Literals - // ##############################" << std::endl; for ( auto lit : literals ) + //##############################" << std::endl; for ( auto lit : literals ) //{ std::cout << lit.first << " = " << toHex( lit.second.first, nWords ) //<< " | " << supportToBin( lit.second.second ) << std::endl; // } diff --git a/lonestar/eda/cpu/sproute/flute.h b/lonestar/eda/cpu/sproute/flute.h index 69bef615d8..7a0b3aedd9 100644 --- a/lonestar/eda/cpu/sproute/flute.h +++ b/lonestar/eda/cpu/sproute/flute.h @@ -5,7 +5,7 @@ #include #include #include -// #include "flute_mst.h" +//#include "flute_mst.h" /*****************************/ /* User-Defined Parameters */ @@ -72,10 +72,10 @@ typedef struct { #define flutes_LMD(d, xs, ys, s, acc) \ (d <= D ? flutes_LD(d, xs, ys, s) : flutes_MD(d, xs, ys, s, acc)) -// #define max(x,y) ((x)>(y)?(x):(y)) -// #define min(x,y) ((x)<(y)?(x):(y)) -// to work around max conflict with bitmap -// #define abs(x) ((x)<0?(-x):(x)) +//#define max(x,y) ((x)>(y)?(x):(y)) +//#define min(x,y) ((x)<(y)?(x):(y)) +// to work around max conflict with bitmap +//#define abs(x) ((x)<0?(-x):(x)) using namespace std; #define ADIFF(x, y) ((x) > (y) ? (x - y) : (y - x)) // Absolute difference @@ -574,9 +574,9 @@ DTYPE flutes_wl_MD(int d, DTYPE xs[], DTYPE ys[], int s[], int acc) { penalty[r] = pnlty, penalty[d - 1 - r] = pnlty; for (r = d / 2 - 1, pnlty = dy; r >= 0; r--, pnlty += dy) penalty[s[r]] += pnlty, penalty[s[d - 1 - r]] += pnlty; - // #define CCWL 0.16 - // for (r=0; r>1) +//#define PARENT(i) ((i-1)>>1) #define LEFT(i) 2 * i + 1 #define RIGHT(i) 2 * i + 2 diff --git a/lonestar/eda/cpu/sproute/maze3D.h b/lonestar/eda/cpu/sproute/maze3D.h index ce1ea2d5f5..88179230e7 100644 --- a/lonestar/eda/cpu/sproute/maze3D.h +++ b/lonestar/eda/cpu/sproute/maze3D.h @@ -12,7 +12,7 @@ #include #define PARENT(i) (i - 1) / 2 -// #define PARENT(i) ((i-1)>>1) +//#define PARENT(i) ((i-1)>>1) #define LEFT(i) 2 * i + 1 #define RIGHT(i) 2 * i + 2 diff --git a/lonestar/eda/cpu/sproute/route.h b/lonestar/eda/cpu/sproute/route.h index 10bf73a37e..4edba91d95 100644 --- a/lonestar/eda/cpu/sproute/route.h +++ b/lonestar/eda/cpu/sproute/route.h @@ -999,7 +999,7 @@ void routeMonotonic(int netID, int edgeID, int threshold) { grid = yl * xGrid_1; for (j = 0; j <= segHeight; j++) { tmp = max((float)0, h_edges[grid + x].red + - h_edges[grid + x].est_usage - hCapacity_lb); + h_edges[grid + x].est_usage - hCapacity_lb); cost[j][i + 1] = cost[j][i] + tmp; parent[j][i + 1] = SAMEY; grid += xGrid - 1; @@ -1071,7 +1071,7 @@ void routeMonotonic(int netID, int edgeID, int threshold) { ind_i = i + 1; for (j = segHeight; j >= 0; j--) { tmp = max((float)0, h_edges[grid + x].red + - h_edges[grid + x].est_usage - hCapacity_lb); + h_edges[grid + x].est_usage - hCapacity_lb); cost[j][ind_i] = cost[j][i] + tmp; parent[j][ind_i] = SAMEY; grid -= xGrid - 1; diff --git a/lonestar/gnn/distributed/gcn/gcn-dist.cpp b/lonestar/gnn/distributed/gcn/gcn-dist.cpp index 7076449384..60e9fe75b4 100644 --- a/lonestar/gnn/distributed/gcn/gcn-dist.cpp +++ b/lonestar/gnn/distributed/gcn/gcn-dist.cpp @@ -9,8 +9,8 @@ int main(int argc, char* argv[]) { galois::StatTimer init_timer("InitializationTime"); init_timer.start(); std::unique_ptr< - galois::GraphNeuralNetwork> - gnn = InitializeGraphNeuralNetwork(); + galois::GraphNeuralNetwork> gnn = + InitializeGraphNeuralNetwork(); gnn->SetLayerPhases(galois::GNNPhase::kTrain); init_timer.stop(); diff --git a/lonestar/gnn/gat/gat.cpp b/lonestar/gnn/gat/gat.cpp index 24ea0b840c..10647924b7 100644 --- a/lonestar/gnn/gat/gat.cpp +++ b/lonestar/gnn/gat/gat.cpp @@ -3,19 +3,16 @@ #include "lonestargnn.h" const char* name = "Graph Attention Networks (GAT)"; -const char* desc = "Graph Attention Networks on an undirected graph: " - ""; +const char* desc = "Graph Attention Networks on an undirected graph: "; const char* url = 0; // math: h_i^{(l+1)} = \sum_{j\in \mathcal{N}(i)} \alpha_{i,j} W^{(l)} h_j^{(l)} -// where :math:`\alpha_{ij}` is the attention score bewteen node :math:`i` and -// node :math:`j`: +// where :math:`\alpha_{ij}` is the attention score bewteen node :math:`i` and node :math:`j`: // .. math:: \alpha_{ij}^{l} & = \mathrm{softmax_i} (e_{ij}^{l}) -// e_{ij}^{l} & = \mathrm{LeakyReLU}\left(\vec{a}^T [W h_{i} \| W -// h_{j}]\right) +// e_{ij}^{l} & = \mathrm{LeakyReLU}\left(\vec{a}^T [W h_{i} \| W h_{j}]\right) /* namespace deepgalois { - + // define aggregator here class AppAggregator: public Aggregator { public: diff --git a/lonestar/gnn/gin/gin.cpp b/lonestar/gnn/gin/gin.cpp index 2cadef0c44..4eb8835214 100644 --- a/lonestar/gnn/gin/gin.cpp +++ b/lonestar/gnn/gin/gin.cpp @@ -6,12 +6,8 @@ const char* name = "Graph Isomorphism Network (GIN)"; const char* desc = "Graph isomorphism neural networks on an undirected graph"; const char* url = 0; -static cll::opt learn_eps( - "le", - cll::desc("whether to learn the parameter epsilon (default value false)"), - cll::init(0)); -static cll::opt agg_type("at", cll::desc("Aggregator Type"), - cll::init("sum")); +static cll::optlearn_eps("le", cll::desc("whether to learn the parameter epsilon (default value false)"), cll::init(0)); +static cll::optagg_type("at", cll::desc("Aggregator Type"), cll::init("sum")); template <> class graph_conv_layer { @@ -34,3 +30,4 @@ int main(int argc, char** argv) { graph_conv_layer layer0; return 0; } + diff --git a/lonestar/gnn/include/DistributedGraphLoader.h b/lonestar/gnn/include/DistributedGraphLoader.h index e4970a82a8..0bce4b5819 100644 --- a/lonestar/gnn/include/DistributedGraphLoader.h +++ b/lonestar/gnn/include/DistributedGraphLoader.h @@ -129,8 +129,7 @@ namespace graphs { * loaded based on command line arguments */ template -std::unique_ptr> -constructSymmetricGraph(std::vector&) { +std::unique_ptr> constructSymmetricGraph(std::vector&) { std::string inputFile = deepgalois::path + dataset + ".csgr"; galois::gInfo("File to read is ", inputFile); switch (partitionScheme) { diff --git a/lonestar/gnn/include/engine.h b/lonestar/gnn/include/engine.h index 25be9c7adc..016ac80831 100644 --- a/lonestar/gnn/include/engine.h +++ b/lonestar/gnn/include/engine.h @@ -28,7 +28,7 @@ void LonestarGnnStart(int argc, char** argv, const char* app, const char* desc, unsigned hostID = 0; #ifndef GALOIS_ENABLE_GPU numThreads = galois::setActiveThreads(numThreads); // number of threads on CPU - hostID = galois::runtime::getSystemNetworkInterface().ID; + hostID = galois::runtime::getSystemNetworkInterface().ID; #endif if (hostID == 0) { diff --git a/lonestar/gnn/include/lonestargnn.h b/lonestar/gnn/include/lonestargnn.h index 2f66303c86..8b18e80ae0 100644 --- a/lonestar/gnn/include/lonestargnn.h +++ b/lonestar/gnn/include/lonestargnn.h @@ -3,55 +3,34 @@ #include "llvm/Support/CommandLine.h" namespace cll = llvm::cl; -static cll::opt - dataset(cll::Positional, cll::desc(""), - cll::Required); // 'cora', 'citeseer', 'pubmed' -// static cll::opt model("m", -// cll::desc("Model string"), cll::init("gcn")); // 'gcn', 'gcn_cheby', -// 'dense' -static cll::opt - epochs("k", cll::desc("number of epoch, i.e. iterations (default value 1)"), - cll::init(1)); -static cll::opt num_conv_layers( - "nc", cll::desc("number of convolutional layers, (default value 2)"), - cll::init(2)); -static cll::opt - hidden1("h", - cll::desc("Number of units in hidden layer 1 (default value 16)"), - cll::init(16)); -static cll::opt - learning_rate("lr", cll::desc("Initial learning rate (default value 0.01)"), - cll::init(0.01)); -static cll::opt dropout_rate( - "dr", cll::desc("Dropout rate (1 - keep probability) (default value 0.5)"), - cll::init(0.5)); -static cll::opt weight_decay( - "wd", - cll::desc("Weight for L2 loss on embedding matrix (default value 5e-4)"), - cll::init(5e-4)); -static cll::opt early_stopping( - "es", - cll::desc("Tolerance for early stopping (# of epochs) (default value 10)"), - cll::init(10)); -static cll::opt is_single_class( - "sc", cll::desc("single-class or multi-class label (default single)"), - cll::init(1)); -static cll::opt do_validate("dv", cll::desc("enable validation"), - cll::init(1)); +static cll::opt dataset(cll::Positional, + cll::desc(""), cll::Required); // 'cora', 'citeseer', 'pubmed' +//static cll::opt model("m", +// cll::desc("Model string"), cll::init("gcn")); // 'gcn', 'gcn_cheby', 'dense' +static cll::opt epochs("k", + cll::desc("number of epoch, i.e. iterations (default value 1)"), cll::init(1)); +static cll::opt num_conv_layers("nc", + cll::desc("number of convolutional layers, (default value 2)"), cll::init(2)); +static cll::opt hidden1("h", + cll::desc("Number of units in hidden layer 1 (default value 16)"), cll::init(16)); +static cll::opt learning_rate("lr", + cll::desc("Initial learning rate (default value 0.01)"), cll::init(0.01)); +static cll::opt dropout_rate("dr", + cll::desc("Dropout rate (1 - keep probability) (default value 0.5)"), cll::init(0.5)); +static cll::opt weight_decay("wd", + cll::desc("Weight for L2 loss on embedding matrix (default value 5e-4)"), cll::init(5e-4)); +static cll::opt early_stopping("es", + cll::desc("Tolerance for early stopping (# of epochs) (default value 10)"), cll::init(10)); +static cll::opt is_single_class("sc", + cll::desc("single-class or multi-class label (default single)"), cll::init(1)); +static cll::opt do_validate("dv", cll::desc("enable validation"), cll::init(1)); static cll::opt do_test("dt", cll::desc("enable test"), cll::init(1)); -static cll::opt add_selfloop("sl", cll::desc("add selfloop"), - cll::init(0)); -static cll::opt add_l2norm("l2", cll::desc("add an l2_norm layer"), - cll::init(0)); -static cll::opt add_dense("d", cll::desc("add an dense layer"), - cll::init(0)); -static cll::opt - val_interval("vi", cll::desc("validation interval (default value 1)"), - cll::init(1)); -static cll::opt neighbor_sample_sz( - "ns", cll::desc("neighbor sampling size (default value 0)"), cll::init(0)); -static cll::opt subgraph_sample_sz( - "ss", cll::desc("subgraph sampling size (default value 0)"), cll::init(0)); +static cll::opt add_selfloop("sl", cll::desc("add selfloop"), cll::init(0)); +static cll::opt add_l2norm("l2", cll::desc("add an l2_norm layer"), cll::init(0)); +static cll::opt add_dense("d", cll::desc("add an dense layer"), cll::init(0)); +static cll::opt val_interval("vi", cll::desc("validation interval (default value 1)"), cll::init(1)); +static cll::opt neighbor_sample_sz("ns", cll::desc("neighbor sampling size (default value 0)"), cll::init(0)); +static cll::opt subgraph_sample_sz("ss", cll::desc("subgraph sampling size (default value 0)"), cll::init(0)); //! standard global options to the benchmarks extern llvm::cl::opt skipVerify; @@ -59,14 +38,9 @@ extern llvm::cl::opt numThreads; extern llvm::cl::opt statFile; //! standard global options to the benchmarks -llvm::cl::opt - skipVerify("noverify", - llvm::cl::desc("Skip verification step (default value false)"), - llvm::cl::init(false)); -llvm::cl::opt - numThreads("t", llvm::cl::desc("Number of threads (default value 1)"), - llvm::cl::init(1)); -llvm::cl::opt statFile( - "statFile", - llvm::cl::desc("ouput file to print stats to (default value empty)"), - llvm::cl::init("")); +llvm::cl::opt skipVerify("noverify", + llvm::cl::desc("Skip verification step (default value false)"), llvm::cl::init(false)); +llvm::cl::optnumThreads("t", llvm::cl::desc("Number of threads (default value 1)"), llvm::cl::init(1)); +llvm::cl::opt statFile("statFile", + llvm::cl::desc("ouput file to print stats to (default value empty)"), llvm::cl::init("")); + diff --git a/lonestar/gnn/sage/sage.cpp b/lonestar/gnn/sage/sage.cpp index b9daad0436..5f078dff63 100644 --- a/lonestar/gnn/sage/sage.cpp +++ b/lonestar/gnn/sage/sage.cpp @@ -3,9 +3,8 @@ #include "lonestargnn.h" const char* name = "GraphSAGE"; -const char* desc = - "GraphSAGE on an undirected graph: "; -const char* url = 0; +const char* desc = "GraphSAGE on an undirected graph: "; +const char* url = 0; // define aggregator here // .. math:: @@ -18,42 +17,39 @@ const char* url = 0; // h_{i}^{(l+1)} & = \mathrm{norm}(h_{i}^{l}) namespace deepgalois { - -class AppAggregator : public Aggregator { + +class AppAggregator: public Aggregator { public: emb_t applyEdge(VertexID, VertexID u, emb_t in) { auto ilen = get_in_feat_len(); - return &in[ilen * u]; + return &in[ilen*u]; } emb_t applyVertex(VertexID v, emb_t in, emb_t accum) { - auto n = get_num_samples(); + auto n = get_num_samples(); auto ilen = get_in_feat_len(); auto olen = get_out_feat_len(); emb_t a, b, c; - math::mvmul(CblasTrans, olen, ilen, 1.0, W, &accum[v * ilen], 0.0, - a); // a = W * accum[v]; [olen x ilen] * [ilen x 1] = [olen x 1] - math::mvmul(CblasTrans, olen, ilen, 1.0, Q, &in[v * ilen], 0.0, - b); // b = Q * in; [olen x ilen] * [ilen x 1] = [olen x 1] + math::mvmul(CblasTrans, olen, ilen, 1.0, W, &accum[v*ilen], 0.0, a); // a = W * accum[v]; [olen x ilen] * [ilen x 1] = [olen x 1] + math::mvmul(CblasTrans, olen, ilen, 1.0, Q, &in[v*ilen], 0.0, b); // b = Q * in; [olen x ilen] * [ilen x 1] = [olen x 1] math::vadd_cpu(olen, a, b, c); // c = a + b; [olen x 1] - return c; // the feature vector to update h[v] + return c; // the feature vector to update h[v] + } +/* + emb_t applyVertex(emb_t in, emb_t accum) { + auto n = get_num_samples(); + auto ilen = get_in_feat_len(); + auto olen = get_out_feat_len(); + emb_t a, b, c; + math::matmul(n, olen, ilen, accum, W, a); // a = accum * W; [n x ilen] * [ilen x olen] = [n x olen] + math::matmul(n, olen, ilen, in, Q, b); // b = in * Q; [n x ilen] * [ilen x olen] = [n x olen] + math::vadd(n*olen, a, b, c); // c = a + b; [n x olen] + return c; // all the feature vectors to update the entire h } - /* - emb_t applyVertex(emb_t in, emb_t accum) { - auto n = get_num_samples(); - auto ilen = get_in_feat_len(); - auto olen = get_out_feat_len(); - emb_t a, b, c; - math::matmul(n, olen, ilen, accum, W, a); // a = accum * W; [n x ilen] * - [ilen x olen] = [n x olen] math::matmul(n, olen, ilen, in, Q, b); // b = - in * Q; [n x ilen] * [ilen x olen] = [n x olen] math::vadd(n*olen, a, b, c); - // c = a + b; [n x olen] return c; // all the feature vectors to update the - entire h - } - */ - // void update_all(size_t len, Graph& g, const emb_t in, emb_t out) { - // } +*/ + //void update_all(size_t len, Graph& g, const emb_t in, emb_t out) { + //} }; -} // namespace deepgalois +} #include "engine.h" diff --git a/lonestar/gnn/src/DistributedGraphLoader.cpp b/lonestar/gnn/src/DistributedGraphLoader.cpp index 67679606b6..5e1a2dbe81 100644 --- a/lonestar/gnn/src/DistributedGraphLoader.cpp +++ b/lonestar/gnn/src/DistributedGraphLoader.cpp @@ -42,8 +42,7 @@ cll::opt partitionScheme( "gnn cvc: train nodes evenly distributed")), cll::init(GNN_OEC)); -cll::opt useWMD("useWMD", - cll::desc("true if the input graph is" - " SHAD WMD graph format." - " Otheriwse, set false."), - cll::init(false)); +cll::opt useWMD("useWMD", cll::desc("true if the input graph is" + " SHAD WMD graph format." + " Otheriwse, set false."), + cll::init(false)); diff --git a/lonestar/libdistbench/include/DistBench/Input.h b/lonestar/libdistbench/include/DistBench/Input.h index 4563b720a7..d7e9cb8568 100644 --- a/lonestar/libdistbench/include/DistBench/Input.h +++ b/lonestar/libdistbench/include/DistBench/Input.h @@ -166,7 +166,7 @@ constructSymmetricGraph(std::vector& GALOIS_UNUSED(scaleFactor)) { case GINGER_O: case GINGER_I: return galois::cuspPartitionGraph( - inputFile, galois::CUSP_CSR, galois::CUSP_CSR, useWMD, true, + inputFile, galois::CUSP_CSR, galois::CUSP_CSR, useWMD ,true, inputFileTranspose); case FENNEL_O: @@ -371,7 +371,8 @@ DistGraphPtr constructGraph(std::vector&) { return galois::cuspPartitionGraph(inputFile, galois::CUSP_CSC, galois::CUSP_CSC, useWMD, - false, inputFileTranspose); + false, + inputFileTranspose); } else { GALOIS_DIE("cvc requires transpose graph"); break; diff --git a/lonestar/libdistbench/src/Input.cpp b/lonestar/libdistbench/src/Input.cpp index 3ed520e69c..844591506f 100644 --- a/lonestar/libdistbench/src/Input.cpp +++ b/lonestar/libdistbench/src/Input.cpp @@ -60,11 +60,10 @@ cll::opt partitionScheme( "fennel, incoming edge cut, using CuSP")), cll::init(OEC)); -cll::opt useWMD("useWMD", - cll::desc("true if the input graph is" - " SHAD WMD graph format." - " Otheriwse, set false."), - cll::init(false)); +cll::opt useWMD("useWMD", cll::desc("true if the input graph is" + " SHAD WMD graph format." + " Otheriwse, set false."), + cll::init(false)); cll::opt readFromFile("readFromFile", cll::desc("Set this flag if graph is to be " diff --git a/lonestar/libgnnbench/src/Input.cpp b/lonestar/libgnnbench/src/Input.cpp index 1068ebd9d0..c1da754222 100644 --- a/lonestar/libgnnbench/src/Input.cpp +++ b/lonestar/libgnnbench/src/Input.cpp @@ -26,11 +26,10 @@ llvm::cl::opt partition_scheme( "Original Cartesian Vertex-Cut")), cll::init(galois::graphs::GNNPartitionScheme::kOEC)); -cll::opt useWMD("useWMD", - cll::desc("true if the input graph is" - " SHAD WMD graph format." - " Otheriwse, set false."), - cll::init(false)); +cll::opt useWMD("useWMD", cll::desc("true if the input graph is" + " SHAD WMD graph format." + " Otheriwse, set false."), + cll::init(false)); llvm::cl::opt num_layers( "numLayers", diff --git a/lonestar/libgnnbench/src/Start.cpp b/lonestar/libgnnbench/src/Start.cpp index 76f0d01744..ed928374cc 100644 --- a/lonestar/libgnnbench/src/Start.cpp +++ b/lonestar/libgnnbench/src/Start.cpp @@ -135,14 +135,14 @@ void GNNBenchStart(int argc, char** argv, const char* app, const char* desc, // partitioning policies. They consider and attempt to balance the // number of master "training" nodes for each host. // SHAD-GNN on WMD graphs is not necessarily constrained to this design. - // SHAD-GNN has the specific number of training vertices, and randomly + // SHAD-GNN has the specific number of training vertices, and randomly // selects vertices from a graph as that, which means that Galois-GNN // could avoid vertex imbalancing due to the skewness if it chooses // vertices in balance manner. // To sum up, we do not support the specialized partitioning policies, // but choose vertices in balance manner. GALOIS_LOG_FATAL("Gnn CVC and OEC are not supported for WMD graphs {}", - GNNPartitionToString(partition_scheme)); + GNNPartitionToString(partition_scheme)); } } diff --git a/lonestar/mining/cpu/subgraph-listing/sgl_cycle.cpp b/lonestar/mining/cpu/subgraph-listing/sgl_cycle.cpp index 2aad7806b0..e38521caa6 100644 --- a/lonestar/mining/cpu/subgraph-listing/sgl_cycle.cpp +++ b/lonestar/mining/cpu/subgraph-listing/sgl_cycle.cpp @@ -4,7 +4,7 @@ const char* name = "sgl"; const char* desc = "listing edge-induced subgraphs of a given pattern in a " "graph using bfs extension"; -const char* url = nullptr; +const char* url = nullptr; #include "pangolin/BfsMining/vertex_miner_api.h" class MyAPI : public VertexMinerAPI { diff --git a/lonestar/mining/cpu/subgraph-listing/sgl_diamond.cpp b/lonestar/mining/cpu/subgraph-listing/sgl_diamond.cpp index ca272c8f52..2b68512858 100644 --- a/lonestar/mining/cpu/subgraph-listing/sgl_diamond.cpp +++ b/lonestar/mining/cpu/subgraph-listing/sgl_diamond.cpp @@ -4,7 +4,7 @@ const char* name = "sgl"; const char* desc = "listing edge-induced subgraphs of a given pattern in a " "graph using bfs extension"; -const char* url = nullptr; +const char* url = nullptr; #include "pangolin/BfsMining/vertex_miner_api.h" class MyAPI : public VertexMinerAPI { diff --git a/lonestar/scientific/cpu/delaunayrefinement/DelaunayRefinement.cpp b/lonestar/scientific/cpu/delaunayrefinement/DelaunayRefinement.cpp index d8e9630cb9..8dadc777cb 100644 --- a/lonestar/scientific/cpu/delaunayrefinement/DelaunayRefinement.cpp +++ b/lonestar/scientific/cpu/delaunayrefinement/DelaunayRefinement.cpp @@ -38,7 +38,7 @@ namespace cll = llvm::cl; static const char* name = "Delaunay Mesh Refinement"; static const char* desc = "Refines a Delaunay triangulation mesh such that no " "angle in the mesh is less than 30 degrees"; -static const char* url = "delaunay_mesh_refinement"; +static const char* url = "delaunay_mesh_refinement"; static cll::opt inputFile(cll::Positional, cll::desc(""), cll::Required); diff --git a/lonestar/scientific/cpu/longestedge/src/LongestEdge.cpp b/lonestar/scientific/cpu/longestedge/src/LongestEdge.cpp index cb253bed15..6da95f5126 100644 --- a/lonestar/scientific/cpu/longestedge/src/LongestEdge.cpp +++ b/lonestar/scientific/cpu/longestedge/src/LongestEdge.cpp @@ -33,7 +33,7 @@ namespace cll = llvm::cl; static const char* name = "Longest edge mesh generator"; static const char* desc = "Implementation of Rivara's Longest Edge algorithm " "based on hyper-graph grammars."; -static const char* url = "longest_edge"; +static const char* url = "longest_edge"; // Command line arguments static cll::opt dataDir("data", cll::Positional, diff --git a/lonestar/scientific/cpu/longestedge/src/readers/SrtmReader.cpp b/lonestar/scientific/cpu/longestedge/src/readers/SrtmReader.cpp index 9f916d744f..40c5a1080b 100644 --- a/lonestar/scientific/cpu/longestedge/src/readers/SrtmReader.cpp +++ b/lonestar/scientific/cpu/longestedge/src/readers/SrtmReader.cpp @@ -32,7 +32,7 @@ Map* SrtmReader::read( // from disk double** map_data = Map::init_map_data(rows, cols); Map* map = new Map(map_data, cols, rows, 1. / VALUES_IN_DEGREE, - 1. / VALUES_IN_DEGREE); + 1. / VALUES_IN_DEGREE); map->setNorthBorder(map_N_border); map->setWestBorder(map_W_border);