Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
a482cf6e
Commit
a482cf6e
authored
10 years ago
by
Chichi Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
fix DEBUG_MSG etc defines
parent
eaed4109
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
makefile
+1
-1
1 addition, 1 deletion
makefile
src/base.hpp
+10
-1
10 additions, 1 deletion
src/base.hpp
src/field_descriptor.cpp
+26
-10
26 additions, 10 deletions
src/field_descriptor.cpp
with
37 additions
and
12 deletions
makefile
+
1
−
1
View file @
a482cf6e
MPICXX
=
mpicxx
LINKER
=
mpicxx
DEFINES
=
-DNDEBUG
DEFINES
=
#
-DNDEBUG
CFLAGS
=
-Wall
\
-O2
\
#-pg
\
...
...
This diff is collapsed.
Click to expand it.
src/base.hpp
+
10
−
1
View file @
a482cf6e
...
...
@@ -29,11 +29,20 @@ inline void DEBUG_MSG(const char * format, ...)
std
::
cerr
<<
debug_message_buffer
;
}
inline
void
DEBUG_WAIT
(
MPI_Comm
communicator
)
{
MPI_Barrier
(
communicator
);
}
#define DEBUG_WAIT_ALL() MPI_Barrier(MPI_COMM_WORLD)
#define CHECK_POINT() DEBUG_MSG("%s %s", __FILE__, __LINE__)
#else
#define DEBUG_MSG(x)
#define DEBUG_MSG(...)
#define DEBUG_WAIT_ALL()
#define DEBUG_WAIT(...)
#define CHECK_POINT()
...
...
This diff is collapsed.
Click to expand it.
src/field_descriptor.cpp
+
26
−
10
View file @
a482cf6e
...
...
@@ -52,6 +52,7 @@ field_descriptor::field_descriptor(
this
->
sizes
[
0
],
this
->
subsizes
[
0
],
this
->
starts
[
0
]);
DEBUG_WAIT_ALL
();
int
local_zero_array
[
this
->
nprocs
],
zero_array
[
this
->
nprocs
];
for
(
int
i
=
0
;
i
<
this
->
nprocs
;
i
++
)
local_zero_array
[
i
]
=
0
;
...
...
@@ -87,9 +88,20 @@ field_descriptor::field_descriptor(
MPI_Comm_create
(
this
->
comm
,
tgroup
,
&
this
->
io_comm
);
MPI_Group_free
(
&
tgroup0
);
MPI_Group_free
(
&
tgroup
);
if
(
this
->
subsizes
[
0
]
>
0
)
{
MPI_Comm_rank
(
this
->
io_comm
,
&
this
->
io_myrank
);
MPI_Comm_size
(
this
->
io_comm
,
&
this
->
io_nprocs
);
}
else
{
this
->
io_myrank
=
MPI_PROC_NULL
;
this
->
io_nprocs
=
-
1
;
}
}
if
(
this
->
subsizes
[
0
]
>
0
)
{
DEBUG_MSG
(
"creating subarray
\n
"
);
MPI_Type_create_subarray
(
ndims
,
this
->
sizes
,
...
...
@@ -114,27 +126,31 @@ field_descriptor::field_descriptor(
MPI_SUM
,
this
->
comm
);
delete
[]
local_rank
;
DEBUG_MSG
(
"exiting field_descriptor::field_descriptor
\n
"
);
}
field_descriptor
::~
field_descriptor
()
{
DEBUG_MSG
(
"entered field_descriptor::~field_descriptor
\n
"
);
delete
[]
this
->
sizes
;
delete
[]
this
->
subsizes
;
delete
[]
this
->
starts
;
delete
[]
this
->
rank
;
// if (this->subsizes[0] > 0)
DEBUG_MSG
(
this
->
io_comm
==
MPI_COMM_NULL
?
"null
\n
"
:
"not null
\n
"
);
DEBUG_WAIT_ALL
();
DEBUG_MSG
(
"subsizes[0] = %d
\n
"
,
this
->
subsizes
[
0
]);
DEBUG_WAIT_ALL
();
if
(
this
->
subsizes
[
0
]
>
0
)
{
DEBUG_MSG
(
"deallocating mpi_array_dtype
\n
"
);
DEBUG_WAIT
(
this
->
io_comm
);
MPI_Type_free
(
&
this
->
mpi_array_dtype
);
if
(
this
->
nprocs
!=
this
->
io_nprocs
)
{
DEBUG_MSG
(
"freeing io_comm
\n
"
);
MPI_Comm_free
(
&
this
->
io_comm
);
}
}
DEBUG_MSG
(
"exiting field_descriptor::~field_descriptor
\n
"
);
DEBUG_WAIT_ALL
();
if
(
this
->
nprocs
!=
this
->
io_nprocs
&&
this
->
io_myrank
!=
MPI_PROC_NULL
)
{
DEBUG_MSG
(
"freeing io_comm
\n
"
);
DEBUG_WAIT
(
this
->
io_comm
);
MPI_Comm_free
(
&
this
->
io_comm
);
}
}
int
field_descriptor
::
read
(
...
...
@@ -186,7 +202,7 @@ int field_descriptor::write(
sprintf
(
ffname
,
"%s"
,
fname
);
MPI_File_open
(
this
->
comm
,
this
->
io_
comm
,
ffname
,
MPI_MODE_CREATE
|
MPI_MODE_WRONLY
,
info
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment