Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
3cd0bf99
Commit
3cd0bf99
authored
Dec 9, 2022
by
chantrait
Browse files
Options
Downloads
Patches
Plain Diff
fixup! coupling module
parent
d8dba731
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/utils/CMakeLists.txt
+8
-6
8 additions, 6 deletions
src/utils/CMakeLists.txt
src/utils/Messenger.cpp
+3
-3
3 additions, 3 deletions
src/utils/Messenger.cpp
src/utils/Messenger.hpp
+5
-0
5 additions, 0 deletions
src/utils/Messenger.hpp
src/utils/Serializer.cpp
+22
-1
22 additions, 1 deletion
src/utils/Serializer.cpp
with
38 additions
and
10 deletions
src/utils/CMakeLists.txt
+
8
−
6
View file @
3cd0bf99
...
@@ -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 ---------------
...
...
This diff is collapsed.
Click to expand it.
src/utils/Messenger.cpp
+
3
−
3
View file @
3cd0bf99
#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) { */
...
...
This diff is collapsed.
Click to expand it.
src/utils/Messenger.hpp
+
5
−
0
View file @
3cd0bf99
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
src/utils/Serializer.cpp
+
22
−
1
View file @
3cd0bf99
#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; */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment