Commit cd3568f2 authored by BRAMAS Berenger's avatar BRAMAS Berenger

update simgrid task name system

parent a5616c5d
......@@ -1018,7 +1018,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, p2mTaskNames.get(),
#else
STARPU_NAME, taskNames.print("P2M_nb%d_i%lld_p%lld",
STARPU_NAME, taskNames.print("P2M", "nb%d_i%lld_p%lld",
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getSizeOfInterval(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNbParticlesInGroup()),
......@@ -1080,7 +1080,7 @@ protected:
#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",
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(),
......@@ -1127,7 +1127,7 @@ protected:
#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",
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(),
......@@ -1170,7 +1170,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, m2lTaskNames[idxLevel].get(),
#else
STARPU_NAME, taskNames.print("M2L_l%d_nb%d_i%lld",
STARPU_NAME, taskNames.print("M2L", "l%d_nb%d_i%lld",
idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval()),
......@@ -1205,7 +1205,7 @@ protected:
#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",
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(),
......@@ -1234,7 +1234,7 @@ protected:
#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",
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(),
......@@ -1307,7 +1307,7 @@ protected:
#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",
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(),
......@@ -1357,7 +1357,7 @@ protected:
#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",
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(),
......@@ -1410,7 +1410,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, p2pOuterTaskNames.get(),
#else
STARPU_NAME, taskNames.print("P2P_out_nb%d_i%lld_p%lld_nb%d_i%lld_p%lld_s%d",
STARPU_NAME, taskNames.print("P2P_out", "nb%d_i%lld_p%lld_nb%d_i%lld_p%lld_s%d",
tree->getParticleGroup(idxGroup)->getNumberOfLeavesInBlock(),
tree->getParticleGroup(idxGroup)->getSizeOfInterval(),
tree->getParticleGroup(idxGroup)->getNbParticlesInGroup(),
......@@ -1442,7 +1442,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, p2pTaskNames.get(),
#else
STARPU_NAME, taskNames.print("P2P_nb%d_i%lld_p%lld",
STARPU_NAME, taskNames.print("P2P", "nb%d_i%lld_p%lld",
tree->getParticleGroup(idxGroup)->getNumberOfLeavesInBlock(),
tree->getParticleGroup(idxGroup)->getSizeOfInterval(),
tree->getParticleGroup(idxGroup)->getNbParticlesInGroup()),
......@@ -1484,7 +1484,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, l2pTaskNames.get(),
#else
STARPU_NAME, taskNames.print("L2P_nb%d_i%lld_p%lld",
STARPU_NAME, taskNames.print("L2P", "nb%d_i%lld_p%lld",
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getSizeOfInterval(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNbParticlesInGroup()),
......
......@@ -14,12 +14,18 @@
class FStarPUTaskNameParams{
protected:
std::list<const char*> names;
FILE* fout;
int taskid;
public:
FStarPUTaskNameParams(){
FStarPUTaskNameParams() : fout(nullptr), taskid(0){
const char* fname = getenv("SCALFMM_SIMGRIDOUT")?getenv("SCALFMM_SIMGRIDOUT"):"/tmp/scalfmm.out";
fout = fopen(fname, "w");
std::cout << "output task name in " << fname << "\n";
}
~FStarPUTaskNameParams(){
fclose(fout);
clear();
}
......@@ -31,22 +37,30 @@ public:
}
template <typename ... Params>
const char* print(const char format[], Params... args ){
const char* print(const char key[], const char format[], Params... args ){
const size_t length = 512;
char* name = new char[length+1];
snprintf(name, length, format, args...);
snprintf(name, length, "%s_%d", key, taskid++);
name[length] = '\0';
names.push_back(name);
fprintf(fout, "%s=", name);
fprintf(fout, format, args...);
return name;
}
const char* add(const char* strToCpy){
const size_t length = strlen(strToCpy);
char* cpy = new char[length+1];
memcpy(cpy, length, strToCpy, length);
cpy[length] = '\0';
names.push_back(cpy);
return cpy;
const char* add(const char key[], const char* strToCpy){
const size_t length = 512;
char* name = new char[length+1];
snprintf(name, length, "%s_%d", key, taskid++);
name[length] = '\0';
names.push_back(name);
fprintf(fout, "%s=", name);
fprintf(fout, strToCpy);
return name;
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment