Skip to content

Commit 8a947a4

Browse files
committed
Merge branch 'development' into release-v1.0
2 parents 868a369 + d704de6 commit 8a947a4

File tree

251 files changed

+383831
-7602
lines changed

Some content is hidden

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

251 files changed

+383831
-7602
lines changed

.github/workflows/tests.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,39 +36,47 @@ jobs:
3636
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-tiny.xml
3737
- name: verify test-tiny
3838
if: always() && steps.tt.conclusion == 'success'
39-
run: diff ../Testing/RegressionTesting/TestOutput/test-tiny-out.xml ../Testing/RegressionTesting/GoodOutput/test-tiny-out.xml
39+
run: diff ../Testing/RegressionTesting/TestOutput/test-tiny-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-tiny-out.xml
4040

4141
- id: ts
4242
name: run test-small
4343
if: always() && steps.build.conclusion == 'success'
4444
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-small.xml
4545
- name: verify test-small
4646
if: always() && steps.ts.conclusion == 'success'
47-
run: diff ../Testing/RegressionTesting/TestOutput/test-small-out.xml ../Testing/RegressionTesting/GoodOutput/test-small-out.xml
47+
run: diff ../Testing/RegressionTesting/TestOutput/test-small-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-small-out.xml
4848

4949
- id: tsc
5050
name: run test-small-connected
5151
if: always() && steps.build.conclusion == 'success'
5252
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-small-connected.xml
5353
- name: verify test-small-connected
5454
if: always() && steps.tsc.conclusion == 'success'
55-
run: diff ../Testing/RegressionTesting/TestOutput/test-small-connected-out.xml ../Testing/RegressionTesting/GoodOutput/test-small-connected-out.xml
55+
run: diff ../Testing/RegressionTesting/TestOutput/test-small-connected-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-small-connected-out.xml
5656

5757
- id: tsl
5858
name: run test-small-long
5959
if: always() && steps.build.conclusion == 'success'
6060
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-small-long.xml
6161
- name: verify test-small-long
6262
if: always() && steps.tsl.conclusion == 'success'
63-
run: diff ../Testing/RegressionTesting/TestOutput/test-small-long-out.xml ../Testing/RegressionTesting/GoodOutput/test-small-long-out.xml
63+
run: diff ../Testing/RegressionTesting/TestOutput/test-small-long-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-small-long-out.xml
6464

6565
- id: tscl
6666
name: run test-small-connected-long
6767
if: always() && steps.build.conclusion == 'success'
6868
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-small-connected-long.xml
6969
- name: verify test-small-connected-long
7070
if: always() && steps.tscl.conclusion == 'success'
71-
run: diff ../Testing/RegressionTesting/TestOutput/test-small-connected-long-out.xml ../Testing/RegressionTesting/GoodOutput/test-small-connected-long-out.xml
71+
run: diff ../Testing/RegressionTesting/TestOutput/test-small-connected-long-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-small-connected-long-out.xml
72+
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
7280

7381
- id: ts911
7482
name: run test-small-911
@@ -84,28 +92,28 @@ jobs:
8492
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-medium.xml
8593
- name: verify test-medium
8694
if: always() && steps.tm.conclusion == 'success'
87-
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-out.xml ../Testing/RegressionTesting/GoodOutput/test-medium-out.xml
95+
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-medium-out.xml
8896

8997
- id: tmc
9098
name: run test-medium-connected
9199
if: always() && steps.build.conclusion == 'success'
92100
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-medium-connected.xml
93101
- name: verify test-medium-connected
94102
if: always() && steps.tmc.conclusion == 'success'
95-
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-connected-out.xml ../Testing/RegressionTesting/GoodOutput/test-medium-connected-out.xml
103+
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-connected-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-medium-connected-out.xml
96104

97105
- id: tml
98106
name: run test-medium-long
99107
if: always() && steps.build.conclusion == 'success'
100108
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-medium-long.xml
101109
- name: verify test-medium-long
102110
if: always() && steps.tml.conclusion == 'success'
103-
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-long-out.xml ../Testing/RegressionTesting/GoodOutput/test-medium-long-out.xml
111+
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-long-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-medium-long-out.xml
104112

105113
- id: tmcl
106114
name: run test-medium-connected-long
107115
if: always() && steps.build.conclusion == 'success'
108116
run: ./cgraphitti -c ../Testing/RegressionTesting/configfiles/test-medium-connected-long.xml
109117
- name: verify test-medium-connected-long
110118
if: always() && steps.tmcl.conclusion == 'success'
111-
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-connected-long-out.xml ../Testing/RegressionTesting/GoodOutput/test-medium-connected-long-out.xml
119+
run: diff ../Testing/RegressionTesting/TestOutput/test-medium-connected-long-out.xml ../Testing/RegressionTesting/GoodOutput/Cpu/test-medium-connected-long-out.xml

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ cgraphitti
4444
tests
4545
serialTest
4646
deserialTest
47+
serialFileAccessTest
48+
#recorderTest
4749
*.exe
4850
*.out
4951
*.app

CMakeLists.txt

Lines changed: 72 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
cmake_minimum_required(VERSION 3.12)
22

33
############################################################################################
4-
# CONDITIONAL FLAG (to run simulation on CPU or GPU)
5-
#
6-
# For GPU: For CPU:
7-
# set(ENABLE_CUDA YES) set(ENABLE_CUDA NO)
4+
#CONDITIONAL FLAG(to run simulation on CPU or GPU)
85
#
9-
# You can also pass this flag when running cmake from the command line like this:
6+
#For GPU : For CPU:
7+
#set(ENABLE_CUDA YES) set(ENABLE_CUDA NO)
108
#
11-
# cmake .. -D ENABLE_CUDA=YES
9+
#You can also pass this flag when running cmake from the command line like this:
1210
#
13-
# "YES"/GPU choice only available if CUDA library is installed and the GPU is CUDA capable.
11+
#cmake..- D ENABLE_CUDA = YES
12+
#
13+
#"YES" / GPU choice only available if CUDA library is installed and the GPU is CUDA capable.
1414
############################################################################################
1515
if(NOT ENABLE_CUDA)
1616
set(ENABLE_CUDA NO)
1717
endif()
1818

19-
# CONDITIONAL FLAG to turn on the performance metrics
19+
#CONDITIONAL FLAG to turn on the performance metrics
2020
if(NOT PERFORMANCE_METRICS)
2121
set(PERFORMANCE_METRICS NO)
2222
endif()
2323

24-
# CONDITIONAL FLAG to turn on the Gprof profiler (Gprof is a performance analysis tool for Unix applications)
25-
# Steps to run Gprof
26-
# Step 01 : set(GPROF YES) below
27-
# Step 02 : Compile and run the simulation on CPU or GPU as usual
28-
# Step 03 : Run the generated gmon.out file from the build directory and save the output in an txt file to improve readability-
29-
# If using CPU - "~/Graphitti/build$ gprof cgraphitti gmon.out > analysis_test.txt"
30-
# If using GPU - "~/Graphitti/build$ gprof ggraphitti gmon.out > analysis_test.txt"
24+
#CONDITIONAL FLAG to turn on the Gprof profiler( \
25+
# Gprof is a performance analysis tool for Unix applications)
26+
#Steps to run Gprof
27+
#Step 01 : set(GPROF YES) below
28+
#Step 02 : Compile and run the simulation on CPU or GPU as usual
29+
#Step 03 : Run the generated gmon.out file from the build directory and save the output in an txt \
30+
# file to improve readability \
31+
#If using CPU - "~/Graphitti/build$ gprof cgraphitti gmon.out > analysis_test.txt"
32+
#If using GPU - "~/Graphitti/build$ gprof ggraphitti gmon.out > analysis_test.txt"
3133
if(NOT GPROF)
3234
set(GPROF NO)
3335
endif()
3436

35-
# Creates the Graphitti project with the correct languages, depending on if using GPU or not
36-
# If using CUDA, also verify the CUDA package and set the required CUDA variables
37+
#Creates the Graphitti project with the correct languages, depending on if using GPU or not
38+
#If using CUDA, also verify the CUDA package and set the required CUDA variables
3739
if(ENABLE_CUDA)
3840
message("\n----Generating Makefile for Graphitti GPU version----")
3941
project(Graphitti LANGUAGES CXX CUDA C)
40-
# Verify CUDA package is present
42+
#Verify CUDA package is present
4143
find_Package(CUDA REQUIRED)
42-
# Set the USE_GPU preprocessor macro so that GPU code will be compiled.
44+
#Set the USE_GPU preprocessor macro so that GPU code will be compiled.
4345
add_compile_definitions(USE_GPU)
44-
# Specify the CUDA architecture/gencode that will be targeted
46+
#Specify the CUDA architecture / gencode that will be targeted
4547
### Set gencode and architecture variables to the correct values for your specific NVIDIA hardware
4648
set(CMAKE_CUDA_ARCHITECTURES 37)
4749
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_37,code=sm_37)
@@ -51,11 +53,11 @@ else()
5153
project(Graphitti LANGUAGES CXX C)
5254
endif()
5355

54-
# Setting the base version to C++ 11
56+
#Setting the base version to C++ 11
5557
set(CMAKE_CXX_STANDARD 17)
5658

57-
# set(DEBUG_MODE YES) for debugging, no optimization
58-
# set(DEBUG_MODE NO) for production code, -O3 optimization enabled
59+
#set(DEBUG_MODE YES) for debugging, no optimization
60+
#set(DEBUG_MODE NO) for production code, -O3 optimization enabled
5961
set(DEBUG_MODE NO)
6062

6163
if(PERFORMANCE_METRICS)
@@ -70,7 +72,8 @@ if(GPROF)
7072
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
7173
endif()
7274

73-
# HDF5 Support, finds HDF5 package for C and C++ and links the hdf5 libraries to the executable later in the file.
75+
#HDF5 Support, finds HDF5 package for C and C++ and links the hdf5 libraries to the executable \
76+
# later in the file.
7477
find_package(HDF5 COMPONENTS C CXX)
7578
if (HDF5_FOUND)
7679
message("-- HDF5 version ${HDF5_VERSION} located. HDF5 recorders are available.")
@@ -81,20 +84,20 @@ else()
8184
message("-- HDF5 library was not located. Please only use XML recorders.")
8285
endif()
8386

84-
# Find boost graph library
87+
#Find boost graph library
8588
find_package(Boost REQUIRED COMPONENTS graph)
8689

87-
# Get git commit ID
88-
# Change to "git rev-parse --short HEAD" for short commit ID
90+
#Get git commit ID
91+
#Change to "git rev-parse --short HEAD" for short commit ID
8992
execute_process(
9093
COMMAND
9194
git rev-parse HEAD
9295
OUTPUT_VARIABLE GIT_COMMIT_ID )
9396

94-
# GIT_COMMIT_ID has trailing whitespaces
97+
#GIT_COMMIT_ID has trailing whitespaces
9598
string(REGEX REPLACE "\n$" "" GIT_COMMIT_ID "${GIT_COMMIT_ID}")
9699

97-
# Save GIT_COMMIT_ID to config.h, which is included in Core.cpp
100+
#Save GIT_COMMIT_ID to config.h, which is included in Core.cpp
98101
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
99102
${CMAKE_BINARY_DIR}/config.h
100103
@ONLY )
@@ -103,13 +106,14 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
103106

104107
#set(CMAKE_VERBOSE_MAKEFILE TRUE)
105108

106-
# Setting the location of the executable to be in the top-level directory. This helps when using file paths during
107-
# runtime.
109+
#Setting the location of the executable to be in the top \
110+
# - level directory.This helps when using file paths during
111+
#runtime.
108112
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
109113
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
110114
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
111115

112-
# Set extra warning flags
116+
#Set extra warning flags
113117
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
114118

115119
if (NOT DEBUG_MODE)
@@ -121,11 +125,11 @@ endif()
121125
add_compile_definitions(TIXML_USE_STL)
122126
message("-- Setting Compile Definition: TIMXL_USE_STL")
123127

124-
# Used to define file paths for #include definitions. For example, you can write:
128+
#Used to define file paths for #include definitions.For example, you can write:
125129
# #include "Simulator.h"
126-
# rather than:
130+
#rather than:
127131
# #include "Simulator/Core/Simulator.h"
128-
# if the file path "Simulator/Core" is in the following statement.
132+
#if the file path "Simulator/Core" is in the following statement.
129133
include_directories(
130134
../Graphitti
131135
Simulator
@@ -171,11 +175,12 @@ if(ENABLE_CUDA)
171175
set_source_files_properties(${cuda_sources} PROPERTIES LANGUAGE CUDA)
172176
endif()
173177

174-
# Collect source files and create libraries
175-
# Libraries containing .cpp files compiled as CUDA .cu files should be created as STATIC to ensure proper linking
178+
#Collect source files and create libraries
179+
#Libraries containing.cpp files compiled as CUDA.cu files should be created as STATIC to ensure \
180+
#proper linking
176181

177182

178-
# Create Connections library
183+
#Create Connections library
179184
file(GLOB_RECURSE Connections_Source Simulator/Connections/*.cpp Simulator/Connections/*.h)
180185

181186
if(ENABLE_CUDA)
@@ -285,8 +290,8 @@ include_directories(Testing/lib/GoogleTest/googletest-master/googletest/include)
285290

286291
# Set CUDA_SEPERABLE_COMPILATION to ON for all libraries that contain .cpp files with device functions compiled as CUDA files
287292
if(ENABLE_CUDA)
288-
set_property(TARGET Edges PROPERTY CUDA_STANDARD 11)
289-
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)
290295
# Enables CUDA code in these libraries to be compiled into separate object files and then linked together
291296
set_property(TARGET Edges PROPERTY CUDA_SEPARABLE_COMPILATION ON)
292297
set_property(TARGET Vertices PROPERTY CUDA_SEPARABLE_COMPILATION ON)
@@ -355,36 +360,47 @@ add_executable(tests
355360
Testing/UnitTesting/RecorderFactoryTests.cpp
356361
Testing/UnitTesting/InputManagerTests.cpp
357362
Testing/UnitTesting/RNGFactoryTests.cpp
363+
Testing/UnitTesting/GraphManagerTests.cpp
358364
Testing/Utils/ParameterManagerTests.cpp
359365
Testing/Utils/CircularBufferTests.cpp
360-
# Testing/UnitTesting/XmlRecorderTests.cpp)
361-
)
366+
Testing/UnitTesting/XmlRecorderTests.cpp
367+
Testing/UnitTesting/Hdf5RecorderTests.cpp)
362368

363369
# Links the Googletest framework with the testing executable
364370
target_link_libraries(tests gtest gtest_main)
365371

366372
# Link the combined library into the 'tests' executable.
367373
target_link_libraries(tests combinedLib)
368374

369-
add_executable(serialTest
370-
Testing/RunTests.cpp
371-
Testing/UnitTesting/SerializationTests.cpp)
375+
# add_executable(serialTest
376+
# Testing/RunTests.cpp
377+
# Testing/UnitTesting/SerializationTests.cpp)
372378

373-
# Links the Googletest framework with the serialTest executable
374-
target_link_libraries(serialTest gtest gtest_main)
379+
# # Links the Googletest framework with the serialTest executable
380+
# target_link_libraries(serialTest gtest gtest_main)
375381

376-
# Link the combined library into the 'serialTest' executable.
377-
target_link_libraries(serialTest combinedLib)
382+
# # Link the combined library into the 'serialTest' executable.
383+
# target_link_libraries(serialTest combinedLib)
378384

379-
add_executable(deserialTest
380-
Testing/RunTests.cpp
381-
Testing/UnitTesting/DeserializationTests.cpp)
385+
# add_executable(deserialTest
386+
# Testing/RunTests.cpp
387+
# Testing/UnitTesting/DeserializationTests.cpp)
388+
389+
# # Links the Googletest framework with the deserialTest executable
390+
# target_link_libraries(deserialTest gtest gtest_main)
391+
392+
# # Link the combined library into the 'deserialTest' executable.
393+
# target_link_libraries(deserialTest combinedLib)
394+
395+
# add_executable(serialFileAccessTest
396+
# Testing/RunTests.cpp
397+
# Testing/UnitTesting/SerializationFileAccessTest.cpp)
382398

383-
# Links the Googletest framework with the deserialTest executable
384-
target_link_libraries(deserialTest gtest gtest_main)
399+
# # Links the Googletest framework with the serialFileAccessTest executable
400+
# target_link_libraries(serialFileAccessTest gtest gtest_main)
385401

386-
# Link the combined library into the 'deserialTest' executable.
387-
target_link_libraries(deserialTest combinedLib)
402+
# # Link the combined library into the 'serialFileAccessTest' executable.
403+
# target_link_libraries(serialFileAccessTest combinedLib)
388404

389405
add_executable(serialFileAccessTest
390406
Testing/RunTests.cpp

Contributors.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ Andrzej Dawiec
7474

7575
Jasleen Kaur Saini
7676

77+
ChengHao Hsu
78+
79+
Zaina Shaikh
80+
7781
<!-- ---------------------------------------------------------------------------------- -->
7882
# Graduate
7983

@@ -112,8 +116,10 @@ Victoria Jo Salvatore
112116
Divya Kamath
113117

114118
## 2024
119+
Vanessa Arndorfer
120+
121+
Xiang Li
122+
115123
Jardi Martinez
116124

117125
Nicholas Posey
118-
119-
Xiang Li

Simulator/Connections/Connections.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -103,31 +103,3 @@ void Connections::updateSynapsesWeights()
103103
{
104104
}
105105
#endif // !USE_GPU
106-
107-
/// Creates synapses from synapse weights saved in the serialization file.
108-
void Connections::createSynapsesFromWeights()
109-
{
110-
int numVertices = Simulator::getInstance().getTotalVertices();
111-
Layout &layout = Simulator::getInstance().getModel().getLayout();
112-
AllVertices &vertices = layout.getVertices();
113-
114-
// for each neuron
115-
for (int i = 0; i < numVertices; i++) {
116-
// for each synapse in the vertex
117-
for (BGSIZE synapseIndex = 0; synapseIndex < Simulator::getInstance().getMaxEdgesPerVertex();
118-
synapseIndex++) {
119-
BGSIZE iEdg = Simulator::getInstance().getMaxEdgesPerVertex() * i + synapseIndex;
120-
// if the synapse weight is not zero (which means there is a connection), create the synapse
121-
if (edges_->W_[iEdg] != 0.0) {
122-
BGFLOAT theW = edges_->W_[iEdg];
123-
int srcVertex = edges_->sourceVertexIndex_[iEdg];
124-
int destVertex = edges_->destVertexIndex_[iEdg];
125-
edgeType type = layout.edgType(srcVertex, destVertex);
126-
edges_->edgeCounts_[i]++;
127-
edges_->createEdge(iEdg, srcVertex, destVertex, Simulator::getInstance().getDeltaT(),
128-
type);
129-
edges_->W_[iEdg] = theW;
130-
}
131-
}
132-
}
133-
}

0 commit comments

Comments
 (0)