mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
MPI-Parallel output of profiler
This commit is contained in:
parent
69363e7ff2
commit
4aa7e76bd1
@ -35,6 +35,17 @@ namespace ngcore
|
||||
fclose(prof); // NOLINT
|
||||
}
|
||||
|
||||
if (getenv ("NGPROFILE"))
|
||||
{
|
||||
std::string filename = "netgen.prof";
|
||||
#ifdef PARALLEL
|
||||
filename += "."+ToString(id);
|
||||
#endif
|
||||
if (id == 0) logger->info( "write profile to file {}", filename );
|
||||
FILE *prof = fopen(filename.c_str(),"w"); // NOLINT
|
||||
Print (prof);
|
||||
fclose(prof); // NOLINT
|
||||
}
|
||||
}
|
||||
|
||||
void NgProfiler :: Print (FILE * prof)
|
||||
|
@ -8,6 +8,9 @@
|
||||
|
||||
namespace ngcore
|
||||
{
|
||||
// parallel netgen
|
||||
int id = 0, ntasks = 1;
|
||||
|
||||
#ifdef WIN32
|
||||
// windows does demangling in typeid(T).name()
|
||||
NGCORE_API std::string Demangle(const char* typeinfo) { return typeinfo; }
|
||||
|
@ -15,6 +15,9 @@
|
||||
|
||||
namespace ngcore
|
||||
{
|
||||
// MPI rank, nranks TODO: Rename
|
||||
extern NGCORE_API int id, ntasks;
|
||||
|
||||
NGCORE_API std::string Demangle(const char* typeinfo);
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
@ -14,9 +14,8 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
|
||||
extern DLL_HEADER int id, ntasks;
|
||||
|
||||
using ngcore::id;
|
||||
using ngcore::ntasks;
|
||||
|
||||
#ifdef PARALLEL
|
||||
|
||||
|
@ -4,14 +4,11 @@
|
||||
// #include <ostream>
|
||||
// #include <mystdlib.h>
|
||||
// #include <meshing.hpp>
|
||||
#include "mpi_interface.hpp"
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
|
||||
#ifdef PARALLEL
|
||||
extern int id;
|
||||
extern int ntasks;
|
||||
#endif
|
||||
DLL_HEADER extern int printmessage_importance;
|
||||
DLL_HEADER extern int printdots;
|
||||
|
||||
|
@ -50,10 +50,6 @@ namespace netgen
|
||||
|
||||
string ngdir = ".";
|
||||
|
||||
// parallel netgen
|
||||
int id = 0, ntasks = 1;
|
||||
|
||||
|
||||
void Ng_PrintDest(const char * s)
|
||||
{
|
||||
if (id == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user