Skip to content
Snippets Groups Projects
Commit 3cd0bf99 authored by chantrait's avatar chantrait
Browse files

fixup! coupling module

parent d8dba731
No related branches found
No related tags found
No related merge requests found
...@@ -22,18 +22,20 @@ add_library( ...@@ -22,18 +22,20 @@ add_library(
) )
set(COSTO_INSTALL_DIR "/home/chantraitt/softs/04-costo/install/depot_git") set(COSTO_INSTALL_DIR "/home/chantraitt/softs/04-costo/install/depot_git")
add_library(CPO SHARED IMPORTED) # or STATIC instead of SHARED
add_library(costo SHARED IMPORTED) # or STATIC instead of SHARED set_target_properties(CPO PROPERTIES
set_target_properties(costo PROPERTIES IMPORTED_LOCATION ${COSTO_INSTALL_DIR}/lib/libCPO.so
IMPORTED_LOCATION "${COSTO_INSTALL_DIR}/lib/libcosto.so"
INTERFACE_INCLUDE_DIRECTORIES "${COSTO_INSTALL_DIR}/includes" INTERFACE_INCLUDE_DIRECTORIES "${COSTO_INSTALL_DIR}/includes"
) )
target_include_directories(PugsUtils
PUBLIC "${COSTO_INSTALL_DIR}/includes/utils"
)
target_link_libraries( target_link_libraries(
PugsUtils PugsUtils
${PETSC_LIBRARIES} ${PETSC_LIBRARIES}
${SLEPC_LIBRARIES} ${SLEPC_LIBRARIES}
costo CPO
) )
# --------------- get git revision info --------------- # --------------- get git revision info ---------------
......
#include <utils/Messenger.hpp> #include <utils/Messenger.hpp>
#include "couplingObjects.hpp"
#include <utils/CommunicatorManager.hpp> #include <utils/CommunicatorManager.hpp>
#include <iostream> #include <iostream>
...@@ -35,8 +34,9 @@ Messenger::Messenger([[maybe_unused]] int& argc, [[maybe_unused]] char* argv[]) ...@@ -35,8 +34,9 @@ Messenger::Messenger([[maybe_unused]] int& argc, [[maybe_unused]] char* argv[])
MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
if (CommunicatorManager::hasSplitColor()) { if (CommunicatorManager::hasSplitColor()) {
costo::coupling myCoupling = costo::coupling(CommunicatorManager::splitColor()); myCoupling = new costo::coupling(CommunicatorManager::splitColor());
m_pugs_comm_world = myCoupling.getLocalComm();
m_pugs_comm_world = myCoupling->getLocalComm();
/* auto res = */ /* auto res = */
/* MPI_Comm_split(MPI_COMM_WORLD, CommunicatorManager::splitColor(), key, &m_pugs_comm_world); */ /* MPI_Comm_split(MPI_COMM_WORLD, CommunicatorManager::splitColor(), key, &m_pugs_comm_world); */
/* if (res) { */ /* if (res) { */
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
#include <mpi.h> #include <mpi.h>
#endif // PUGS_HAS_MPI #endif // PUGS_HAS_MPI
#include "/home/chantraitt/softs/04-costo/install/depot_git/includes/couplingObjects.hpp"
#include "/home/chantraitt/softs/04-costo/install/depot_git/includes/utils/costoMacros.hpp"
#include <utils/CommunicatorManager.hpp>
#include <utils/Exceptions.hpp> #include <utils/Exceptions.hpp>
#include <utils/PugsTraits.hpp> #include <utils/PugsTraits.hpp>
...@@ -406,6 +409,8 @@ class Messenger ...@@ -406,6 +409,8 @@ class Messenger
} }
public: public:
costo::coupling* myCoupling = nullptr;
static void create(int& argc, char* argv[]); static void create(int& argc, char* argv[]);
static void destroy(); static void destroy();
......
#include <mesh/MeshNodeBoundary.hpp> #include <mesh/MeshNodeBoundary.hpp>
#include <utils/FPEManager.hpp>
#include <utils/Messenger.hpp>
#include <utils/Serializer.hpp> #include <utils/Serializer.hpp>
void void
...@@ -54,8 +56,27 @@ Serializer::Serializer(const std::shared_ptr<const IBoundaryDescriptor>& boundar ...@@ -54,8 +56,27 @@ Serializer::Serializer(const std::shared_ptr<const IBoundaryDescriptor>& boundar
for (unsigned short j = 0; j < MeshType::Dimension; ++j) { for (unsigned short j = 0; j < MeshType::Dimension; ++j) {
pts[2 * r + j] = positions[r][j]; pts[2 * r + j] = positions[r][j];
} }
std::cout << "\033[01;31m" << pts[2 * r] << "; " << pts[2 * r + 1] << "\033[00;00m" << std::endl; /* std::cout << "\033[01;31m" << pts[2 * r] << "; " << pts[2 * r + 1] << "\033[00;00m" << std::endl; */
} }
const int dest = 1;
const int tag = 100;
std::vector<int> shape;
shape.resize(3);
shape[0] = mesh->numberOfNodes();
shape[1] = 2;
shape[2] = 0;
std::cout << "\033[01;31m"
<< "LA0"
<< "\033[00;00m" << std::endl;
parallel::Messenger::getInstance().myCoupling->sendData(shape, pts, dest, tag);
std::cout << "\033[01;31m"
<< "LA1"
<< "\033[00;00m" << std::endl;
std::vector<int> recv;
const int src = 1;
parallel::Messenger::getInstance().myCoupling->recvData(recv, src, tag + 10);
/* mess.myCoupling->sendData(shape, pts, dest, tag); */
/* for (size_t i_node = 0; i_node < mesh->numberOfNodes(); i_node++) { */ /* for (size_t i_node = 0; i_node < mesh->numberOfNodes(); i_node++) { */
/* std::cout << "\033[01;31m" << coords [[i_node]] << "\033[00;00m" << std::endl; */ /* std::cout << "\033[01;31m" << coords [[i_node]] << "\033[00;00m" << std::endl; */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment