From 4d5f6cf955fb6604ba537cc4d32d7c29a2310691 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Wed, 20 Feb 2019 14:44:21 -0600 Subject: [PATCH 01/10] enable console output if passing --osp:vv, --osp:verbose, and --osp:debug --- doc/api.md | 6 ++++-- ospray/common/OSPCommon.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/api.md b/doc/api.md index 57de84d9e9..54affa1f49 100644 --- a/doc/api.md +++ b/doc/api.md @@ -42,9 +42,11 @@ prefixed by convention with "`--osp:`") are understood: `--osp:loglevel ` set logging level, default `0`; increasing `n` means increasingly verbose log messages - `--osp:verbose` shortcut for `--osp:loglevel 1` + `--osp:verbose` shortcut for `--osp:loglevel 1` and enable debug + output on console - `--osp:vv` shortcut for `--osp:loglevel 2` + `--osp:vv` shortcut for `--osp:loglevel 2` and enable debug + output on console `--osp:module:` load a module during initialization; equivalent to calling `ospLoadModule(name)` diff --git a/ospray/common/OSPCommon.cpp b/ospray/common/OSPCommon.cpp index 0c0a3a79ac..660b213a48 100644 --- a/ospray/common/OSPCommon.cpp +++ b/ospray/common/OSPCommon.cpp @@ -51,14 +51,18 @@ namespace ospray { std::string parm = av[i]; if (parm == "--osp:debug") { device->setParam("debug", true); - // per default enable logging to cout; may be overridden later - device->msg_fcn = [](const char *msg){ std::cout << msg; }; + device->setParam("logOutput", std::string("cout")); + device->setParam("errorOutput", std::string("cerr")); removeArgs(ac,av,i,1); } else if (parm == "--osp:verbose") { device->setParam("logLevel", 1); + device->setParam("logOutput", std::string("cout")); + device->setParam("errorOutput", std::string("cerr")); removeArgs(ac,av,i,1); } else if (parm == "--osp:vv") { device->setParam("logLevel", 2); + device->setParam("logOutput", std::string("cout")); + device->setParam("errorOutput", std::string("cerr")); removeArgs(ac,av,i,1); } else if (parm == "--osp:loglevel") { if (i+1 Date: Wed, 27 Feb 2019 15:13:59 -0600 Subject: [PATCH 02/10] bump version --- cmake/ospray_version.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ospray_version.cmake b/cmake/ospray_version.cmake index f60247f1e0..7038fb4a1f 100644 --- a/cmake/ospray_version.cmake +++ b/cmake/ospray_version.cmake @@ -16,7 +16,7 @@ set(OSPRAY_VERSION_MAJOR 1) set(OSPRAY_VERSION_MINOR 8) -set(OSPRAY_VERSION_PATCH 1) +set(OSPRAY_VERSION_PATCH 2) set(OSPRAY_SOVERSION 0) set(OSPRAY_VERSION_GITHASH 0) set(OSPRAY_VERSION_NOTE "") From 07112d1793d0126d41e3a39647ab18727297a1b0 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Wed, 27 Feb 2019 08:57:23 -0600 Subject: [PATCH 03/10] fix install prefix of ospcommon --- components/ospcommon/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ospcommon/CMakeLists.txt b/components/ospcommon/CMakeLists.txt index f99b92c09e..eb08f136df 100644 --- a/components/ospcommon/CMakeLists.txt +++ b/components/ospcommon/CMakeLists.txt @@ -90,7 +90,7 @@ else() target_include_directories(ospray_common PUBLIC $ - $ + $ PRIVATE ${CMAKE_CURRENT_LIST_DIR} ) From 0506fc1e421762976b0ca1cec2d316203281d8e7 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Wed, 27 Feb 2019 11:20:05 -0600 Subject: [PATCH 04/10] fix issues in find_package() config for targets other than ospray::ospray --- .../ospray_cmake_config/osprayConfig.cmake.in | 15 ++- cmake/ospray_macros.cmake | 102 +++++++++++++++++- components/ospcommon/cmake/macros.cmake | 92 ---------------- ospray/CMakeLists.txt | 2 - 4 files changed, 109 insertions(+), 102 deletions(-) diff --git a/cmake/ospray_cmake_config/osprayConfig.cmake.in b/cmake/ospray_cmake_config/osprayConfig.cmake.in index 35d1f9caa6..c3e4678d20 100644 --- a/cmake/ospray_cmake_config/osprayConfig.cmake.in +++ b/cmake/ospray_cmake_config/osprayConfig.cmake.in @@ -113,6 +113,8 @@ set(OSPRAY_COMPILER_GCC @OSPRAY_COMPILER_GCC@) set(OSPRAY_COMPILER_CLANG @OSPRAY_COMPILER_CLANG@) set(OSPRAY_COMPILER_MSVC @OSPRAY_COMPILER_MSVC@) +set(OSPRAY_TASKING_SYSTEM @OSPRAY_TASKING_SYSTEM@) + set(OSPRAY_TASKING_TBB @OSPRAY_TASKING_TBB@) set(OSPRAY_TASKING_CILK @OSPRAY_TASKING_CILK@) set(OSPRAY_TASKING_OPENMP @OSPRAY_TASKING_OPENMP@) @@ -120,7 +122,8 @@ set(OSPRAY_TASKING_INTERNAL @OSPRAY_TASKING_INTERNAL@) set(OSPRAY_TASKING_LIBDISPATCH @OSPRAY_TASKING_LIBDISPATCH@) set(OSPRAY_TASKING_DEBUG @OSPRAY_TASKING_DEBUG@) -set(OSPRAY_TASKING_DEFINITIONS @TASKING_SYSTEM_DEFINITIONS@) +set(OSPRAY_TASKING_DEFINITIONS @OSPRAY_TASKING_DEFINITIONS@) +set(OSPRAY_TASKING_OPTIONS @OSPRAY_TASKING_OPTIONS@) set(OSPRAY_ISPC_TARGET_LIST @OSPRAY_ISPC_TARGET_LIST@) set(OSPRAY_ISPC_ADDRESSING @OSPRAY_ISPC_ADDRESSING@) @@ -172,6 +175,7 @@ if (OSPRAY_TASKING_TBB) "Found required OSPRay dependency: TBB in ${TBB_INCLUDE_DIRS}") endif() endif() + set (OSPRAY_TASKING_LIBS ${TBB_LIBRARIES}) endif() ospray_create_tasking_target() @@ -180,13 +184,14 @@ ospray_create_tasking_target() if (OSPRAY_INSTALL_DEPENDENCIES) # Embree installed with OSPRay file(GLOB_RECURSE EMBREE_LIBRARY ${LIBRARY_PATH_PREFIX}embree*) - ospray_create_embree_target() else() # Find existing Embree on the machine ospray_find_embree(${EMBREE_VERSION_REQUIRED}) ospray_verify_embree_features() endif() +ospray_create_embree_target() + list(APPEND OSPRAY_INCLUDE_DIRS ${EMBREE_INCLUDE_DIRS}) # Restore state @@ -210,8 +215,10 @@ set(OSPRAY_TESTING_LIBRARY ${LIBRARY_PATH_PREFIX}ospray_testing${LIBRARY_SUFFIX} include(${CMAKE_CURRENT_LIST_DIR}/ospray_Exports.cmake) # Add missing targets to libraries -target_link_libraries(ospray::ospray_common INTERFACE ospray_tasking) -target_link_libraries(ospray::ospray_module_ispc INTERFACE embree) +set_target_properties(ospray::ospray_common PROPERTIES + INTERFACE_LINK_LIBRARIES ospray_tasking) +set_target_properties(ospray::ospray_module_ispc PROPERTIES + INTERFACE_LINK_LIBRARIES embree) # Set expected OSPRAY_LIBRARIES variable for FindPackage(). set(OSPRAY_LIBRARIES ospray::ospray) diff --git a/cmake/ospray_macros.cmake b/cmake/ospray_macros.cmake index 2bc2723e21..2c5bb672fe 100644 --- a/cmake/ospray_macros.cmake +++ b/cmake/ospray_macros.cmake @@ -14,24 +14,118 @@ ## limitations under the License. ## ## ======================================================================== ## -## Tasking system target macro ## +## Tasking system target macros ## + +macro(ospray_configure_tasking_system) + # ------------------------------------------------------- + # Setup tasking system build configuration + # ------------------------------------------------------- + + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) + + # NOTE(jda) - Notice that this implies that OSPRAY_CONFIGURE_COMPILER() has + # been called before this macro! + if(OSPRAY_COMPILER_ICC) + set(CILK_STRING "Cilk") + endif() + + set(OSPRAY_TASKING_SYSTEM TBB CACHE STRING + "Per-node thread tasking system [TBB,OpenMP,Cilk,LibDispatch,Internal,Debug]") + + set_property(CACHE OSPRAY_TASKING_SYSTEM PROPERTY + STRINGS TBB ${CILK_STRING} OpenMP Internal LibDispatch Debug) + mark_as_advanced(OSPRAY_TASKING_SYSTEM) + + # NOTE(jda) - Make the OSPRAY_TASKING_SYSTEM build option case-insensitive + string(TOUPPER ${OSPRAY_TASKING_SYSTEM} OSPRAY_TASKING_SYSTEM_ID) + + set(OSPRAY_TASKING_TBB FALSE) + set(OSPRAY_TASKING_CILK FALSE) + set(OSPRAY_TASKING_OPENMP FALSE) + set(OSPRAY_TASKING_INTERNAL FALSE) + set(OSPRAY_TASKING_LIBDISPATCH FALSE) + set(OSPRAY_TASKING_DEBUG FALSE) + + if(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "TBB") + set(OSPRAY_TASKING_TBB TRUE) + find_package(TBB REQUIRED) + else() + unset(TBB_INCLUDE_DIR CACHE) + unset(TBB_LIBRARY CACHE) + unset(TBB_LIBRARY_DEBUG CACHE) + unset(TBB_LIBRARY_MALLOC CACHE) + unset(TBB_LIBRARY_MALLOC_DEBUG CACHE) + if(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "CILK") + set(OSPRAY_TASKING_CILK TRUE) + elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "OPENMP") + set(OSPRAY_TASKING_OPENMP TRUE) + find_package(OpenMP) + elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "INTERNAL") + set(OSPRAY_TASKING_INTERNAL TRUE) + elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "LIBDISPATCH") + set(OSPRAY_TASKING_LIBDISPATCH TRUE) + else() + set(OSPRAY_TASKING_DEBUG TRUE) + endif() + endif() + + set(OSPRAY_TASKING_LIBS ${CMAKE_THREAD_LIBS_INIT}) + + if(OSPRAY_TASKING_TBB) + set(OSPRAY_TASKING_DEFINITIONS -DOSPRAY_TASKING_TBB) + set(OSPRAY_TASKING_INCLUDES ${TBB_INCLUDE_DIRS}) + set(OSPRAY_TASKING_LIBS ${OSPRAY_TASKING_LIBS} ${TBB_LIBRARIES}) + elseif(OSPRAY_TASKING_OPENMP) + if (OPENMP_FOUND) + set(OSPRAY_TASKING_OPTIONS "${OpenMP_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + if(OSPRAY_COMPILER_ICC) # workaround linker issue #115 + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -liomp5") + endif() + set(OSPRAY_TASKING_DEFINITIONS -DOSPRAY_TASKING_OMP) + endif() + elseif(OSPRAY_TASKING_CILK) + set(OSPRAY_TASKING_DEFINITIONS -DOSPRAY_TASKING_CILK) + if (OSPRAY_COMPILER_GCC OR OSPRAY_COMPILER_CLANG) + ospray_warn_once(UNSAFE_USE_OF_CILK + "You are using Cilk with GCC or Clang...use at your own risk!") + set(OSPRAY_TASKING_OPTIONS "-fcilkplus") + endif() + elseif(OSPRAY_TASKING_INTERNAL) + set(OSPRAY_TASKING_DEFINITIONS -DOSPRAY_TASKING_INTERNAL) + elseif(OSPRAY_TASKING_LIBDISPATCH) + find_package(libdispatch REQUIRED) + set(OSPRAY_TASKING_INCLUDES ${LIBDISPATCH_INCLUDE_DIRS}) + set(OSPRAY_TASKING_LIBS ${OSPRAY_TASKING_LIBS} ${LIBDISPATCH_LIBRARIES}) + set(OSPRAY_TASKING_DEFINITIONS -DOSPRAY_TASKING_LIBDISPATCH) + else()#Debug + # Do nothing, will fall back to scalar code (useful for debugging) + endif() +endmacro() macro(ospray_create_tasking_target) add_library(ospray_tasking INTERFACE) target_include_directories(ospray_tasking INTERFACE - ${TASKING_SYSTEM_INCLUDES} + ${OSPRAY_TASKING_INCLUDES} ) target_link_libraries(ospray_tasking INTERFACE - ${TASKING_SYSTEM_LIBS} + ${OSPRAY_TASKING_LIBS} ) target_compile_definitions(ospray_tasking INTERFACE - ${TASKING_SYSTEM_DEFINITIONS} + ${OSPRAY_TASKING_DEFINITIONS} + ) + + target_compile_options(ospray_tasking + INTERFACE + ${OSPRAY_TASKING_OPTIONS} ) endmacro() diff --git a/components/ospcommon/cmake/macros.cmake b/components/ospcommon/cmake/macros.cmake index 8161bcb2fb..64a286dc13 100644 --- a/components/ospcommon/cmake/macros.cmake +++ b/components/ospcommon/cmake/macros.cmake @@ -404,98 +404,6 @@ macro(ospray_disable_compiler_warnings) endif() endmacro() -## Tasking system configuration macro ## - -macro(ospray_configure_tasking_system) - # ------------------------------------------------------- - # Setup tasking system build configuration - # ------------------------------------------------------- - - set(CMAKE_THREAD_PREFER_PTHREAD TRUE) - set(THREADS_PREFER_PTHREAD_FLAG TRUE) - find_package(Threads REQUIRED) - - # NOTE(jda) - Notice that this implies that OSPRAY_CONFIGURE_COMPILER() has - # been called before this macro! - if(OSPRAY_COMPILER_ICC) - set(CILK_STRING "Cilk") - endif() - - set(OSPRAY_TASKING_SYSTEM TBB CACHE STRING - "Per-node thread tasking system [TBB,OpenMP,Cilk,LibDispatch,Internal,Debug]") - - set_property(CACHE OSPRAY_TASKING_SYSTEM PROPERTY - STRINGS TBB ${CILK_STRING} OpenMP Internal LibDispatch Debug) - mark_as_advanced(OSPRAY_TASKING_SYSTEM) - - # NOTE(jda) - Make the OSPRAY_TASKING_SYSTEM build option case-insensitive - string(TOUPPER ${OSPRAY_TASKING_SYSTEM} OSPRAY_TASKING_SYSTEM_ID) - - set(OSPRAY_TASKING_TBB FALSE) - set(OSPRAY_TASKING_CILK FALSE) - set(OSPRAY_TASKING_OPENMP FALSE) - set(OSPRAY_TASKING_INTERNAL FALSE) - set(OSPRAY_TASKING_LIBDISPATCH FALSE) - set(OSPRAY_TASKING_DEBUG FALSE) - - if(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "TBB") - set(OSPRAY_TASKING_TBB TRUE) - elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "CILK") - set(OSPRAY_TASKING_CILK TRUE) - elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "OPENMP") - set(OSPRAY_TASKING_OPENMP TRUE) - elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "INTERNAL") - set(OSPRAY_TASKING_INTERNAL TRUE) - elseif(${OSPRAY_TASKING_SYSTEM_ID} STREQUAL "LIBDISPATCH") - set(OSPRAY_TASKING_LIBDISPATCH TRUE) - else() - set(OSPRAY_TASKING_DEBUG TRUE) - endif() - - set(TASKING_SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT}) - - if(OSPRAY_TASKING_TBB) - find_package(TBB REQUIRED) - set(TASKING_SYSTEM_DEFINITIONS -DOSPRAY_TASKING_TBB) - set(TASKING_SYSTEM_INCLUDES ${TBB_INCLUDE_DIRS}) - set(TASKING_SYSTEM_LIBS ${TASKING_SYSTEM_LIBS} ${TBB_LIBRARIES}) - else(OSPRAY_TASKING_TBB) - unset(TBB_INCLUDE_DIR CACHE) - unset(TBB_LIBRARY CACHE) - unset(TBB_LIBRARY_DEBUG CACHE) - unset(TBB_LIBRARY_MALLOC CACHE) - unset(TBB_LIBRARY_MALLOC_DEBUG CACHE) - if(OSPRAY_TASKING_OPENMP) - find_package(OpenMP) - if (OPENMP_FOUND) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - if(OSPRAY_COMPILER_ICC) # workaround linker issue #115 - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -liomp5") - endif() - set(TASKING_SYSTEM_DEFINITIONS -DOSPRAY_TASKING_OMP) - endif() - elseif(OSPRAY_TASKING_CILK) - set(TASKING_SYSTEM_DEFINITIONS -DOSPRAY_TASKING_CILK) - if (OSPRAY_COMPILER_GCC OR OSPRAY_COMPILER_CLANG) - ospray_warn_once(UNSAFE_USE_OF_CILK - "You are using Cilk with GCC or Clang...use at your own risk!") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcilkplus") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcilkplus") - endif() - elseif(OSPRAY_TASKING_INTERNAL) - set(TASKING_SYSTEM_DEFINITIONS -DOSPRAY_TASKING_INTERNAL) - elseif(OSPRAY_TASKING_LIBDISPATCH) - find_package(libdispatch REQUIRED) - set(TASKING_SYSTEM_INCLUDES ${LIBDISPATCH_INCLUDE_DIRS}) - set(TASKING_SYSTEM_LIBS ${TASKING_SYSTEM_LIBS} ${LIBDISPATCH_LIBRARIES}) - set(TASKING_SYSTEM_DEFINITIONS -DOSPRAY_TASKING_LIBDISPATCH) - else()#Debug - # Do nothing, will fall back to scalar code (useful for debugging) - endif() - endif(OSPRAY_TASKING_TBB) -endmacro() - ## MPI configuration macro ## macro(ospray_configure_mpi) diff --git a/ospray/CMakeLists.txt b/ospray/CMakeLists.txt index 1d0ff309aa..090d70b159 100644 --- a/ospray/CMakeLists.txt +++ b/ospray/CMakeLists.txt @@ -312,8 +312,6 @@ if(OSPRAY_BUILD_ISPC_DEVICE) target_link_libraries(ospray_module_ispc PUBLIC - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} ospray $ ) From b392539a9c3141af1fe6a864e53d1dd382218eee Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Wed, 27 Feb 2019 12:02:11 -0600 Subject: [PATCH 05/10] implement OSPRAY_LOAD_MODULES and OSPRAY_DEFAULT_DEVICE environment vars --- doc/api.md | 23 ++++++++++++++--------- ospray/api/API.cpp | 29 ++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/doc/api.md b/doc/api.md index 54affa1f49..f236402c89 100644 --- a/doc/api.md +++ b/doc/api.md @@ -155,15 +155,20 @@ environment variables for easy changes to OSPRay's behavior without needing to change the application (variables are prefixed by convention with "`OSPRAY_`"): - Variable Description - ------------------- --------------------------------- - OSPRAY_THREADS equivalent to `--osp:numthreads` - OSPRAY_LOG_LEVEL equivalent to `--osp:loglevel` - OSPRAY_LOG_OUTPUT equivalent to `--osp:logoutput` - OSPRAY_ERROR_OUTPUT equivalent to `--osp:erroroutput` - OSPRAY_DEBUG equivalent to `--osp:debug` - OSPRAY_SET_AFFINITY equivalent to `--osp:setaffinity` - ------------------- --------------------------------- + Variable Description + --------------------- --------------------------------- + OSPRAY_THREADS equivalent to `--osp:numthreads` + OSPRAY_LOG_LEVEL equivalent to `--osp:loglevel` + OSPRAY_LOG_OUTPUT equivalent to `--osp:logoutput` + OSPRAY_ERROR_OUTPUT equivalent to `--osp:erroroutput` + OSPRAY_DEBUG equivalent to `--osp:debug` + OSPRAY_SET_AFFINITY equivalent to `--osp:setaffinity` + OSPRAY_LOAD_MODULES equivalent to `--osp:module:`, + can be a comma separated list + of modules which will be loaded + in order + OSPRAY_DEFAULT_DEVICE equivalent to `--osp:device:` + --------------------- --------------------------------- : Environment variables interpreted by OSPRay. ### Error Handling and Status Messages diff --git a/ospray/api/API.cpp b/ospray/api/API.cpp index 45ed11fe97..3ae0b65c22 100644 --- a/ospray/api/API.cpp +++ b/ospray/api/API.cpp @@ -17,6 +17,7 @@ //ospcommon #include "ospcommon/utility/OnScopeExit.h" #include "ospcommon/utility/getEnvVar.h" +#include "ospcommon/utility/StringManip.h" #include "ospcommon/library.h" //ospray @@ -68,7 +69,7 @@ inline std::string getPidString() using namespace ospray; -inline Device *createMpiDevice(const std::string &type) +static inline Device *createMpiDevice(const std::string &type) { Device *device = nullptr; @@ -91,6 +92,18 @@ inline Device *createMpiDevice(const std::string &type) return device; } +static inline void loadModulesFromEnvironmentVar() +{ + auto OSPRAY_LOAD_MODULES = + utility::getEnvVar("OSPRAY_LOAD_MODULES"); + + if (OSPRAY_LOAD_MODULES) { + auto module_names = utility::split(OSPRAY_LOAD_MODULES.value(), ','); + for (auto &name : module_names) + loadLocalModule(name); + } +} + extern "C" OSPError ospInit(int *_ac, const char **_av) OSPRAY_CATCH_BEGIN { @@ -100,6 +113,8 @@ OSPRAY_CATCH_BEGIN throw std::runtime_error("device already exists [ospInit() called twice?]"); } + loadModulesFromEnvironmentVar(); + auto OSP_MPI_LAUNCH = utility::getEnvVar("OSPRAY_MPI_LAUNCH"); if (OSP_MPI_LAUNCH) { @@ -220,8 +235,16 @@ OSPRAY_CATCH_BEGIN // no device created on cmd line, yet, so default to ISPCDevice if (!deviceIsSet()) { - ospLoadModule("ispc"); - currentDevice.reset(Device::createDevice("default")); + auto OSPRAY_DEFAULT_DEVICE = + utility::getEnvVar("OSPRAY_DEFAULT_DEVICE"); + + if (OSPRAY_DEFAULT_DEVICE) { + auto device_name = OSPRAY_DEFAULT_DEVICE.value(); + currentDevice.reset(Device::createDevice(device_name.c_str())); + } else { + ospLoadModule("ispc"); + currentDevice.reset(Device::createDevice("default")); + } } ospray::initFromCommandLine(_ac,&_av); From e74b5fc695cb73f033ed2ddcd4a28031dc0491c4 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Wed, 27 Feb 2019 12:05:14 -0600 Subject: [PATCH 06/10] update changelog --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6793c286e7..b83d2711ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,18 @@ Version History --------------- +### Changes in v1.8.2: + +- CMake bug fix where external users of OSPRay needed CMake newer than 3.1 +- Fix incorrect propagation of tasking system flags from an OSPRay install +- Fix inconsistency between supported environment variables and command + line parameters passed to `ospInit()` + - Missing variables were `OSPRAY_LOAD_MODULES` and + `OSPRAY_DEFAULT_DEVICE` + ### Changes in v1.8.1: -- CMake bugfix to remove full paths to dependencies in packages +- CMake bug fix to remove full paths to dependencies in packages ### Changes in v1.8.0: From cf4210bda233f4459d311b0e71ff612bd3e5e4ef Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Thu, 28 Feb 2019 10:43:25 -0600 Subject: [PATCH 07/10] update readme --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 489fcc64ad..0c5a078233 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ OSPRay ====== -This is release v1.8.1 of OSPRay. For changes and new features see the +This is release v1.8.2 of OSPRay. For changes and new features see the [changelog](CHANGELOG.md). Visit http://www.ospray.org for more information. @@ -317,11 +317,11 @@ prefixed by convention with “`--osp:`”) are understood: --osp:verbose -shortcut for --osp:loglevel 1 +shortcut for --osp:loglevel 1 and enable debug output on console --osp:vv -shortcut for --osp:loglevel 2 +shortcut for --osp:loglevel 2 and enable debug output on console --osp:module:<name> @@ -473,14 +473,19 @@ environment variables for easy changes to OSPRay’s behavior without needing to change the application (variables are prefixed by convention with “`OSPRAY_`”): -| Variable | Description | -|:----------------------|:----------------------------------| -| OSPRAY\_THREADS | equivalent to `--osp:numthreads` | -| OSPRAY\_LOG\_LEVEL | equivalent to `--osp:loglevel` | -| OSPRAY\_LOG\_OUTPUT | equivalent to `--osp:logoutput` | -| OSPRAY\_ERROR\_OUTPUT | equivalent to `--osp:erroroutput` | -| OSPRAY\_DEBUG | equivalent to `--osp:debug` | -| OSPRAY\_SET\_AFFINITY | equivalent to `--osp:setaffinity` | +| Variable | Description | +|:------------------------|:----------------------------------| +| OSPRAY\_THREADS | equivalent to `--osp:numthreads` | +| OSPRAY\_LOG\_LEVEL | equivalent to `--osp:loglevel` | +| OSPRAY\_LOG\_OUTPUT | equivalent to `--osp:logoutput` | +| OSPRAY\_ERROR\_OUTPUT | equivalent to `--osp:erroroutput` | +| OSPRAY\_DEBUG | equivalent to `--osp:debug` | +| OSPRAY\_SET\_AFFINITY | equivalent to `--osp:setaffinity` | +| OSPRAY\_LOAD\_MODULES | equivalent to `--osp:module:`, | +| | can be a comma separated list | +| | of modules which will be loaded | +| | in order | +| OSPRAY\_DEFAULT\_DEVICE | equivalent to `--osp:device:` | : Environment variables interpreted by OSPRay. @@ -2208,9 +2213,11 @@ below). Comparison of diffuse rooms with 100% reflecting white paint (left) and realistic 80% reflecting white paint (right), which leads to higher overall contrast. Note that exposure has been adjusted to achieve similar brightness levels.
Comparison of diffuse rooms with 100% reflecting white paint (left) and realistic 80% reflecting white paint (right), which leads to higher overall contrast. Note that exposure has been adjusted to achieve similar brightness levels.
-If present, the color component of [geometries](#geometries) is -also used for the diffuse color `Kd` and the alpha component is also -used for the opacity `d`. + + +If present, the color component of [geometries](#geometries) is also +used for the diffuse color `Kd` and the alpha component is also used for +the opacity `d`. Note that currently only the path tracer implements colored transparency with `Tf`. @@ -2232,6 +2239,8 @@ invert its green channel. Normal map representing an exalted square pyramidal frustum.
Normal map representing an exalted square pyramidal frustum.
+ + All parameters (except `Tf`) can be textured by passing a [texture](#texture) handle, prefixed with “`map_`”. The fetched texels are multiplied by the respective parameter value. Texturing requires @@ -2246,6 +2255,8 @@ textures support [texture transformations](#texture2d-transformations). Rendering of a OBJ material with wood textures.
Rendering of a OBJ material with wood textures.
+ + #### Principled The Principled material is the most complex material offered by the @@ -2456,6 +2467,8 @@ transformations](#texture2d-transformations) are supported as well. Rendering of a Principled coated brushed metal material with textured anisotropic rotation and a dust layer (sheen) on top.
Rendering of a Principled coated brushed metal material with textured anisotropic rotation and a dust layer (sheen) on top.
+ + #### CarPaint The CarPaint material is a specialized version of the Principled @@ -2589,6 +2602,8 @@ transformations](#texture2d-transformations) are supported as well. Rendering of a pearlescent CarPaint material.
Rendering of a pearlescent CarPaint material.
+ + #### Metal The [path tracer](#path-tracer) offers a physical metal, supporting @@ -2675,6 +2690,8 @@ create notable edging effects. Rendering of golden Metal material with textured roughness.
Rendering of golden Metal material with textured roughness.
+ + #### Alloy The [path tracer](#path-tracer) offers an alloy material, which behaves @@ -2704,6 +2721,8 @@ transformations](#texture2d-transformations) are supported as well. Rendering of a fictional Alloy material with textured color.
Rendering of a fictional Alloy material with textured color.
+ + #### Glass The [path tracer](#path-tracer) offers a realistic a glass material, @@ -2728,6 +2747,8 @@ trough a glass of thickness `attenuationDistance`. Rendering of a Glass material with orange attenuation.
Rendering of a Glass material with orange attenuation.
+ + #### ThinGlass The [path tracer](#path-tracer) offers a thin glass material useful for @@ -2763,10 +2784,14 @@ attenuation and thus the material appearance. Rendering of a ThinGlass material with red attenuation.
Rendering of a ThinGlass material with red attenuation.
+ +
Example image of a colored window made with textured attenuation of the ThinGlass material.
Example image of a colored window made with textured attenuation of the ThinGlass material.
+ + #### MetallicPaint The [path tracer](#path-tracer) offers a metallic paint material, @@ -2800,6 +2825,8 @@ average, thus individual flakes are not visible. Rendering of a MetallicPaint material.
Rendering of a MetallicPaint material.
+ + #### Luminous The [path tracer](#path-tracer) supports the Luminous material which @@ -2813,6 +2840,8 @@ parameters of lights: [`color` and `intensity`](#lights). Rendering of a yellow Luminous material.
Rendering of a yellow Luminous material.
+ + ### Texture OSPRay currently implements two texture types (`texture2d` and `volume`) @@ -3025,14 +3054,20 @@ images below. Example image created with the perspective camera, featuring depth of field.
Example image created with the perspective camera, featuring depth of field.
+ +
Enabling the architectural flag corrects the perspective projection distortion, resulting in parallel vertical edges.
Enabling the architectural flag corrects the perspective projection distortion, resulting in parallel vertical edges.
+ +
Example 3D stereo image using stereoMode side-by-side.
Example 3D stereo image using stereoMode side-by-side.
+ + #### Orthographic Camera The orthographic camera implements a simple camera with orthographic @@ -3059,6 +3094,8 @@ and `imageEnd`, and both methods can be combined. In any case, the Example image created with the orthographic camera.
Example image created with the orthographic camera.
+ + #### Panoramic Camera The panoramic camera implements a simple camera without support for @@ -3072,6 +3109,8 @@ by using the [general parameters](#cameras) understood by all cameras. Latitude / longitude map created with the panoramic camera.
Latitude / longitude map created with the panoramic camera.
+ + ### Picking To get the world-space position of the geometry (if any) seen at \[0–1\] From 45d8f3e67aa389110c9399911ffe8e8971f2f168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Fri, 1 Mar 2019 11:23:00 +0100 Subject: [PATCH 08/10] Fix typo, closes #303 --- CHANGELOG.md | 10 ++++++---- apps/common/ospapp/OSPApp.cpp | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b83d2711ff..ade2b122ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,12 @@ Version History ### Changes in v1.8.2: -- CMake bug fix where external users of OSPRay needed CMake newer than 3.1 -- Fix incorrect propagation of tasking system flags from an OSPRay install -- Fix inconsistency between supported environment variables and command - line parameters passed to `ospInit()` +- CMake bug fix where external users of OSPRay needed CMake newer than + version 3.1 +- Fix incorrect propagation of tasking system flags from an OSPRay + install +- Fix inconsistency between supported environment variables and + command line parameters passed to `ospInit()` - Missing variables were `OSPRAY_LOAD_MODULES` and `OSPRAY_DEFAULT_DEVICE` diff --git a/apps/common/ospapp/OSPApp.cpp b/apps/common/ospapp/OSPApp.cpp index 31ce4beda6..05045dd984 100644 --- a/apps/common/ospapp/OSPApp.cpp +++ b/apps/common/ospapp/OSPApp.cpp @@ -117,8 +117,8 @@ general app-parameters: camera up xyz -vi [float] [float] [float] camera direction xyz - -vf [float] - camera field of view + -fv [float] + camera field of view (of height, in degrees) -ar [float] camera aperture radius --aces From 251e119a38afc067b35cc490d0a5a643a37af9e1 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Fri, 1 Mar 2019 13:05:13 -0600 Subject: [PATCH 09/10] build releases with MSVC --- scripts/release/win.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/release/win.bat b/scripts/release/win.bat index 6e7b3cf806..c8a3bf0f6e 100755 --- a/scripts/release/win.bat +++ b/scripts/release/win.bat @@ -23,7 +23,6 @@ cd build_release rem set release settings cmake -L ^ -G "Visual Studio 14 2015 Win64" ^ --T "Intel C++ Compiler 18.0" ^ -D OSPRAY_BUILD_ISA=ALL ^ -D OSPRAY_MODULE_MPI=ON ^ -D OSPRAY_MODULE_MPI_APPS=OFF ^ From 5c893a34f285d9bcca6ea7da3469c9de41800647 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Fri, 1 Mar 2019 13:12:29 -0600 Subject: [PATCH 10/10] add news item for v1.8.2 release --- doc/news.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/news.md b/doc/news.md index cf8d12a944..d27c1de2a1 100644 --- a/doc/news.md +++ b/doc/news.md @@ -1,6 +1,13 @@ News, Updates, and Announcements ================================ +Mar 1, 2019: Version v1.8.2 now released on GitHub +--------------------------------------------------- + +New release version 1.8.2 is now available on the [OSPRay GitHub +page](https://github.com/ospray/OSPRay/releases/v1.8.2). + + Feb 20, 2019: Version v1.8.1 now released on GitHub ---------------------------------------------------