7 #include <boost/functional/hash.hpp>
67 xiosStack=getin<bool>(
"xios_stack",
true) ;
69 if (xiosStack && systemStack)
76 StdString bufOpt = getin<StdString>(
"optimal_buffer_size", bufPerformance);
77 std::transform(bufOpt.begin(), bufOpt.end(), bufOpt.begin(), ::tolower);
79 else if (0 != bufOpt.compare(bufPerformance))
81 ERROR(
"CXios::parseXiosConfig()", <<
"optimal_buffer_size must be memory or performance "<< endl );
85 minBufferSize = getin<int>(
"min_buffer_size", 1024 *
sizeof(double));
86 maxBufferSize = getin<int>(
"max_buffer_size", std::numeric_limits<int>::max());
88 if (recvFieldTimeout < 0.0)
89 ERROR(
"CXios::parseXiosConfig()",
"recv_field_timeout cannot be negative.");
114 isServer = !usingServer;
141 #ifdef XIOS_MEMTRACK_LIGHT
142 report(10) <<
" Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<
" Mbyte" << endl ;
143 report(10) <<
" Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<
" Mbyte" << endl ;
146 #ifdef XIOS_MEMTRACK_FULL
147 MemTrack::TrackListMemoryUsage() ;
148 MemTrack::TrackDumpBlocks();
160 std::set<StdString> parseList;
161 parseList.insert(
"xios");
223 int firstPoolGlobalRank = secondaryServerGlobalRanks[0];
231 for (
int i=1; i<secondaryServerGlobalRanks.size(); i++)
233 if (rankGlobal == secondaryServerGlobalRanks[i])
236 int registrySize = globalRegistrySndServers.
size();
239 globalRegistrySndServers.
toBuffer(buffer) ;
245 if (rankGlobal == firstPoolGlobalRank)
252 for (
int i=1; i< secondaryServerGlobalRanks.size(); i++)
254 int rank = secondaryServerGlobalRanks[i];
255 int registrySize = 0;
257 recvBuff =
new char[registrySize];
258 MPI_Recv(recvBuff, registrySize, MPI_CHAR, rank, 15,
CXios::globalComm, &status);
259 CBufferIn buffer(recvBuff, registrySize) ;
266 info(80)<<
"Write data base Registry"<<endl<<globalRegistrySndServers.
toString()<<endl ;
267 globalRegistrySndServers.
toFile(
"xios_registry.bin") ;
277 #ifdef XIOS_MEMTRACK_LIGHT
278 report(10) <<
" Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<
" Mbyte" << endl ;
279 report(10) <<
" Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<
" Mbyte" << endl ;
282 #ifdef XIOS_MEMTRACK_FULL
283 MemTrack::TrackListMemoryUsage() ;
284 MemTrack::TrackDumpBlocks();
static bool isClient
Check if xios is client.
bool toBuffer(CBufferOut &buffer) const
static void initServer()
Initialize server (if any)
static void initialize(const string &codeId, MPI_Comm &localComm, MPI_Comm &returnComm)
static bool checkEventSync
For debuuging, check if event are coherent and synchrone on client side.
static const double defaultBufferSizeFactor
Default factor value.
static void openErrorStream()
Write the error log to standard error output.
static double bufferSizeFactor
Factor used to tune the buffer size.
static int nbPoolsServer2
Number of pools created on the secondary server.
static bool isOptPerformance
Check if buffer size is for performance (as large as possible)
static string rootFile
Configuration filename.
string toString(void) const
static bool systemStack
Exception handling.
static bool usingServer2
Using secondary server (server mode).
static void parseFile(const string &filename)
Parse configuration file.
static void ParseFile(const StdString &filename, const std::set< StdString > &parseList=std::set< StdString >())
////////////////////// Définitions ////////////////////// ///
static double recvFieldTimeout
Time to wait for data before issuing an error when receiving a field.
static CRegistry * globalRegistry
global registry which is wrote by the root process of the servers
static bool usingServer
Using server (server mode)
static MPI_Comm globalComm
Global communicator.
void mergeRegistry(const CRegistry &inRegistry)
static bool xiosStack
Exception handling.
static void initialize(void)
Creates intraComm for each possible type of servers (classical, primary or secondary).
static int getRank()
Get rank of the current process in the intraComm.
static string clientFile
Filename template for client.
static void setNotUsingServer()
Setting xios NOT to use server mode.
void toFile(const string &filename)
This class is a registry database which store key with an associated value.
CATCH CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar *scalarDestination, CScalar *scalarSource, CReduceScalarToScalar *algo ERROR)("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",<< "Operation must be defined."<< "Scalar source "<< scalarSource->getId()<< std::endl<< "Scalar destination "<< scalarDestination->getId())
static void closeInfoStream()
Close the info logs file if it opens.
static void initServerSide(void)
Initialize server then put it into listening state.
static void openErrorStream()
Write the error log to standard error output.
static void initialize(void)
Parse configuration file and create some objects from it.
static StdSize minBufferSize
Minimum buffer size.
static string xiosCodeId
Identity for XIOS.
static void openInfoStream()
Write the info logs to standard output.
static void eventLoop(void)
static bool printLogs2Files
Printing out logs into files.
static int getRank()
Get global rank without oasis and current rank in model intraComm in case of oasis.
static void initClientSide(const string &codeId, MPI_Comm &localComm, MPI_Comm &returnComm)
Initialize client.
static bool isServer
Check if xios is server.
static bool usingOasis
Using Oasis.
static MPI_Comm intraComm
static void finalize(void)
static void parseXiosConfig()
Parse only Xios part of configuration file.
static StdSize maxBufferSize
Maximum buffer size.
static string serverFile
Filename template for server.
static void setUsingServer()
Setting xios to use server mode.
static void clientFinalize(void)
static void openInfoStream()
Write the info logs to standard output.
static int ratioServer2
Percentage of server processors dedicated to secondary server.
bool fromBuffer(CBufferIn &buffer)
static void closeInfoStream()
Close the info logs file if it opens.
static string serverPrmFile
Filename template for primary server in case of two server levels.
static string serverSndFile
Filename template for secondary server in case of two server levels.
static void finalize(void)
static vector< int > & getSecondaryServerGlobalRanks()