1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Fixed wrong meta data correction and added macros for sample size

This commit is contained in:
Dennis Potter 2018-10-11 14:18:30 +02:00
parent d88c59aab4
commit ed3a27fefd
3 changed files with 8 additions and 5 deletions

View file

@ -36,7 +36,7 @@
#include <rdma/rdma_cma.h>
/* Constants */
#define META_SIZE 32
#define META_SIZE 24
#define GRH_SIZE 40
#define META_GRH_SIZE META_SIZE + GRH_SIZE
#define CHK_PER_ITER 2048

View file

@ -44,6 +44,9 @@ struct pool;
/** The length of a sample data portion of a sample datastructure with \p values values in bytes. */
#define SAMPLE_DATA_LENGTH(len) ((len) * sizeof(double))
/** The number of values in a sample datastructure. */
#define SAMPLE_NUMBER_OF_VALUES(len) ((len) / sizeof(double))
/** The offset to the beginning of the data section. */
#define SAMPLE_DATA_OFFSET(smp) ((char *) (smp) + offsetof(struct sample, data))

View file

@ -852,7 +852,7 @@ int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *relea
debug(LOG_IB | 10, "Succesfully posted receive Work Requests");
// Doesn't start, if wcs == 0
// Doesn't start if wcs == 0
for (int j = 0; j < wcs; j++) {
if ( !( (wc[j].opcode & IBV_WC_RECV) && wc[j].status == IBV_WC_SUCCESS) ) {
// Drop all values, we don't know where the error occured
@ -872,11 +872,11 @@ int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *relea
smps[j] = (struct sample *) (wc[j].wr_id);
smps[j]->length = (wc[j].byte_len - correction) / sizeof(double);
smps[j]->length = SAMPLE_NUMBER_OF_VALUES(wc[j].byte_len - correction);
smps[j]->ts.received = ts_receive;
smps[j]->flags = (SAMPLE_HAS_TS_ORIGIN | SAMPLE_HAS_TS_RECEIVED | SAMPLE_HAS_SEQUENCE);
}
}
return read_values;
}
@ -922,7 +922,7 @@ int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele
// Actual Payload
sge[sent][j].addr = (uint64_t) &smps[sent]->data;
sge[sent][j].length = smps[sent]->length*sizeof(double);
sge[sent][j].length = SAMPLE_DATA_LENGTH(smps[sent]->length);
sge[sent][j].lkey = mr->lkey;
j++;