Skip to content

Commit d0a3cde

Browse files
add parse_smv_benchmark
This is another test designed to both test and benchmark
1 parent 0e00978 commit d0a3cde

File tree

6 files changed

+639
-9
lines changed

6 files changed

+639
-9
lines changed

CMakeLists.txt

Lines changed: 162 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ if (SMOKEVIEW_OBJECT_DEFS_PATH)
291291
endif()
292292

293293
if (LUA)
294-
add_definitions(-Dpp_LUA)
294+
target_compile_definitions(smokeview PRIVATE pp_LUA)
295295
find_package(Lua)
296296
if (LUA_FOUND)
297297
target_link_libraries(smokeview PRIVATE ${LUA_LIBRARIES})
@@ -712,3 +712,164 @@ list(GET smokeview_ini_status 0 smokeview_ini_status_code)
712712
if (smokeview_ini_status_code)
713713
message(FATAL_ERROR "Could not download smokeview.ini ${smokeview_ini_status_code}")
714714
endif()
715+
716+
# parse_smv_benchmark
717+
add_executable(parse_smv_benchmark Tests/parse_smv_benchmark.c
718+
Source/shared/getdata.c
719+
Source/shared/dmalloc.c
720+
Source/smokeview/menus.c
721+
Source/smokeview/IOscript.c
722+
Source/smokeview/IOshooter.c
723+
Source/shared/csphere.c
724+
Source/smokeview/colortimebar.c
725+
Source/smokeview/camera.c
726+
Source/smokeview/IOgeometry.c
727+
Source/smokeview/IOwui.c
728+
Source/smokeview/IOobjects.c
729+
Source/smokeview/IOtour.c
730+
Source/smokeview/getdatacolors.c
731+
Source/smokeview/smokeview.c
732+
Source/smokeview/output.c
733+
Source/smokeview/renderimage.c
734+
Source/smokeview/renderhtml.c
735+
Source/shared/isobox.c
736+
Source/smokeview/getdatabounds.c
737+
Source/smokeview/readsmv.c
738+
Source/smokeview/scontour2d.c
739+
Source/shared/dmalloc.c
740+
Source/shared/compress.c
741+
Source/smokeview/IOvolsmoke.c
742+
Source/smokeview/IOsmoke.c
743+
Source/smokeview/IOplot3d.c
744+
Source/smokeview/IOplot2d.c
745+
Source/smokeview/IOslice.c
746+
Source/smokeview/IOhvac.c
747+
Source/smokeview/IOboundary.c
748+
Source/smokeview/IOpart.c
749+
Source/smokeview/IOzone.c
750+
Source/smokeview/IOiso.c
751+
Source/smokeview/callbacks.c
752+
Source/smokeview/drawGeometry.c
753+
Source/smokeview/skybox.c
754+
Source/shared/file_util.c
755+
Source/shared/string_util.c
756+
Source/smokeview/startup.c
757+
Source/smokeview/shaders.c
758+
Source/smokeview/unit.c
759+
Source/smokeview/threader.c
760+
Source/shared/histogram.c
761+
Source/shared/translate.c
762+
Source/smokeview/update.c
763+
Source/smokeview/viewports.c
764+
Source/smokeview/smv_geometry.c
765+
Source/smokeview/showscene.c
766+
Source/smokeview/infoheader.c
767+
Source/shared/md5.c
768+
Source/shared/sha1.c
769+
Source/shared/sha256.c
770+
Source/shared/stdio_m.c
771+
Source/shared/stdio_buffer.c
772+
Source/shared/getdata.c
773+
Source/shared/color2rgb.c
774+
Source/smokeview/colortable.c
775+
Source/smokeview/command_args.c
776+
777+
Source/smokeview/glui_smoke.cpp
778+
Source/smokeview/glui_clip.cpp
779+
Source/smokeview/glui_stereo.cpp
780+
Source/smokeview/glui_geometry.cpp
781+
Source/smokeview/glui_motion.cpp
782+
Source/smokeview/glui_bounds.cpp
783+
Source/smokeview/glui_colorbar.cpp
784+
Source/smokeview/glui_display.cpp
785+
Source/smokeview/glui_tour.cpp
786+
Source/smokeview/glui_trainer.cpp
787+
Source/smokeview/glui_objects.cpp
788+
Source/smokeview/glui_shooter.cpp
789+
)
790+
791+
target_include_directories(parse_smv_benchmark PRIVATE
792+
Source/shared
793+
Source/glew
794+
Source/smokeview
795+
Source/glui_v2_1_beta
796+
Source/glui_gl
797+
)
798+
799+
800+
# These include directories are an existing workaround that would be good to
801+
# remove.Because of this custom code and the potential conflict with native libs
802+
# this needs to be early in the include order.
803+
if (WIN32)
804+
target_include_directories(parse_smv_benchmark PRIVATE Source/glut_gl)
805+
else()
806+
target_include_directories(parse_smv_benchmark PRIVATE Source/glui_gl)
807+
endif ()
808+
# GLUI can be provided natively, but there are modifications in the code
809+
# vendored with Smokeview that we rely on. Because of this custom code and the
810+
# potential conflict with native libs this needs to be early in the include order.
811+
target_link_libraries(parse_smv_benchmark PRIVATE glui_static)
812+
target_include_directories(parse_smv_benchmark PRIVATE Source/glui_v2_1_beta)
813+
if(WIN32)
814+
if (PThreads4W_FOUND)
815+
target_link_libraries(parse_smv_benchmark PRIVATE PThreads4W::PThreads4W)
816+
else()
817+
target_include_directories(parse_smv_benchmark PRIVATE Source/pthreads)
818+
target_link_libraries(parse_smv_benchmark PRIVATE pthread_static)
819+
endif()
820+
endif()
821+
# Selecting which GLUT version to use is the most platform-dependent part of the
822+
# build.
823+
if (MACOSX)
824+
add_definitions(-Dpp_NOQUARTZ)
825+
target_link_libraries(parse_smv_benchmark PRIVATE "-framework OpenGL" "-framework GLUT")
826+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
827+
elseif (GLUT_FOUND)
828+
target_link_libraries(parse_smv_benchmark PRIVATE GLUT::GLUT)
829+
else()
830+
target_link_libraries(parse_smv_benchmark PRIVATE glut32_static)
831+
endif ()
832+
if (GLEW_FOUND)
833+
target_link_libraries(parse_smv_benchmark PRIVATE GLEW::GLEW)
834+
# This line is a hack to work around the fact the code includes "glew.h"
835+
# rather than <GL/glew.h>
836+
target_include_directories(parse_smv_benchmark PRIVATE ${GLEW_INCLUDE_DIRS}/GL)
837+
else()
838+
target_sources(parse_smv_benchmark PRIVATE
839+
Source/glew/glew.c
840+
)
841+
target_include_directories(parse_smv_benchmark PRIVATE Source/glew)
842+
endif()
843+
if (JPEG_FOUND)
844+
target_link_libraries(parse_smv_benchmark PRIVATE JPEG::JPEG)
845+
else()
846+
target_link_libraries(parse_smv_benchmark PRIVATE jpeg_static)
847+
endif()
848+
if (PNG_FOUND)
849+
target_link_libraries(parse_smv_benchmark PRIVATE PNG::PNG)
850+
else()
851+
target_link_libraries(parse_smv_benchmark PRIVATE png_static)
852+
endif()
853+
if (ZLIB_FOUND)
854+
target_link_libraries(parse_smv_benchmark PRIVATE ZLIB::ZLIB)
855+
else()
856+
target_link_libraries(parse_smv_benchmark PRIVATE zlib_static)
857+
endif()
858+
if (LIBGD_FOUND)
859+
target_link_libraries(parse_smv_benchmark PRIVATE PkgConfig::LIBGD)
860+
else()
861+
target_link_libraries(parse_smv_benchmark PRIVATE gd_static)
862+
endif()
863+
target_link_libraries(parse_smv_benchmark PRIVATE OpenGL::GL OpenGL::GLU)
864+
865+
866+
if (WIN32)
867+
target_include_directories(parse_smv_benchmark PRIVATE Source/pthreads)
868+
endif()
869+
if ((NOT MACOSX) AND UNIX)
870+
target_link_libraries(parse_smv_benchmark PRIVATE m)
871+
endif()
872+
if (LINUX)
873+
add_definitions(-Dpp_LINUX)
874+
target_link_libraries(parse_smv_benchmark PRIVATE pthread X11 Xmu GLU GL m stdc++)
875+
endif()

Tests/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
fig/
2+
test_model_small/
3+
test_model_large/

Tests/options.h

Lines changed: 103 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,113 @@
11
#ifndef OPTIONS_H_DEFINED
22
#define OPTIONS_H_DEFINED
33

4-
#include "options_common.h"
54

6-
//*** uncomment the following two lines to force all versions to be beta
7-
//#undef pp_BETA
8-
//#define pp_BETA
5+
#include "options_common.h"
96

10-
//*** define smokediff title
7+
//*** define smokeview title
118

129
#ifdef pp_BETA
13-
#define PROGVERSION "Test"
14-
#else
15-
#define PROGVERSION "1.0.11"
10+
#define pp_DEBUG_SUBMENU // debug output and testing for building menus
11+
#endif
12+
13+
//*** parallel file loading
14+
#define pp_SLICE_MULTI // load slice files in parallel
15+
#define pp_PART_MULTI // load particle files in parallel
16+
#define pp_CSV_MULTI // read in csv files in parallel
17+
18+
#define pp_PATCH_HIST // simplify boundary file histogram computation
19+
//#define pp_HIST // compute histograms
20+
21+
#define pp_SMOKE_SKIP // add option to skip smoke frames
22+
//#define pp_SMOKE16 // load 16 bit smoke files
23+
//#define pp_VOLSMOKE // add option to compress volume rendered data
24+
//#define pp_GAMMA // show gamma correction checkbox
25+
#define pp_BLACKBODY // use blackbody theory for generating fire colors
26+
// pp_BLACKBODY_OUT // output generated blackbody color data
27+
//#define pp_BOUND_HIST_ON // turn on boundary file histograms
28+
//#define pp_DECIMATE // decimate terrain geometry
29+
30+
#define pp_FAST // set fast startup by default
31+
#define pp_FED_COMPRESS // skip fed slices when co, o2 or co2 slices are compressed (for now)
32+
33+
#define pp_COLOR_PLOT / add checkbox for showing CIELab colorbar delta distance plot
34+
35+
//#define pp_BNDF // merge geometry and structured boundary files in load menus
36+
37+
//#define pp_DPRINT // turn on debug print (file, line number)
38+
39+
// streaming directives
40+
41+
//#define pp_SMOKE3DSTREAM // stream smoke3d data
42+
//#define pp_PARTSTREAM // stream particle data
43+
44+
// turn on pp_STREAM if streaming is on for any file type
45+
46+
#ifdef pp_SMOKE3DSTREAM
47+
#define pp_STREAM
48+
#endif
49+
#ifdef pp_PARTSTREAM
50+
#undef pp_STREAM
51+
#define pp_STREAM
52+
#endif
53+
54+
#define pp_READBUFFER_THREAD // use pthreads in ReadBuffer routine (don't use pthreads when used in smokezip and smokediff)
55+
//#define pp_CRASH_TEST // test detection of division by zero or use of undefined pointer
56+
#define pp_GPU // support the GPU
57+
// #define pp_THREAD // turn on multi-threading
58+
//#define pp_LOAD_NEWDATA // add button for loading new data
59+
60+
#ifdef pp_GPU
61+
#define pp_GPUTHROTTLE // pp_GPU directive must also be set
62+
#endif
63+
64+
//*** options: windows
65+
66+
#ifdef WIN32
67+
#define pp_memstatus
68+
#define pp_COMPRESS // support for smokezip
69+
#define pp_DIALOG_SHORTCUTS // dialog shortcuts
70+
#ifdef pp_GPU
71+
#define pp_WINGPU // only draw 3d slices with the GPU on windows
72+
#endif
73+
#endif
74+
75+
76+
//*** options: Linux
77+
78+
#ifdef pp_LINUX
79+
#define pp_REFRESH // refresh glui dialogs when they change size
80+
#define pp_DIALOG_SHORTCUTS // dialog shortcuts
81+
#endif
82+
83+
//*** options: Mac
84+
85+
#ifdef pp_OSX
86+
#ifndef pp_NOQUARTZ // if used, passed in from the command line so we don'thave to change source
87+
#define pp_QUARTZ // use Quartz
88+
#endif
89+
#endif
90+
91+
#ifdef pp_QUARTZ
92+
#define pp_CLOSEOFF // turn off and disable close buttons in dialog box
93+
#endif
94+
95+
#undef pp_OSX_HIGHRES
96+
#ifdef pp_OSX
97+
#ifndef pp_QUARTZ
98+
#define pp_REFRESH // refresh glui dialogs when they change size
99+
#ifndef pp_OSX_LOWRES
100+
#define pp_OSX_HIGHRES
101+
#endif
102+
#endif
103+
#endif
104+
105+
//*** options: for debugging
106+
107+
#ifdef _DEBUG
108+
#define pp_MOVIE_BATCH_DEBUG // allow movei batch dialogs to be defined for testing
109+
#define pp_SNIFF_ERROR
16110
#endif
111+
#define pp_RENDER360_DEBUG
17112

18113
#endif

0 commit comments

Comments
 (0)