Added parallel gadget loader to saturate I/O
This commit is contained in:
parent
8b9b72ca82
commit
5e55b263a1
2 changed files with 79 additions and 1 deletions
29
python/safe_gadget.hpp
Normal file
29
python/safe_gadget.hpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue