Skip to content
Snippets Groups Projects
Commit 4366ff29 authored by Podhorszki, Norbert's avatar Podhorszki, Norbert
Browse files

Add heatTransfer to the cmake build. Only the adios2 version yet.

parent cf597589
No related branches found
No related tags found
1 merge request!41ADIOS1 Write engine, Selections, Variable.SetSelection() and updated Heat Transfer example
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
add_subdirectory(hello) add_subdirectory(hello)
add_subdirectory(heatTransfer)
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
add_executable(heatTransfer_adios main.cpp HeatTransfer.cpp Settings.cpp IO_adios2.cpp)
if(ADIOS_USE_MPI)
find_package(MPI COMPONENTS C REQUIRED)
target_include_directories(heatTransfer_adios PRIVATE ${MPI_C_INCLUDE_PATH})
target_link_libraries(heatTransfer_adios adios2 ${MPI_C_LIBRARIES})
else(ADIOS_USE_MPI)
add_executable(heatTransfer_adios main.cpp HeatTransfer.cpp Settings.cpp IO_adios2.cpp)
target_link_libraries(heatTransfer_adios adios2)
endif()
if(ADIOS_USE_ADIOS1)
add_executable(heatTransfer_adios1 main.cpp HeatTransfer.cpp Settings.cpp IO_adios1.cpp)
endif()
#add_subdirectory(read)
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* Author: Norbert Podhorszki * Author: Norbert Podhorszki
* *
*/ */
#include <mpi.h>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
......
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
#ifndef HEATTRANSFER_H_ #ifndef HEATTRANSFER_H_
#define HEATTRANSFER_H_ #define HEATTRANSFER_H_
#define OMPI_SKIP_MPICXX 1 // workaround for OpenMPI forcing C++ bindings
#include <mpi.h> #include <mpi.h>
#undef OMPI_SKIP_MPICXX
#include <vector> #include <vector>
#include "Settings.h" #include "Settings.h"
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
#include "HeatTransfer.h" #include "HeatTransfer.h"
#include "Settings.h" #include "Settings.h"
#define OMPI_SKIP_MPICXX 1 // workaround for OpenMPI forcing C++ bindings
#include <mpi.h> #include <mpi.h>
#undef OMPI_SKIP_MPICXX
class IO class IO
{ {
......
...@@ -69,13 +69,17 @@ IO::~IO() ...@@ -69,13 +69,17 @@ IO::~IO()
delete ad; delete ad;
} }
void /*IO::*/ old_style_write(int step, const HeatTransfer &ht, #if 1
const Settings &s, MPI_Comm comm)
void IO::write(int step, const HeatTransfer &ht,
const Settings &s, MPI_Comm comm)
{ {
bpWriter->Write<double>(*varT, ht.data_noghost().data()); bpWriter->Write<double>(*varT, ht.data_noghost().data());
bpWriter->Advance(); bpWriter->Advance();
} }
#else
void IO::write(int step, const HeatTransfer &ht, const Settings &s, void IO::write(int step, const HeatTransfer &ht, const Settings &s,
MPI_Comm comm) MPI_Comm comm)
{ {
...@@ -107,3 +111,5 @@ void IO::write(int step, const HeatTransfer &ht, const Settings &s, ...@@ -107,3 +111,5 @@ void IO::write(int step, const HeatTransfer &ht, const Settings &s,
bpWriter->Write<double>(*varT, ht.data()); bpWriter->Write<double>(*varT, ht.data());
bpWriter->Advance(); bpWriter->Advance();
} }
#endif // 1
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
* Author: Norbert Podhorszki * Author: Norbert Podhorszki
* *
*/ */
#define OMPI_SKIP_MPICXX 1 // workaround for OpenMPI forcing C++ bindings
#include <mpi.h> #include <mpi.h>
#undef OMPI_SKIP_MPICXX
#include <iostream> #include <iostream>
#include <memory> #include <memory>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment