Commit 6b47c312 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Inline trivial functions.

parent 2cb83ebe
......@@ -29,10 +29,6 @@ long initial_buffersize = 16 * 1024 * 1024;
/* 16 * 1024; */
/* 4 * 1024; */
enum {
tagKey = 100,
};
double accumProbe = 0.0;
double accumRecv = 0.0;
double accumSend = 0.0;
......@@ -44,25 +40,6 @@ char *token = "%";
/***************************************************************/
int encodeFileOpTag(int ID, int sc)
{
return ID * tagKey + sc;
}
/***************************************************************/
struct fileOpTag decodeFileOpTag(int tag)
{
struct fileOpTag rtag;
rtag.id = tag / tagKey;
rtag.command = tag % tagKey;
return rtag;
}
/***************************************************************/
size_t
cdiPioFileWrite(int fileID, const void *restrict buffer, size_t len, int tsID)
{
......
......@@ -9,15 +9,17 @@
#include <mpi.h>
typedef enum
enum IO_Server_command
{
IO_Open_file,
IO_Close_file,
IO_Get_fp,
IO_Set_fp,
IO_Send_buffer,
IO_Finalize
} IO_Server_command;
IO_Finalize,
tagKey = 8, /* should be power of 2, must be
* larger than IO_Finalize */
};
struct dBuffer
{
......@@ -38,8 +40,20 @@ struct fileOpTag
};
/* pio.c */
int encodeFileOpTag(int fileID, int command);
struct fileOpTag decodeFileOpTag(int);
static inline int
encodeFileOpTag(int fileID, int command)
{
return fileID * tagKey + command;
}
static inline struct fileOpTag
decodeFileOpTag(int tag)
{
struct fileOpTag rtag = { .id = tag / tagKey,
.command = tag % tagKey };
return rtag;
}
/* pio_dbuffer.c */
int dbuffer_init ( struct dBuffer **, size_t );
......
......@@ -31,7 +31,7 @@ typedef struct
struct dBuffer *db2;
struct dBuffer *db;
FILE *fp;
IO_Server_command command;
enum IO_Server_command command;
int tsID, fileID;
char name[];
} aFiledataPF;
......
......@@ -22,7 +22,7 @@ typedef struct
struct dBuffer *db1;
struct dBuffer *db2;
struct dBuffer *db;
IO_Server_command command;
enum IO_Server_command command;
MPI_Request request;
int tsID, fileID;
char name[];
......
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