Skip to content

Commit ea711f8

Browse files
committed
Update feature branch before pulling into development
2 parents 1c8cf7d + ea773d4 commit ea711f8

File tree

255 files changed

+457807
-82503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+457807
-82503
lines changed

.github/workflows/tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ jobs:
7070
if: always() && steps.tscl.conclusion == 'success'
7171
run: diff ../Testing/RegressionTesting/TestOutput/test-small-connected-long-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-small-connected-long-out.xml
7272

73+
- id: ts911
74+
name: run test-small-911
75+
if: always() && steps.build.conclusion == 'success'
76+
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-small-911.xml
77+
- name: verify test-small-911
78+
if: always() && steps.tt.conclusion == 'success'
79+
run: diff ../Testing/RegressionTesting/TestOutput/test-small-911-out.xml ../Testing/RegressionTesting/GoodOutput/test-small-911-out.xml
80+
7381
- id: tm
7482
name: run test-medium
7583
if: always() && steps.build.conclusion == 'success'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*.lib
2828

2929
# Generated Files
30+
__pycache__/
3031
build/.cmake
3132
build/bin
3233
build/Simulator

CMakeLists.txt

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ include_directories(Testing/lib/GoogleTest/googletest-master/googletest/include)
290290

291291
# Set CUDA_SEPERABLE_COMPILATION to ON for all libraries that contain .cpp files with device functions compiled as CUDA files
292292
if(ENABLE_CUDA)
293-
set_property(TARGET Edges PROPERTY CUDA_STANDARD 11)
294-
set_property(TARGET Vertices PROPERTY CUDA_STANDARD 11)
293+
set_property(TARGET Edges PROPERTY CUDA_STANDARD 17)
294+
set_property(TARGET Vertices PROPERTY CUDA_STANDARD 17)
295295
# Enables CUDA code in these libraries to be compiled into separate object files and then linked together
296296
set_property(TARGET Edges PROPERTY CUDA_SEPARABLE_COMPILATION ON)
297297
set_property(TARGET Vertices PROPERTY CUDA_SEPARABLE_COMPILATION ON)
@@ -360,45 +360,47 @@ add_executable(tests
360360
Testing/UnitTesting/RecorderFactoryTests.cpp
361361
Testing/UnitTesting/InputManagerTests.cpp
362362
Testing/UnitTesting/RNGFactoryTests.cpp
363+
Testing/UnitTesting/GraphManagerTests.cpp
363364
Testing/Utils/ParameterManagerTests.cpp
364365
Testing/Utils/CircularBufferTests.cpp
365-
Testing/UnitTesting/XmlRecorderTests.cpp)
366+
Testing/UnitTesting/XmlRecorderTests.cpp
367+
Testing/UnitTesting/Hdf5RecorderTests.cpp)
366368

367369
# Links the Googletest framework with the testing executable
368370
target_link_libraries(tests gtest gtest_main)
369371

370372
# Link the combined library into the 'tests' executable.
371373
target_link_libraries(tests combinedLib)
372374

373-
add_executable(serialTest
374-
Testing/RunTests.cpp
375-
Testing/UnitTesting/SerializationTests.cpp)
375+
# add_executable(serialTest
376+
# Testing/RunTests.cpp
377+
# Testing/UnitTesting/SerializationTests.cpp)
376378

377-
# Links the Googletest framework with the serialTest executable
378-
target_link_libraries(serialTest gtest gtest_main)
379+
# # Links the Googletest framework with the serialTest executable
380+
# target_link_libraries(serialTest gtest gtest_main)
379381

380-
# Link the combined library into the 'serialTest' executable.
381-
target_link_libraries(serialTest combinedLib)
382+
# # Link the combined library into the 'serialTest' executable.
383+
# target_link_libraries(serialTest combinedLib)
382384

383-
add_executable(deserialTest
384-
Testing/RunTests.cpp
385-
Testing/UnitTesting/DeserializationTests.cpp)
385+
# add_executable(deserialTest
386+
# Testing/RunTests.cpp
387+
# Testing/UnitTesting/DeserializationTests.cpp)
386388

387-
# Links the Googletest framework with the deserialTest executable
388-
target_link_libraries(deserialTest gtest gtest_main)
389+
# # Links the Googletest framework with the deserialTest executable
390+
# target_link_libraries(deserialTest gtest gtest_main)
389391

390-
# Link the combined library into the 'deserialTest' executable.
391-
target_link_libraries(deserialTest combinedLib)
392+
# # Link the combined library into the 'deserialTest' executable.
393+
# target_link_libraries(deserialTest combinedLib)
392394

393-
add_executable(serialFileAccessTest
394-
Testing/RunTests.cpp
395-
Testing/UnitTesting/SerializationFileAccessTest.cpp)
395+
# add_executable(serialFileAccessTest
396+
# Testing/RunTests.cpp
397+
# Testing/UnitTesting/SerializationFileAccessTest.cpp)
396398

397-
# Links the Googletest framework with the serialFileAccessTest executable
398-
target_link_libraries(serialFileAccessTest gtest gtest_main)
399+
# # Links the Googletest framework with the serialFileAccessTest executable
400+
# target_link_libraries(serialFileAccessTest gtest gtest_main)
399401

400-
# Link the combined library into the 'serialFileAccessTest' executable.
401-
target_link_libraries(serialFileAccessTest combinedLib)
402+
# # Link the combined library into the 'serialFileAccessTest' executable.
403+
# target_link_libraries(serialFileAccessTest combinedLib)
402404

403405
# Clear ENABLE_CUDA, PERFORMANCE_METRICS and GPROF from the cache so it's reset for subsequent builds
404406
unset(ENABLE_CUDA CACHE)

CONTRIBUTING.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,43 @@ For UW Bothell students interested in working in the BCL, we use a [shared repos
1212

1313
## Workflow
1414

15-
- Please read up on Github basics (including [GitHub Issues](https://help.github.com/categories/managing-your-work-on-github/)).
15+
- Please read up on Github basics (including [GitHub Issues](https://docs.github.com/en/issues/tracking-your-work-with-issues)).
1616
- Seek the guidance of more senior lab members regarding how to get started.
1717
- Please ***DO NOT WORK DIRECTLY ON THE MASTER BRANCH***.
1818
- Instead, please follow the lab workflow that follows.
1919

20-
0. Review our [Code Formatting Etiquette](https://uwb-biocomputing.github.io/Graphitti/Developer/codingConventions.html) and [C++ design and Coding standards](https://uwb-biocomputing.github.io/Graphitti/Developer/cppStyleGuide.html). Your work will be rejected if it doesn't conform (in fact, your pull requests will fail our code style check in many cases).
20+
1. Review our [Code Formatting Etiquette](https://uwb-biocomputing.github.io/Graphitti/Developer/codingConventions.html) and [C++ design and Coding standards](https://uwb-biocomputing.github.io/Graphitti/Developer/cppStyleGuide.html). Your work will be rejected if it doesn't conform (in fact, your pull requests will fail our code style check in many cases).
2121

22-
1. Your work should be in response to one or more _issues_. If you are planning to work on something that is a small part of an existing issue, then likely that issue is a placeholder "umbrella" that was generated in lieu of thinking through all related details. In that case, now is the time for you to think it through and break that issue down into actionable items — new issues that partially or completely replace the umbrella.
22+
2. Your work should be in response to one or more _issues_. If you are planning to work on something that is a small part of an existing issue, then likely that issue is a placeholder "umbrella" that was generated in lieu of thinking through all related details. In that case, now is the time for you to think it through and break that issue down into actionable items — new issues that partially or completely replace the umbrella.
2323

24-
2. When creating an issue, ensure that it is not a duplicate of an existing one. At Graphitti, we value proper etiquette for issue management. The issue title should be concise and descriptive, starting with action verbs. The issue body should provide all the necessary details, including a description section and tasks section.
24+
3. When creating an issue, ensure that it is not a duplicate of an existing one. At Graphitti, we value proper etiquette for issue management. The issue title should be concise and descriptive, starting with action verbs. The issue body should provide all the necessary details, including a description section and tasks section.
2525

26-
3. Assign yourself to those issue(s).
26+
4. Assign yourself to those issue(s).
2727

28-
4. Create a new feature branch for your work. The branch name should be prefixed with issue number followed by a short description of the issue i.e., **issue-3141-add-documentation-cereal**.
28+
For more information on our GitFlow, please review our [GitFlow Documentation](docs/Developer/GitFlowDiagram.md) to better understand our modifications regarding merging the development branch.
29+
30+
5. Create a new feature branch for your work. The branch name should be prefixed with issue number followed by a short description of the issue i.e., **issue-3141-add-documentation-cereal**.
2931
Use lowercase letters & hyphens to separate words. Additionally, you can add a comment to the issue(s) including a link to the feature branch (unless you are going to create a pull request right away).
3032

31-
5. Make changes to the feature branch (commit/push).
33+
6. Make changes to the feature branch (commit/push).
3234

33-
6. Create a pull request for your branch, whether early or later in your work, to merge into the development branch (not master). Start the pull request title with the issue number, such as **[ISSUE-3141] Add documentation on cereal**.
35+
7. Create a pull request for your branch, whether early or later in your work, to merge into the development branch (not master). Start the pull request title with the issue number, such as **[ISSUE-3141] Add documentation on cereal**.
3436
In the pull request description, tag your issue and provide a brief overview of the changes for the reviewer. Additionally, ensure to perform the following actions in the right-hand column of the pull request page:
3537

3638
- Assign the pull request to yourself.
3739
- Attach appropriate labels to the pull request.
3840
- Link the issue(s) you're working on to this pull request (under "Development", for some reason).
3941

40-
For more information on pull requests, you can read the following guide: [pull requests](http://help.github.com/pull-requests/)
42+
For more information on pull requests, you can read the following guide: [pull requests](https://docs.github.com/en/pull-requests)
4143

42-
6. Before requesting a review of your pull request, *check that your haven't broken anything*. This means checking that all of our automated GitHub actions have passed their tests (this will show directly in the pull request) and that any required manual tests have passed. Some of our tests take a while to run, so rather than do them for every commit to a pull request, we just run them manually when such requests are close to done. Also, GitHub can only test the CPU version of the simulator, so you need to run GPU tests manually. If in doubt, ask someone.
44+
8. Before requesting a review of your pull request, *check that your haven't broken anything*. This means checking that all of our automated GitHub actions have passed their tests (this will show directly in the pull request) and that any required manual tests have passed. Some of our tests take a while to run, so rather than do them for every commit to a pull request, we just run them manually when such requests are close to done. Also, GitHub can only test the CPU version of the simulator, so you need to run GPU tests manually. If in doubt, ask someone.
4345

44-
7. Request a review of your pull request. If you have a designated reviewer, ask that person; otherwise, ask Prof. Stiber or ask during a lab meeting who should review your pull request.
46+
9. Request a review of your pull request. If you have a designated reviewer, ask that person; otherwise, ask Prof. Stiber or ask during a lab meeting who should review your pull request.
4547

46-
8. When your pull request is approved, you can merge it.
48+
10. When your pull request is approved, you can merge it.
4749

48-
9. Once you've verified that the merge is done, you can delete your feature branch.
50+
11. Once you've verified that the merge is done, you can delete your feature branch.
4951

5052
***Please document what you've done***, not only in your commit messages but also with useful comments in code and via changes to the github pages content in the docs directory.
5153

5254
***Please write unit tests.*** Every time you touch a file, you should review the existing unit tests and think of at least one new one to add.
53-
54-

Contributors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ Natalie Gonzales
7272
## 2024
7373
Andrzej Dawiec
7474

75+
ChengHao Hsu
76+
77+
Zaina Shaikh
78+
7579
<!-- ---------------------------------------------------------------------------------- -->
7680
# Graduate
7781

Simulator/Connections/Connections.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ bool Connections::updateConnections(AllVertices &vertices)
8989
}
9090

9191
#if defined(USE_GPU)
92-
void Connections::updateSynapsesWeights(const int numVertices, AllVertices &vertices,
93-
AllEdges &synapses,
92+
void Connections::updateSynapsesWeights(int numVertices, AllVertices &vertices, AllEdges &synapses,
9493
AllSpikingNeuronsDeviceProperties *allVerticesDevice,
9594
AllSpikingSynapsesDeviceProperties *allEdgesDevice,
9695
Layout &layout)

Simulator/Connections/Connections.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "Recorder.h"
3333
#include <log4cplus/loggingmacros.h>
3434
#include <memory>
35+
// cereal
36+
#include <cereal/types/memory.hpp>
3537

3638
using namespace std;
3739

@@ -74,6 +76,9 @@ class Connections {
7476
/// Creates synapses from synapse weights saved in the serialization file.
7577
void createSynapsesFromWeights();
7678

79+
/// Cereal serialization method
80+
template <class Archive> void serialize(Archive &archive, std::uint32_t const version);
81+
7782
#if defined(USE_GPU)
7883
public:
7984
/// Update the weight of the Synapses in the simulation.
@@ -85,8 +90,7 @@ class Connections {
8590
/// @param allVerticesDevice GPU address of the allVertices struct on device memory.
8691
/// @param allEdgesDevice GPU address of the allEdges struct on device memory.
8792
/// @param layout Layout information of the neural network.
88-
virtual void updateSynapsesWeights(const int numVertices, AllVertices &vertices,
89-
AllEdges &synapses,
93+
virtual void updateSynapsesWeights(int numVertices, AllVertices &vertices, AllEdges &synapses,
9094
AllSpikingNeuronsDeviceProperties *allVerticesDevice,
9195
AllSpikingSynapsesDeviceProperties *allEdgesDevice,
9296
Layout &layout);
@@ -104,4 +108,13 @@ class Connections {
104108

105109
log4cplus::Logger fileLogger_;
106110
log4cplus::Logger edgeLogger_;
107-
};
111+
};
112+
113+
CEREAL_CLASS_VERSION(Connections, 1);
114+
115+
/// Cereal serialization method
116+
template <class Archive> void Connections::serialize(Archive &archive, std::uint32_t const version)
117+
{
118+
archive(cereal::make_nvp("edges_", edges_),
119+
cereal::make_nvp("synapseIndexMap_", synapseIndexMap_));
120+
}

Simulator/Connections/NG911/Connections911.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "Connections911.h"
1010
#include "All911Edges.h"
1111
#include "GraphManager.h"
12+
#include "Layout911.h"
1213
#include "ParameterManager.h"
1314

1415
void Connections911::setup()
@@ -106,7 +107,8 @@ BGSIZE Connections911::getEdgeToClosestResponder(const Call &call, BGSIZE vertex
106107
// Euclidean distance to the call's location.
107108
BGSIZE startOutEdg = synapseIndexMap_->outgoingEdgeBegin_[vertexIdx];
108109
BGSIZE outEdgCount = synapseIndexMap_->outgoingEdgeCount_[vertexIdx];
109-
Layout &layout = Simulator::getInstance().getModel().getLayout();
110+
Layout911 &layout911
111+
= dynamic_cast<Layout911 &>(Simulator::getInstance().getModel().getLayout());
110112

111113
BGSIZE resp, respEdge;
112114
double minDistance = numeric_limits<double>::max();
@@ -115,10 +117,8 @@ BGSIZE Connections911::getEdgeToClosestResponder(const Call &call, BGSIZE vertex
115117
assert(edges911.inUse_[outEdg]); // Edge must be in use
116118

117119
BGSIZE dstVertex = edges911.destVertexIndex_[outEdg];
118-
if (layout.vertexTypeMap_[dstVertex] == requiredType) {
119-
double xDelta = call.x - layout.xloc_[dstVertex];
120-
double yDelta = call.y - layout.yloc_[dstVertex];
121-
double distance = sqrt(pow(xDelta, 2) + pow(yDelta, 2));
120+
if (layout911.vertexTypeMap_[dstVertex] == requiredType) {
121+
double distance = layout911.getDistance(dstVertex, call.x, call.y);
122122

123123
if (distance < minDistance) {
124124
minDistance = distance;
@@ -130,7 +130,7 @@ BGSIZE Connections911::getEdgeToClosestResponder(const Call &call, BGSIZE vertex
130130

131131
// We must have found the closest responder of the right type
132132
assert(minDistance < numeric_limits<double>::max());
133-
assert(layout.vertexTypeMap_[resp] == requiredType);
133+
assert(layout911.vertexTypeMap_[resp] == requiredType);
134134
return respEdge;
135135
}
136136

0 commit comments

Comments
 (0)