2012-01-09 00:51:04 +04:00
|
|
|
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
|
|
|
|
* vim:expandtab:shiftwidth=8:tabstop=8:
|
|
|
|
*/
|
2011-11-12 04:40:45 +04:00
|
|
|
/******************************************************************************\
|
|
|
|
* *
|
|
|
|
* Copyright (c) 2003, The Regents of the University of California *
|
|
|
|
* See the file COPYRIGHT for a complete copyright notice and license. *
|
|
|
|
* *
|
|
|
|
\******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _UTILITIES_H
|
|
|
|
#define _UTILITIES_H
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
2014-09-18 21:20:37 +04:00
|
|
|
# include "config.h"
|
2011-11-12 04:40:45 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <mpi.h>
|
|
|
|
#include "ior.h"
|
|
|
|
|
2018-07-07 12:29:27 +03:00
|
|
|
extern int numTasksWorld;
|
|
|
|
extern int rank;
|
|
|
|
extern int rankOffset;
|
|
|
|
extern int tasksPerNode;
|
|
|
|
extern int verbose;
|
|
|
|
extern MPI_Comm testComm;
|
|
|
|
extern MPI_Comm mpi_comm_world;
|
|
|
|
extern FILE * out_logfile;
|
2018-07-08 15:47:55 +03:00
|
|
|
extern FILE * out_resultfile;
|
2018-07-08 15:07:32 +03:00
|
|
|
extern enum OutputFormat_t outputFormat; /* format of the output */
|
2018-07-07 12:29:27 +03:00
|
|
|
|
2018-07-08 00:39:14 +03:00
|
|
|
/*
|
|
|
|
* Try using the system's PATH_MAX, which is what realpath and such use.
|
|
|
|
*/
|
|
|
|
#define MAX_PATHLEN PATH_MAX
|
|
|
|
|
|
|
|
|
2018-07-07 16:01:11 +03:00
|
|
|
#ifdef __linux__
|
2019-07-28 20:17:11 +03:00
|
|
|
#define ERROR_LOCATION __func__
|
2018-07-07 16:01:11 +03:00
|
|
|
#else
|
2019-07-28 20:17:11 +03:00
|
|
|
#define ERROR_LOCATION __LINE__
|
2018-07-07 16:01:11 +03:00
|
|
|
#endif
|
|
|
|
|
2019-07-28 20:17:11 +03:00
|
|
|
#define FAIL(...) FailMessage(rank, ERROR_LOCATION, __VA_ARGS__)
|
|
|
|
void FailMessage(int rank, const char *location, char *format, ...);
|
|
|
|
|
2019-03-27 23:04:48 +03:00
|
|
|
void* safeMalloc(uint64_t size);
|
2014-09-18 21:20:37 +04:00
|
|
|
void set_o_direct_flag(int *fd);
|
|
|
|
|
2011-11-12 04:40:45 +04:00
|
|
|
char *CurrentTimeString(void);
|
|
|
|
int Regex(char *, char *);
|
|
|
|
void ShowFileSystemSize(char *);
|
|
|
|
void DumpBuffer(void *, size_t);
|
|
|
|
void SeedRandGen(MPI_Comm);
|
|
|
|
void SetHints (MPI_Info *, char *);
|
|
|
|
void ShowHints (MPI_Info *);
|
2018-07-08 15:38:05 +03:00
|
|
|
char *HumanReadable(IOR_offset_t value, int base);
|
2018-07-08 00:19:42 +03:00
|
|
|
int CountTasksPerNode(MPI_Comm comm);
|
2019-07-26 17:55:24 +03:00
|
|
|
int QueryNodeMapping(MPI_Comm comm);
|
2018-07-08 00:26:57 +03:00
|
|
|
void DelaySecs(int delay);
|
2019-03-27 23:04:48 +03:00
|
|
|
void updateParsedOptions(IOR_param_t * options, options_all_t * global_options);
|
|
|
|
size_t NodeMemoryStringToBytes(char *size_str);
|
2011-11-12 04:40:45 +04:00
|
|
|
|
2018-07-07 16:01:11 +03:00
|
|
|
/* Returns -1, if cannot be read */
|
|
|
|
int64_t ReadStoneWallingIterations(char * const filename);
|
|
|
|
void StoreStoneWallingIterations(char * const filename, int64_t count);
|
|
|
|
|
2018-07-07 12:29:27 +03:00
|
|
|
void init_clock(void);
|
|
|
|
double GetTimeStamp(void);
|
2018-07-07 16:01:11 +03:00
|
|
|
char * PrintTimestamp(); // TODO remove this function
|
2018-07-07 12:29:27 +03:00
|
|
|
|
|
|
|
extern double wall_clock_deviation;
|
|
|
|
extern double wall_clock_delta;
|
2011-11-12 04:40:45 +04:00
|
|
|
#endif /* !_UTILITIES_H */
|