Commit cd3568f2 authored by BRAMAS Berenger's avatar BRAMAS Berenger

update simgrid task name system

parent a5616c5d
...@@ -1018,7 +1018,7 @@ protected: ...@@ -1018,7 +1018,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, p2mTaskNames.get(), STARPU_NAME, p2mTaskNames.get(),
#else #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)->getNumberOfCellsInBlock(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getSizeOfInterval(), tree->getCellGroup(tree->getHeight()-1,idxGroup)->getSizeOfInterval(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNbParticlesInGroup()), tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNbParticlesInGroup()),
...@@ -1080,7 +1080,7 @@ protected: ...@@ -1080,7 +1080,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task->name = m2mTaskNames[idxLevel].get(); task->name = m2mTaskNames[idxLevel].get();
#else #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, idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(), tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(),
...@@ -1127,7 +1127,7 @@ protected: ...@@ -1127,7 +1127,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task->name = m2mTaskNames[idxLevel].get(); task->name = m2mTaskNames[idxLevel].get();
#else #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, idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(), tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(),
...@@ -1170,7 +1170,7 @@ protected: ...@@ -1170,7 +1170,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, m2lTaskNames[idxLevel].get(), STARPU_NAME, m2lTaskNames[idxLevel].get(),
#else #else
STARPU_NAME, taskNames.print("M2L_l%d_nb%d_i%lld", STARPU_NAME, taskNames.print("M2L", "l%d_nb%d_i%lld",
idxLevel, idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval()), tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval()),
...@@ -1205,7 +1205,7 @@ protected: ...@@ -1205,7 +1205,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, m2lOuterTaskNames[idxLevel].get(), STARPU_NAME, m2lOuterTaskNames[idxLevel].get(),
#else #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, idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(), tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(),
...@@ -1234,7 +1234,7 @@ protected: ...@@ -1234,7 +1234,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, m2lOuterTaskNames[idxLevel].get(), STARPU_NAME, m2lOuterTaskNames[idxLevel].get(),
#else #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, idxLevel,
tree->getCellGroup(idxLevel,interactionid)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,interactionid)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,interactionid)->getSizeOfInterval(), tree->getCellGroup(idxLevel,interactionid)->getSizeOfInterval(),
...@@ -1307,7 +1307,7 @@ protected: ...@@ -1307,7 +1307,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task->name = l2lTaskNames[idxLevel].get(); task->name = l2lTaskNames[idxLevel].get();
#else #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, idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(), tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(),
...@@ -1357,7 +1357,7 @@ protected: ...@@ -1357,7 +1357,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
task->name = l2lTaskNames[idxLevel].get(); task->name = l2lTaskNames[idxLevel].get();
#else #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, idxLevel,
tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(), tree->getCellGroup(idxLevel,idxGroup)->getNumberOfCellsInBlock(),
tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(), tree->getCellGroup(idxLevel,idxGroup)->getSizeOfInterval(),
...@@ -1410,7 +1410,7 @@ protected: ...@@ -1410,7 +1410,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, p2pOuterTaskNames.get(), STARPU_NAME, p2pOuterTaskNames.get(),
#else #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)->getNumberOfLeavesInBlock(),
tree->getParticleGroup(idxGroup)->getSizeOfInterval(), tree->getParticleGroup(idxGroup)->getSizeOfInterval(),
tree->getParticleGroup(idxGroup)->getNbParticlesInGroup(), tree->getParticleGroup(idxGroup)->getNbParticlesInGroup(),
...@@ -1442,7 +1442,7 @@ protected: ...@@ -1442,7 +1442,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, p2pTaskNames.get(), STARPU_NAME, p2pTaskNames.get(),
#else #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)->getNumberOfLeavesInBlock(),
tree->getParticleGroup(idxGroup)->getSizeOfInterval(), tree->getParticleGroup(idxGroup)->getSizeOfInterval(),
tree->getParticleGroup(idxGroup)->getNbParticlesInGroup()), tree->getParticleGroup(idxGroup)->getNbParticlesInGroup()),
...@@ -1484,7 +1484,7 @@ protected: ...@@ -1484,7 +1484,7 @@ protected:
#ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS #ifndef SCALFMM_SIMGRID_TASKNAMEPARAMS
STARPU_NAME, l2pTaskNames.get(), STARPU_NAME, l2pTaskNames.get(),
#else #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)->getNumberOfCellsInBlock(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getSizeOfInterval(), tree->getCellGroup(tree->getHeight()-1,idxGroup)->getSizeOfInterval(),
tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNbParticlesInGroup()), tree->getCellGroup(tree->getHeight()-1,idxGroup)->getNbParticlesInGroup()),
......
...@@ -14,12 +14,18 @@ ...@@ -14,12 +14,18 @@
class FStarPUTaskNameParams{ class FStarPUTaskNameParams{
protected: protected:
std::list<const char*> names; std::list<const char*> names;
FILE* fout;
int taskid;
public: 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(){ ~FStarPUTaskNameParams(){
fclose(fout);
clear(); clear();
} }
...@@ -31,22 +37,30 @@ public: ...@@ -31,22 +37,30 @@ public:
} }
template <typename ... Params> 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; const size_t length = 512;
char* name = new char[length+1]; char* name = new char[length+1];
snprintf(name, length, format, args...); snprintf(name, length, "%s_%d", key, taskid++);
name[length] = '\0'; name[length] = '\0';
names.push_back(name); names.push_back(name);
fprintf(fout, "%s=", name);
fprintf(fout, format, args...);
return name; return name;
} }
const char* add(const char* strToCpy){ const char* add(const char key[], const char* strToCpy){
const size_t length = strlen(strToCpy); const size_t length = 512;
char* cpy = new char[length+1]; char* name = new char[length+1];
memcpy(cpy, length, strToCpy, length); snprintf(name, length, "%s_%d", key, taskid++);
cpy[length] = '\0'; name[length] = '\0';
names.push_back(cpy); names.push_back(name);
return cpy;
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