Commit bcb9cfc8 authored by Nick's avatar Nick
Browse files

Use pre-existing tools to detect file existence.

parent 6305992f
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "adios2/core/IO.h" #include "adios2/core/IO.h"
#include "adios2/helper/adiosCommDummy.h" #include "adios2/helper/adiosCommDummy.h"
#include "adios2/helper/adiosFunctions.h" //InquireKey, BroadcastFile #include "adios2/helper/adiosFunctions.h" //InquireKey, BroadcastFile
#include <adios2sys/SystemTools.hxx>
// OPERATORS // OPERATORS
...@@ -65,8 +66,7 @@ ADIOS::ADIOS(const std::string configFile, helper::Comm comm, ...@@ -65,8 +66,7 @@ ADIOS::ADIOS(const std::string configFile, helper::Comm comm,
{ {
if (!configFile.empty()) if (!configFile.empty())
{ {
std::ifstream f(configFile.c_str()); if (!adios2sys::SystemTools::FileExists(configFile))
if (!f.good())
{ {
throw std::logic_error("Config file " + configFile + throw std::logic_error("Config file " + configFile +
" passed to ADIOS does not exist."); " passed to ADIOS does not exist.");
......
...@@ -10,10 +10,8 @@ int main(int argc, char *argv[]) ...@@ -10,10 +10,8 @@ int main(int argc, char *argv[])
{ {
int rank = 0; int rank = 0;
#ifdef ADIOS2_HAVE_MPI #ifdef ADIOS2_HAVE_MPI
int size = 1;
MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
#endif #endif
adios2::ADIOS ad; adios2::ADIOS ad;
try try
......
Supports Markdown
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