Update cosmotool

This commit is contained in:
Guilhem Lavaux 2018-07-19 15:11:04 +03:00
parent 387dc4d853
commit 64e05fc180
148 changed files with 1064 additions and 19378 deletions

View file

@ -1,5 +1,10 @@
SET(tolink ${GSL_LIBRARIES} CosmoTool ${CosmoTool_LIBS})
include_directories(${CMAKE_SOURCE_DIR}/src ${FFTW3_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${NETCDF_INCLUDE_PATH} ${GSL_INCLUDE_PATH})
SET(tolink ${CosmoTool_local} ${CosmoTool_LIBS} ${GSL_LIBRARIES} ${DL_LIBRARY})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${FFTW3_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${GSL_INCLUDE_PATH})
if(YORICK_SUPPORT)
include_directories(${NETCDF_INCLUDE_PATH})
endif(YORICK_SUPPORT)
include_directories(${CMAKE_SOURCE_DIR}/sample)
IF(SHARP_INCLUDE_PATH)
include_directories(BEFORE ${SHARP_INCLUDE_PATH})
@ -11,9 +16,6 @@ target_link_libraries(testBQueue ${tolink})
add_executable(testInterpolate testInterpolate.cpp)
target_link_libraries(testInterpolate ${tolink})
add_executable(testSmooth testSmooth.cpp)
target_link_libraries(testSmooth ${tolink})
add_executable(testkd testkd.cpp)
target_link_libraries(testkd ${tolink})
@ -33,8 +35,10 @@ add_executable(testPool testPool.cpp)
target_link_libraries(testPool ${tolink})
if (HDF5_FOUND)
add_executable(testReadFlash testReadFlash.cpp)
target_link_libraries(testReadFlash ${tolink})
include_directories(${HDF5_INCLUDE_DIR})
add_executable(testReadFlash testReadFlash.cpp)
target_link_libraries(testReadFlash ${tolink})
endif (HDF5_FOUND)
@ -48,18 +52,64 @@ add_executable(testBSP testBSP.cpp)
target_link_libraries(testBSP ${tolink})
if (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
add_executable(test_fft_calls test_fft_calls.cpp)
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES})
IF (FFTW3F_LIBRARY_FULL)
SET(FFTW3_LIB ${FFTW3F_LIBRARY_FULL})
ENDIF (FFTW3F_LIBRARY_FULL)
IF (FFTW3_LIBRARY_FULL)
SET(FFTW3_LIB ${FFTW3_LIB} ${FFTW3_LIBRARY_FULL})
ENDIF (FFTW3_LIBRARY_FULL)
IF(YORICK_SUPPORT)
add_executable(test_fft_calls test_fft_calls.cpp)
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIB})
ENDIF(YORICK_SUPPORT)
endif (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
if (ENABLE_SHARP AND SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
include_directories(${SHARP_INCLUDE_PATH})
add_executable(test_healpix_calls test_healpix_calls.cpp)
target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES})
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
if (ENABLE_OPENMP)
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS "${OpenMP_CXX_FLAGS}" LINK_FLAGS "${OpenMP_CXX_FLAGS}")
endif()
add_dependencies(test_healpix_calls sharp)
endif (ENABLE_SHARP AND SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
add_executable(test_cosmopower test_cosmopower.cpp)
target_link_libraries(test_cosmopower ${tolink})
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
IF (YORICK_SUPPORT)
add_executable(testSmooth testSmooth.cpp)
target_link_libraries(testSmooth ${tolink})
ENDIF (YORICK_SUPPORT)
if (HDF5_FOUND)
add_executable(simple3DFilter simple3DFilter.cpp)
target_link_libraries(simple3DFilter ${tolink})
add_executable(simpleDistanceFilter simpleDistanceFilter.cpp)
target_link_libraries(simpleDistanceFilter ${tolink})
install(TARGETS simple3DFilter simpleDistanceFilter
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
add_executable(gadgetToArray gadgetToArray.cpp)
target_link_libraries(gadgetToArray ${tolink})
add_executable(testHDF5 testHDF5.cpp)
target_link_libraries(testHDF5 ${tolink})
add_executable(graficToDensity graficToDensity.cpp)
target_link_libraries(graficToDensity ${tolink})
endif()
endif (Boost_FOUND)
IF (ENABLE_OPENMP AND YORICK_SUPPORT)
add_executable(gadgetToDensity gadgetToDensity.cpp)
target_link_libraries(gadgetToDensity ${tolink})
ENDIF (ENABLE_OPENMP AND YORICK_SUPPORT)

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testAlgo.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testAlgo.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testBQueue.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testBQueue.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testBSP.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testBSP.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testDelaunay.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testDelaunay.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testEskow.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testEskow.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testInterpolate.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testInterpolate.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testNewton.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testNewton.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testPool.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testPool.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testReadFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testReadFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testSmooth.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testSmooth.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com
@ -75,7 +75,7 @@ int main()
cout << "iy=" << iy << endl;
for (uint32_t ix = 0; ix < NX; ix++)
{
MyTree::coords c = { 1.0*ix/NX, 1.0*iy/NX };
MyTree::coords c = { 1.0f*ix/NX, 1.0f*iy/NX };
smooth.fetchNeighbours(c);
smooth.addGridSite(c);
}
@ -85,14 +85,16 @@ int main()
uint32_t dims[] = { NX, NX };
ProgressiveOutput<ComputePrecision> out =
ProgressiveOutput<ComputePrecision>::saveArrayProgressive("out.nc", dims, 2);
//#pragma omp parallel for schedule(static)
for (uint32_t iy = 0; iy < NX; iy++)
{
MySmooth::SPHState state;
cout << "iy=" << iy << endl;
for (uint32_t ix = 0; ix < NX; ix++)
{
MyTree::coords c = { 1.0*ix/NX, 1.0*iy/NX };
smooth.fetchNeighbours(c);
out.put(smooth.computeSmoothedValue(c, unit_fun));
MyTree::coords c = { 1.0f*ix/NX, 1.0f*iy/NX };
smooth.fetchNeighbours(c, &state);
out.put(smooth.computeSmoothedValue(c, unit_fun, &state));
}

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/test_cosmopower.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/test_cosmopower.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/test_fft_calls.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/test_fft_calls.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com
@ -89,5 +89,6 @@ int main(int argc, char **argv)
test_2d<float>(128,128);
test_2d<float>(128,131);
test_2d<float>(128,130);
test_2d<float>(131,128);
return 0;
}

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/test_healpix_calls.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/test_healpix_calls.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testkd.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testkd.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com

View file

@ -1,5 +1,5 @@
/*+
This is CosmoTool (./sample/testkd3.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013)
This is CosmoTool (./sample/testkd3.cpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
guilhem.lavaux@gmail.com