Added parallel gadget loader to saturate I/O

This commit is contained in:
Guilhem Lavaux 2014-11-20 14:45:00 +01:00
parent 8b9b72ca82
commit 5e55b263a1
2 changed files with 79 additions and 1 deletions

29
python/safe_gadget.hpp Normal file
View file

@ -0,0 +1,29 @@
#include "config.hpp"
#include "loadGadget.hpp"
#include <string>
static inline
CosmoTool::SimuData *loadGadgetMulti_safe(const std::string& fname, int flags)
{
try
{
return CosmoTool::loadGadgetMulti(fname.c_str(), -1, flags);
}
catch (const CosmoTool::Exception& e)
{
return 0;
}
}
static inline
CosmoTool::SimuData **alloc_simudata(int n)
{
return new CosmoTool::SimuData *[n];
}
static inline
void del_simudata(CosmoTool::SimuData **s)
{
delete[] s;
}