Skip to content

Commit 3142dae

Browse files
author
Padmanabh Patil
committed
Merge branch 'SharedDevelopment' into PatilDevelopment
2 parents 740b54b + 212fb1d commit 3142dae

File tree

142 files changed

+2771
-185842
lines changed

Some content is hidden

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

142 files changed

+2771
-185842
lines changed

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ graphitti
4242
ggraphitti
4343
cgraphitti
4444
tests
45-
serialTest
46-
deserialTest
45+
serialFullTest
46+
serialFirstHalfTest
47+
serialSecondHalfTest
4748
serialFileAccessTest
48-
#recorderTest
49+
core
50+
# core is generated by GDB during debugging
51+
52+
# Recorder Test
4953
*.exe
5054
*.out
5155
*.app

CMakeLists.txt

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ else()
5353
project(Graphitti LANGUAGES CXX C)
5454
endif()
5555

56-
#Setting the base version to C++ 11
56+
#Setting the base version to C++ 17
5757
set(CMAKE_CXX_STANDARD 17)
5858

5959
#set(DEBUG_MODE YES) for debugging, no optimization
@@ -161,18 +161,24 @@ include_directories(
161161

162162
if(ENABLE_CUDA)
163163

164-
set(cuda_sources Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp
165-
Simulator/Vertices/Neuro/AllVerticesDeviceFuncs_d.cpp
166-
Simulator/Edges/Neuro/AllSpikingSynapses_d.cpp
167-
Simulator/Edges/Neuro/AllSTDPSynapses_d.cpp
168-
Simulator/Edges/Neuro/AllDSSynapses_d.cpp
169-
Simulator/Edges/Neuro/AllDynamicSTDPSynapses_d.cpp
170-
Simulator/Vertices/Neuro/AllLIFNeurons_d.cpp
171-
Simulator/Vertices/Neuro/AllIZHNeurons_d.cpp
172-
Simulator/Vertices/Neuro/AllIFNeurons_d.cpp
173-
Simulator/Vertices/Neuro/AllSpikingNeurons_d.cpp
164+
set(cuda_ConnectionsSources
174165
Simulator/Connections/Neuro/ConnGrowth_d.cpp )
175-
set_source_files_properties(${cuda_sources} PROPERTIES LANGUAGE CUDA)
166+
set_source_files_properties(${cuda_ConnectionsSources} PROPERTIES LANGUAGE CUDA)
167+
168+
set(cuda_EdgesSources Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp
169+
Simulator/Edges/Neuro/AllSpikingSynapses_d.cpp
170+
Simulator/Edges/Neuro/AllSTDPSynapses_d.cpp
171+
Simulator/Edges/Neuro/AllDSSynapses_d.cpp
172+
Simulator/Edges/Neuro/AllDynamicSTDPSynapses_d.cpp)
173+
set_source_files_properties(${cuda_EdgesSources} PROPERTIES LANGUAGE CUDA)
174+
175+
set(cuda_VerticesSources
176+
Simulator/Vertices/Neuro/AllVerticesDeviceFuncs_d.cpp
177+
Simulator/Vertices/Neuro/AllLIFNeurons_d.cpp
178+
Simulator/Vertices/Neuro/AllIZHNeurons_d.cpp
179+
Simulator/Vertices/Neuro/AllIFNeurons_d.cpp
180+
Simulator/Vertices/Neuro/AllSpikingNeurons_d.cpp)
181+
set_source_files_properties(${cuda_VerticesSources} PROPERTIES LANGUAGE CUDA)
176182
endif()
177183

178184
#Collect source files and create libraries
@@ -184,7 +190,7 @@ endif()
184190
file(GLOB_RECURSE Connections_Source Simulator/Connections/*.cpp Simulator/Connections/*.h)
185191

186192
if(ENABLE_CUDA)
187-
add_library(Connections STATIC ${Connections_Source} ${cuda_sources})
193+
add_library(Connections STATIC ${Connections_Source} ${cuda_ConnectionsSources})
188194
else()
189195
list(REMOVE_ITEM Connections_Source "${CMAKE_CURRENT_SOURCE_DIR}/Simulator/Connections/Neuro/ConnGrowth_d.cpp")
190196
add_library(Connections STATIC ${Connections_Source})
@@ -195,7 +201,7 @@ endif()
195201
file(GLOB_RECURSE Vertices_Source Simulator/Vertices/*.cpp Simulator/Vertices/*.h)
196202

197203
if(ENABLE_CUDA)
198-
add_library(Vertices SHARED ${Vertices_Source} ${cuda_sources})
204+
add_library(Vertices STATIC ${Vertices_Source} ${cuda_VerticesSources})
199205
else()
200206
list(REMOVE_ITEM Vertices_Source "${CMAKE_CURRENT_SOURCE_DIR}/Simulator/Vertices/Neuro/AllVerticesDeviceFuncs.h")
201207
list(REMOVE_ITEM Vertices_Source "${CMAKE_CURRENT_SOURCE_DIR}/Simulator/Vertices/Neuro/AllVerticesDeviceFuncs_d.cpp")
@@ -212,7 +218,7 @@ endif()
212218
# Create Edges library
213219
file(GLOB_RECURSE Edges_Source Simulator/Edges/*.cpp Simulator/Edges/*.h)
214220
if(ENABLE_CUDA)
215-
add_library(Edges SHARED ${Edges_Source} ${cuda_sources})
221+
add_library(Edges STATIC ${Edges_Source} ${cuda_EdgesSources})
216222
else()
217223
list(REMOVE_ITEM Edges_Source "${CMAKE_CURRENT_SOURCE_DIR}/Simulator/Edges/Neuro/AllSynapsesDeviceFuncs.h")
218224
list(REMOVE_ITEM Edges_Source "${CMAKE_CURRENT_SOURCE_DIR}/Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp")
@@ -373,45 +379,48 @@ target_link_libraries(tests gtest gtest_main)
373379
# Link the combined library into the 'tests' executable.
374380
target_link_libraries(tests combinedLib)
375381

376-
# add_executable(serialTest
377-
# Testing/RunTests.cpp
378-
# Testing/UnitTesting/SerializationTests.cpp)
382+
#------- SERIALIZATION TESTS --------------------
383+
# Serialization tests must be executed separately, as each test requires the
384+
# simulation to run from start to finish. Running multiple simulations with
385+
# the same singleton instance results in a segmentation fault (SEG FAULT).
379386

380-
# # Links the Googletest framework with the serialTest executable
381-
# target_link_libraries(serialTest gtest gtest_main)
387+
add_executable(serialFullTest
388+
Testing/RunTests.cpp
389+
Testing/UnitTesting/SerializationFullTest.cpp)
382390

383-
# # Link the combined library into the 'serialTest' executable.
384-
# target_link_libraries(serialTest combinedLib)
391+
add_executable(serialFirstHalfTest
392+
Testing/RunTests.cpp
393+
Testing/UnitTesting/SerializationFirstHalfTest.cpp)
385394

386-
# add_executable(deserialTest
387-
# Testing/RunTests.cpp
388-
# Testing/UnitTesting/DeserializationTests.cpp)
395+
add_executable(serialSecondHalfTest
396+
Testing/RunTests.cpp
397+
Testing/UnitTesting/SerializationSecondHalfTest.cpp)
389398

390-
# # Links the Googletest framework with the deserialTest executable
391-
# target_link_libraries(deserialTest gtest gtest_main)
399+
# Link the GoogleTest framework to each of the serial test executables.
400+
target_link_libraries(serialFullTest gtest gtest_main)
401+
target_link_libraries(serialFirstHalfTest gtest gtest_main)
402+
target_link_libraries(serialSecondHalfTest gtest gtest_main)
392403

393-
# # Link the combined library into the 'deserialTest' executable.
394-
# target_link_libraries(deserialTest combinedLib)
404+
# Link the combined library and filesystem support to the respective serial test executables.
405+
target_link_libraries(serialFullTest stdc++fs)
406+
target_link_libraries(serialFullTest combinedLib)
395407

396-
# add_executable(serialFileAccessTest
397-
# Testing/RunTests.cpp
398-
# Testing/UnitTesting/SerializationFileAccessTest.cpp)
408+
target_link_libraries(serialFirstHalfTest stdc++fs)
409+
target_link_libraries(serialFirstHalfTest combinedLib)
399410

400-
# # Links the Googletest framework with the serialFileAccessTest executable
401-
# target_link_libraries(serialFileAccessTest gtest gtest_main)
411+
target_link_libraries(serialSecondHalfTest stdc++fs)
412+
target_link_libraries(serialSecondHalfTest combinedLib)
402413

403-
# # Link the combined library into the 'serialFileAccessTest' executable.
404-
# target_link_libraries(serialFileAccessTest combinedLib)
405-
406-
add_executable(serialFileAccessTest
407-
Testing/RunTests.cpp
408-
Testing/UnitTesting/SerializationFileAccessTest.cpp)
414+
# commenting out serialFileAccessTest until issue-754 is resolved
415+
# add_executable(serialFileAccessTest
416+
# Testing/RunTests.cpp
417+
# Testing/UnitTesting/SerializationFileAccessTest.cpp)
409418

410419
# Links the Googletest framework with the serialFileAccessTest executable
411-
target_link_libraries(serialFileAccessTest gtest gtest_main)
420+
# target_link_libraries(serialFileAccessTest gtest gtest_main)
412421

413422
# Link the combined library into the 'serialFileAccessTest' executable.
414-
target_link_libraries(serialFileAccessTest combinedLib)
423+
# target_link_libraries(serialFileAccessTest combinedLib)
415424

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

Contributors.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ ChengHao Hsu
7878

7979
Zaina Shaikh
8080

81+
## 2025
82+
Andrew Madison
83+
8184
<!-- ---------------------------------------------------------------------------------- -->
8285
# Graduate
8386

Simulator/Connections/Connections.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Connections::Connections()
3838

3939
// Register loadParameters function with Operation Manager
4040
function<void()> loadParamsFunc = bind(&Connections::loadParameters, this);
41-
opsManager.registerOperation(Operations::op::loadParameters, loadParamsFunc);
41+
opsManager.registerOperation(Operations::loadParameters, loadParamsFunc);
4242

4343
// Register registerGraphProperties as Operations registerGraphProperties
4444
function<void()> regGraphPropsFunc = bind(&Connections::registerGraphProperties, this);
@@ -89,17 +89,16 @@ bool Connections::updateConnections(AllVertices &vertices)
8989
}
9090

9191
#if defined(USE_GPU)
92-
void Connections::updateSynapsesWeights(int numVertices, AllVertices &vertices, AllEdges &synapses,
93-
AllSpikingNeuronsDeviceProperties *allVerticesDevice,
94-
AllSpikingSynapsesDeviceProperties *allEdgesDevice,
95-
Layout &layout)
92+
void Connections::updateEdgesWeights(int numVertices, AllVertices &vertices, AllEdges &edges,
93+
AllVerticesDeviceProperties *allVerticesDevice,
94+
AllEdgesDeviceProperties *allEdgesDevice, Layout &layout)
9695
{
9796
}
9897
#else
9998

100-
/// Update the weight of the Synapses in the simulation.
99+
/// Update the weight of the edges in the simulation.
101100
/// Note: Platform Dependent.
102-
void Connections::updateSynapsesWeights()
101+
void Connections::updateEdgesWeights()
103102
{
104103
}
105104
#endif // !USE_GPU

Simulator/Connections/Connections.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#pragma once
2525

2626
#include "AllEdges.h"
27-
#include "AllSpikingNeurons.h"
28-
#include "AllSpikingSynapses.h"
2927
#include "AllVertices.h"
3028
#include "EdgeIndexMap.h"
3129
#include "Layout.h"
@@ -69,7 +67,7 @@ class Connections {
6967

7068
/// Update the connections status in every epoch.
7169
///
72-
/// @param neurons The Neuron list to search from.
70+
/// @param vertices The vertex list to search from.
7371
/// @return true if successful, false otherwise.
7472
virtual bool updateConnections(AllVertices &vertices);
7573

@@ -78,35 +76,36 @@ class Connections {
7876

7977
#if defined(USE_GPU)
8078
public:
81-
/// Update the weight of the Synapses in the simulation.
79+
/// Update the weight of the edges in the simulation.
8280
/// Note: Platform Dependent.
8381
///
8482
/// @param numVertices number of vertices to update.
85-
/// @param neurons the Neuron list to search from.
86-
/// @param synapses the Synapse list to search from.
83+
/// @param vertices the vertex list to search from.
84+
/// @param edges the edge list to search from.
8785
/// @param allVerticesDevice GPU address of the allVertices struct on device memory.
88-
/// @param allEdgesDevice GPU address of the allEdges struct on device memory.
89-
/// @param layout Layout information of the neural network.
90-
virtual void updateSynapsesWeights(int numVertices, AllVertices &vertices, AllEdges &synapses,
91-
AllSpikingNeuronsDeviceProperties *allVerticesDevice,
92-
AllSpikingSynapsesDeviceProperties *allEdgesDevice,
93-
Layout &layout);
86+
/// @param allEdgesDevice GPU address of the allEdges struct on device memory.
87+
/// @param layout Layout information of the graph network.
88+
virtual void updateEdgesWeights(int numVertices, AllVertices &vertices, AllEdges &edges,
89+
AllVerticesDeviceProperties *allVerticesDevice,
90+
AllEdgesDeviceProperties *allEdgesDevice, Layout &layout);
9491
#else
9592
public:
96-
/// Update the weight of the Synapses in the simulation.
93+
/// Update the weight of the edges in the simulation.
9794
/// Note: Platform Dependent.
98-
virtual void updateSynapsesWeights();
95+
virtual void updateEdgesWeights();
9996

10097
#endif // USE_GPU
10198

10299
protected:
103100
unique_ptr<AllEdges> edges_;
101+
/// TODO: Rename to edgeIndexMap_ since this is a base class
104102
unique_ptr<EdgeIndexMap> synapseIndexMap_;
105103

106104
log4cplus::Logger fileLogger_;
107105
log4cplus::Logger edgeLogger_;
108106
};
109107

108+
/// TODO: Rename to synapseIndexMap since this is a base class
110109
/// Cereal serialization method
111110
template <class Archive> void Connections::serialize(Archive &archive)
112111
{

0 commit comments

Comments
 (0)