Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
dace132b
Commit
dace132b
authored
Feb 28, 2016
by
BRAMAS Berenger
Browse files
update the task name to use simgrid
parent
48c0856a
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
dace132b
...
...
@@ -97,6 +97,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
option
(
SCALFMM_DISABLE_NATIVE_OMP4
"Set to ON to disable the gcc/intel omp4"
OFF
)
option
(
SCALFMM_TIME_OMPTASKS
"Set to ON to time omp4 tasks and generate output file"
OFF
)
option
(
SCALFMM_SIMGRID_NODATA
"Set to ON to avoid the allocation of numerical parts in the group tree"
OFF
)
option
(
SCALFMM_SIMGRID_TASKNAMEPARAMS
"Set to ON to have verbose information in the task name"
OFF
)
# STARPU options
CMAKE_DEPENDENT_OPTION
(
SCALFMM_STARPU_USE_COMMUTE
"Set to ON to enable commute with StarPU"
ON
"SCALFMM_USE_STARPU"
OFF
)
CMAKE_DEPENDENT_OPTION
(
SCALFMM_STARPU_USE_REDUX
"Set to ON to enable redux with StarPU"
OFF
"SCALFMM_USE_STARPU"
OFF
)
...
...
Src/GroupTree/Core/FGroupTaskStarpuAlgorithm.hpp
View file @
dace132b
...
...
@@ -40,6 +40,9 @@
#include
"../OpenCl/FOpenCLDeviceWrapper.hpp"
#endif
#ifdef SCALFMM_SIMGRID_TASKNAMEPARAMS
#include
"../StarPUUtils/FStarPUTaskNameParams.hpp"
#endif
#include
"Containers/FBoolArray.hpp"
...
...
@@ -131,6 +134,7 @@ protected:
#endif
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
std
::
vector
<
std
::
unique_ptr
<
char
[]
>>
m2mTaskNames
;
std
::
vector
<
std
::
unique_ptr
<
char
[]
>>
m2lTaskNames
;
std
::
vector
<
std
::
unique_ptr
<
char
[]
>>
m2lOuterTaskNames
;
...
...
@@ -139,6 +143,9 @@ protected:
std
::
unique_ptr
<
char
[]
>
l2pTaskNames
;
std
::
unique_ptr
<
char
[]
>
p2pTaskNames
;
std
::
unique_ptr
<
char
[]
>
p2pOuterTaskNames
;
#else
FStarPUTaskNameParams
taskNames
;
#endif
#endif
#ifdef SCALFMM_STARPU_USE_PRIO
typedef
FStarPUFmmPrioritiesV2
PrioClass
;
// FStarPUFmmPriorities
...
...
@@ -231,6 +238,7 @@ public:
void
buildTaskNames
(){
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
const
int
namesLength
=
128
;
m2mTaskNames
.
resize
(
tree
->
getHeight
());
m2lTaskNames
.
resize
(
tree
->
getHeight
());
...
...
@@ -255,6 +263,7 @@ public:
snprintf
(
p2pTaskNames
.
get
(),
namesLength
,
"P2P"
);
p2pOuterTaskNames
.
reset
(
new
char
[
namesLength
]);
snprintf
(
p2pOuterTaskNames
.
get
(),
namesLength
,
"P2P-out"
);
#endif
#endif
}
...
...
@@ -1006,7 +1015,13 @@ protected:
STARPU_RW
,
cellHandles
[
tree
->
getHeight
()
-
1
][
idxGroup
].
up
,
STARPU_R
,
particleHandles
[
idxGroup
].
symb
,
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
p2mTaskNames
.
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"P2M_nb%d_i%lld"
,
tree
->
getCellGroup
(
tree
->
getHeight
()
-
1
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
tree
->
getHeight
()
-
1
,
idxGroup
)
->
getSizeOfInterval
()),
#endif
#endif
0
);
}
...
...
@@ -1061,7 +1076,18 @@ protected:
task
->
priority
=
PrioClass
::
Controller
().
getInsertionPosM2M
(
idxLevel
);
#endif
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task
->
name
=
m2mTaskNames
[
idxLevel
].
get
();
#else
task
->
name
=
taskNames
.
print
(
"M2M_l%d_nb%d_i%lld_nbc%d_ic%lld_s%lld"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getSizeOfInterval
(),
FMath
::
Min
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getEndingIndex
()
-
1
,
(
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getEndingIndex
()
-
1
)
>>
3
)
-
FMath
::
Max
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getStartingIndex
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getStartingIndex
()
>>
3
));
#endif
#endif
FAssertLF
(
starpu_task_submit
(
task
)
==
0
);
}
...
...
@@ -1097,7 +1123,18 @@ protected:
task
->
priority
=
PrioClass
::
Controller
().
getInsertionPosM2M
(
idxLevel
);
#endif
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task
->
name
=
m2mTaskNames
[
idxLevel
].
get
();
#else
task
->
name
=
taskNames
.
print
(
"M2M_l%d_nb%d_i%lld_nbc%d_ic%lld_s%lld"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getSizeOfInterval
(),
FMath
::
Min
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getEndingIndex
()
-
1
,
(
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getEndingIndex
()
-
1
)
>>
3
)
-
FMath
::
Max
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getStartingIndex
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getStartingIndex
()
>>
3
));
#endif
#endif
FAssertLF
(
starpu_task_submit
(
task
)
==
0
);
}
...
...
@@ -1129,7 +1166,14 @@ protected:
STARPU_R
,
cellHandles
[
idxLevel
][
idxGroup
].
up
,
(
STARPU_RW
|
STARPU_COMMUTE_IF_SUPPORTED
),
cellHandles
[
idxLevel
][
idxGroup
].
down
,
#ifdef STARPU_USE_TASK_NAME
STARPU_NAME
,
m2lTaskNames
[
idxLevel
].
get
(),
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
m2lTaskNames
[
idxLevel
].
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"M2L_l%d_nb%d_i%lld"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
()),
#endif
#endif
0
);
}
...
...
@@ -1157,7 +1201,17 @@ protected:
STARPU_R
,
cellHandles
[
idxLevel
][
interactionid
].
symb
,
STARPU_R
,
cellHandles
[
idxLevel
][
interactionid
].
up
,
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
m2lOuterTaskNames
[
idxLevel
].
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"M2L_out_l%d_nb%d_i%lld_nb%d_i%lld_s%d"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
(),
tree
->
getCellGroup
(
idxLevel
,
interactionid
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
interactionid
)
->
getSizeOfInterval
(),
outsideInteractions
->
size
()),
#endif
#endif
0
);
...
...
@@ -1176,7 +1230,17 @@ protected:
STARPU_R
,
cellHandles
[
idxLevel
][
idxGroup
].
symb
,
STARPU_R
,
cellHandles
[
idxLevel
][
idxGroup
].
up
,
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
m2lOuterTaskNames
[
idxLevel
].
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"M2L_out_l%d_nb%d_i%lld_nb%d_i%lld_s%d"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
interactionid
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
interactionid
)
->
getSizeOfInterval
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
(),
outsideInteractions
->
size
()),
#endif
#endif
0
);
}
...
...
@@ -1239,7 +1303,18 @@ protected:
task
->
priority
=
PrioClass
::
Controller
().
getInsertionPosL2L
(
idxLevel
);
#endif
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task
->
name
=
l2lTaskNames
[
idxLevel
].
get
();
#else
task
->
name
=
taskNames
.
print
(
"L2L_l%d_nb%d_i%lld_nbc%d_ic%lld_s%lld"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getSizeOfInterval
(),
FMath
::
Min
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getEndingIndex
()
-
1
,
(
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getEndingIndex
()
-
1
)
>>
3
)
-
FMath
::
Max
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getStartingIndex
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getStartingIndex
()
>>
3
));
#endif
#endif
FAssertLF
(
starpu_task_submit
(
task
)
==
0
);
}
...
...
@@ -1278,7 +1353,18 @@ protected:
task
->
priority
=
PrioClass
::
Controller
().
getInsertionPosL2L
(
idxLevel
);
#endif
#ifdef STARPU_USE_TASK_NAME
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task
->
name
=
l2lTaskNames
[
idxLevel
].
get
();
#else
task
->
name
=
taskNames
.
print
(
"L2L_l%d_nb%d_i%lld_nbc%d_ic%lld_s%lld"
,
idxLevel
,
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getSizeOfInterval
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getSizeOfInterval
(),
FMath
::
Min
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getEndingIndex
()
-
1
,
(
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getEndingIndex
()
-
1
)
>>
3
)
-
FMath
::
Max
(
tree
->
getCellGroup
(
idxLevel
,
idxGroup
)
->
getStartingIndex
(),
tree
->
getCellGroup
(
idxLevel
+
1
,
idxSubGroup
)
->
getStartingIndex
()
>>
3
));
#endif
#endif
FAssertLF
(
starpu_task_submit
(
task
)
==
0
);
}
...
...
@@ -1320,7 +1406,16 @@ protected:
(
STARPU_RW
|
STARPU_COMMUTE_IF_SUPPORTED
),
particleHandles
[
interactionid
].
down
,
#endif
#ifdef STARPU_USE_TASK_NAME
STARPU_NAME
,
p2pOuterTaskNames
.
get
(),
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
p2pOuterTaskNames
.
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"P2P_out_nb%d_i%lld_nb%d_i%lld_s%d"
,
tree
->
getParticleGroup
(
idxGroup
)
->
getNumberOfLeavesInBlock
(),
tree
->
getParticleGroup
(
idxGroup
)
->
getSizeOfInterval
(),
tree
->
getParticleGroup
(
interactionid
)
->
getNumberOfLeavesInBlock
(),
tree
->
getParticleGroup
(
interactionid
)
->
getSizeOfInterval
(),
outsideInteractions
->
size
()),
#endif
#endif
0
);
}
...
...
@@ -1341,7 +1436,13 @@ protected:
(
STARPU_RW
|
STARPU_COMMUTE_IF_SUPPORTED
),
particleHandles
[
idxGroup
].
down
,
#endif
#ifdef STARPU_USE_TASK_NAME
STARPU_NAME
,
p2pTaskNames
.
get
(),
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
p2pTaskNames
.
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"P2P_nb%d_i%lld"
,
tree
->
getParticleGroup
(
idxGroup
)
->
getNumberOfLeavesInBlock
(),
tree
->
getParticleGroup
(
idxGroup
)
->
getSizeOfInterval
()),
#endif
#endif
0
);
}
...
...
@@ -1376,7 +1477,13 @@ protected:
(
STARPU_RW
|
STARPU_COMMUTE_IF_SUPPORTED
),
particleHandles
[
idxGroup
].
down
,
#endif
#ifdef STARPU_USE_TASK_NAME
STARPU_NAME
,
l2pTaskNames
.
get
(),
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME
,
l2pTaskNames
.
get
(),
#else
STARPU_NAME
,
taskNames
.
print
(
"L2P_nb%d_i%lld"
,
tree
->
getCellGroup
(
tree
->
getHeight
()
-
1
,
idxGroup
)
->
getNumberOfCellsInBlock
(),
tree
->
getCellGroup
(
tree
->
getHeight
()
-
1
,
idxGroup
)
->
getSizeOfInterval
()),
#endif
#endif
0
);
}
...
...
Src/GroupTree/StarPUUtils/FStarPUTaskNameParams.hpp
0 → 100644
View file @
dace132b
#ifndef FSTARPUTASKNAMEPARAMS_HPP
#define FSTARPUTASKNAMEPARAMS_HPP
#include
"../../Utils/FGlobal.hpp"
#include
<list>
#include
<cstring>
#include
<cstdio>
/**
* This class creates task name for starpu
* it is used for simgrid (to pass task parameters)
*/
class
FStarPUTaskNameParams
{
protected:
std
::
list
<
const
char
*>
names
;
public:
FStarPUTaskNameParams
(){
}
~
FStarPUTaskNameParams
(){
clear
();
}
void
clear
(){
while
(
names
.
size
()){
delete
[]
names
.
front
();
names
.
pop_front
();
}
}
template
<
typename
...
Params
>
const
char
*
print
(
const
char
format
[],
Params
...
args
){
const
size_t
length
=
512
;
char
*
name
=
new
char
[
length
+
1
];
snprintf
(
name
,
format
,
args
...);
name
[
length
]
=
'\0'
;
names
.
push_back
(
name
);
return
name
;
}
const
char
*
add
(
const
char
*
strToCpy
){
const
size_t
length
=
strlen
(
strToCpy
);
char
*
cpy
=
new
char
[
length
+
1
];
memcpy
(
cpy
,
strToCpy
,
length
);
cpy
[
length
]
=
'\0'
;
names
.
push_back
(
cpy
);
return
cpy
;
}
};
#endif // FSTARPUTASKNAMEPARAMS_HPP
Src/ScalFmmConfig.h.cmake
View file @
dace132b
...
...
@@ -163,5 +163,6 @@ const std::string SCALFMMCompileLibs("@SCALFMM_COMPILE_LIBS@");
///////////////////////////////////////////////////////
#cmakedefine SCALFMM_SIMGRID_NODATA
#cmakedefine SCALFMM_SIMGRID_TASKNAMEPARAMS
#endif // CONFIG_H
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment