Commit f05696f9 authored by Luka Stanisic's avatar Luka Stanisic

SCALFMM_SIMGRID_TASKNAMEPARAMS option is no longer needed, as we automatized many things

parent 32ab9b95
......@@ -97,7 +97,6 @@ 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)
......
#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;
FILE* fout;
int taskid;
public:
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();
}
void clear(){
while(names.size()){
delete[] names.front();
names.pop_front();
}
}
template <typename ... Params>
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, "%s-%d", key, taskid++);
name[length] = '\0';
names.push_back(name);
fprintf(fout, "%s, %d, ", key, taskid);
fprintf(fout, format, args...);
return name;
}
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;
}
};
#endif // FSTARPUTASKNAMEPARAMS_HPP
......@@ -163,6 +163,5 @@ const std::string SCALFMMCompileLibs("@SCALFMM_COMPILE_LIBS@");
///////////////////////////////////////////////////////
#cmakedefine SCALFMM_SIMGRID_NODATA
#cmakedefine SCALFMM_SIMGRID_TASKNAMEPARAMS
#endif // CONFIG_H
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