Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
ba0576cc
Commit
ba0576cc
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Don't need to keep logs between dumps, so dispose of them.
parent
fc68c167
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!861
Add logging for task MPI requests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mpiuse.c
+7
-5
7 additions, 5 deletions
src/mpiuse.c
with
7 additions
and
5 deletions
src/mpiuse.c
+
7
−
5
View file @
ba0576cc
...
@@ -98,7 +98,6 @@ struct mpiuse_log_entry {
...
@@ -98,7 +98,6 @@ struct mpiuse_log_entry {
static
struct
mpiuse_log_entry
*
volatile
mpiuse_log
=
NULL
;
static
struct
mpiuse_log_entry
*
volatile
mpiuse_log
=
NULL
;
static
volatile
size_t
mpiuse_log_size
=
0
;
static
volatile
size_t
mpiuse_log_size
=
0
;
static
volatile
size_t
mpiuse_log_count
=
0
;
static
volatile
size_t
mpiuse_log_count
=
0
;
static
volatile
size_t
mpiuse_old_count
=
0
;
static
volatile
size_t
mpiuse_log_done
=
0
;
static
volatile
size_t
mpiuse_log_done
=
0
;
/**
/**
...
@@ -186,7 +185,7 @@ void mpiuse_log_allocation(int type, int subtype, void *ptr, int activation,
...
@@ -186,7 +185,7 @@ void mpiuse_log_allocation(int type, int subtype, void *ptr, int activation,
void
mpiuse_log_dump
(
const
char
*
filename
)
{
void
mpiuse_log_dump
(
const
char
*
filename
)
{
/* Skip if nothing logged this step. */
/* Skip if nothing logged this step. */
if
(
mpiuse_log_count
==
mpiuse_old_count
)
return
;
if
(
mpiuse_log_count
==
0
)
return
;
// ticks tic = getticks();
// ticks tic = getticks();
...
@@ -196,7 +195,6 @@ void mpiuse_log_dump(const char *filename) {
...
@@ -196,7 +195,6 @@ void mpiuse_log_dump(const char *filename) {
/* Stop any new logs from being processed while we are dumping. */
/* Stop any new logs from being processed while we are dumping. */
size_t
log_count
=
mpiuse_log_count
;
size_t
log_count
=
mpiuse_log_count
;
size_t
old_count
=
mpiuse_old_count
;
/* Open the output file. */
/* Open the output file. */
FILE
*
fd
;
FILE
*
fd
;
...
@@ -215,7 +213,7 @@ void mpiuse_log_dump(const char *filename) {
...
@@ -215,7 +213,7 @@ void mpiuse_log_dump(const char *filename) {
size_t
mpiuse_max
=
0
;
size_t
mpiuse_max
=
0
;
double
mpiuse_sum
=
0
;
double
mpiuse_sum
=
0
;
size_t
mpiuse_actcount
=
0
;
size_t
mpiuse_actcount
=
0
;
for
(
size_t
k
=
old_count
;
k
<
log_count
;
k
++
)
{
for
(
size_t
k
=
0
;
k
<
log_count
;
k
++
)
{
/* Check if this address has already been recorded. */
/* Check if this address has already been recorded. */
struct
memuse_rnode
*
child
=
memuse_rnode_find_child
(
struct
memuse_rnode
*
child
=
memuse_rnode_find_child
(
...
@@ -326,7 +324,7 @@ void mpiuse_log_dump(const char *filename) {
...
@@ -326,7 +324,7 @@ void mpiuse_log_dump(const char *filename) {
/* Now check any still active logs, these are errors all should match. */
/* Now check any still active logs, these are errors all should match. */
if
(
mpiuse_current
!=
0
)
{
if
(
mpiuse_current
!=
0
)
{
message
(
"Some MPI requests have not been completed"
);
message
(
"Some MPI requests have not been completed"
);
for
(
size_t
k
=
old_count
;
k
<
log_count
;
k
++
)
{
for
(
size_t
k
=
0
;
k
<
log_count
;
k
++
)
{
if
(
mpiuse_log
[
k
].
active
)
if
(
mpiuse_log
[
k
].
active
)
message
(
"%s/%s: %d->%d: %zd/%d)"
,
taskID_names
[
mpiuse_log
[
k
].
type
],
message
(
"%s/%s: %d->%d: %zd/%d)"
,
taskID_names
[
mpiuse_log
[
k
].
type
],
subtaskID_names
[
mpiuse_log
[
k
].
subtype
],
engine_rank
,
subtaskID_names
[
mpiuse_log
[
k
].
subtype
],
engine_rank
,
...
@@ -337,6 +335,10 @@ void mpiuse_log_dump(const char *filename) {
...
@@ -337,6 +335,10 @@ void mpiuse_log_dump(const char *filename) {
/* Finished with the rnodes. */
/* Finished with the rnodes. */
memuse_rnode_cleanup
(
memuse_rnode_root
);
memuse_rnode_cleanup
(
memuse_rnode_root
);
/* Clear the log. We expect this to clear step to step, unlike memory. */
mpiuse_log_count
=
0
;
mpiuse_log_done
=
0
;
/* Close the file. */
/* Close the file. */
fflush
(
fd
);
fflush
(
fd
);
fclose
(
fd
);
fclose
(
fd
);
...
...
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