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
0aadda70
Commit
0aadda70
authored
4 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Restore --enable-dumper after code re-organization
parent
947ec89e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+0
-66
0 additions, 66 deletions
src/engine.c
src/engine_config.c
+66
-0
66 additions, 0 deletions
src/engine_config.c
with
66 additions
and
66 deletions
src/engine.c
+
0
−
66
View file @
0aadda70
...
@@ -2616,72 +2616,6 @@ void engine_unpin(void) {
...
@@ -2616,72 +2616,6 @@ void engine_unpin(void) {
#endif
#endif
}
}
#ifdef SWIFT_DUMPER_THREAD
/**
* @brief dumper thread action, checks got the existence of the .dump file
* every 5 seconds and does the dump if found.
*
* @param p the #engine
*/
static
void
*
engine_dumper_poll
(
void
*
p
)
{
struct
engine
*
e
=
(
struct
engine
*
)
p
;
while
(
1
)
{
if
(
access
(
".dump"
,
F_OK
)
==
0
)
{
/* OK, do our work. */
message
(
"Dumping engine tasks in step: %d"
,
e
->
step
);
task_dump_active
(
e
);
#ifdef SWIFT_MEMUSE_REPORTS
/* Dump the currently logged memory. */
message
(
"Dumping memory use report"
);
memuse_log_dump_error
(
e
->
nodeID
);
#endif
#if defined(SWIFT_MPIUSE_REPORTS) && defined(WITH_MPI)
/* Dump the MPI interactions in the step. */
mpiuse_log_dump_error
(
e
->
nodeID
);
#endif
/* Add more interesting diagnostics. */
scheduler_dump_queues
(
e
);
/* Delete the file. */
unlink
(
".dump"
);
message
(
"Dumping completed"
);
fflush
(
stdout
);
}
/* Take a breath. */
sleep
(
5
);
}
return
NULL
;
}
#endif
/* SWIFT_DUMPER_THREAD */
#ifdef SWIFT_DUMPER_THREAD
/**
* @brief creates the dumper thread.
*
* This watches for the creation of a ".dump" file in the current directory
* and if found dumps the current state of the tasks and memory use (if also
* configured).
*
* @param e the #engine
*
*/
static
void
engine_dumper_init
(
struct
engine
*
e
)
{
pthread_t
dumper
;
/* Make sure the .dump file is not present, that is bad when starting up. */
struct
stat
buf
;
if
(
stat
(
".dump"
,
&
buf
)
==
0
)
unlink
(
".dump"
);
/* Thread does not exit, so nothing to do but create it. */
pthread_create
(
&
dumper
,
NULL
,
&
engine_dumper_poll
,
e
);
}
#endif
/* SWIFT_DUMPER_THREAD */
/**
/**
* @brief init an engine struct with the necessary properties for the
* @brief init an engine struct with the necessary properties for the
* simulation.
* simulation.
...
...
This diff is collapsed.
Click to expand it.
src/engine_config.c
+
66
−
0
View file @
0aadda70
...
@@ -49,6 +49,72 @@ extern int engine_max_parts_per_cooling;
...
@@ -49,6 +49,72 @@ extern int engine_max_parts_per_cooling;
/* Particle cache size. */
/* Particle cache size. */
#define CACHE_SIZE 512
#define CACHE_SIZE 512
#ifdef SWIFT_DUMPER_THREAD
/**
* @brief dumper thread action, checks got the existence of the .dump file
* every 5 seconds and does the dump if found.
*
* @param p the #engine
*/
static
void
*
engine_dumper_poll
(
void
*
p
)
{
struct
engine
*
e
=
(
struct
engine
*
)
p
;
while
(
1
)
{
if
(
access
(
".dump"
,
F_OK
)
==
0
)
{
/* OK, do our work. */
message
(
"Dumping engine tasks in step: %d"
,
e
->
step
);
task_dump_active
(
e
);
#ifdef SWIFT_MEMUSE_REPORTS
/* Dump the currently logged memory. */
message
(
"Dumping memory use report"
);
memuse_log_dump_error
(
e
->
nodeID
);
#endif
#if defined(SWIFT_MPIUSE_REPORTS) && defined(WITH_MPI)
/* Dump the MPI interactions in the step. */
mpiuse_log_dump_error
(
e
->
nodeID
);
#endif
/* Add more interesting diagnostics. */
scheduler_dump_queues
(
e
);
/* Delete the file. */
unlink
(
".dump"
);
message
(
"Dumping completed"
);
fflush
(
stdout
);
}
/* Take a breath. */
sleep
(
5
);
}
return
NULL
;
}
#endif
/* SWIFT_DUMPER_THREAD */
#ifdef SWIFT_DUMPER_THREAD
/**
* @brief creates the dumper thread.
*
* This watches for the creation of a ".dump" file in the current directory
* and if found dumps the current state of the tasks and memory use (if also
* configured).
*
* @param e the #engine
*
*/
static
void
engine_dumper_init
(
struct
engine
*
e
)
{
pthread_t
dumper
;
/* Make sure the .dump file is not present, that is bad when starting up. */
struct
stat
buf
;
if
(
stat
(
".dump"
,
&
buf
)
==
0
)
unlink
(
".dump"
);
/* Thread does not exit, so nothing to do but create it. */
pthread_create
(
&
dumper
,
NULL
,
&
engine_dumper_poll
,
e
);
}
#endif
/* SWIFT_DUMPER_THREAD */
/**
/**
* @brief configure an engine with the given number of threads, queues
* @brief configure an engine with the given number of threads, queues
* and core affinity. Also initialises the scheduler and opens various
* and core affinity. Also initialises the scheduler and opens various
...
...
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