Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickSched
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
QuickSched
Commits
4a263c1c
Commit
4a263c1c
authored
9 years ago
by
d74ksy
Browse files
Options
Downloads
Patches
Plain Diff
Some fixes and additions. Now synchronises to get better timings
parent
fd08d3bd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/test_qr_mpi.c
+33
-6
33 additions, 6 deletions
examples/test_qr_mpi.c
src/qsched.c
+1
-0
1 addition, 0 deletions
src/qsched.c
with
34 additions
and
6 deletions
examples/test_qr_mpi.c
+
33
−
6
View file @
4a263c1c
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
/* Standard includes. */
/* Standard includes. */
#include
<stdio.h>
#include
<stdio.h>
#include
<errno.h>
#include
<stdlib.h>
#include
<stdlib.h>
#include
<string.h>
#include
<string.h>
#include
<unistd.h>
#include
<unistd.h>
...
@@ -40,7 +41,7 @@
...
@@ -40,7 +41,7 @@
#include
"quicksched.h"
#include
"quicksched.h"
#include
"res.h"
#include
"res.h"
#define
NO_
TASK_TIMERS
#define TASK_TIMERS
#ifdef WITH_CBLAS
#ifdef WITH_CBLAS
/**
/**
...
@@ -610,7 +611,7 @@ task_tids = (int*)calloc(sizeof(int), m*n*K*K);
...
@@ -610,7 +611,7 @@ task_tids = (int*)calloc(sizeof(int), m*n*K*K);
task_types
=
(
int
*
)
calloc
(
sizeof
(
int
),
m
*
n
*
K
*
K
);
task_types
=
(
int
*
)
calloc
(
sizeof
(
int
),
m
*
n
*
K
*
K
);
#endif
#endif
if
(
s
.
rank
==
0
){
/* Allocate and fill the original matrix. */
/* Allocate and fill the original matrix. */
if
((
A
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
m
*
n
*
K
*
K
))
==
NULL
||
if
((
A
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
m
*
n
*
K
*
K
))
==
NULL
||
(
tau
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
m
*
n
*
K
))
==
NULL
||
(
tau
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
m
*
n
*
K
))
==
NULL
||
...
@@ -624,7 +625,7 @@ if(s.rank == 0){
...
@@ -624,7 +625,7 @@ if(s.rank == 0){
}
}
memcpy
(
A
,
A_orig
,
sizeof
(
double
)
*
m
*
n
*
K
*
K
);
memcpy
(
A
,
A_orig
,
sizeof
(
double
)
*
m
*
n
*
K
*
K
);
bzero
(
tau
,
sizeof
(
double
)
*
m
*
n
*
K
);
bzero
(
tau
,
sizeof
(
double
)
*
m
*
n
*
K
);
if
(
s
.
rank
==
0
){
/* Initialize the scheduler. */
/* Initialize the scheduler. */
/* Allocate and init the task ID and resource ID matrix. */
/* Allocate and init the task ID and resource ID matrix. */
// tic = getticks();
// tic = getticks();
...
@@ -778,8 +779,6 @@ qsched_run_MPI(&s, nr_threads, runner);
...
@@ -778,8 +779,6 @@ qsched_run_MPI(&s, nr_threads, runner);
printf
(
"Hello world from processor %s, rank = %i, count_ranks = %i
\n
"
,
printf
(
"Hello world from processor %s, rank = %i, count_ranks = %i
\n
"
,
processor_name
,
s
.
rank
,
s
.
count_ranks
);
processor_name
,
s
.
rank
,
s
.
count_ranks
);
//TODO Clean up the resource data.
qsched_free
(
&
s
);
#ifdef TASK_TIMERS
#ifdef TASK_TIMERS
FILE
*
file
=
NULL
;
FILE
*
file
=
NULL
;
...
@@ -795,7 +794,7 @@ FILE *file = NULL;
...
@@ -795,7 +794,7 @@ FILE *file = NULL;
for
(
i
=
0
;
i
<
m
*
n
*
K
*
K
;
i
++
)
for
(
i
=
0
;
i
<
m
*
n
*
K
*
K
;
i
++
)
{
{
if
(
task_types
[
i
]
>
0
)
if
(
task_types
[
i
]
>
0
)
fprintf
(
file
,
"%i %i %lli %lli
\n
"
,
task_types
[
i
],
task_tids
[
i
],
task_start
[
i
],
task_finish
[
i
]
);
fprintf
(
file
,
"%i %i %lli %lli
\n
"
,
task_types
[
i
],
s
.
rank
*
nr_threads
+
task_tids
[
i
],
task_start
[
i
],
task_finish
[
i
]
);
}
}
...
@@ -805,6 +804,34 @@ FILE *file = NULL;
...
@@ -805,6 +804,34 @@ FILE *file = NULL;
free
(
task_start
);
free
(
task_start
);
free
(
task_finish
);
free
(
task_finish
);
#endif
#endif
//TODO Copy all the resources back into A, synchronize them across the nodes and check correctness.
if
(
s
.
count_ranks
>
1
&&
s
.
rank
==
0
)
{
errno
=
0
;
FILE
*
file2
=
fopen
(
"resource_allocation.out"
,
"w"
);
if
(
file2
==
NULL
)
error
(
"Failed to open file2 %d "
,
errno
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
j
=
0
;
j
<
m
;
j
++
)
{
/*printf("j*m+i= %i\n", j*m+i);
printf("rid[j*m+i] = %lli\n", rid[j*m+i]);
printf("s.res = %p\n", &s.res[rid[j*m+i]]);
printf("s.res[rid[j*m+i]].node = %i\n", s.res[rid[j*m+i]].node);*/
fprintf
(
file2
,
"%i, "
,
s
.
res
[
rid
[
j
*
m
+
i
]].
node
);
}
fprintf
(
file2
,
"
\n
"
);
}
fclose
(
file2
);
}
//TODO Clean up the resource data.
qsched_free
(
&
s
);
free
(
A
);
free
(
A_orig
);
free
(
tau
);
// Finalize the MPI environment.
// Finalize the MPI environment.
MPI_Finalize
();
MPI_Finalize
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/qsched.c
+
1
−
0
View file @
4a263c1c
...
@@ -3420,6 +3420,7 @@ void qsched_run_MPI ( struct qsched *s, int nr_threads, qsched_funtype fun ) {
...
@@ -3420,6 +3420,7 @@ void qsched_run_MPI ( struct qsched *s, int nr_threads, qsched_funtype fun ) {
printf
(
"Rank[%i]: qsched_prepare_mpi took %lli (= %e) ticks
\n
"
,
s
->
rank
,
printf
(
"Rank[%i]: qsched_prepare_mpi took %lli (= %e) ticks
\n
"
,
s
->
rank
,
toc
-
tic
,
(
float
)(
toc
-
tic
));
toc
-
tic
,
(
float
)(
toc
-
tic
));
MPI_Barrier
(
s
->
comm
);
message
(
"Beginning execution of quicksched"
);
message
(
"Beginning execution of quicksched"
);
tic
=
getticks
();
tic
=
getticks
();
#if defined( HAVE_OPENMP )
#if defined( HAVE_OPENMP )
...
...
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