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 rank;
|
|
|
|
extern int rankOffset;
|
|
|
|
extern int verbose;
|
|
|
|
extern MPI_Comm testComm;
|
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
|
2019-07-28 20:17:11 +03:00
|
|
|
#define ERROR_LOCATION __func__
|
2018-07-07 16:01:11 +03:00
|
|
|
|
2019-07-28 20:17:11 +03:00
|
|
|
|
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);
|
|
|
|
|
2021-03-18 23:42:50 +03:00
|
|
|
ior_dataPacketType_e parsePacketType(char t);
|
|
|
|
void update_write_memory_pattern(uint64_t item, char * buf, size_t bytes, int rand_seed, int rank, ior_dataPacketType_e dataPacketType);
|
|
|
|
void generate_memory_pattern(char * buf, size_t bytes, int rand_seed, int rank, ior_dataPacketType_e dataPacketType);
|
2021-01-22 17:05:58 +03:00
|
|
|
/* check a data buffer, @return 0 if all is correct, otherwise 1 */
|
2021-03-18 23:42:50 +03:00
|
|
|
int verify_memory_pattern(uint64_t item, char * buffer, size_t bytes, int rand_seed, int pretendRank, ior_dataPacketType_e dataPacketType);
|
2021-01-22 17:05:58 +03:00
|
|
|
|
2011-11-12 04:40:45 +04:00
|
|
|
char *CurrentTimeString(void);
|
|
|
|
int Regex(char *, char *);
|
2020-11-09 19:23:34 +03:00
|
|
|
void ShowFileSystemSize(char * filename, const struct ior_aiori * backend, void * backend_options);
|
2011-11-12 04:40:45 +04:00
|
|
|
void DumpBuffer(void *, size_t);
|
|
|
|
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);
|
2019-08-01 03:42:03 +03:00
|
|
|
int QueryNodeMapping(MPI_Comm comm, int print_nodemap);
|
2019-08-31 01:45:03 +03:00
|
|
|
int GetNumNodes(MPI_Comm);
|
|
|
|
int GetNumTasks(MPI_Comm);
|
|
|
|
int GetNumTasksOnNode0(MPI_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 */
|
2021-01-20 17:06:05 +03:00
|
|
|
int64_t ReadStoneWallingIterations(char * const filename, MPI_Comm com);
|
2018-07-07 16:01:11 +03:00
|
|
|
void StoreStoneWallingIterations(char * const filename, int64_t count);
|
|
|
|
|
2021-01-20 17:06:05 +03:00
|
|
|
void init_clock(MPI_Comm com);
|
2018-07-07 12:29:27 +03:00
|
|
|
double GetTimeStamp(void);
|
2018-07-07 16:01:11 +03:00
|
|
|
char * PrintTimestamp(); // TODO remove this function
|
2019-11-05 17:37:54 +03:00
|
|
|
unsigned long GetProcessorAndCore(int *chip, int *core);
|
2021-02-18 13:40:42 +03:00
|
|
|
void *aligned_buffer_alloc(size_t size, ior_memory_flags type);
|
|
|
|
void aligned_buffer_free(void *buf, ior_memory_flags type);
|
2011-11-12 04:40:45 +04:00
|
|
|
#endif /* !_UTILITIES_H */
|