Commit 09a812de authored by Rainer Weinberger's avatar Rainer Weinberger

Bugfix in OUTPUT_XDMF option: xdmf file needs to contain relative path from...

Bugfix in OUTPUT_XDMF option: xdmf file needs to contain relative path from itself to hdf5 file, not from executable directory.
parent d14202c9
......@@ -74,6 +74,10 @@
#include <time.h>
#include <unistd.h>
#ifdef OUTPUT_XDMF
#include <libgen.h> /* for basename() function */
#endif /* #ifdef OUTPUT_XDMF */
#include "../main/allvars.h"
#include "../main/proto.h"
......@@ -93,6 +97,10 @@ void write_dataset_attributes(hid_t hdf5_dataset, enum iofields blocknr);
static char alternative_fname[MAXLEN_PATH];
#endif /* #ifdef TOLERATE_WRITE_ERROR */
#ifdef OUTPUT_XDMF
static void write_xdmf(char *fname);
#endif /* #ifdef OUTPUT_XDMF */
static int n_type[NTYPES]; /**< contains the local (for a single task) number of particles of each type in the snapshot file */
static long long ntot_type_all[NTYPES]; /**< contains the global number of particles of each type in the snapshot file */
static int subbox_dump = 0;
......@@ -1921,7 +1929,7 @@ void write_dataset_attributes(hid_t hdf5_dataset, enum iofields blocknr)
*
* \return void
*/
void write_xdmf(char *fname)
static void write_xdmf(char *fname)
{
FILE *f;
char buf[256], buf2[256];
......@@ -1945,8 +1953,9 @@ void write_xdmf(char *fname)
fprintf(f, "<Xdmf Version=\"2.0\">\n");
fprintf(f, " <Domain>");
sprintf(buf, "%s.hdf5", fname);
/* hdf5 file path relative to xmf file, uses basename function of libgen.h,
* i.e. POSIX version of basename() */
sprintf(buf, "./%s.hdf5", basename(fname));
int type = 0;
for(; type < NTYPES; type++)
{
......
Markdown is supported
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