-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce celer-sim
memory usage and improve its CELER_LOG
transport output
#1550
Open
stognini
wants to merge
10
commits into
celeritas-project:develop
Choose a base branch
from
stognini:reduce-memory-usage
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+53
−8
Open
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ff92941
Add print_progress option to Runner
stognini acfb629
Add option to accumulate TransporterResult event data to OutputRegistry
stognini cd2ce65
Merge branch 'develop' into reduce-memory-usage
stognini d5b3aa2
Address comments
stognini 21ed08d
`std::move` event instead of copy; remove trailing `;`
stognini 539ffcd
Verify that print_progress is positive in TransporterInput operator bool
stognini 3426c1b
Refactor progress() and print_progress to log_progress; Fix single st…
stognini 3c218b0
Address comments
stognini 7dbf5f6
Merge branch 'develop' into reduce-memory-usage
stognini 1c5c0b8
Merge branch 'develop' into reduce-memory-usage
sethrj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -93,7 +93,10 @@ void run(std::istream* is, std::shared_ptr<OutputRegistry> output) | |||||||||||
Runner run_stream(*run_input, output); | ||||||||||||
SimulationResult result; | ||||||||||||
result.setup_time = get_setup_time(); | ||||||||||||
result.events.resize(run_stream.num_events()); | ||||||||||||
if (run_input->transporter_result) | ||||||||||||
{ | ||||||||||||
result.events.resize(run_stream.num_events()); | ||||||||||||
} | ||||||||||||
|
||||||||||||
// Allocate device streams, or use the default stream if there is only one. | ||||||||||||
size_type num_streams = run_stream.num_streams(); | ||||||||||||
|
@@ -113,7 +116,7 @@ void run(std::istream* is, std::shared_ptr<OutputRegistry> output) | |||||||||||
|
||||||||||||
// Start profiling *after* initialization and warmup are complete | ||||||||||||
Stopwatch get_transport_time; | ||||||||||||
if (run_input->merge_events) | ||||||||||||
if (run_input->transporter_result && run_input->merge_events) | ||||||||||||
{ | ||||||||||||
// Run all events simultaneously on a single stream | ||||||||||||
result.events.front() = run_stream(); | ||||||||||||
amandalund marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
@@ -131,16 +134,23 @@ void run(std::istream* is, std::shared_ptr<OutputRegistry> output) | |||||||||||
activate_device_local(); | ||||||||||||
|
||||||||||||
// Run a single event on a single thread | ||||||||||||
CELER_TRY_HANDLE(result.events[event] = run_stream( | ||||||||||||
StreamId(get_openmp_thread()), EventId(event)), | ||||||||||||
capture_exception); | ||||||||||||
CELER_TRY_HANDLE( | ||||||||||||
(run_input->transporter_result) | ||||||||||||
? result.events[event] = run_stream( | ||||||||||||
StreamId(get_openmp_thread()), EventId(event)) | ||||||||||||
: run_stream(StreamId(get_openmp_thread()), EventId(event)), | ||||||||||||
capture_exception); | ||||||||||||
sethrj marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
} | ||||||||||||
log_and_rethrow(std::move(capture_exception)); | ||||||||||||
} | ||||||||||||
|
||||||||||||
result.action_times = run_stream.get_action_times(); | ||||||||||||
result.total_time = get_transport_time(); | ||||||||||||
record_mem = {}; | ||||||||||||
output->insert(std::make_shared<RunnerOutput>(std::move(result))); | ||||||||||||
if (run_input->transporter_result) | ||||||||||||
{ | ||||||||||||
output->insert(std::make_shared<RunnerOutput>(std::move(result))); | ||||||||||||
} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should still write the simulation result (timing info, number of CPU threads) either way.
Suggested change
|
||||||||||||
} | ||||||||||||
|
||||||||||||
//---------------------------------------------------------------------------// | ||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use
LDIO_SAVE
since their value is meaningful even when not explicitly set.