moab-dev
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
July 2014
- 13 participants
- 72 discussions
MOAB must be configured with MBZoltan for mbpart tool.
The .h5m file in Nek repo already has two partitions and it should work well with two processors.
The error line you mention is a call to "iMeshP_loadAll" function are you using parallel MOAB?
==> mbsize -t moab_conjht.h5m
File moab_conjht.h5m:
Tag Name Vertex Hex EntitySet
------------------ -------- -------- ---------
MATERIAL_SET 0 0 3
NEUMANN_SET 0 0 6
DIRICHLET_SET 0 0 0
GEOM_DIMENSION 0 0 0
GLOBAL_ID 99 5 11
HAS_MID_NODES 0 0 3
PARALLEL_PARTITION 0 0 2
distFactor 0 0 6
qaRecord 0 0 0
Rajeev
________________________________
From: "Vegendla, Surya Narayana Prasad" <svegendla(a)anl.gov>
To: "Jain, Rajeev" <jain(a)mcs.anl.gov>
Sent: Tuesday, July 15, 2014 3:56 PM
Subject: how to install mbpart in moab installation??
Hi Rajeev,
How to install mbpart in MOAB bin directory as similar to mbconvert?
And also following errors are seen while running on multi processors blues account, here I used the partition grid from MCS account where mbpart installed your directory (it works well in a single processor).
Number of processors: 2
REAL wdsize : 8
INTEGER wdsize : 4
Beginning session:
/home/svegendla/nekFiles/moab_conjhtOld/moab_conjht.rea
timer accuracy: 9.5367432E-08 sec
read .rea file
ASSERT ERROR: 21 in moab.f line 477
ASSERT ERROR: 21 in moab.f line 477
call exitt: dying ...
Thanks,
Prasad
3
2
All,
I think the commit messages that are being sent to moab-dev are an
overkill to follow the development activity in MOAB. We have been
making quite a few changes recently and there are better ways to
follow MOAB through the "watch" feature in bitbucket (click on the eye
at the right hand corner of
https://bitbucket.org/fathomteam/moab/overview) This will give you
the option to follow all commits, or just the PRs or all of the
activity rather than getting your inbox pounded with all
feature-branch dev commits by default.
We would like to reserve moab-dev for user questions and feature/issue
discussions alone in order to avoid further spamming our users with
relentless commit messages.
Please let us know if you have questions or concerns.
Thank you,
Vijay
PS: We will also be implementing similar changes for CGMA, Lasso and
Meshkit lists.
2
1
Assert erros while running moab_conjht exmaple on multiprpceesor
by Vegendla, Surya Narayana Prasad 15 Jul '14
by Vegendla, Surya Narayana Prasad 15 Jul '14
15 Jul '14
Hi All,
I could able to run moab_conjht example on single processor. But, code crashes while running on multi processors (Also used mbpart to create partition geometry for new h5m file). Please advise how to overcome this problem.
Number of processors: 2
REAL wdsize : 8
INTEGER wdsize : 4
Beginning session:
/home/svegendla/nekFiles/moab_conjhtOld/moab_conjht.rea
timer accuracy: 9.5367432E-08 sec
read .rea file
ASSERT ERROR: 21 in moab.f line 477
ASSERT ERROR: 21 in moab.f line 477
call exitt: dying ...
Thanks,
Prasad
1
0
commit/MOAB: vijaysm: Fix uninitialized variable warnings in MBCSLAM
by commits-noreply@bitbucket.org 14 Jul '14
by commits-noreply@bitbucket.org 14 Jul '14
14 Jul '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/57c442e05a5e/
Changeset: 57c442e05a5e
Branch: vijaysm/fix-warnings
User: vijaysm
Date: 2014-07-15 02:37:12
Summary: Fix uninitialized variable warnings in MBCSLAM
Affected #: 1 file
diff --git a/tools/mbcslam/Intx2Mesh.cpp b/tools/mbcslam/Intx2Mesh.cpp
index b17cc33..c6bbdce 100644
--- a/tools/mbcslam/Intx2Mesh.cpp
+++ b/tools/mbcslam/Intx2Mesh.cpp
@@ -177,7 +177,7 @@ ErrorCode Intx2Mesh::intersect_meshes(EntityHandle mbset1, EntityHandle mbset2,
// really, should be something from t1 and t2; blue is 1 (lagrange), red is 2 (euler)
createTags(); //
- EntityHandle startBlue, startRed;
+ EntityHandle startBlue=0, startRed=0;
mb->get_entities_by_dimension(mbs1, 2, rs1);
mb->get_entities_by_dimension(mbs2, 2, rs2);
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: vijaysm: Remove some uninitialized variable usage warnings.
by commits-noreply@bitbucket.org 14 Jul '14
by commits-noreply@bitbucket.org 14 Jul '14
14 Jul '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/db146a6c57e4/
Changeset: db146a6c57e4
Branch: vijaysm/refiner_fixes
User: vijaysm
Date: 2014-07-15 02:23:47
Summary: Remove some uninitialized variable usage warnings.
Affected #: 1 file
diff --git a/tools/refiner/RefinerTagManager.cpp b/tools/refiner/RefinerTagManager.cpp
index c66a974..e4602c5 100644
--- a/tools/refiner/RefinerTagManager.cpp
+++ b/tools/refiner/RefinerTagManager.cpp
@@ -287,7 +287,7 @@ void RefinerTagManager::get_output_vertex_tag( int i, Tag& tag, int& byte_offset
*/
int RefinerTagManager::get_input_gids( int n, const EntityHandle* ents, std::vector<int>& gids )
{
- int stat;
+ int stat=0;
gids.clear();
for ( int i = 0; i < n; ++ i )
{
@@ -315,7 +315,7 @@ int RefinerTagManager::get_input_gids( int n, const EntityHandle* ents, std::vec
*/
int RefinerTagManager::get_output_gids( int n, const EntityHandle* ents, std::vector<int>& gids )
{
- int stat;
+ int stat=0;
gids.clear();
for ( int i = 0; i < n; ++ i )
{
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/a2d1746d29ab/
Changeset: a2d1746d29ab
Branch: None
User: vijaysm
Date: 2014-07-15 02:14:47
Summary: Add extra argument to MB_OPTIONAL_TOOL routine to take a default enabler option and one when --enable-tools is specified.
Affected #: 1 file
diff --git a/configure.ac b/configure.ac
index 890f70d..102c05d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -584,7 +584,7 @@ AC_ARG_WITH([vtk],
],[WITH_VTK=])
VTKMOAB_DEFAULT=no
-if test "x$WITH_VTK" != "xno" -a "x$WITH_VTK" != "x"; then
+if (test "x$WITH_VTK" != "xno" && test "x$WITH_VTK" != "x"); then
VTKMOAB_DEFAULT=yes
fi
@@ -610,7 +610,7 @@ AC_ARG_WITH( [vtk-lib-suffix],
# Optional Tools
###############################################################################
# Define a macro to avoid typing this for each individual tool
- # Usage: MB_OPTIONAL_TOOL( name, default )
+ # Usage: MB_OPTIONAL_TOOL( name, default, default_if_tools_enabled )
# name - name of option
# default - yes/no, $ENABLE_TOOLS overrides this if set
# Actions:
@@ -618,8 +618,9 @@ AC_ARG_WITH( [vtk-lib-suffix],
# creates ENABLE_${tool} automake conditional
AC_DEFUN([MB_OPTIONAL_TOOL],[
mb_default_$1=$2
+
if test "x" != "x$ENABLE_TOOLS"; then
- mb_default_$1="$ENABLE_TOOLS"
+ mb_default_$1=$3
fi
AC_ARG_ENABLE( [$1],
[AC_HELP_STRING([--enable-$1],[Build tool: $1])
@@ -637,26 +638,26 @@ AC_HELP_STRING([--enable-tools],[Build all tools by default])
AC_HELP_STRING([--disable-tools],[Disable all tools by default])],
[ENABLE_TOOLS=$enableval],[ENABLE_TOOLS=] )
# Individual tools
-MB_OPTIONAL_TOOL([mbconvert], [yes])
-MB_OPTIONAL_TOOL([hexmodops], [yes])
-MB_OPTIONAL_TOOL([qvdual], [no] )
-MB_OPTIONAL_TOOL([vtkMOABReader],[${VTKMOAB_DEFAULT}] )
-MB_OPTIONAL_TOOL([vtkMOABReaderNew],[${VTKMOAB_DEFAULT}] )
-MB_OPTIONAL_TOOL([mbsize], [yes])
-MB_OPTIONAL_TOOL([mbskin], [yes])
-MB_OPTIONAL_TOOL([mbtagprop], [yes])
-MB_OPTIONAL_TOOL([mbmem], [yes])
-MB_OPTIONAL_TOOL([mcnpmit], [no])
-MB_OPTIONAL_TOOL([mbcoupler], [$ENABLE_mcnpmit] )
-MB_OPTIONAL_TOOL([spheredecomp], [yes])
-MB_OPTIONAL_TOOL([mbsurfplot], [yes])
-MB_OPTIONAL_TOOL([mbzoltan], [${WITH_ZOLTAN}] )
-MB_OPTIONAL_TOOL([dagmc], [yes])
-MB_OPTIONAL_TOOL([gsets], [yes])
-MB_OPTIONAL_TOOL([mbdepth], [yes])
-MB_OPTIONAL_TOOL([refiner], [no])
-MB_OPTIONAL_TOOL([h5mtools], [yes])
-MB_OPTIONAL_TOOL([mbcslam], [no])
+MB_OPTIONAL_TOOL([mbconvert], [yes], [yes])
+MB_OPTIONAL_TOOL([hexmodops], [yes], [yes])
+MB_OPTIONAL_TOOL([qvdual], [${VTKMOAB_DEFAULT}], [${VTKMOAB_DEFAULT}])
+MB_OPTIONAL_TOOL([vtkMOABReader],[${VTKMOAB_DEFAULT}], [${VTKMOAB_DEFAULT}])
+MB_OPTIONAL_TOOL([vtkMOABReaderNew],[${VTKMOAB_DEFAULT}], [${VTKMOAB_DEFAULT}])
+MB_OPTIONAL_TOOL([mbsize], [yes], [yes])
+MB_OPTIONAL_TOOL([mbskin], [yes], [yes])
+MB_OPTIONAL_TOOL([mbtagprop], [yes], [yes])
+MB_OPTIONAL_TOOL([mbmem], [yes], [yes])
+MB_OPTIONAL_TOOL([mcnpmit], [no], [yes])
+MB_OPTIONAL_TOOL([mbcoupler], [no], [yes] )
+MB_OPTIONAL_TOOL([spheredecomp], [yes], [yes])
+MB_OPTIONAL_TOOL([mbsurfplot], [yes], [yes])
+MB_OPTIONAL_TOOL([mbzoltan], [${WITH_ZOLTAN}], [${WITH_ZOLTAN}] )
+MB_OPTIONAL_TOOL([dagmc], [no], [yes])
+MB_OPTIONAL_TOOL([gsets], [yes], [yes])
+MB_OPTIONAL_TOOL([mbdepth], [yes], [yes])
+MB_OPTIONAL_TOOL([refiner], [no], [yes])
+MB_OPTIONAL_TOOL([h5mtools], [yes], [yes])
+MB_OPTIONAL_TOOL([mbcslam], [no], [yes])
if test "xyes" = "x$ENABLE_refiner"; then
if test "xyes" != "x$WITH_MPI"; then
@@ -809,8 +810,7 @@ AC_DEFUN([FATHOM_MERGE_LISTS],[
$1="${$1} $2"
])
-if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
-
+if (test "x$WITH_VTK" != "xno" && test "x$WITH_VTK" != "x"); then
AC_PATH_X
AC_PATH_XTRA
if test "xyes" = "x$no_x"; then
https://bitbucket.org/fathomteam/moab/commits/5317f24e46c4/
Changeset: 5317f24e46c4
Branch: vijaysm/config_tools
User: vijaysm
Date: 2014-07-15 02:19:52
Summary: Make h5mtools depend on actual HDF5 configuration
Affected #: 1 file
diff --git a/configure.ac b/configure.ac
index 102c05d..a86f98d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -656,7 +656,7 @@ MB_OPTIONAL_TOOL([dagmc], [no], [yes])
MB_OPTIONAL_TOOL([gsets], [yes], [yes])
MB_OPTIONAL_TOOL([mbdepth], [yes], [yes])
MB_OPTIONAL_TOOL([refiner], [no], [yes])
-MB_OPTIONAL_TOOL([h5mtools], [yes], [yes])
+MB_OPTIONAL_TOOL([h5mtools], [${HAVE_HDF5}], [${HAVE_HDF5}])
MB_OPTIONAL_TOOL([mbcslam], [no], [yes])
if test "xyes" = "x$ENABLE_refiner"; then
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
5 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/29f47717e991/
Changeset: 29f47717e991
Branch: None
User: vijaysm
Date: 2014-07-15 00:09:19
Summary: Making an API change to estimate the memory usage in all of the MOAB routines: changing long to long long
Affected #: 10 files
diff --git a/src/AEntityFactory.cpp b/src/AEntityFactory.cpp
index e29df97..650ad49 100644
--- a/src/AEntityFactory.cpp
+++ b/src/AEntityFactory.cpp
@@ -1473,8 +1473,8 @@ ErrorCode AEntityFactory::set_adjacency_ptr( EntityHandle entity,
}
-void AEntityFactory::get_memory_use( unsigned long& entity_total,
- unsigned long& memory_total )
+void AEntityFactory::get_memory_use( unsigned long long& entity_total,
+ unsigned long long& memory_total )
{
entity_total = memory_total = 0;
@@ -1506,8 +1506,8 @@ void AEntityFactory::get_memory_use( unsigned long& entity_total,
ErrorCode AEntityFactory::get_memory_use( const Range& ents_in,
- unsigned long& min_per_ent,
- unsigned long& amortized )
+ unsigned long long& min_per_ent,
+ unsigned long long& amortized )
{
min_per_ent = amortized = 0;
SequenceData* prev_data = 0;
diff --git a/src/AEntityFactory.hpp b/src/AEntityFactory.hpp
index 5d3c3f3..c84a0d3 100644
--- a/src/AEntityFactory.hpp
+++ b/src/AEntityFactory.hpp
@@ -163,11 +163,11 @@ public:
ErrorCode merge_adjust_adjacencies(EntityHandle entity_to_keep,
EntityHandle entity_to_remove);
- void get_memory_use( unsigned long& total_entity_storage,
- unsigned long& total_storage );
+ void get_memory_use( unsigned long long& total_entity_storage,
+ unsigned long long& total_storage );
ErrorCode get_memory_use( const Range& entities,
- unsigned long& total_entity_storage,
- unsigned long& total_amortized_storage );
+ unsigned long long& total_entity_storage,
+ unsigned long long& total_amortized_storage );
private:
diff --git a/src/AdaptiveKDTree.cpp b/src/AdaptiveKDTree.cpp
index 4b104b4..f629cc4 100644
--- a/src/AdaptiveKDTree.cpp
+++ b/src/AdaptiveKDTree.cpp
@@ -2154,7 +2154,7 @@ namespace moab {
all.merge( elem2d );
all.merge( elem3d );
tree_sets.insert( myRoot );
- unsigned long set_used, set_amortized, set_store_used, set_store_amortized,
+ unsigned long long set_used, set_amortized, set_store_used, set_store_amortized,
set_tag_used, set_tag_amortized, elem_used, elem_amortized;
moab()->estimated_memory_use( tree_sets,
&set_used, &set_amortized,
diff --git a/src/Core.cpp b/src/Core.cpp
index 0bd882f..620c2dd 100644
--- a/src/Core.cpp
+++ b/src/Core.cpp
@@ -3851,22 +3851,22 @@ ErrorCode Core::get_set_iterators(EntityHandle meshset,
}
void Core::estimated_memory_use_internal( const Range* ents,
- unsigned long* total_storage,
- unsigned long* total_amortized_storage,
- unsigned long* entity_storage,
- unsigned long* amortized_entity_storage,
- unsigned long* adjacency_storage,
- unsigned long* amortized_adjacency_storage,
+ unsigned long long* total_storage,
+ unsigned long long* total_amortized_storage,
+ unsigned long long* entity_storage,
+ unsigned long long* amortized_entity_storage,
+ unsigned long long* adjacency_storage,
+ unsigned long long* amortized_adjacency_storage,
const Tag* tag_array,
unsigned num_tags,
- unsigned long* tag_storage,
- unsigned long* amortized_tag_storage )
+ unsigned long long* tag_storage,
+ unsigned long long* amortized_tag_storage )
{
// Figure out which values we need to calulate
- unsigned long i_entity_storage, ia_entity_storage,
+ unsigned long long i_entity_storage, ia_entity_storage,
i_adjacency_storage, ia_adjacency_storage,
i_tag_storage, ia_tag_storage;
- unsigned long *total_tag_storage = 0,
+ unsigned long long *total_tag_storage = 0,
*amortized_total_tag_storage =0;
if (!tag_array) {
total_tag_storage = tag_storage;
@@ -3998,16 +3998,16 @@ void Core::estimated_memory_use_internal( const Range* ents,
void Core::estimated_memory_use( const EntityHandle* ent_array,
unsigned long num_ents,
- unsigned long* total_storage,
- unsigned long* total_amortized_storage,
- unsigned long* entity_storage,
- unsigned long* amortized_entity_storage,
- unsigned long* adjacency_storage,
- unsigned long* amortized_adjacency_storage,
+ unsigned long long* total_storage,
+ unsigned long long* total_amortized_storage,
+ unsigned long long* entity_storage,
+ unsigned long long* amortized_entity_storage,
+ unsigned long long* adjacency_storage,
+ unsigned long long* amortized_adjacency_storage,
const Tag* tag_array,
unsigned num_tags,
- unsigned long* tag_storage,
- unsigned long* amortized_tag_storage )
+ unsigned long long* tag_storage,
+ unsigned long long* amortized_tag_storage )
{
Range range;
@@ -4035,16 +4035,16 @@ void Core::estimated_memory_use( const EntityHandle* ent_array,
}
void Core::estimated_memory_use( const Range& ents,
- unsigned long* total_storage,
- unsigned long* total_amortized_storage,
- unsigned long* entity_storage,
- unsigned long* amortized_entity_storage,
- unsigned long* adjacency_storage,
- unsigned long* amortized_adjacency_storage,
+ unsigned long long* total_storage,
+ unsigned long long* total_amortized_storage,
+ unsigned long long* entity_storage,
+ unsigned long long* amortized_entity_storage,
+ unsigned long long* adjacency_storage,
+ unsigned long long* amortized_adjacency_storage,
const Tag* tag_array,
unsigned num_tags,
- unsigned long* tag_storage,
- unsigned long* amortized_tag_storage )
+ unsigned long long* tag_storage,
+ unsigned long long* amortized_tag_storage )
{
estimated_memory_use_internal( &ents,
total_storage, total_amortized_storage,
diff --git a/src/SequenceManager.cpp b/src/SequenceManager.cpp
index f896cf2..8ca1755 100644
--- a/src/SequenceManager.cpp
+++ b/src/SequenceManager.cpp
@@ -767,13 +767,13 @@ SequenceManager::replace_subsequence( EntitySequence* new_seq )
return typeData[type].replace_subsequence( new_seq, &tagSizes[0], tagSizes.size() );
}
-void SequenceManager::get_memory_use( unsigned long& total_entity_storage,
- unsigned long& total_storage ) const
+void SequenceManager::get_memory_use( unsigned long long& total_entity_storage,
+ unsigned long long& total_storage ) const
{
total_entity_storage = 0;
total_storage = 0;
- unsigned long temp_entity, temp_total;
+ unsigned long long temp_entity, temp_total;
for (EntityType i = MBVERTEX; i < MBMAXTYPE; ++i) {
temp_entity = temp_total = 0;
get_memory_use( i, temp_entity, temp_total );
@@ -783,19 +783,19 @@ void SequenceManager::get_memory_use( unsigned long& total_entity_storage,
}
void SequenceManager::get_memory_use( EntityType type,
- unsigned long& total_entity_storage,
- unsigned long& total_storage ) const
+ unsigned long long& total_entity_storage,
+ unsigned long long& total_storage ) const
{
typeData[type].get_memory_use( total_entity_storage, total_storage );
}
void SequenceManager::get_memory_use( const Range& entities,
- unsigned long& total_entity_storage,
- unsigned long& total_amortized_storage ) const
+ unsigned long long& total_entity_storage,
+ unsigned long long& total_amortized_storage ) const
{
total_entity_storage = 0;
total_amortized_storage = 0;
- unsigned long temp_entity, temp_total;
+ unsigned long long temp_entity, temp_total;
Range::const_pair_iterator i;
for (i = entities.const_pair_begin(); i != entities.const_pair_end(); ++i) {
const EntityType t1 = TYPE_FROM_HANDLE(i->first);
diff --git a/src/SequenceManager.hpp b/src/SequenceManager.hpp
index 50b1010..be70710 100644
--- a/src/SequenceManager.hpp
+++ b/src/SequenceManager.hpp
@@ -236,16 +236,16 @@ class SequenceManager
const TypeSequenceManager& entity_map( EntityType type ) const
{ return typeData[type]; }
- void get_memory_use( unsigned long& total_entity_storage,
- unsigned long& total_storage ) const;
+ void get_memory_use( unsigned long long& total_entity_storage,
+ unsigned long long& total_storage ) const;
void get_memory_use( EntityType type,
- unsigned long& total_entity_storage,
- unsigned long& total_storage ) const;
+ unsigned long long& total_entity_storage,
+ unsigned long long& total_storage ) const;
void get_memory_use( const Range& entities,
- unsigned long& total_entity_storage,
- unsigned long& total_amortized_storage ) const;
+ unsigned long long& total_entity_storage,
+ unsigned long long& total_amortized_storage ) const;
diff --git a/src/TypeSequenceManager.cpp b/src/TypeSequenceManager.cpp
index 50d6ef6..59f1d42 100644
--- a/src/TypeSequenceManager.cpp
+++ b/src/TypeSequenceManager.cpp
@@ -807,8 +807,8 @@ ErrorCode TypeSequenceManager::notify_prepended( iterator seq )
return rval;
}
-void TypeSequenceManager::get_memory_use( unsigned long& entity_storage,
- unsigned long& total_storage ) const
+void TypeSequenceManager::get_memory_use( unsigned long long& entity_storage,
+ unsigned long long& total_storage ) const
{
entity_storage = total_storage = 0;
if (empty())
@@ -825,8 +825,8 @@ void TypeSequenceManager::get_memory_use( unsigned long& entity_storage,
void TypeSequenceManager::append_memory_use( EntityHandle first,
EntityHandle last,
const SequenceData* data,
- unsigned long& entity_storage,
- unsigned long& total_storage ) const
+ unsigned long long& entity_storage,
+ unsigned long long& total_storage ) const
{
const unsigned long allocated_count = data->size();
@@ -865,8 +865,8 @@ void TypeSequenceManager::append_memory_use( EntityHandle first,
void TypeSequenceManager::get_memory_use( EntityHandle first,
EntityHandle last,
- unsigned long& entity_storage,
- unsigned long& total_storage ) const
+ unsigned long long& entity_storage,
+ unsigned long long& total_storage ) const
{
entity_storage = total_storage = 0;
diff --git a/src/TypeSequenceManager.hpp b/src/TypeSequenceManager.hpp
index f69bf15..bbc89fd 100644
--- a/src/TypeSequenceManager.hpp
+++ b/src/TypeSequenceManager.hpp
@@ -75,8 +75,8 @@ private:
void append_memory_use( EntityHandle first,
EntityHandle last,
const SequenceData* data,
- unsigned long& entity_storage,
- unsigned long& total_storage ) const;
+ unsigned long long& entity_storage,
+ unsigned long long& total_storage ) const;
// check if sequence at passed iterator should be merged with
// the subsequent sequence, and if so merge them retaining i.
@@ -332,12 +332,12 @@ public:
*/
ErrorCode notify_appended( iterator seq );
- void get_memory_use( unsigned long& total_entity_storage,
- unsigned long& total_storage ) const;
+ void get_memory_use( unsigned long long& total_entity_storage,
+ unsigned long long& total_storage ) const;
void get_memory_use( EntityHandle start, EntityHandle end,
- unsigned long& total_entity_storage,
- unsigned long& total_amortized_storage ) const;
+ unsigned long long& total_entity_storage,
+ unsigned long long& total_amortized_storage ) const;
unsigned long get_sequence_count() const
{ return sequenceSet.size(); }
diff --git a/src/moab/Core.hpp b/src/moab/Core.hpp
index aa7d9da..d767226 100644
--- a/src/moab/Core.hpp
+++ b/src/moab/Core.hpp
@@ -1224,16 +1224,16 @@ public:
*/
void estimated_memory_use( const EntityHandle* ent_array = 0,
unsigned long num_ents = 0,
- unsigned long* total_storage = 0,
- unsigned long* total_amortized_storage = 0,
- unsigned long* entity_storage = 0,
- unsigned long* amortized_entity_storage = 0,
- unsigned long* adjacency_storage = 0,
- unsigned long* amortized_adjacency_storage = 0,
+ unsigned long long* total_storage = 0,
+ unsigned long long* total_amortized_storage = 0,
+ unsigned long long* entity_storage = 0,
+ unsigned long long* amortized_entity_storage = 0,
+ unsigned long long* adjacency_storage = 0,
+ unsigned long long* amortized_adjacency_storage = 0,
const Tag* tag_array = 0,
unsigned num_tags = 0,
- unsigned long* tag_storage = 0,
- unsigned long* amortized_tag_storage = 0 );
+ unsigned long long* tag_storage = 0,
+ unsigned long long* amortized_tag_storage = 0 );
/**\brief Calculate amount of memory used to store MOAB data
*
@@ -1262,16 +1262,16 @@ public:
* all tags.
*/
void estimated_memory_use( const Range& ents,
- unsigned long* total_storage = 0,
- unsigned long* total_amortized_storage = 0,
- unsigned long* entity_storage = 0,
- unsigned long* amortized_entity_storage = 0,
- unsigned long* adjacency_storage = 0,
- unsigned long* amortized_adjacency_storage = 0,
+ unsigned long long* total_storage = 0,
+ unsigned long long* total_amortized_storage = 0,
+ unsigned long long* entity_storage = 0,
+ unsigned long long* amortized_entity_storage = 0,
+ unsigned long long* adjacency_storage = 0,
+ unsigned long long* amortized_adjacency_storage = 0,
const Tag* tag_array = 0,
unsigned num_tags = 0,
- unsigned long* tag_storage = 0,
- unsigned long* amortized_tag_storage = 0 );
+ unsigned long long* tag_storage = 0,
+ unsigned long long* amortized_tag_storage = 0 );
void print_database() const;
@@ -1284,16 +1284,16 @@ private:
Core& operator=( const Core& copy );
void estimated_memory_use_internal( const Range* ents,
- unsigned long* total_storage,
- unsigned long* total_amortized_storage,
- unsigned long* entity_storage,
- unsigned long* amortized_entity_storage,
- unsigned long* adjacency_storage,
- unsigned long* amortized_adjacency_storage,
+ unsigned long long* total_storage,
+ unsigned long long* total_amortized_storage,
+ unsigned long long* entity_storage,
+ unsigned long long* amortized_entity_storage,
+ unsigned long long* adjacency_storage,
+ unsigned long long* amortized_adjacency_storage,
const Tag* tag_array,
unsigned num_tags,
- unsigned long* tag_storage,
- unsigned long* amortized_tag_storage );
+ unsigned long long* tag_storage,
+ unsigned long long* amortized_tag_storage );
//! database init and de-init routines
ErrorCode initialize();
diff --git a/src/moab/Interface.hpp b/src/moab/Interface.hpp
index 09f4219..88ce232 100644
--- a/src/moab/Interface.hpp
+++ b/src/moab/Interface.hpp
@@ -1043,16 +1043,16 @@ public:
*/
virtual void estimated_memory_use( const EntityHandle* ent_array = 0,
unsigned long num_ents = 0,
- unsigned long* total_storage = 0,
- unsigned long* total_amortized_storage = 0,
- unsigned long* entity_storage = 0,
- unsigned long* amortized_entity_storage = 0,
- unsigned long* adjacency_storage = 0,
- unsigned long* amortized_adjacency_storage = 0,
+ unsigned long long* total_storage = 0,
+ unsigned long long* total_amortized_storage = 0,
+ unsigned long long* entity_storage = 0,
+ unsigned long long* amortized_entity_storage = 0,
+ unsigned long long* adjacency_storage = 0,
+ unsigned long long* amortized_adjacency_storage = 0,
const Tag* tag_array = 0,
unsigned num_tags = 0,
- unsigned long* tag_storage = 0,
- unsigned long* amortized_tag_storage = 0 ) = 0;
+ unsigned long long* tag_storage = 0,
+ unsigned long long* amortized_tag_storage = 0 ) = 0;
/**\brief Calculate amount of memory used to store MOAB data
*
@@ -1082,16 +1082,16 @@ public:
* for all tags.
*/
virtual void estimated_memory_use( const Range& ents,
- unsigned long* total_storage = 0,
- unsigned long* total_amortized_storage = 0,
- unsigned long* entity_storage = 0,
- unsigned long* amortized_entity_storage = 0,
- unsigned long* adjacency_storage = 0,
- unsigned long* amortized_adjacency_storage = 0,
+ unsigned long long* total_storage = 0,
+ unsigned long long* total_amortized_storage = 0,
+ unsigned long long* entity_storage = 0,
+ unsigned long long* amortized_entity_storage = 0,
+ unsigned long long* adjacency_storage = 0,
+ unsigned long long* amortized_adjacency_storage = 0,
const Tag* tag_array = 0,
unsigned num_tags = 0,
- unsigned long* tag_storage = 0,
- unsigned long* amortized_tag_storage = 0 ) = 0;
+ unsigned long long* tag_storage = 0,
+ unsigned long long* amortized_tag_storage = 0 ) = 0;
/**@}*/
/** \name Higher-order elements */
https://bitbucket.org/fathomteam/moab/commits/a045781af504/
Changeset: a045781af504
Branch: None
User: vijaysm
Date: 2014-07-15 00:09:20
Summary: Modifying the mbmem (memory estimator) tool to use the new API
Affected #: 1 file
diff --git a/tools/mbmem.cpp b/tools/mbmem.cpp
index a881fcd..538abca 100644
--- a/tools/mbmem.cpp
+++ b/tools/mbmem.cpp
@@ -116,14 +116,14 @@ int main( int argc, char* argv[] )
// struct to store memory stats
struct MemStats {
- unsigned long total_storage;
- unsigned long total_amortized;
- unsigned long entity_storage;
- unsigned long entity_amortized;
- unsigned long adjacency_storage;
- unsigned long adjacency_amortized;
- unsigned long tag_storage;
- unsigned long tag_amortized;
+ unsigned long long total_storage;
+ unsigned long long total_amortized;
+ unsigned long long entity_storage;
+ unsigned long long entity_amortized;
+ unsigned long long adjacency_storage;
+ unsigned long long adjacency_amortized;
+ unsigned long long tag_storage;
+ unsigned long long tag_amortized;
};
// test if MemStats object indicates no memory
@@ -136,7 +136,7 @@ static void get_mem_stats( moab::Interface& mb,
moab::EntityType type = moab::MBMAXTYPE );
// Formatted string representation of memory size value
-static std::string memstr( unsigned long val );
+static std::string memstr( unsigned long long val );
// Get string describing tag data type
static std::string tag_type_string( moab::Interface& mb, moab::Tag tag );
@@ -244,7 +244,7 @@ void print_memory_stats( moab::Interface& mb,
if (moab::MB_SUCCESS != rval || name.empty())
name = ANON_TAG_NAME;
- unsigned long occupied, allocated;
+ unsigned long long occupied, allocated;
mb.estimated_memory_use( 0, 0, 0, 0, 0, 0, 0, 0, &*ti, 1, &occupied, &allocated );
std::cout << std::left << std::setw(maxlen) << name << ' '
@@ -270,8 +270,8 @@ void print_memory_stats( moab::Interface& mb,
if (sysstats) {
std::FILE* filp = std::fopen("/proc/self/stat", "r");
- unsigned long vsize;
- long rss;
+ unsigned long long vsize;
+ long long rss;
if (filp && 2 == std::fscanf(filp,
"%*d " // pid
"%*s " // comm
@@ -295,8 +295,8 @@ void print_memory_stats( moab::Interface& mb,
"%*d " // num_threads
"%*d " // itrealvalue
"%*u " // starttime
- "%lu " // vsize
- "%ld", // rss
+ "%llu " // vsize
+ "%lld", // rss
&vsize, &rss )) {
#ifndef _MSC_VER
rss *= getpagesize();
@@ -313,7 +313,7 @@ void print_memory_stats( moab::Interface& mb,
std::cerr << "getrusage failed" << std::endl;
}
else {
- long int tmp_rss = sysdata.ru_maxrss;
+ long long int tmp_rss = sysdata.ru_maxrss;
rss *= getpagesize();
std::cerr << std::endl << "SYSTEM:"
<< std::endl << "Resident set size: " << memstr(tmp_rss)
@@ -360,17 +360,17 @@ void get_mem_stats( moab::Interface& mb,
}
// rounded division
-static unsigned long rdiv( unsigned long num, unsigned long den )
+static unsigned long long rdiv( unsigned long long num, unsigned long long den )
{
return (num + den/2) / den;
}
-std::string memstr( unsigned long val )
+std::string memstr( unsigned long long val )
{
- const unsigned long kb = 1024;
- const unsigned long mb = kb*kb;
- const unsigned long gb = kb*mb;
- const unsigned long tb = kb*gb;
+ const unsigned long long kb = 1024;
+ const unsigned long long mb = kb*kb;
+ const unsigned long long gb = kb*mb;
+ const unsigned long long tb = kb*gb;
std::ostringstream s;
if (UNITS == HUMAN) {
@@ -388,7 +388,7 @@ std::string memstr( unsigned long val )
s << "0 ";
}
else {
- unsigned long den = 1;
+ unsigned long long den = 1;
switch (UNITS) {
case BYTES: den = 1; break;
case KILOBYTES: den = kb; break;
https://bitbucket.org/fathomteam/moab/commits/990cdc89551a/
Changeset: 990cdc89551a
Branch: None
User: vijaysm
Date: 2014-07-15 00:09:20
Summary: Fixing all the tests to conform to the new long long API change
Affected #: 4 files
diff --git a/test/MBTest.cpp b/test/MBTest.cpp
index d70753f..3b6795c 100644
--- a/test/MBTest.cpp
+++ b/test/MBTest.cpp
@@ -6044,7 +6044,7 @@ ErrorCode mb_poly_adjacency_test2()
ErrorCode mb_memory_use_test()
{
Core mb;
- unsigned long init_total, total_with_elem, total_with_tag, total_with_tag_data;
+ unsigned long long init_total, total_with_elem, total_with_tag, total_with_tag_data;
mb.estimated_memory_use(0,0,0,&init_total);
double coords[12] = { 1, 2, 0, 3, 4, 0, 5, 6, 0, 7, 8, 0 };
@@ -6060,7 +6060,7 @@ ErrorCode mb_memory_use_test()
if (total_with_elem <= init_total)
return MB_FAILURE;
- unsigned long min, am;
+ unsigned long long min, am;
Range r;
r.insert( elem );
mb.estimated_memory_use( r, &min, &am );
diff --git a/test/kd_tree_time.cpp b/test/kd_tree_time.cpp
index 9c34430..ecc3024 100644
--- a/test/kd_tree_time.cpp
+++ b/test/kd_tree_time.cpp
@@ -19,7 +19,7 @@ void print_file_stats(Interface& moab)
ErrorCode rval;
int num_tri;
Range sets;
- unsigned long set_mem, set_am, tag_mem, tag_am;
+ unsigned long long set_mem, set_am, tag_mem, tag_am;
rval = moab.get_number_entities_by_type(0, MBTRI, num_tri);
if (MB_SUCCESS != rval)
@@ -31,8 +31,8 @@ void print_file_stats(Interface& moab)
moab.estimated_memory_use(sets, 0, 0, &set_mem, &set_am, 0, 0, 0, 0, &tag_mem, &tag_am);
printf("Triangles: %d\n", num_tri);
printf("Sets: %lu\n", (unsigned long)sets.size());
- printf("Set storage: %lu (%lu)\n", set_mem, set_am);
- printf("Tag storage: %lu (%lu)\n", tag_mem, tag_am);
+ printf("Set storage: %llu (%llu)\n", set_mem, set_am);
+ printf("Tag storage: %llu (%llu)\n", tag_mem, tag_am);
}
int main(int argc, char* argv[])
diff --git a/test/obb/obb_tree_tool.cpp b/test/obb/obb_tree_tool.cpp
index f6fb539..bb76d88 100644
--- a/test/obb/obb_tree_tool.cpp
+++ b/test/obb/obb_tree_tool.cpp
@@ -60,10 +60,10 @@ static void usage( bool err = true )
}
#if defined(_MSC_VER) || defined(__MINGW32__)
-static void memory_use( unsigned long& vsize, unsigned long& rss )
+static void memory_use( unsigned long long& vsize, unsigned long long& rss )
{ vsize = rss = 0; }
#else
-static void memory_use( unsigned long& vsize, unsigned long& rss )
+static void memory_use( unsigned long long& vsize, unsigned long long& rss )
{
char buffer[512];
int filp = open( "/proc/self/stat", O_RDONLY );
@@ -80,7 +80,7 @@ static void memory_use( unsigned long& vsize, unsigned long& rss )
"%*u %*u %*d %*d " // utime stime cutime cstime
"%*d %*d %*d " // priority nice (unused)
"%*d %*u " // itrealval starttime
- "%lu %lu", &vsize, &rss );
+ "%llu %llu", &vsize, &rss );
rss *= getpagesize();
}
#endif
@@ -374,7 +374,7 @@ void print_stats( Interface* interface )
interface->get_entities_by_type( 0, MBVERTEX, verts );
triangles.merge( verts );
tree_sets.insert( root );
- unsigned long set_used, set_amortized, set_store_used, set_store_amortized,
+ unsigned long long set_used, set_amortized, set_store_used, set_store_amortized,
set_tag_used, set_tag_amortized, tri_used, tri_amortized;
interface->estimated_memory_use( tree_sets,
&set_used, &set_amortized,
@@ -388,7 +388,7 @@ void print_stats( Interface* interface )
tool.stats( root, std::cout );
- unsigned long real_rss, real_vsize;
+ unsigned long long real_rss, real_vsize;
memory_use( real_vsize, real_rss );
printf("------------------------------------------------------------------\n");
diff --git a/test/perf/point_location/point_location.cpp b/test/perf/point_location/point_location.cpp
index 4f5ddcc..39fde21 100644
--- a/test/perf/point_location/point_location.cpp
+++ b/test/perf/point_location/point_location.cpp
@@ -143,7 +143,7 @@ int main( int argc, char* argv[] )
// GET MEMORY USE BEFORE BUILDING TREE
- unsigned long init_total_storage;
+ unsigned long long init_total_storage;
mb.estimated_memory_use( 0, 0, &init_total_storage );
// RUN TIMING TEST
@@ -159,7 +159,7 @@ int main( int argc, char* argv[] )
break;
}
- unsigned long fini_total_storage;
+ unsigned long long fini_total_storage;
mb.estimated_memory_use( 0, 0, &fini_total_storage );
// VALIDATE RESULTS
https://bitbucket.org/fathomteam/moab/commits/b263db0d99a9/
Changeset: b263db0d99a9
Branch: None
User: vijaysm
Date: 2014-07-15 00:09:20
Summary: Updating the DagMC test to conform to API change.
Affected #: 1 file
diff --git a/tools/dagmc/ray_fire_test.cc b/tools/dagmc/ray_fire_test.cc
index cc73a38..e7496af 100644
--- a/tools/dagmc/ray_fire_test.cc
+++ b/tools/dagmc/ray_fire_test.cc
@@ -500,9 +500,9 @@ void write_obbtree_histogram( EntityHandle root, OrientedBoxTreeTool& tree, std:
}
-void moab_memory_estimates( Interface* mbi, int& moab_data_bytes, int& moab_alldata_est_bytes ){
+void moab_memory_estimates( Interface* mbi, unsigned long long& moab_data_bytes, unsigned long long& moab_alldata_est_bytes ){
- unsigned long storage, amortized_storage;
+ unsigned long long storage, amortized_storage;
mbi->estimated_memory_use( NULL, 0, &storage, &amortized_storage );
moab_data_bytes = storage;
@@ -550,7 +550,7 @@ void dump_pyfile( char* filename, double timewith, double timewithout, double tm
DICT_VAL(timewith-timewithout);
}
DICT_VAL(tmem);
- int moab_data_bytes, moab_alldata_est_bytes;
+ unsigned long long moab_data_bytes, moab_alldata_est_bytes;
moab_memory_estimates( dagmc.moab_instance(), moab_data_bytes, moab_alldata_est_bytes );
DICT_VAL( moab_data_bytes );
DICT_VAL( moab_alldata_est_bytes );
https://bitbucket.org/fathomteam/moab/commits/096ca89f28ef/
Changeset: 096ca89f28ef
Branch: vijaysm/memory_api_llu
User: vijaysm
Date: 2014-07-15 02:05:09
Summary: Conform to the correct data type when reading from file for vsize and rss (ref: http://man7.org/linux/man-pages/man5/proc.5.html ::# /proc/[pid]/stat)
Affected #: 2 files
diff --git a/test/obb/obb_tree_tool.cpp b/test/obb/obb_tree_tool.cpp
index bb76d88..1d59bbc 100644
--- a/test/obb/obb_tree_tool.cpp
+++ b/test/obb/obb_tree_tool.cpp
@@ -66,11 +66,13 @@ static void memory_use( unsigned long long& vsize, unsigned long long& rss )
static void memory_use( unsigned long long& vsize, unsigned long long& rss )
{
char buffer[512];
+ unsigned long lvsize;
+ long lrss;
int filp = open( "/proc/self/stat", O_RDONLY );
ssize_t r = read( filp, buffer, sizeof(buffer)-1 );
close( filp );
if (r < 0) r = 0;
- vsize = rss = 0;
+ lvsize = lrss = 0;
buffer[r] = '\0';
sscanf( buffer, "%*d %*s %*c " // pid command state
"%*d %*d " // ppid pgrp
@@ -80,8 +82,9 @@ static void memory_use( unsigned long long& vsize, unsigned long long& rss )
"%*u %*u %*d %*d " // utime stime cutime cstime
"%*d %*d %*d " // priority nice (unused)
"%*d %*u " // itrealval starttime
- "%llu %llu", &vsize, &rss );
- rss *= getpagesize();
+ "%lu %ld", &lvsize, &lrss );
+ rss = lrss*getpagesize();
+ vsize = lvsize;
}
#endif
diff --git a/tools/mbmem.cpp b/tools/mbmem.cpp
index 538abca..d49cdc1 100644
--- a/tools/mbmem.cpp
+++ b/tools/mbmem.cpp
@@ -271,7 +271,7 @@ void print_memory_stats( moab::Interface& mb,
if (sysstats) {
std::FILE* filp = std::fopen("/proc/self/stat", "r");
unsigned long long vsize;
- long long rss;
+ long rss;
if (filp && 2 == std::fscanf(filp,
"%*d " // pid
"%*s " // comm
@@ -296,14 +296,14 @@ void print_memory_stats( moab::Interface& mb,
"%*d " // itrealvalue
"%*u " // starttime
"%llu " // vsize
- "%lld", // rss
+ "%ld", // rss
&vsize, &rss )) {
#ifndef _MSC_VER
- rss *= getpagesize();
+ long long tmprss = rss * getpagesize();
#endif
std::cout << std::endl << "SYSTEM:"
<< std::endl << "Virtual memory: " << memstr(vsize)
- << std::endl << "Resident set size: " << memstr(rss)
+ << std::endl << "Resident set size: " << memstr(tmprss)
<< std::endl;
}
else {
@@ -313,10 +313,10 @@ void print_memory_stats( moab::Interface& mb,
std::cerr << "getrusage failed" << std::endl;
}
else {
- long long int tmp_rss = sysdata.ru_maxrss;
- rss *= getpagesize();
+ rss = sysdata.ru_maxrss;
+ long long tmprss = rss * getpagesize();
std::cerr << std::endl << "SYSTEM:"
- << std::endl << "Resident set size: " << memstr(tmp_rss)
+ << std::endl << "Resident set size: " << memstr(tmprss)
<< std::endl;
}
#endif
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
15 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/a6e546d1a491/
Changeset: a6e546d1a491
Branch: None
User: iulian07
Date: 2014-07-14 21:19:57
Summary: add large mesh example
Affected #: 2 files
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
new file mode 100644
index 0000000..6ef1dc9
--- /dev/null
+++ b/examples/GenLargeMesh.cpp
@@ -0,0 +1,105 @@
+/** @example GenLargeMesh.cpp \n
+ * \brief Create a large structured mesh, partitioned \n
+ * <b>To run</b>: mpiexec -np 2 GenLargeMesh \n
+ *
+ * It shows how to load create a mesh on the fly, on multiple
+ * processors, block wise
+ * Each processor will create its version of a block mesh, partitioned
+ * as AxBxC blocks. Each block will be with blockSize^3 hexahedrons, and will get a
+ * different PARALLEL_PARTITION tag
+ *
+ * The number of tasks will be MxNxK, and it must match the mpi size
+ * Each task will generate its mesh at location (m,n,k)
+ *
+ * By default M=2, N=1, K=1, so by default it should be launched on 2 procs
+ * By default, blockSize is 4, and A=2, B=2, C=2, so each task will generate locally
+ * blockSize^3 x A x B x C hexahedrons (value = 64x8 = 512 hexas, in 8 partitions)
+ *
+ * The total number f partitions will be A*B*C*M*N*K (default 16)
+ *
+ * Each part in partition will get a proper tag
+ *
+ * The vertices will get a proper global id, which will be used to resolve the
+ * shared entities
+ * The output will be written in parallel, and we will try sizes as big as we can
+ * (up to a billion vertices, because we use int for global ids)
+ *
+ * Within each partition, the hexas will be numbered contiguously, and also the
+ * vertices; The global id will be determined easily, for a vertex, but the entity
+ * handle space will be more interesting to handle, within a partition (we want
+ * contiguous handles within a partition)
+ *
+ * We may or may not use ScdInterface, because we want control over global id and
+ * entity handle within a partition
+ *
+ *
+ * mpiexec -np 2 GenLargeMesh
+ */
+
+#include "moab/Core.hpp"
+#include "moab/ProgOptions.hpp"
+#include "moab/ParallelComm.hpp"
+#include "moab/CN.hpp"
+
+#include <iostream>
+#include <vector>
+
+using namespace moab;
+using namespace std;
+int main(int argc, char **argv)
+{
+ int A=2, B=2, C=2, M=2, N=1, K=1;
+ int blockSize = 4;
+
+ MPI_Init(&argc, &argv);
+
+ ProgOptions opts;
+
+ opts.addOpt<int>(std::string("blockSize,b"),
+ std::string("Block size of mesh (default=4)"), &blockSize);
+ opts.addOpt<int>(std::string("xproc,M"),
+ std::string("Number of processors in x dir (default=2)"), &M);
+ opts.addOpt<int>(std::string("yproc,N"),
+ std::string("Number of processors in y dir (default=1)"), &N);
+ opts.addOpt<int>(std::string("zproc,K"),
+ std::string("Number of processors in z dir (default=1)"), &K);
+
+ opts.addOpt<int>(std::string("xblocks,A"),
+ std::string("Number of blocks on a task in x dir (default=2)"), &A);
+ opts.addOpt<int>(std::string("yblocks,B"),
+ std::string("Number of blocks on a task in y dir (default=2)"), &B);
+ opts.addOpt<int>(std::string("zblocks,C"),
+ std::string("Number of blocks on a task in x dir (default=2)"), &C);
+
+
+ opts.parseCommandLine(argc, argv);
+
+ Interface* mb = new Core;
+ if (NULL == mb)
+ {
+ MPI_Finalize();
+ return 1;
+ }
+
+ MPI_Comm comm ;
+ int rank, size;
+ MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+ MPI_Comm_rank( MPI_COMM_WORLD, &size );
+
+ if (M*N*K != size)
+ {
+ if (rank==0)
+ {
+ cout <<"M*N*K=" << M*N*K << " != size = "<< " size\n";
+ }
+ MPI_Finalize();
+ return 1;
+ }
+
+ // the global id of each vertex will be, on task
+
+ MPI_Finalize();
+ return 0;
+}
+
+
diff --git a/examples/makefile b/examples/makefile
index 787c8d3..f41def7 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -71,6 +71,9 @@ VisTags: VisTags.o ${MOAB_LIBDIR}/libMOAB.la
ReadWriteTest: ReadWriteTest.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
+GenLargeMesh: GenLargeMesh.o ${MOAB_LIBDIR}/libMOAB.la
+ ${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
+
clean:
rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
https://bitbucket.org/fathomteam/moab/commits/f6bbe84f4c2e/
Changeset: f6bbe84f4c2e
Branch: None
User: iulian07
Date: 2014-07-14 21:19:57
Summary: is_valid should be on the interface too
not only on the Core.hpp
How do we know if an entity handle is valid or not?
is there another way?
Affected #: 1 file
diff --git a/src/moab/Interface.hpp b/src/moab/Interface.hpp
index 09f4219..c8102b8 100644
--- a/src/moab/Interface.hpp
+++ b/src/moab/Interface.hpp
@@ -1981,6 +1981,8 @@ public:
SetIterator *&set_iter) = 0;
/**@}*/
+
+ virtual bool is_valid(EntityHandle entity) const = 0;
};
//! predicate for STL algorithms. Returns true if the entity handle is
https://bitbucket.org/fathomteam/moab/commits/acb938397bc9/
Changeset: acb938397bc9
Branch: None
User: iulian07
Date: 2014-07-14 21:19:57
Summary: validate sharedEnts
it is becoming important if some entities are deleted after they are resolved
they are part of the sharedEnts vector, but they are not deleted
from there.
This is the advantage of keeping entities in lists in member data
we should hunt them down :(
Affected #: 2 files
diff --git a/src/parallel/ParallelComm.cpp b/src/parallel/ParallelComm.cpp
index 886ef77..4fb8afc 100644
--- a/src/parallel/ParallelComm.cpp
+++ b/src/parallel/ParallelComm.cpp
@@ -8791,7 +8791,22 @@ ErrorCode ParallelComm::settle_intersection_points(Range & edges, Range & shared
return MB_SUCCESS;
// end copy
+}
+ErrorCode ParallelComm::correct_shared_entities()
+{
+
+ std::vector<EntityHandle> good_ents;
+ for (size_t i=0; i<sharedEnts.size(); i++)
+ {
+ if (mbImpl->is_valid(sharedEnts[i]))
+ {
+ good_ents.push_back(sharedEnts[i]);
+ }
}
+ sharedEnts = good_ents;
+
+ return MB_SUCCESS;
+}
void ParallelComm::print_pstatus(unsigned char pstat, std::string &ostr)
{
diff --git a/src/parallel/moab/ParallelComm.hpp b/src/parallel/moab/ParallelComm.hpp
index 3424c51..2a16ac2 100644
--- a/src/parallel/moab/ParallelComm.hpp
+++ b/src/parallel/moab/ParallelComm.hpp
@@ -932,6 +932,12 @@ namespace moab {
ErrorCode settle_intersection_points(Range & edges, Range & shared_edges_owned,
std::vector<std::vector<EntityHandle> *> & extraNodesVec, double tolerance);
+ /* \brief check the shared entities if they exist anymore
+ * will check the shared ents array, and clean it if necessary
+ *
+ */
+ ErrorCode correct_shared_entities();
+
private:
ErrorCode reduce_void(int tag_data_type, const MPI_Op mpi_op, int num_ents, void *old_vals, void *new_vals);
https://bitbucket.org/fathomteam/moab/commits/834ce0f7daa2/
Changeset: 834ce0f7daa2
Branch: None
User: iulian07
Date: 2014-07-14 21:19:57
Summary: improve the large mesh example
this example pushes the limits of moab
It will be used later to create meshes larger than 1 billion vertices
Each processor creates a structure of AxBxC blocks, each block with
blockSize ^ 3 hexas
The example should be run on MxNxK array of processors.
After resolving and sharing the vertices, mesh is written in
parallel.
each block will represent a partition
It is different than test paralle_write_test because there the number
of partitions created is equal to the number of processors.
Here, each processor creates AxBxC partitions
For a total of AxBxC x MxNxK partitions
block size, A, B, .., K are options, with default values
The total number of hexas will be
AxBxC x MxNxK x block^3
edges and faces are removed after resolve sharing
the file will have just vertices and hexas, and it will be already
partitioned
We will add some tags of interest, to make it better.
The writer failed if I just deleted the edges and faces.
I had to introduce a method to correct sharedEnts in PC
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 6ef1dc9..1e0fa73 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -40,12 +40,16 @@
#include "moab/ProgOptions.hpp"
#include "moab/ParallelComm.hpp"
#include "moab/CN.hpp"
+#include "moab/ReadUtilIface.hpp"
+#include "moab/MergeMesh.hpp"
#include <iostream>
#include <vector>
using namespace moab;
using namespace std;
+
+#define CHECKE(message) if(rval != MB_SUCCESS) { cout << (message) << "\n"; MPI_Finalize(); return 1; }
int main(int argc, char **argv)
{
int A=2, B=2, C=2, M=2, N=1, K=1;
@@ -58,7 +62,7 @@ int main(int argc, char **argv)
opts.addOpt<int>(std::string("blockSize,b"),
std::string("Block size of mesh (default=4)"), &blockSize);
opts.addOpt<int>(std::string("xproc,M"),
- std::string("Number of processors in x dir (default=2)"), &M);
+ std::string("Number of processors in x dir (default=1)"), &M);
opts.addOpt<int>(std::string("yproc,N"),
std::string("Number of processors in y dir (default=1)"), &N);
opts.addOpt<int>(std::string("zproc,K"),
@@ -80,23 +84,175 @@ int main(int argc, char **argv)
MPI_Finalize();
return 1;
}
+ ReadUtilIface *iface;
+ ErrorCode rval = mb->query_interface(iface);
+ CHECKE("Can't get reader interface");
- MPI_Comm comm ;
int rank, size;
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
- MPI_Comm_rank( MPI_COMM_WORLD, &size );
+ MPI_Comm_size( MPI_COMM_WORLD, &size );
if (M*N*K != size)
{
if (rank==0)
{
- cout <<"M*N*K=" << M*N*K << " != size = "<< " size\n";
+ cout <<"M*N*K=" << M*N*K << " != size = "<< size << "\n";
}
MPI_Finalize();
return 1;
}
- // the global id of each vertex will be, on task
+ // determine m, n, k for processor rank
+ int m,n,k;
+ k = rank/(M*N);
+ int leftover = rank%(M*N);
+ n = leftover/M;
+ m = leftover%M;
+ if (rank==size-1)
+ {
+ cout << "m, n, k for last rank:" << m << " " << n << " " << k << "\n";
+ }
+
+ // so there are a total of M * A * blockSize elements in x direction (so M * A * blockSize + 1 verts in x direction)
+ // so there are a total of N * B * blockSize elements in y direction (so N * B * blockSize + 1 verts in y direction)
+ // so there are a total of K * C * blockSize elements in z direction (so K * C * blockSize + 1 verts in z direction)
+
+ // there are ( M * A blockSize ) * ( N * B * blockSize) * (K * C * blockSize ) hexas
+ // there are ( M * A * blockSize + 1) * ( N * B * blockSize + 1 ) * (K * C * blockSize + 1) vertices
+ // x is the first dimension that varies
+
+ int NX = ( M * A * blockSize + 1);
+ int NY = ( N * B * blockSize + 1);
+ int NZ = ( K * C * blockSize + 1);
+ int blockSize1 = blockSize + 1;// used for vertices
+ int bsq = blockSize * blockSize;
+ int b1sq = blockSize1 * blockSize1;
+ // generate the block at (a, b, c); it will represent a partition , it will get a partition tag
+
+ Tag global_id_tag;
+ mb->tag_get_handle("GLOBAL_ID", 1, MB_TYPE_INTEGER,
+ global_id_tag);
+
+ Tag part_tag;
+ int dum_id=-1;
+ mb->tag_get_handle("PARALLEL_PARTITION", 1, MB_TYPE_INTEGER,
+ part_tag, MB_TAG_CREAT|MB_TAG_SPARSE, &dum_id);
+
+ for (int a=0; a<A; a++)
+ {
+ for (int b=0; b<B; b++)
+ {
+ for (int c=0; c<C; c++)
+ {
+ // we will generate (block+1)^3 vertices, and block^3 hexas
+ // the global id of the vertices will come from m, n, k, a, b, c
+ // x will vary from m*A*block + a*block to m*A*block+(a+1)*block etc;
+ int num_nodes = (blockSize+1)*(blockSize+1)*(blockSize+1);
+
+ vector<double*> arrays;
+ EntityHandle startv;
+ rval = iface->get_node_coords(3, num_nodes, 0, startv, arrays);
+ CHECKE("Can't get node coords.");
+
+ int x = m*A*blockSize + a*blockSize;
+ int y = n*B*blockSize + b*blockSize;
+ int z = k*C*blockSize + c*blockSize;
+ int ix=0;
+ vector<int> gids(num_nodes);
+ Range verts(startv, startv+num_nodes-1);
+ for (int kk=0; kk<blockSize+1; kk++)
+ {
+ for (int jj=0; jj<blockSize+1; jj++)
+ {
+ for (int ii=0; ii<blockSize+1; ii++)
+ {
+ arrays[0][ix] = (double)x+ii;
+ arrays[1][ix] = (double)y+jj;
+ arrays[2][ix] = (double)z+kk;
+ gids[ix] = 1 + (z+kk) * (NX*NY) + (y+jj) * NX + (x+ii);
+ ix++;
+ }
+ }
+ }
+ mb->tag_set_data(global_id_tag, verts, &gids[0]);
+ int num_hexas = (blockSize)*(blockSize)*(blockSize);
+ EntityHandle starte; // connectivity
+ EntityHandle * conn;
+ rval = iface->get_element_connect(num_hexas, 8, MBHEX, 0, starte, conn);
+ CHECKE("Can't get hexa connectivity.");
+
+ Range hexas(starte, starte+num_hexas-1);
+ // fill hexas
+ ix=0;
+ for (int kk=0; kk<blockSize; kk++)
+ {
+ for (int jj=0; jj<blockSize; jj++)
+ {
+ for (int ii=0; ii<blockSize; ii++)
+ {
+ EntityHandle corner=startv + ii + (jj*blockSize1) + kk * b1sq;
+ conn[ix]=corner;
+ conn[ix+1]=corner+1;
+ conn[ix+2]=corner+ 1 + blockSize1;
+ conn[ix+3]=corner+ blockSize1;
+ conn[ix+4]=corner + b1sq;
+ conn[ix+5]=corner+1 + b1sq;
+ conn[ix+6]=corner+ 1 + blockSize1 + b1sq;
+ conn[ix+7]=corner+ blockSize1 + b1sq;
+ ix+=8;
+ }
+ }
+ }
+ EntityHandle part_set;
+ rval = mb->create_meshset(MESHSET_SET, part_set);
+ CHECKE("Can't create mesh set.");
+ rval = mb->add_entities(part_set, hexas);
+ CHECKE("Can't add entities to set.");
+ int part_num= a + m*A + (b + n*B)*(M*A) + (c+k*C)*(M*A * N*B);
+ rval = mb->tag_set_data(part_tag, &part_set, 1, &part_num);
+ CHECKE("Can't set part tag on set");
+
+
+
+ }
+ }
+ }
+ // after the mesh is generated on each proc, merge the vertices
+ MergeMesh mm(mb);
+ Range allhexas;
+ rval = mb->get_entities_by_type(0, MBHEX, allhexas);
+
+ CHECKE("Can't get all hexa elements.");
+
+ rval = mm.merge_entities( allhexas, 0.0001);
+ CHECKE("Can't merge");
+ ParallelComm* pcomm = ParallelComm::get_pcomm(mb, 0);
+ if (pcomm==NULL)
+ {
+ pcomm = new ParallelComm( mb, MPI_COMM_WORLD );
+ }
+ rval = pcomm->resolve_shared_ents( 0, allhexas, 3, 0 );
+ CHECKE("Can't resolve shared ents");
+
+ // delete all quads and edges
+ Range toDelete;
+ rval = mb->get_entities_by_dimension(0, 1, toDelete);
+ CHECKE("Can't get edges");
+ rval = mb->delete_entities(toDelete);
+ CHECKE("Can't delete edges");
+
+ toDelete.clear();
+
+ rval = mb->get_entities_by_dimension(0, 2, toDelete);
+ CHECKE("Can't get faces");
+ rval = mb->delete_entities(toDelete);
+ CHECKE("Can't delete faces");
+
+ rval = pcomm->correct_shared_entities() ;
+ CHECKE("Can't correct local shared")
+
+ rval = mb->write_file("test1.h5m", 0, ";;PARALLEL=WRITE_PART");
+ CHECKE("Can't write in parallel");
MPI_Finalize();
return 0;
https://bitbucket.org/fathomteam/moab/commits/f916f2f0c3fd/
Changeset: f916f2f0c3fd
Branch: None
User: iulian07
Date: 2014-07-14 21:19:57
Summary: changes to the large structured mesh example
fun project
see how big of a model we can write in moab
use a different merging strategy, in which the global id tag is
used for determining what should be merged. (instead of a
adaptive KD tree)
It took 21 minutes on a task to merge a mesh with 500k vertices
This is ridiculous; the new method takes 3 minutes
I think that there is still room for improvement.
In the new method, we get the tag on each vertex and then order
The vertices that get the same tag will be merged (duh..)
It is away to generate a big model on a small machine
This new merging method might need a new branch/pull request
Maybe this will be accepted as is :) I will not hold my breath.
Still, right now it took 21 minutes to merge locally an 80x80x80
mesh
this is way too much. With the new method (-w option) it is taking less,
Still need to quantify
Affected #: 3 files
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 1e0fa73..52cca34 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -42,6 +42,7 @@
#include "moab/CN.hpp"
#include "moab/ReadUtilIface.hpp"
#include "moab/MergeMesh.hpp"
+#include <time.h>
#include <iostream>
#include <vector>
@@ -52,9 +53,11 @@ using namespace std;
#define CHECKE(message) if(rval != MB_SUCCESS) { cout << (message) << "\n"; MPI_Finalize(); return 1; }
int main(int argc, char **argv)
{
- int A=2, B=2, C=2, M=2, N=1, K=1;
+ int A=2, B=2, C=2, M=1, N=1, K=1;
int blockSize = 4;
+ bool newMergeMethod=false;
+
MPI_Init(&argc, &argv);
ProgOptions opts;
@@ -75,6 +78,8 @@ int main(int argc, char **argv)
opts.addOpt<int>(std::string("zblocks,C"),
std::string("Number of blocks on a task in x dir (default=2)"), &C);
+ opts.addOpt<void>("newMerge,w", "use new merging method",
+ &newMergeMethod);
opts.parseCommandLine(argc, argv);
@@ -121,11 +126,13 @@ int main(int argc, char **argv)
// there are ( M * A * blockSize + 1) * ( N * B * blockSize + 1 ) * (K * C * blockSize + 1) vertices
// x is the first dimension that varies
+ clock_t tt = clock();
+
int NX = ( M * A * blockSize + 1);
int NY = ( N * B * blockSize + 1);
- int NZ = ( K * C * blockSize + 1);
+ // int NZ = ( K * C * blockSize + 1); not used
int blockSize1 = blockSize + 1;// used for vertices
- int bsq = blockSize * blockSize;
+ // int bsq = blockSize * blockSize;
int b1sq = blockSize1 * blockSize1;
// generate the block at (a, b, c); it will represent a partition , it will get a partition tag
@@ -217,6 +224,14 @@ int main(int argc, char **argv)
}
}
}
+
+ if (0==rank)
+ {
+ std::cout << "generate local mesh: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
+
// after the mesh is generated on each proc, merge the vertices
MergeMesh mm(mb);
Range allhexas;
@@ -224,8 +239,23 @@ int main(int argc, char **argv)
CHECKE("Can't get all hexa elements.");
- rval = mm.merge_entities( allhexas, 0.0001);
+ Range verts;
+ rval = mb->get_entities_by_dimension(0, 0, verts);
+
+ CHECKE("Can't get all vertices.");
+
+ if (newMergeMethod)
+ rval = mm.merge_using_integer_tag( verts, global_id_tag);
+ else
+ rval = mm.merge_entities(allhexas, 0.0001);
CHECKE("Can't merge");
+ if (0==rank)
+ {
+ std::cout << "merge locally: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
+
ParallelComm* pcomm = ParallelComm::get_pcomm(mb, 0);
if (pcomm==NULL)
{
@@ -234,6 +264,13 @@ int main(int argc, char **argv)
rval = pcomm->resolve_shared_ents( 0, allhexas, 3, 0 );
CHECKE("Can't resolve shared ents");
+ if (0==rank)
+ {
+ std::cout << "resolve shared entities: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
+
// delete all quads and edges
Range toDelete;
rval = mb->get_entities_by_dimension(0, 1, toDelete);
@@ -251,9 +288,23 @@ int main(int argc, char **argv)
rval = pcomm->correct_shared_entities() ;
CHECKE("Can't correct local shared")
+ if (0==rank)
+ {
+ std::cout << "delete edges and faces, and correct sharedEnts: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
+
rval = mb->write_file("test1.h5m", 0, ";;PARALLEL=WRITE_PART");
CHECKE("Can't write in parallel");
+ if (0==rank)
+ {
+ std::cout << "write file test1.h5m in parallel "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
+
MPI_Finalize();
return 0;
}
diff --git a/src/MergeMesh.cpp b/src/MergeMesh.cpp
index cb43b85..62b0022 100644
--- a/src/MergeMesh.cpp
+++ b/src/MergeMesh.cpp
@@ -139,7 +139,79 @@ ErrorCode MergeMesh::perform_merge(Tag merge_tag)
result = mbImpl->delete_entities(deadEnts);
return result;
}
+// merge vertices according to an input tag
+// merge them if the tags are equal
+struct handle_id
+{
+ EntityHandle eh;
+ int val;
+};
+
+// handle structure comparison function for qsort
+// if the id is the same , compare the handle.
+bool compare_handle_id(handle_id ia, handle_id ib) {
+
+ if(ia.val == ib.val) {
+ return ia.eh<ia.eh;
+ } else {
+ return ia.val<ib.val;
+ }
+}
+
+ErrorCode MergeMesh::merge_using_integer_tag(Range & verts, Tag user_tag, Tag merge_tag)
+{
+ ErrorCode rval;
+ DataType tag_type;
+ rval = mbImpl->tag_get_data_type(user_tag, tag_type);
+ if (rval!=MB_SUCCESS || tag_type!=MB_TYPE_INTEGER)
+ return MB_FAILURE;
+ std::vector<int> vals(verts.size());
+ rval = mbImpl->tag_get_data(user_tag, verts, &vals[0]);
+ if (rval!=MB_SUCCESS)
+ return rval;
+
+ if (0 == merge_tag)
+ {
+ EntityHandle def_val = 0;
+ rval = mbImpl->tag_get_handle("__merge_tag", 1, MB_TYPE_HANDLE, mbMergeTag,
+ MB_TAG_DENSE | MB_TAG_EXCL, &def_val);
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
+ else
+ mbMergeTag = merge_tag;
+
+ std::vector<handle_id> handles(verts.size());
+ int i=0;
+ for (Range::iterator vit = verts.begin(); vit!= verts.end(); vit++ )
+ {
+ handles[i].eh=*vit;
+ handles[i].val = vals[i];
+ i++;
+ }
+ std::sort(handles.begin(), handles.end(), compare_handle_id);
+
+ i=0;
+ while (i<(int)verts.size()-1)
+ {
+ handle_id first = handles[i];
+ int j=i+1;
+ while (handles[j].val == first.val && j<(int)verts.size())
+ {
+ rval= mbImpl->tag_set_data(mbMergeTag, &(handles[j].eh), 1, &(first.eh));
+ if (rval!=MB_SUCCESS)
+ return rval;
+ deadEnts.insert(handles[j].eh);
+ j++;
+ }
+ i=j;
+ }
+
+ rval = perform_merge(mbMergeTag);
+
+ return rval;
+}
ErrorCode MergeMesh::find_merged_to(EntityHandle &tree_root,
AdaptiveKDTree &tree, Tag merge_tag)
{
diff --git a/src/moab/MergeMesh.hpp b/src/moab/MergeMesh.hpp
index 8eef9a8..8f4d5bc 100644
--- a/src/moab/MergeMesh.hpp
+++ b/src/moab/MergeMesh.hpp
@@ -32,6 +32,9 @@ public:
//Identify higher dimension to be merged
ErrorCode merge_higher_dimensions(Range &elems);
+ // merge vertices according to an input tag
+ ErrorCode merge_using_integer_tag(Range & verts, Tag user_tag, Tag merge_tag=0);
+
//- perform the actual merge
ErrorCode perform_merge(Tag merged_to);
private:
@@ -39,8 +42,6 @@ private:
double mergeTol, mergeTolSq;
- Tag mergeTag;
-
//- given a kdtree, set tag on vertices in leaf nodes with vertices
//- to which they should be merged
ErrorCode find_merged_to(EntityHandle &tree_root,
https://bitbucket.org/fathomteam/moab/commits/e162e9ae5eee/
Changeset: e162e9ae5eee
Branch: None
User: iulian07
Date: 2014-07-14 21:19:57
Summary: add quadratic option
with -q option, the hexas generated will be quadratic hex 27 elements
it will allow for more vertices compared to elements (~ 8 times more vertices)
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 52cca34..7de1a8b 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -57,6 +57,7 @@ int main(int argc, char **argv)
int blockSize = 4;
bool newMergeMethod=false;
+ bool quadratic=false;
MPI_Init(&argc, &argv);
@@ -81,6 +82,9 @@ int main(int argc, char **argv)
opts.addOpt<void>("newMerge,w", "use new merging method",
&newMergeMethod);
+ opts.addOpt<void>("quadratic,q", "use hex 27 elements",
+ &quadratic);
+
opts.parseCommandLine(argc, argv);
Interface* mb = new Core;
@@ -128,10 +132,16 @@ int main(int argc, char **argv)
clock_t tt = clock();
- int NX = ( M * A * blockSize + 1);
- int NY = ( N * B * blockSize + 1);
+ int q = 1;
+ if (quadratic)
+ {
+ q = 2;
+ }
+ int NX = (q * M * A * blockSize + 1);
+ int NY = (q * N * B * blockSize + 1);
// int NZ = ( K * C * blockSize + 1); not used
- int blockSize1 = blockSize + 1;// used for vertices
+ int blockSize1 = q*blockSize + 1;// used for vertices
+
// int bsq = blockSize * blockSize;
int b1sq = blockSize1 * blockSize1;
// generate the block at (a, b, c); it will represent a partition , it will get a partition tag
@@ -151,27 +161,28 @@ int main(int argc, char **argv)
{
for (int c=0; c<C; c++)
{
- // we will generate (block+1)^3 vertices, and block^3 hexas
+ // we will generate (q*block+1)^3 vertices, and block^3 hexas; q is 1 for linear, 2 for quadratic
// the global id of the vertices will come from m, n, k, a, b, c
- // x will vary from m*A*block + a*block to m*A*block+(a+1)*block etc;
- int num_nodes = (blockSize+1)*(blockSize+1)*(blockSize+1);
+ // x will vary from m*A*q*block + a*q*block to m*A*q*block+(a+1)*q*block etc;
+ int num_nodes = blockSize1*blockSize1*blockSize1;
vector<double*> arrays;
EntityHandle startv;
rval = iface->get_node_coords(3, num_nodes, 0, startv, arrays);
CHECKE("Can't get node coords.");
- int x = m*A*blockSize + a*blockSize;
- int y = n*B*blockSize + b*blockSize;
- int z = k*C*blockSize + c*blockSize;
+ // will start with the lower corner:
+ int x = m*A*q*blockSize + a*q*blockSize;
+ int y = n*B*q*blockSize + b*q*blockSize;
+ int z = k*C*q*blockSize + c*q*blockSize;
int ix=0;
vector<int> gids(num_nodes);
Range verts(startv, startv+num_nodes-1);
- for (int kk=0; kk<blockSize+1; kk++)
+ for (int kk=0; kk<blockSize1; kk++)
{
- for (int jj=0; jj<blockSize+1; jj++)
+ for (int jj=0; jj<blockSize1; jj++)
{
- for (int ii=0; ii<blockSize+1; ii++)
+ for (int ii=0; ii<blockSize1; ii++)
{
arrays[0][ix] = (double)x+ii;
arrays[1][ix] = (double)y+jj;
@@ -185,7 +196,12 @@ int main(int argc, char **argv)
int num_hexas = (blockSize)*(blockSize)*(blockSize);
EntityHandle starte; // connectivity
EntityHandle * conn;
- rval = iface->get_element_connect(num_hexas, 8, MBHEX, 0, starte, conn);
+ if (quadratic)
+ {
+ rval = iface->get_element_connect(num_hexas, 27, MBHEX, 0, starte, conn);
+ }
+ else
+ rval = iface->get_element_connect(num_hexas, 8, MBHEX, 0, starte, conn);
CHECKE("Can't get hexa connectivity.");
Range hexas(starte, starte+num_hexas-1);
@@ -197,16 +213,50 @@ int main(int argc, char **argv)
{
for (int ii=0; ii<blockSize; ii++)
{
- EntityHandle corner=startv + ii + (jj*blockSize1) + kk * b1sq;
- conn[ix]=corner;
- conn[ix+1]=corner+1;
- conn[ix+2]=corner+ 1 + blockSize1;
- conn[ix+3]=corner+ blockSize1;
- conn[ix+4]=corner + b1sq;
- conn[ix+5]=corner+1 + b1sq;
- conn[ix+6]=corner+ 1 + blockSize1 + b1sq;
- conn[ix+7]=corner+ blockSize1 + b1sq;
- ix+=8;
+ EntityHandle corner=startv + q*ii + (q*jj*blockSize1) + q*kk * b1sq;
+ if (quadratic)
+ {
+ conn[ix]=corner;
+ conn[ix+1]=corner+2;
+ conn[ix+2]=corner+2 + 2 * blockSize1;
+ conn[ix+3]=corner+ 2 * blockSize1;
+ conn[ix+4]=corner + 2 * b1sq;
+ conn[ix+5]=corner+ 2 + 2 * b1sq;
+ conn[ix+6]=corner+ 2 + 2 * blockSize1 + 2 * b1sq;
+ conn[ix+7]=corner+ 2*blockSize1 + 2*b1sq;
+ conn[ix+8]=corner + 1 ; // 0-1
+ conn[ix+9]= corner+ 2 + blockSize1; //1-2
+ conn[ix+10]= corner + 1 + 2 * blockSize1;// 2-3
+ conn[ix+11] =corner + blockSize1; // 3-0
+ conn[ix+12]= corner + b1sq; // 0-4
+ conn[ix+13]= corner+2 + b1sq; // 1-5
+ conn[ix+14]= corner + 2+ 2*blockSize1 + b1sq; // 2-6
+ conn[ix+15] = corner + 2* blockSize1 + b1sq; // 3-7
+ conn[ix+16] = corner + 1 + 2*b1sq; // 4-5
+ conn[ix+17] = corner + 2 + blockSize1 + 2* b1sq; //5-6
+ conn[ix+18] = corner + 1 + 2*blockSize1 + 2* b1sq; // 6-7
+ conn[ix+19] = corner + blockSize1 + 2* b1sq; // 4-7
+ conn[ix+20] = corner + 1 + b1sq; // 0154
+ conn[ix+21] = corner + 2 + blockSize1 + b1sq; // 1265
+ conn[ix+22] = corner + 1 + 2*blockSize1 + b1sq ; // 2376
+ conn[ix+23] = corner + blockSize1 + b1sq; // 0374
+ conn[ix+24] = corner + 1 + blockSize1 ; // 0123
+ conn[ix+25] = corner + 1 + blockSize1 + 2*b1sq; // 4567
+ conn[ix+26] = corner + 1 + blockSize1 + b1sq; // center
+ ix+=27;
+ }
+ else
+ {
+ conn[ix]=corner;
+ conn[ix+1]=corner+1;
+ conn[ix+2]=corner+ 1 + blockSize1;
+ conn[ix+3]=corner+ blockSize1;
+ conn[ix+4]=corner + b1sq;
+ conn[ix+5]=corner+1 + b1sq;
+ conn[ix+6]=corner+ 1 + blockSize1 + b1sq;
+ conn[ix+7]=corner+ blockSize1 + b1sq;
+ ix+=8;
+ }
}
}
}
@@ -232,6 +282,9 @@ int main(int argc, char **argv)
tt = clock();
}
+ // before merge locally
+ rval = mb->write_file("test0.h5m", 0, ";;PARALLEL=WRITE_PART");
+ CHECKE("Can't write in parallel, before merging");
// after the mesh is generated on each proc, merge the vertices
MergeMesh mm(mb);
Range allhexas;
https://bitbucket.org/fathomteam/moab/commits/461454043992/
Changeset: 461454043992
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: add global id tag on elements too
also, add ystride and zstride variables, for clarity, and
a drawing with hex27 connectivity
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 7de1a8b..16cd9a0 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -11,11 +11,11 @@
* The number of tasks will be MxNxK, and it must match the mpi size
* Each task will generate its mesh at location (m,n,k)
*
- * By default M=2, N=1, K=1, so by default it should be launched on 2 procs
+ * By default M=1, N=1, K=1, so by default it should be launched on 1 proc
* By default, blockSize is 4, and A=2, B=2, C=2, so each task will generate locally
* blockSize^3 x A x B x C hexahedrons (value = 64x8 = 512 hexas, in 8 partitions)
*
- * The total number f partitions will be A*B*C*M*N*K (default 16)
+ * The total number of partitions will be A*B*C*M*N*K (default 8)
*
* Each part in partition will get a proper tag
*
@@ -33,7 +33,14 @@
* entity handle within a partition
*
*
- * mpiexec -np 2 GenLargeMesh
+ * to run: ./GenLargeMesh
+ *
+ * when launched on more procs, you have to make sure
+ * num procs = M*N*K
+ *
+ * so you can launch with
+ * mpiexec -np 8 ./GenLargeMesh -M 2 -N 2 -K 2
+ *
*/
#include "moab/Core.hpp"
@@ -139,11 +146,15 @@ int main(int argc, char **argv)
}
int NX = (q * M * A * blockSize + 1);
int NY = (q * N * B * blockSize + 1);
+ int nex = M * A * blockSize; // number of elements in x direction, used for global id on element
+ int ney = N * B * blockSize; // number of elements in y direction ....
// int NZ = ( K * C * blockSize + 1); not used
int blockSize1 = q*blockSize + 1;// used for vertices
- // int bsq = blockSize * blockSize;
- int b1sq = blockSize1 * blockSize1;
+ //int xstride = 1;
+ int ystride = blockSize1;
+
+ int zstride = blockSize1 * blockSize1;
// generate the block at (a, b, c); it will represent a partition , it will get a partition tag
Tag global_id_tag;
@@ -187,7 +198,7 @@ int main(int argc, char **argv)
arrays[0][ix] = (double)x+ii;
arrays[1][ix] = (double)y+jj;
arrays[2][ix] = (double)z+kk;
- gids[ix] = 1 + (z+kk) * (NX*NY) + (y+jj) * NX + (x+ii);
+ gids[ix] = 1 + (x+ii) + (y+jj) * NX + (z+kk) * (NX*NY) ;
ix++;
}
}
@@ -207,54 +218,79 @@ int main(int argc, char **argv)
Range hexas(starte, starte+num_hexas-1);
// fill hexas
ix=0;
+ // identify the elements at the lower corner, for their global ids
+ int xe = m*A*blockSize + a*blockSize;
+ int ye = n*B*blockSize + b*blockSize;
+ int ze = k*C*blockSize + c*blockSize;
+ gids.resize(num_hexas);
+ int ie=0; // index now in the elements, for global ids
for (int kk=0; kk<blockSize; kk++)
{
for (int jj=0; jj<blockSize; jj++)
{
for (int ii=0; ii<blockSize; ii++)
{
- EntityHandle corner=startv + q*ii + (q*jj*blockSize1) + q*kk * b1sq;
+ EntityHandle corner=startv + q * ii + q * jj * ystride + q * kk * zstride;
+ gids[ie] = 1 + (xe+ii) + (ye+jj) * nex + (ze+kk) * (nex*ney) ;
+ ie++;
if (quadratic)
{
- conn[ix]=corner;
- conn[ix+1]=corner+2;
- conn[ix+2]=corner+2 + 2 * blockSize1;
- conn[ix+3]=corner+ 2 * blockSize1;
- conn[ix+4]=corner + 2 * b1sq;
- conn[ix+5]=corner+ 2 + 2 * b1sq;
- conn[ix+6]=corner+ 2 + 2 * blockSize1 + 2 * b1sq;
- conn[ix+7]=corner+ 2*blockSize1 + 2*b1sq;
- conn[ix+8]=corner + 1 ; // 0-1
- conn[ix+9]= corner+ 2 + blockSize1; //1-2
- conn[ix+10]= corner + 1 + 2 * blockSize1;// 2-3
- conn[ix+11] =corner + blockSize1; // 3-0
- conn[ix+12]= corner + b1sq; // 0-4
- conn[ix+13]= corner+2 + b1sq; // 1-5
- conn[ix+14]= corner + 2+ 2*blockSize1 + b1sq; // 2-6
- conn[ix+15] = corner + 2* blockSize1 + b1sq; // 3-7
- conn[ix+16] = corner + 1 + 2*b1sq; // 4-5
- conn[ix+17] = corner + 2 + blockSize1 + 2* b1sq; //5-6
- conn[ix+18] = corner + 1 + 2*blockSize1 + 2* b1sq; // 6-7
- conn[ix+19] = corner + blockSize1 + 2* b1sq; // 4-7
- conn[ix+20] = corner + 1 + b1sq; // 0154
- conn[ix+21] = corner + 2 + blockSize1 + b1sq; // 1265
- conn[ix+22] = corner + 1 + 2*blockSize1 + b1sq ; // 2376
- conn[ix+23] = corner + blockSize1 + b1sq; // 0374
- conn[ix+24] = corner + 1 + blockSize1 ; // 0123
- conn[ix+25] = corner + 1 + blockSize1 + 2*b1sq; // 4567
- conn[ix+26] = corner + 1 + blockSize1 + b1sq; // center
+
+ // 4 ----- 19 ----- 7
+ // . | . |
+ // 16 25 18 |
+ // . | . |
+ // 5 ----- 17 ----- 6 |
+ // | 12 | 23 15
+ // | | |
+ // | 20 | 26 | 22 |
+ // | | |
+ // 13 21 | 14 |
+ // | 0 ----- 11 ----- 3
+ // | . | .
+ // | 8 24 | 10
+ // | . | .
+ // 1 ----- 9 ----- 2
+ //
+ conn[ix]= corner;
+ conn[ix+1]= corner + 2;
+ conn[ix+2]= corner + 2 + 2 * ystride;
+ conn[ix+3]= corner + 2 * ystride;
+ conn[ix+4]= corner + 2 * zstride;
+ conn[ix+5]= corner + 2 + 2 * zstride;
+ conn[ix+6]= corner + 2 + 2 * ystride + 2 * zstride;
+ conn[ix+7]= corner + 2 * ystride + 2 * zstride;
+ conn[ix+8]= corner + 1 ; // 0-1
+ conn[ix+9]= corner + 2 + ystride ; // 1-2
+ conn[ix+10]= corner + 1 + 2 * ystride ; // 2-3
+ conn[ix+11]= corner + ystride; // 3-0
+ conn[ix+12]= corner + zstride; // 0-4
+ conn[ix+13]= corner + 2 + zstride; // 1-5
+ conn[ix+14]= corner + 2 + 2 * ystride + zstride; // 2-6
+ conn[ix+15]= corner + 2 * ystride + zstride; // 3-7
+ conn[ix+16]= corner + 1 + 2 * zstride; // 4-5
+ conn[ix+17]= corner + 2 + ystride + 2 * zstride; //5-6
+ conn[ix+18]= corner + 1 + 2 * ystride + 2 * zstride; // 6-7
+ conn[ix+19]= corner + ystride + 2 * zstride; // 4-7
+ conn[ix+20]= corner + 1 + zstride; // 0154
+ conn[ix+21]= corner + 2 + ystride + zstride; // 1265
+ conn[ix+22]= corner + 1 + 2 * ystride + zstride; // 2376
+ conn[ix+23]= corner + ystride + zstride; // 0374
+ conn[ix+24]= corner + 1 + ystride ; // 0123
+ conn[ix+25]= corner + 1 + ystride + 2 * zstride; // 4567
+ conn[ix+26]= corner + 1 + ystride + zstride; // center
ix+=27;
}
else
{
- conn[ix]=corner;
- conn[ix+1]=corner+1;
- conn[ix+2]=corner+ 1 + blockSize1;
- conn[ix+3]=corner+ blockSize1;
- conn[ix+4]=corner + b1sq;
- conn[ix+5]=corner+1 + b1sq;
- conn[ix+6]=corner+ 1 + blockSize1 + b1sq;
- conn[ix+7]=corner+ blockSize1 + b1sq;
+ conn[ix]= corner;
+ conn[ix+1]=corner + 1;
+ conn[ix+2]=corner + 1 + ystride;
+ conn[ix+3]=corner + ystride;
+ conn[ix+4]=corner + zstride;
+ conn[ix+5]=corner + 1 + zstride;
+ conn[ix+6]=corner + 1 + ystride + zstride;
+ conn[ix+7]=corner + ystride + zstride;
ix+=8;
}
}
@@ -265,6 +301,8 @@ int main(int argc, char **argv)
CHECKE("Can't create mesh set.");
rval = mb->add_entities(part_set, hexas);
CHECKE("Can't add entities to set.");
+ rval = mb->tag_set_data(global_id_tag, hexas, &gids[0]);
+ CHECKE("Can't set global ids to elements.");
int part_num= a + m*A + (b + n*B)*(M*A) + (c+k*C)*(M*A * N*B);
rval = mb->tag_set_data(part_tag, &part_set, 1, &part_num);
CHECKE("Can't set part tag on set");
https://bitbucket.org/fathomteam/moab/commits/649779ff57a1/
Changeset: 649779ff57a1
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: add tags to the large mesh example
use -i option for integer tags name on vertices,
and -d for double tags on cells
we can have multiple integer and double tags, with something like
GenLargeMesh -i tag1 -i tag2 -d tag3 -d tag4
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 16cd9a0..08dad08 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -92,8 +92,19 @@ int main(int argc, char **argv)
opts.addOpt<void>("quadratic,q", "use hex 27 elements",
&quadratic);
+ vector<string> intTagNames;
+ string firstIntTag;
+ opts.addOpt<string>(std::string("int_tag_vert,i"), string("add integer tag on vertices"), &firstIntTag);
+
+ vector<string> doubleTagNames;
+ string firstDoubleTag;
+ opts.addOpt<string>(std::string("double_tag_cell,d"), string("add double tag on cells"), &firstDoubleTag);
+
opts.parseCommandLine(argc, argv);
+ opts.getOptAllArgs("int_tag_vert,i", intTagNames);
+ opts.getOptAllArgs("double_tag_cell,d", doubleTagNames);
+
Interface* mb = new Core;
if (NULL == mb)
{
@@ -166,6 +177,22 @@ int main(int argc, char **argv)
mb->tag_get_handle("PARALLEL_PARTITION", 1, MB_TYPE_INTEGER,
part_tag, MB_TAG_CREAT|MB_TAG_SPARSE, &dum_id);
+ // create tags on vertices and cells, look in the list of options
+ vector<Tag> intTags(intTagNames.size());
+ vector<Tag> doubleTags(doubleTagNames.size());
+ for (size_t i=0; i<intTagNames.size(); i++)
+ {
+ rval = mb->tag_get_handle(intTagNames[i].c_str(), 1, MB_TYPE_INTEGER, intTags[i],
+ MB_TAG_CREAT|MB_TAG_DENSE, &dum_id);
+ CHECKE("Can't create integer tag.");
+ }
+ double defval=0.;
+ for (size_t i=0; i<doubleTagNames.size(); i++)
+ {
+ rval = mb->tag_get_handle(doubleTagNames[i].c_str(), 1, MB_TYPE_DOUBLE, doubleTags[i],
+ MB_TAG_CREAT|MB_TAG_DENSE, &defval);
+ CHECKE("Can't create double tag.");
+ }
for (int a=0; a<A; a++)
{
for (int b=0; b<B; b++)
@@ -199,6 +226,13 @@ int main(int argc, char **argv)
arrays[1][ix] = (double)y+jj;
arrays[2][ix] = (double)z+kk;
gids[ix] = 1 + (x+ii) + (y+jj) * NX + (z+kk) * (NX*NY) ;
+ // set int tags, some nice values?
+ EntityHandle v = startv + ix;
+ for (size_t i=0; i<intTags.size(); i++)
+ {
+ int valv=gids[ix]/2+3 + i*1000;
+ mb->tag_set_data(intTags[i], &v, 1, &valv);
+ }
ix++;
}
}
@@ -232,7 +266,15 @@ int main(int argc, char **argv)
{
EntityHandle corner=startv + q * ii + q * jj * ystride + q * kk * zstride;
gids[ie] = 1 + (xe+ii) + (ye+jj) * nex + (ze+kk) * (nex*ney) ;
+
+ EntityHandle eh = starte + ie;
ie++;
+ for (size_t i=0; i<doubleTags.size(); i++)
+ {
+ double valv=gids[ie]/30. + i*5000.;
+ mb->tag_set_data(doubleTags[i], &eh, 1, &valv);
+ }
+
if (quadratic)
{
@@ -320,9 +362,9 @@ int main(int argc, char **argv)
tt = clock();
}
- // before merge locally
+ /*// before merge locally
rval = mb->write_file("test0.h5m", 0, ";;PARALLEL=WRITE_PART");
- CHECKE("Can't write in parallel, before merging");
+ CHECKE("Can't write in parallel, before merging");*/
// after the mesh is generated on each proc, merge the vertices
MergeMesh mm(mb);
Range allhexas;
https://bitbucket.org/fathomteam/moab/commits/1e6784293d7f/
Changeset: 1e6784293d7f
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: introduce ParallelComm::delete_entities(Range &)
when a user deletes an entity, in a parallel environment,
it needs to make sure it is deleted from all tasks that might
share it
Also, update the sharedEnts local vector on each
Affected #: 3 files
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 08dad08..8e5e029 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -408,18 +408,12 @@ int main(int argc, char **argv)
Range toDelete;
rval = mb->get_entities_by_dimension(0, 1, toDelete);
CHECKE("Can't get edges");
- rval = mb->delete_entities(toDelete);
- CHECKE("Can't delete edges");
-
- toDelete.clear();
rval = mb->get_entities_by_dimension(0, 2, toDelete);
CHECKE("Can't get faces");
- rval = mb->delete_entities(toDelete);
- CHECKE("Can't delete faces");
- rval = pcomm->correct_shared_entities() ;
- CHECKE("Can't correct local shared")
+ rval = pcomm->delete_entities(toDelete) ;
+ CHECKE("Can't delete entities")
if (0==rank)
{
diff --git a/src/parallel/ParallelComm.cpp b/src/parallel/ParallelComm.cpp
index 4fb8afc..49c1606 100644
--- a/src/parallel/ParallelComm.cpp
+++ b/src/parallel/ParallelComm.cpp
@@ -8792,19 +8792,75 @@ ErrorCode ParallelComm::settle_intersection_points(Range & edges, Range & shared
return MB_SUCCESS;
// end copy
}
-ErrorCode ParallelComm::correct_shared_entities()
+ErrorCode ParallelComm::delete_entities(Range & to_delete)
{
+ // will not look at shared sets yet, but maybe we should
+ // first, see if any of the entities to delete is shared; then inform the other processors
+ // about their fate (to be deleted), using a crystal router transfer
+ ErrorCode rval=MB_SUCCESS;
+ unsigned char pstat;
+ EntityHandle tmp_handles[MAX_SHARING_PROCS];
+ int tmp_procs[MAX_SHARING_PROCS];
+ unsigned int num_ps;
+ TupleList ents_to_delete;
+ ents_to_delete.initialize(1, 0, 1, 0, to_delete.size() * (MAX_SHARING_PROCS+1) );// a little bit of overkill
+ ents_to_delete.enableWriteAccess();
+ unsigned int i = 0;
+ for (Range::iterator it=to_delete.begin(); it!=to_delete.end(); it++)
+ {
+ EntityHandle eh=*it; // entity to be deleted
+
+ rval = get_sharing_data(eh, tmp_procs, tmp_handles,
+ pstat, num_ps);
+ if (rval!=MB_SUCCESS || num_ps==0)
+ continue;
+ // add to the tuple list the information to be sent (to the remote procs)
+
+ for (unsigned int p = 0; p < num_ps; p++)
+ {
+ ents_to_delete.vi_wr[i] = tmp_procs[p];
+ ents_to_delete.vul_wr[i] = (unsigned long)tmp_handles[p];
+ i++;
+ ents_to_delete.inc_n();
+ }
+ }
+
+ gs_data::crystal_data *cd = this->procConfig.crystal_router();
+ // all communication happens here; no other mpi calls
+ // also, this is a collective call
+ rval = cd->gs_transfer(1,ents_to_delete,0);
+
+ if (MB_SUCCESS!= rval)
+ {
+ std::cout << "error in tuple transfer\n";
+ return rval;
+ }
+ // add to the range of ents to delete the new ones that were sent from other procs
+ unsigned int received = ents_to_delete.get_n();
+ for (i=0; i< received; i++)
+ {
+ //int from = ents_to_delete.vi_rd[i];
+ unsigned long valrec = ents_to_delete.vul_rd[i];
+ to_delete.insert((EntityHandle)valrec);
+ }
+ rval = mbImpl->delete_entities(to_delete);
+ if (MB_SUCCESS!= rval)
+ {
+ std::cout << "error in deleting actual entities\n";
+ return rval;
+ }
std::vector<EntityHandle> good_ents;
- for (size_t i=0; i<sharedEnts.size(); i++)
+ for (size_t j=0; j<sharedEnts.size(); j++)
{
- if (mbImpl->is_valid(sharedEnts[i]))
+ if (mbImpl->is_valid(sharedEnts[j]))
{
- good_ents.push_back(sharedEnts[i]);
+ good_ents.push_back(sharedEnts[j]);
}
}
sharedEnts = good_ents;
+ // what about shared sets? who is updating them?
return MB_SUCCESS;
}
diff --git a/src/parallel/moab/ParallelComm.hpp b/src/parallel/moab/ParallelComm.hpp
index 2a16ac2..976236e 100644
--- a/src/parallel/moab/ParallelComm.hpp
+++ b/src/parallel/moab/ParallelComm.hpp
@@ -932,11 +932,11 @@ namespace moab {
ErrorCode settle_intersection_points(Range & edges, Range & shared_edges_owned,
std::vector<std::vector<EntityHandle> *> & extraNodesVec, double tolerance);
- /* \brief check the shared entities if they exist anymore
+ /* \brief delete entities from moab database
* will check the shared ents array, and clean it if necessary
*
*/
- ErrorCode correct_shared_entities();
+ ErrorCode delete_entities(Range & to_delete);
private:
https://bitbucket.org/fathomteam/moab/commits/2484581d45f1/
Changeset: 2484581d45f1
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: add the option to keep the skins
these skins result from resolving shared entities
we may want to keep them
By default, we delete them
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 8e5e029..ce67ac9 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -65,6 +65,7 @@ int main(int argc, char **argv)
bool newMergeMethod=false;
bool quadratic=false;
+ bool keep_skins=false;
MPI_Init(&argc, &argv);
@@ -92,6 +93,9 @@ int main(int argc, char **argv)
opts.addOpt<void>("quadratic,q", "use hex 27 elements",
&quadratic);
+ opts.addOpt<void>("keep_skins,k", "keep skins with shared entities",
+ &keep_skins);
+
vector<string> intTagNames;
string firstIntTag;
opts.addOpt<string>(std::string("int_tag_vert,i"), string("add integer tag on vertices"), &firstIntTag);
@@ -404,22 +408,25 @@ int main(int argc, char **argv)
tt = clock();
}
- // delete all quads and edges
- Range toDelete;
- rval = mb->get_entities_by_dimension(0, 1, toDelete);
- CHECKE("Can't get edges");
+ if (!keep_skins) // default is to delete the 1- and 2-dimensional entities
+ {
+ // delete all quads and edges
+ Range toDelete;
+ rval = mb->get_entities_by_dimension(0, 1, toDelete);
+ CHECKE("Can't get edges");
- rval = mb->get_entities_by_dimension(0, 2, toDelete);
- CHECKE("Can't get faces");
+ rval = mb->get_entities_by_dimension(0, 2, toDelete);
+ CHECKE("Can't get faces");
- rval = pcomm->delete_entities(toDelete) ;
- CHECKE("Can't delete entities")
+ rval = pcomm->delete_entities(toDelete) ;
+ CHECKE("Can't delete entities")
- if (0==rank)
- {
- std::cout << "delete edges and faces, and correct sharedEnts: "
- << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
- tt = clock();
+ if (0==rank)
+ {
+ std::cout << "delete edges and faces, and correct sharedEnts: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
}
rval = mb->write_file("test1.h5m", 0, ";;PARALLEL=WRITE_PART");
https://bitbucket.org/fathomteam/moab/commits/b11de15ea2b2/
Changeset: b11de15ea2b2
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: add tetra option
also, add option for output file, default was test1.h5m
tetra does not work with quadratic yet, but it will someday
I mean, the tetras are all linear right now.
if -q and -t are used together, quadratic hexas will be generated
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index ce67ac9..5918a09 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -7,6 +7,7 @@
* Each processor will create its version of a block mesh, partitioned
* as AxBxC blocks. Each block will be with blockSize^3 hexahedrons, and will get a
* different PARALLEL_PARTITION tag
+ * When -t option is used, instead of each hex, we are creating 6 tetrahedrons
*
* The number of tasks will be MxNxK, and it must match the mpi size
* Each task will generate its mesh at location (m,n,k)
@@ -14,7 +15,7 @@
* By default M=1, N=1, K=1, so by default it should be launched on 1 proc
* By default, blockSize is 4, and A=2, B=2, C=2, so each task will generate locally
* blockSize^3 x A x B x C hexahedrons (value = 64x8 = 512 hexas, in 8 partitions)
- *
+ * (if -t, multiple by 6 for total number of cells/tets)
* The total number of partitions will be A*B*C*M*N*K (default 8)
*
* Each part in partition will get a proper tag
@@ -41,6 +42,8 @@
* so you can launch with
* mpiexec -np 8 ./GenLargeMesh -M 2 -N 2 -K 2
*
+ * We also added -q option; it works now only for hexa mesh, it will generate
+ * quadratic hex27 elements
*/
#include "moab/Core.hpp"
@@ -66,6 +69,7 @@ int main(int argc, char **argv)
bool newMergeMethod=false;
bool quadratic=false;
bool keep_skins=false;
+ bool tetra = false;
MPI_Init(&argc, &argv);
@@ -96,6 +100,9 @@ int main(int argc, char **argv)
opts.addOpt<void>("keep_skins,k", "keep skins with shared entities",
&keep_skins);
+ opts.addOpt<void>("tetrahedrons,t", "generate tetrahedrons ",
+ &tetra);
+
vector<string> intTagNames;
string firstIntTag;
opts.addOpt<string>(std::string("int_tag_vert,i"), string("add integer tag on vertices"), &firstIntTag);
@@ -104,6 +111,9 @@ int main(int argc, char **argv)
string firstDoubleTag;
opts.addOpt<string>(std::string("double_tag_cell,d"), string("add double tag on cells"), &firstDoubleTag);
+ string outFileName="test1.h5m";
+ opts.addOpt<std::string> ("outFile,o", "Specify the output file name string (default test1.h5m)", &outFileName );
+
opts.parseCommandLine(argc, argv);
opts.getOptAllArgs("int_tag_vert,i", intTagNames);
@@ -159,6 +169,9 @@ int main(int argc, char **argv)
{
q = 2;
}
+ int factor =1;
+ if (tetra)
+ factor =6;
int NX = (q * M * A * blockSize + 1);
int NY = (q * N * B * blockSize + 1);
int nex = M * A * blockSize; // number of elements in x direction, used for global id on element
@@ -243,24 +256,26 @@ int main(int argc, char **argv)
}
mb->tag_set_data(global_id_tag, verts, &gids[0]);
int num_hexas = (blockSize)*(blockSize)*(blockSize);
+ int num_el = num_hexas * factor;
+
EntityHandle starte; // connectivity
EntityHandle * conn;
if (quadratic)
- {
- rval = iface->get_element_connect(num_hexas, 27, MBHEX, 0, starte, conn);
- }
+ rval = iface->get_element_connect(num_el, 27, MBHEX, 0, starte, conn);
+ else if (tetra)
+ rval = iface->get_element_connect(num_el, 4, MBTET, 0, starte, conn);
else
- rval = iface->get_element_connect(num_hexas, 8, MBHEX, 0, starte, conn);
- CHECKE("Can't get hexa connectivity.");
+ rval = iface->get_element_connect(num_el, 8, MBHEX, 0, starte, conn);
+ CHECKE("Can't get element connectivity.");
- Range hexas(starte, starte+num_hexas-1);
+ Range hexas(starte, starte+num_el-1); // should be elements
// fill hexas
ix=0;
// identify the elements at the lower corner, for their global ids
int xe = m*A*blockSize + a*blockSize;
int ye = n*B*blockSize + b*blockSize;
int ze = k*C*blockSize + c*blockSize;
- gids.resize(num_hexas);
+ gids.resize(num_el);
int ie=0; // index now in the elements, for global ids
for (int kk=0; kk<blockSize; kk++)
{
@@ -269,16 +284,15 @@ int main(int argc, char **argv)
for (int ii=0; ii<blockSize; ii++)
{
EntityHandle corner=startv + q * ii + q * jj * ystride + q * kk * zstride;
- gids[ie] = 1 + (xe+ii) + (ye+jj) * nex + (ze+kk) * (nex*ney) ;
+ gids[ie] = 1 + ((xe+ii) + (ye+jj) * nex + (ze+kk) * (nex*ney))*factor ; // 6 more for tetra
EntityHandle eh = starte + ie;
- ie++;
for (size_t i=0; i<doubleTags.size(); i++)
{
double valv=gids[ie]/30. + i*5000.;
mb->tag_set_data(doubleTags[i], &eh, 1, &valv);
}
-
+ ie++;
if (quadratic)
{
@@ -327,7 +341,73 @@ int main(int argc, char **argv)
conn[ix+26]= corner + 1 + ystride + zstride; // center
ix+=27;
}
- else
+ else if (tetra)
+ {
+
+ // E H
+ // F G
+ //
+ // A D
+ // B C
+ EntityHandle AA = corner;
+ EntityHandle BB = corner + 1;
+ EntityHandle CC = corner + 1 + ystride;
+ EntityHandle D = corner + ystride;
+ EntityHandle E = corner + zstride;
+ EntityHandle F = corner + 1 + zstride;
+ EntityHandle G = corner + 1 + ystride + zstride;
+ EntityHandle H = corner + ystride + zstride;
+
+ // tet EDHG
+ conn[ix] = E;
+ conn[ix+1] = D;
+ conn[ix+2] = H;
+ conn[ix+3] = G;
+
+ // tet ABCF
+ conn[ix+4] = AA;
+ conn[ix+5] = BB;
+ conn[ix+6] = CC;
+ conn[ix+7] = F;
+
+ // tet ADEF
+ conn[ix+8] = AA;
+ conn[ix+9] = D;
+ conn[ix+10] = E;
+ conn[ix+11] = F;
+
+ // tet CGDF
+ conn[ix+12] = CC;
+ conn[ix+13] = G;
+ conn[ix+14] = D;
+ conn[ix+15] = F;
+
+ // tet ACDF
+ conn[ix+16] = AA;
+ conn[ix+17] = CC;
+ conn[ix+18] = D;
+ conn[ix+19] = F;
+
+ // tet DGEF
+ conn[ix+20] = D;
+ conn[ix+21] = G;
+ conn[ix+22] = E;
+ conn[ix+23] = F;
+ ix+=24;
+ for (int ff=0; ff<factor-1; ff++)
+ {
+ gids[ie] = gids[ie-1]+1 ; // 6 more for tetra
+
+ eh = starte + ie;
+ for (size_t i=0; i<doubleTags.size(); i++)
+ {
+ double valv=gids[ie]/30. + i*5000.;
+ mb->tag_set_data(doubleTags[i], &eh, 1, &valv);
+ }
+ ie++;
+ }
+ }
+ else // linear hex
{
conn[ix]= corner;
conn[ix+1]=corner + 1;
@@ -371,10 +451,10 @@ int main(int argc, char **argv)
CHECKE("Can't write in parallel, before merging");*/
// after the mesh is generated on each proc, merge the vertices
MergeMesh mm(mb);
- Range allhexas;
- rval = mb->get_entities_by_type(0, MBHEX, allhexas);
+ Range all3dcells;
+ rval = mb->get_entities_by_dimension(0, 3, all3dcells);
- CHECKE("Can't get all hexa elements.");
+ CHECKE("Can't get all 3d cells elements.");
Range verts;
rval = mb->get_entities_by_dimension(0, 0, verts);
@@ -384,7 +464,7 @@ int main(int argc, char **argv)
if (newMergeMethod)
rval = mm.merge_using_integer_tag( verts, global_id_tag);
else
- rval = mm.merge_entities(allhexas, 0.0001);
+ rval = mm.merge_entities(all3dcells, 0.0001);
CHECKE("Can't merge");
if (0==rank)
{
@@ -398,7 +478,7 @@ int main(int argc, char **argv)
{
pcomm = new ParallelComm( mb, MPI_COMM_WORLD );
}
- rval = pcomm->resolve_shared_ents( 0, allhexas, 3, 0 );
+ rval = pcomm->resolve_shared_ents( 0, all3dcells, 3, 0 );
CHECKE("Can't resolve shared ents");
if (0==rank)
@@ -429,12 +509,12 @@ int main(int argc, char **argv)
}
}
- rval = mb->write_file("test1.h5m", 0, ";;PARALLEL=WRITE_PART");
+ rval = mb->write_file(outFileName.c_str(), 0, ";;PARALLEL=WRITE_PART");
CHECKE("Can't write in parallel");
if (0==rank)
{
- std::cout << "write file test1.h5m in parallel "
+ std::cout << "write file " << outFileName << " in "
<< (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
tt = clock();
}
https://bitbucket.org/fathomteam/moab/commits/2ab0e45260af/
Changeset: 2ab0e45260af
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: add option for faces and edges
it will create faces and edges too, and output them to the file
They will not be part of parallel partition
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 5918a09..25cbaa0 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -70,6 +70,7 @@ int main(int argc, char **argv)
bool quadratic=false;
bool keep_skins=false;
bool tetra = false;
+ bool adjEnts = false;
MPI_Init(&argc, &argv);
@@ -103,6 +104,8 @@ int main(int argc, char **argv)
opts.addOpt<void>("tetrahedrons,t", "generate tetrahedrons ",
&tetra);
+ opts.addOpt<void>("faces_edges,f", "create all faces and edges", &adjEnts);
+
vector<string> intTagNames;
string firstIntTag;
opts.addOpt<string>(std::string("int_tag_vert,i"), string("add integer tag on vertices"), &firstIntTag);
@@ -143,6 +146,10 @@ int main(int argc, char **argv)
return 1;
}
+ if (adjEnts)
+ {
+ keep_skins = true; // do not delete anything
+ }
// determine m, n, k for processor rank
int m,n,k;
k = rank/(M*N);
@@ -473,6 +480,15 @@ int main(int argc, char **argv)
tt = clock();
}
+ if (adjEnts)
+ {
+ // generate all adj entities dimension 1 and 2 (edges and faces/ tri or quads)
+ Range edges, faces;
+ rval = mb->get_adjacencies(all3dcells, 1, true, edges, Interface::UNION );
+ CHECKE("Can't get edges");
+ rval = mb->get_adjacencies(all3dcells, 2, true, faces, Interface::UNION );
+ CHECKE("Can't get faces");
+ }
ParallelComm* pcomm = ParallelComm::get_pcomm(mb, 0);
if (pcomm==NULL)
{
https://bitbucket.org/fathomteam/moab/commits/7b1158dc7db4/
Changeset: 7b1158dc7db4
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: the edges and faces should be added to the partition
if created, it would be better to put the edges and faces to their partitions
for this, create them early, in the loop
Need to update adjacencies, otherwise next time in the loop it does not work
(to create edges and faces based on adjacencies)
it is the n-th time I made this mistake :(
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 25cbaa0..4ec1e1b 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -267,16 +267,23 @@ int main(int argc, char **argv)
EntityHandle starte; // connectivity
EntityHandle * conn;
+ int num_v_per_elem = 8;
if (quadratic)
+ {
+ num_v_per_elem = 27;
rval = iface->get_element_connect(num_el, 27, MBHEX, 0, starte, conn);
+ }
else if (tetra)
+ {
+ num_v_per_elem = 4;
rval = iface->get_element_connect(num_el, 4, MBTET, 0, starte, conn);
+ }
else
rval = iface->get_element_connect(num_el, 8, MBHEX, 0, starte, conn);
CHECKE("Can't get element connectivity.");
- Range hexas(starte, starte+num_el-1); // should be elements
- // fill hexas
+ Range cells(starte, starte+num_el-1); // should be elements
+ // fill cells
ix=0;
// identify the elements at the lower corner, for their global ids
int xe = m*A*blockSize + a*blockSize;
@@ -432,9 +439,28 @@ int main(int argc, char **argv)
EntityHandle part_set;
rval = mb->create_meshset(MESHSET_SET, part_set);
CHECKE("Can't create mesh set.");
- rval = mb->add_entities(part_set, hexas);
+ rval = mb->add_entities(part_set, cells);
CHECKE("Can't add entities to set.");
- rval = mb->tag_set_data(global_id_tag, hexas, &gids[0]);
+ // if needed, add all edges and faces
+ if (adjEnts)
+ {
+ // we need to update adjacencies now, because some elements are new
+ rval = iface->update_adjacencies(starte, num_el, num_v_per_elem, conn);
+ CHECKE("Can't update adjacencies");
+ // generate all adj entities dimension 1 and 2 (edges and faces/ tri or qua
+ Range edges, faces;
+ rval = mb->get_adjacencies(cells, 1, true, edges,
+ Interface::UNION);
+ CHECKE("Can't get edges");
+ rval = mb->get_adjacencies(cells, 2, true, faces,
+ Interface::UNION);
+ CHECKE("Can't get faces");
+ rval = mb->add_entities(part_set, edges);
+ CHECKE("Can't add edges to partition set.");
+ rval = mb->add_entities(part_set, faces);
+ CHECKE("Can't add faces to partition set.");
+ }
+ rval = mb->tag_set_data(global_id_tag, cells, &gids[0]);
CHECKE("Can't set global ids to elements.");
int part_num= a + m*A + (b + n*B)*(M*A) + (c+k*C)*(M*A * N*B);
rval = mb->tag_set_data(part_tag, &part_set, 1, &part_num);
@@ -480,15 +506,6 @@ int main(int argc, char **argv)
tt = clock();
}
- if (adjEnts)
- {
- // generate all adj entities dimension 1 and 2 (edges and faces/ tri or quads)
- Range edges, faces;
- rval = mb->get_adjacencies(all3dcells, 1, true, edges, Interface::UNION );
- CHECKE("Can't get edges");
- rval = mb->get_adjacencies(all3dcells, 2, true, faces, Interface::UNION );
- CHECKE("Can't get faces");
- }
ParallelComm* pcomm = ParallelComm::get_pcomm(mb, 0);
if (pcomm==NULL)
{
https://bitbucket.org/fathomteam/moab/commits/0f126314d793/
Changeset: 0f126314d793
Branch: None
User: iulian07
Date: 2014-07-14 21:19:58
Summary: skip merge if not needed and skip PCOMM if on one proc
will be able to create meshes faster, if the partitioning
is not needed
Affected #: 1 file
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 4ec1e1b..4338601 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -493,55 +493,58 @@ int main(int argc, char **argv)
rval = mb->get_entities_by_dimension(0, 0, verts);
CHECKE("Can't get all vertices.");
-
- if (newMergeMethod)
- rval = mm.merge_using_integer_tag( verts, global_id_tag);
- else
- rval = mm.merge_entities(all3dcells, 0.0001);
- CHECKE("Can't merge");
- if (0==rank)
+ if (A*B*C!=1) // merge needed
{
- std::cout << "merge locally: "
- << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
- tt = clock();
+ if (newMergeMethod)
+ rval = mm.merge_using_integer_tag( verts, global_id_tag);
+ else
+ rval = mm.merge_entities(all3dcells, 0.0001);
+ CHECKE("Can't merge");
+ if (0==rank)
+ {
+ std::cout << "merge locally: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
}
-
- ParallelComm* pcomm = ParallelComm::get_pcomm(mb, 0);
- if (pcomm==NULL)
+ if (size>1)
{
- pcomm = new ParallelComm( mb, MPI_COMM_WORLD );
- }
- rval = pcomm->resolve_shared_ents( 0, all3dcells, 3, 0 );
- CHECKE("Can't resolve shared ents");
+ ParallelComm* pcomm = ParallelComm::get_pcomm(mb, 0);
+ if (pcomm==NULL)
+ {
+ pcomm = new ParallelComm( mb, MPI_COMM_WORLD );
+ }
+ rval = pcomm->resolve_shared_ents( 0, all3dcells, 3, 0 );
+ CHECKE("Can't resolve shared ents");
- if (0==rank)
- {
- std::cout << "resolve shared entities: "
- << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
- tt = clock();
- }
+ if (0==rank)
+ {
+ std::cout << "resolve shared entities: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
- if (!keep_skins) // default is to delete the 1- and 2-dimensional entities
- {
- // delete all quads and edges
- Range toDelete;
- rval = mb->get_entities_by_dimension(0, 1, toDelete);
- CHECKE("Can't get edges");
+ if (!keep_skins) // default is to delete the 1- and 2-dimensional entities
+ {
+ // delete all quads and edges
+ Range toDelete;
+ rval = mb->get_entities_by_dimension(0, 1, toDelete);
+ CHECKE("Can't get edges");
- rval = mb->get_entities_by_dimension(0, 2, toDelete);
- CHECKE("Can't get faces");
+ rval = mb->get_entities_by_dimension(0, 2, toDelete);
+ CHECKE("Can't get faces");
- rval = pcomm->delete_entities(toDelete) ;
- CHECKE("Can't delete entities")
+ rval = pcomm->delete_entities(toDelete) ;
+ CHECKE("Can't delete entities")
- if (0==rank)
- {
- std::cout << "delete edges and faces, and correct sharedEnts: "
- << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
- tt = clock();
+ if (0==rank)
+ {
+ std::cout << "delete edges and faces, and correct sharedEnts: "
+ << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+ tt = clock();
+ }
}
}
-
rval = mb->write_file(outFileName.c_str(), 0, ";;PARALLEL=WRITE_PART");
CHECKE("Can't write in parallel");
https://bitbucket.org/fathomteam/moab/commits/fdfef1b01fe7/
Changeset: fdfef1b01fe7
Branch: iulian07/largemesh
User: iulian07
Date: 2014-07-14 22:39:22
Summary: remove the is_valid from interface
cosmetic changes to example (too many braces, better definition for q, factor)
Affected #: 3 files
diff --git a/examples/GenLargeMesh.cpp b/examples/GenLargeMesh.cpp
index 4338601..eb26805 100644
--- a/examples/GenLargeMesh.cpp
+++ b/examples/GenLargeMesh.cpp
@@ -139,17 +139,14 @@ int main(int argc, char **argv)
if (M*N*K != size)
{
if (rank==0)
- {
cout <<"M*N*K=" << M*N*K << " != size = "<< size << "\n";
- }
MPI_Finalize();
return 1;
}
if (adjEnts)
- {
keep_skins = true; // do not delete anything
- }
+
// determine m, n, k for processor rank
int m,n,k;
k = rank/(M*N);
@@ -157,9 +154,7 @@ int main(int argc, char **argv)
n = leftover/M;
m = leftover%M;
if (rank==size-1)
- {
cout << "m, n, k for last rank:" << m << " " << n << " " << k << "\n";
- }
// so there are a total of M * A * blockSize elements in x direction (so M * A * blockSize + 1 verts in x direction)
// so there are a total of N * B * blockSize elements in y direction (so N * B * blockSize + 1 verts in y direction)
@@ -171,14 +166,11 @@ int main(int argc, char **argv)
clock_t tt = clock();
- int q = 1;
- if (quadratic)
- {
- q = 2;
- }
- int factor =1;
- if (tetra)
- factor =6;
+ // used for nodes increments
+ int q = (quadratic)? 2 : 1;
+ // used for element increments
+ int factor = (tetra)? 6 : 1;
+
int NX = (q * M * A * blockSize + 1);
int NY = (q * N * B * blockSize + 1);
int nex = M * A * blockSize; // number of elements in x direction, used for global id on element
diff --git a/src/moab/Interface.hpp b/src/moab/Interface.hpp
index c8102b8..09f4219 100644
--- a/src/moab/Interface.hpp
+++ b/src/moab/Interface.hpp
@@ -1981,8 +1981,6 @@ public:
SetIterator *&set_iter) = 0;
/**@}*/
-
- virtual bool is_valid(EntityHandle entity) const = 0;
};
//! predicate for STL algorithms. Returns true if the entity handle is
diff --git a/src/parallel/ParallelComm.cpp b/src/parallel/ParallelComm.cpp
index 49c1606..f660c0a 100644
--- a/src/parallel/ParallelComm.cpp
+++ b/src/parallel/ParallelComm.cpp
@@ -8853,10 +8853,9 @@ ErrorCode ParallelComm::delete_entities(Range & to_delete)
std::vector<EntityHandle> good_ents;
for (size_t j=0; j<sharedEnts.size(); j++)
{
- if (mbImpl->is_valid(sharedEnts[j]))
- {
+ int index=to_delete.index(sharedEnts[j]);
+ if (-1==index)
good_ents.push_back(sharedEnts[j]);
- }
}
sharedEnts = good_ents;
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: danwu: Updated HelloMOAB example to use new error handling code. We can change the mesh file name (e.g. 3k-tri-sphere.vtk -> 4k-tri-sphere.vtk) to test a trivial "No such file or directory" error. Other examples will be updated similarly later.
by commits-noreply@bitbucket.org 14 Jul '14
by commits-noreply@bitbucket.org 14 Jul '14
14 Jul '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/e1e603b143e3/
Changeset: e1e603b143e3
Branch: danwu/error_handling_enhancement
User: danwu
Date: 2014-07-15 00:07:17
Summary: Updated HelloMOAB example to use new error handling code. We can change the mesh file name (e.g. 3k-tri-sphere.vtk -> 4k-tri-sphere.vtk) to test a trivial "No such file or directory" error. Other examples will be updated similarly later.
Affected #: 1 file
diff --git a/examples/HelloMOAB.cpp b/examples/HelloMOAB.cpp
index 6ca2b23..0c160de 100644
--- a/examples/HelloMOAB.cpp
+++ b/examples/HelloMOAB.cpp
@@ -9,7 +9,6 @@
#include "moab/Core.hpp"
#include <iostream>
-#include <assert.h>
using namespace moab;
using namespace std;
@@ -18,45 +17,47 @@ using namespace std;
#define MESH_DIR "."
#endif
+// Note: change the file name below to test a trivial "No such file or directory" error
string test_file_name = string(MESH_DIR) + string("/3k-tri-sphere.vtk");
-int main( int argc, char** argv )
+int main(int argc, char** argv)
{
- Interface *iface = new Core;
+ Interface* iface = new Core;
- // need option handling here for input filename
- if (argc > 1){
- //user has input a mesh file
+ // Need option handling here for input filename
+ if (argc > 1) {
+ // User has input a mesh file
test_file_name = argv[1];
- }
- //load the mesh from vtk file
- ErrorCode rval = iface->load_mesh( test_file_name.c_str() );
- assert(rval == MB_SUCCESS);
+ }
- // get verts entities, by type
+ MBErrorHandler_Init();
+
+ // Load the mesh from vtk file
+ ErrorCode rval = iface->load_mesh(test_file_name.c_str());CHK_ERR(rval);
+
+ // Get verts entities, by type
Range verts;
- rval = iface->get_entities_by_type(0, MBVERTEX, verts);
- assert(rval == MB_SUCCESS);
- //get edge entities, by type
+ rval = iface->get_entities_by_type(0, MBVERTEX, verts);CHK_ERR(rval);
+
+ // Get edge entities, by type
Range edges;
- rval = iface->get_entities_by_type(0, MBEDGE, edges);
- assert(rval == MB_SUCCESS);
+ rval = iface->get_entities_by_type(0, MBEDGE, edges);CHK_ERR(rval);
- // get faces, by dimension, so we stay generic to entity type
+ // Get faces, by dimension, so we stay generic to entity type
Range faces;
- rval = iface->get_entities_by_dimension(0, 2, faces);
- assert(rval == MB_SUCCESS);
+ rval = iface->get_entities_by_dimension(0, 2, faces);CHK_ERR(rval);
- //get regions, by dimension, so we stay generic to entity type
+ // Get regions, by dimension, so we stay generic to entity type
Range elems;
- rval = iface->get_entities_by_dimension(0, 3, elems);
- assert(rval == MB_SUCCESS);
-
- //output the number of entities
- cout << "Number of vertices is " << verts.size() << endl;
- cout << "Number of edges is " << edges.size() << endl;
- cout << "Number of faces is " << faces.size() << endl;
- cout << "Number of elements is " << elems.size() << endl;
+ rval = iface->get_entities_by_dimension(0, 3, elems);CHK_ERR(rval);
+
+ MBErrorHandler_Finalize();
+
+ // Output the number of entities
+ cout << "Number of vertices is " << verts.size() << endl;
+ cout << "Number of edges is " << edges.size() << endl;
+ cout << "Number of faces is " << faces.size() << endl;
+ cout << "Number of elements is " << elems.size() << endl;
delete iface;
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
Sure, no problem, you can send them to moab-dev.
We are upgrading our documentation, so this discussion will help us, too.
Iulian
________________________________________
From: Gerd Heber [gheber(a)hdfgroup.org]
Sent: Monday, July 14, 2014 4:12 PM
To: Grindeanu, Iulian R.
Cc: Jacob.D.Hochhalter(a)nasa.gov; WARNER, JAMES E. (LARC-D309)
Subject: MOAB
Iulian, how are you? My collaborators at NASA Langley and I were looking at MOAB
as a candidate for our mesh database. We have a few questions that we didn't see
covered in the documentation. Would you mind having a quick chat (~30min)
sometime later this week or next week? We'd collect our questions and send
them to you a few days in advance.
Best, G.
>>> Gerd Heber + Applications Architect @ The HDF Group + 217-531-6109 <<<
1
0