Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
swiftmpistepsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
SWIFT
swiftmpistepsim
Commits
ea3fbee7
Commit
ea3fbee7
authored
3 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Honour -f flag
parent
50707721
No related branches found
No related tags found
1 merge request
!6
Version with faked data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swiftmpifakestepsim.c
+17
-15
17 additions, 15 deletions
swiftmpifakestepsim.c
with
17 additions
and
15 deletions
swiftmpifakestepsim.c
+
17
−
15
View file @
ea3fbee7
...
@@ -288,15 +288,15 @@ static void *recv_thread(void *arg) {
...
@@ -288,15 +288,15 @@ static void *recv_thread(void *arg) {
/**
/**
* @brief Comparison function for logged times.
* @brief Comparison function for logged times.
*/
*/
//
static int cmp_logs(const void *p1, const void *p2) {
static
int
cmp_logs
(
const
void
*
p1
,
const
void
*
p2
)
{
//
struct mpiuse_log_entry *l1 = *(struct mpiuse_log_entry **)p1;
struct
mpiuse_log_entry
*
l1
=
*
(
struct
mpiuse_log_entry
**
)
p1
;
//
struct mpiuse_log_entry *l2 = *(struct mpiuse_log_entry **)p2;
struct
mpiuse_log_entry
*
l2
=
*
(
struct
mpiuse_log_entry
**
)
p2
;
//
//
/* Large unsigned values, so take care. */
/* Large unsigned values, so take care. */
//
if (l1->tic > l2->tic) return 1;
if
(
l1
->
tic
>
l2
->
tic
)
return
1
;
//
if (l1->tic < l2->tic) return -1;
if
(
l1
->
tic
<
l2
->
tic
)
return
-
1
;
//
return 0;
return
0
;
//
}
}
/**
/**
* @brief Pick out the relevant logging data for our rank, i.e. all
* @brief Pick out the relevant logging data for our rank, i.e. all
...
@@ -304,7 +304,7 @@ static void *recv_thread(void *arg) {
...
@@ -304,7 +304,7 @@ static void *recv_thread(void *arg) {
* The final list is sorted into increasing time of activation if required,
* The final list is sorted into increasing time of activation if required,
* otherwise the order is randomized.
* otherwise the order is randomized.
*
*
* @param random randomize injection order, otherwise use order of th
r
* @param random randomize injection order, otherwise use order of th
e
* original logs.
* original logs.
*/
*/
static
void
pick_logs
(
int
random
)
{
static
void
pick_logs
(
int
random
)
{
...
@@ -330,11 +330,13 @@ static void pick_logs(int random) {
...
@@ -330,11 +330,13 @@ static void pick_logs(int random) {
}
}
}
}
/* Sort into increasing time. */
if
(
!
random
)
{
// qsort(reqs_queue, nr_reqs, sizeof(struct mpiuse_log_entry *), cmp_logs);
/* Sort into increasing time. */
qsort
(
reqs_queue
,
nr_reqs
,
sizeof
(
struct
mpiuse_log_entry
*
),
cmp_logs
);
/* Randomize the order, so ranks do not all work in sequence. */
}
else
{
mpiuse_shuffle_logs
(
reqs_queue
,
nr_reqs
);
/* Randomize the order, so ranks do not all work in sequence. */
mpiuse_shuffle_logs
(
reqs_queue
,
nr_reqs
);
}
/* Check. */
/* Check. */
if
(
!
random
)
{
if
(
!
random
)
{
...
...
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