Skip to content

Commit b491e0f

Browse files
authored
Merge pull request #7 from MultithreadCorner/develop
Merging develop into master
2 parents 4e2fd92 + c6cd70e commit b491e0f

27 files changed

+2732
-3661
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TCode
1+
<img src="logo_TCoDe.png" width="300">
22

33
## What is it?
44
TCode is a C++14 compliant application to simulate the response of solid state sensors in massively parallel platforms on Linux systems. TCode is implemented on top of [Hydra](https://github.com/MultithreadCorner/Hydra) and as such, it can run on OpenMP, CUDA and TBB compatible devices.

cmake/AddAnalysisTarget.cmake

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ function(ADD_ANALYSIS target_name)
44
# CUDA TARGETS |
55
#+++++++++++++++++++++++++
66
if(BUILD_CUDA_TARGETS)
7-
message(STATUS "Adding target ${target_name} to CUDA backend. Executable file name: ${target_name}_cuda")
7+
message(STATUS "Adding target ${target_name} to CUDA backend. Executable file name: ${PROJECT_NAME}-${target_name}_cuda")
88

9-
cuda_add_executable("${target_name}_cuda"
10-
#EXCLUDE_FROM_ALL
11-
"${CMAKE_CURRENT_SOURCE_DIR}/src/${target_name}.cu"
12-
OPTIONS -Xcompiler -DHYDRA_DEVICE_SYSTEM=CUDA -DHYDRA_HOST_SYSTEM=CPP)
13-
14-
target_link_libraries("${target_name}_cuda" ${ROOT_LIBRARIES} ${LIBCONFIGPP_LIBRARIES} )
9+
cuda_add_executable("${target_name}_cuda"
10+
#EXCLUDE_FROM_ALL
11+
"${CMAKE_CURRENT_SOURCE_DIR}/src/${target_name}.cu"
12+
OPTIONS -Xcompiler -DHYDRA_DEVICE_SYSTEM=CUDA -DHYDRA_HOST_SYSTEM=CPP)
13+
14+
set_target_properties( "${target_name}_cuda"
15+
PROPERTIES OUTPUT_NAME "${PROJECT_NAME}-${target_name}_cuda")
16+
17+
target_link_libraries("${target_name}_cuda" ${ROOT_LIBRARIES} ${LIBCONFIGPP_LIBRARIES})
18+
19+
install(TARGETS "${target_name}_cuda" DESTINATION bin)
1520

1621

1722
endif(BUILD_CUDA_TARGETS)
@@ -20,15 +25,17 @@ function(ADD_ANALYSIS target_name)
2025
# TBB TARGETS |
2126
#+++++++++++++++++++++++++
2227
if(BUILD_TBB_TARGETS)
23-
message(STATUS "Adding target ${target_name} to TBB backend. Executable file name: ${target_name}_tbb")
28+
message(STATUS "Adding target ${target_name} to TBB backend. Executable file name: ${PROJECT_NAME}-${target_name}_tbb")
2429
add_executable("${target_name}_tbb"
2530
# EXCLUDE_FROM_ALL
2631
"${CMAKE_CURRENT_SOURCE_DIR}/src/${target_name}.cpp" )
2732

2833
set_target_properties( "${target_name}_tbb"
29-
PROPERTIES COMPILE_FLAGS "-DHYDRA_HOST_SYSTEM=CPP -DHYDRA_DEVICE_SYSTEM=TBB")
34+
PROPERTIES COMPILE_FLAGS "-DHYDRA_HOST_SYSTEM=CPP -DHYDRA_DEVICE_SYSTEM=TBB" OUTPUT_NAME "${PROJECT_NAME}-${target_name}_tbb")
3035

3136
target_link_libraries( "${target_name}_tbb" ${ROOT_LIBRARIES} ${TBB_LIBRARIES} ${LIBCONFIGPP_LIBRARIES} )
37+
38+
install(TARGETS "${target_name}_tbb" DESTINATION bin)
3239

3340

3441
endif(BUILD_TBB_TARGETS)
@@ -37,15 +44,17 @@ function(ADD_ANALYSIS target_name)
3744
# CPP TARGETS |
3845
#+++++++++++++++++++++++++
3946
if(BUILD_CPP_TARGETS)
40-
message(STATUS "Adding target ${target_name} to CPP backend. Executable file name: ${target_name}_cpp")
47+
message(STATUS "Adding target ${target_name} to CPP backend. Executable file name: ${PROJECT_NAME}-${target_name}_cpp")
4148
add_executable("${target_name}_cpp"
4249
# EXCLUDE_FROM_ALL
4350
"${CMAKE_CURRENT_SOURCE_DIR}/src/${target_name}.cpp" )
44-
51+
4552
set_target_properties( "${target_name}_cpp"
46-
PROPERTIES COMPILE_FLAGS "-DHYDRA_HOST_SYSTEM=CPP -DHYDRA_DEVICE_SYSTEM=CPP")
53+
PROPERTIES COMPILE_FLAGS "-DHYDRA_HOST_SYSTEM=CPP -DHYDRA_DEVICE_SYSTEM=CPP" OUTPUT_NAME "${PROJECT_NAME}-${target_name}_cpp")
4754

4855
target_link_libraries( "${target_name}_cpp" ${ROOT_LIBRARIES} ${TBB_LIBRARIES} ${LIBCONFIGPP_LIBRARIES} )
56+
57+
install(TARGETS "${target_name}_cpp" DESTINATION bin)
4958

5059

5160
endif(BUILD_CPP_TARGETS)
@@ -55,17 +64,19 @@ function(ADD_ANALYSIS target_name)
5564
# OMP TARGETS |
5665
#+++++++++++++++++++++++++
5766
if(BUILD_OMP_TARGETS)
58-
message(STATUS "Adding target ${target_name} to OMP backend. Executable file name: ${target_name}_omp")
67+
message(STATUS "Adding target ${target_name} to OMP backend. Executable file name: ${PROJECT_NAME}-${target_name}_omp")
5968
add_executable("${target_name}_omp"
6069
#EXCLUDE_FROM_ALL
6170
"${CMAKE_CURRENT_SOURCE_DIR}/src/${target_name}.cpp" )
6271

6372
set_target_properties( "${target_name}_omp"
64-
PROPERTIES COMPILE_FLAGS "-DHYDRA_HOST_SYSTEM=CPP -DHYDRA_DEVICE_SYSTEM=OMP ${OpenMP_CXX_FLAGS}")
73+
PROPERTIES COMPILE_FLAGS "-DHYDRA_HOST_SYSTEM=CPP -DHYDRA_DEVICE_SYSTEM=OMP ${OpenMP_CXX_FLAGS}" OUTPUT_NAME "${PROJECT_NAME}-${target_name}_omp")
6574

6675
target_link_libraries( "${target_name}_omp" ${ROOT_LIBRARIES} ${OpenMP_CXX_LIBRARIES} ${LIBCONFIGPP_LIBRARIES} )
76+
77+
install(TARGETS "${target_name}_omp" DESTINATION bin)
6778

6879

6980
endif(BUILD_OMP_TARGETS)
7081

71-
endfunction(ADD_ANALYSIS)
82+
endfunction(ADD_ANALYSIS)

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ In order to run the example from this directory send the following command:
55
To run only one od the two simulation specify its index, e.g., to run only the first:
66

77
`'path to executables'/simulation_cuda -c example_config.cfg -i 0`
8+
9+
The example configuration file contains all the available options (not all of them mandatory)

examples/README_MAP_PREPROCESSING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Before running a simulation with new maps, it is advised to preprocess them with the command line tool 'loadmap'.
2+
An example is available in this directory at processmaps.sh
3+
4+
All the available options are listed below:
5+
6+
| shortcut | identifier | description | type |
7+
| -------- |:----------:|:---------------------------------------------------------------------------------------------------------------------:|-----:|
8+
| e | efield | Electric field map file | string|
9+
| | efield_sc | Electric field map skip columns | int|
10+
| | efield_sr | Electric field map skip rows | int|
11+
| | efield_scale | Electric field scaling factor | int|
12+
| | efield_scalespace | Electric field coordinates scaling factor | double|
13+
| | efield_output | Electric field output file | string |
14+
| E | emob | Electron mobility map file | string |
15+
| | emob_sc | Electron mobility map skip columns | int |
16+
| | emob_sr | Electron mobility map skip rows | int |
17+
| | emob_scale | Electron mobility map scaling factor | double |
18+
| | emob_scalespace | Electron mobility map coordinates scaling factor | double |
19+
| | emob_out | Electron mobility map output file | string |
20+
| H | hmob |Hole mobility map file | string |
21+
| | hmob_sc | Hole mobility map skip columns | int |
22+
| | hmob_sr | Hole mobility map skip rows | int |
23+
| | hmob_scale | Hole mobility map scaling factor | double |
24+
| | hmob_scalespace | Hole mobility map coordinates scaling factor | double |
25+
| | hmob_out | Hole mobility map output file | string |
26+
| w | wfield | Weighting field map file | string|
27+
| | wfield_sc | Weighting field map skip columns | int|
28+
| | wfield_sr | Weighting field map skip rows | int|
29+
| | wfield_scale | Weighting field scaling factor | int|
30+
| | wfield_scalespace | Weighting field coordinates scaling factor | double|
31+
| | wfield_output | Weighting field output file | string |
32+
| o | OutputDirectory | Output directory | string |
33+
34+
35+
36+
If a single map with all quantitites is given (the order must be x,y,z, Ex, Ey, Ez, emob, hmob, Wx, Wy, Wz) the options are:
37+
38+
| shortcut | identifier | description | type |
39+
| -------- |:----------:|:-----------:|-----:|
40+
| p | physmap | Full map of fields | string |
41+
| | physmap_sc | Full map skip columns | int |
42+
| | physmap_sr | Full map skip rows | int |
43+
| | physmap_scale | Full map scaling factor | double |
44+
| | physmap_scalespace | Full map space scaling factor | double |
45+
| | physmap_out | Full map output file | string |
46+
| o | OutputDirectory | Output directory | string |

examples/processmaps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
'path to executables'/loadmaps_cuda -E 'path to input map'/my_electron_mobility.txt -e 'path to input map'/my_electric_field.txt -w 'path to input map'/my_weighting_field.txt -H 'path to input map'/my_hole_mobility.txt --efield_sc 2 --wfield_sc 2 --hmob_sc 2 --emob_sc 2 --emob_scale 1e8 --hmob_scale 1e8 --efield_scale 1e-4 --wfield_scale 1e-4

0 commit comments

Comments
 (0)