Commit 838342a6 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Fix trailing whitespace.

parent 393d2063
This diff is collapsed.
......@@ -19,8 +19,8 @@ int MCH = UNDEFID;
typedef struct
{
int self;
int used;
int center;
int used;
int center;
int subcenter;
char *name;
char *longname;
......@@ -56,7 +56,7 @@ institute_t * instituteNewEntry ( void )
institute_t *instituteptr;
instituteptr = ( institute_t * ) xmalloc ( sizeof ( institute_t ));
instituteDefaultValue ( instituteptr );
instituteptr->self = reshPut (( void * ) instituteptr, &instituteOps );
instituteptr->used = 1;
......@@ -91,14 +91,14 @@ void instituteInit (void)
if ( instituteInitialized ) return;
instituteInitialized = 1;
instituteInitialized = 1;
instituteDefaultEntries();
}
int instituteCount ( void )
{
{
return reshCountType ( &instituteOps );
}
......@@ -112,28 +112,28 @@ int instituteCompareKernel ( institute_t * ip1, institute_t * ip2 )
{
if ( ip1->center > 0 && ip2->center != ip1->center ) differ = 1;
if ( ip1->subcenter > 0 && ip2->subcenter != ip1->subcenter ) differ = 1;
if ( !differ )
{
if ( ip2->name )
{
len = strlen(ip2->name);
if ( memcmp(ip2->name, ip1->name, len)) differ = 1;
}
}
{
if ( ip2->name )
{
len = strlen(ip2->name);
if ( memcmp(ip2->name, ip1->name, len)) differ = 1;
}
}
}
else if ( ip1->longname )
{
if ( ip2->longname )
{
len = strlen(ip2->longname);
if ( memcmp(ip2->longname, ip1->longname, len)) differ = 1;
}
{
len = strlen(ip2->longname);
if ( memcmp(ip2->longname, ip1->longname, len)) differ = 1;
}
}
else
{
if ( !( ip2->center == ip1->center &&
ip2->subcenter == ip1->subcenter )) differ = 1;
ip2->subcenter == ip1->subcenter )) differ = 1;
}
return differ;
......@@ -202,7 +202,7 @@ int institutDef(int center, int subcenter, const char *name, const char *longnam
instituteInit ();
instituteptr = instituteNewEntry();
instituteptr->center = center;
instituteptr->subcenter = subcenter;
if ( name ) instituteptr->name = strdupx(name);
......@@ -270,16 +270,16 @@ int institutInqNumber(void)
instCount = reshCountType ( &instituteOps );
instIndice = xmalloc ( instCount * sizeof ( int ));
reshGetIndiceArrayOfType ( instCount, instIndice, &instituteOps );
for ( i = 0; i < instCount; i++ )
{
instituteptr = ( institute_t * ) reshGetVal ( instIndice[i], &instituteOps );
if ( instituteptr && instituteptr->used )
instNum++;
instNum++;
}
if ( instIndice ) free ( instIndice );
return instNum;
}
......@@ -308,7 +308,7 @@ void institutePrintP ( void * instituteptr )
fprintf ( fp, "#\n");
fprintf ( fp, "# instituteID %d\n", ip->self);
fprintf ( fp, "#\n");
fprintf ( fp, "#\n");
fprintf ( fp, "self = %d\n", ip->self );
fprintf ( fp, "used = %d\n", ip->used );
fprintf ( fp, "center = %d\n", ip->center );
......@@ -323,7 +323,7 @@ static
size_t instituteGetSizeP ( void * instituteptr )
{
xdebug ();
return 0;
return 0;
}
......
......@@ -416,7 +416,7 @@ long bibBFiledataPFAccess ( aFiledataPFT* afd, int id )
amount = dbuffer_data_size ( afd->db );
if ( ddebug )
fprintf ( stdout,
fprintf ( stdout,
"pe%d in bibBFiledataPFAccess(), id=%d, amount=%ld, "
"command=%d(%s)\n",
pioinfo->rank, id, amount, afd->command,
......
......@@ -38,15 +38,15 @@ void queueDestroy ( queue *q )
if ( q->head )
{
curr = q->head;
curr = q->head;
while ( curr )
{
succ = curr->next;
( *( q->valDestroy )) ( curr->val );
free ( curr );
curr = succ;
}
{
succ = curr->next;
( *( q->valDestroy )) ( curr->val );
free ( curr );
curr = succ;
}
}
free ( q );
......@@ -61,26 +61,26 @@ int queuePush ( queue *q, void *v, int noCollector, ... )
int id = CDI_UNDEFID;
va_start(ap, noCollector);
if ( noCollector )
if ( noCollector )
id = va_arg( ap, int );
va_end(ap);
// ensure unique key values
curr = q->head;
curr = q->head;
while ( curr )
{
{
if (( !noCollector && ( *( q->keyCompare )) ( v, curr->val )) ||
( noCollector && ( id == curr->idx )))
return -1;
( noCollector && ( id == curr->idx )))
return -1;
curr = curr->next;
}
if (( newNode = ( node * ) malloc (sizeof ( node ))) == NULL )
}
if (( newNode = ( node * ) malloc (sizeof ( node ))) == NULL )
{
perror ( "pio_queue: queuePush (): Not enough memory" );
return 1;
......@@ -89,25 +89,25 @@ int queuePush ( queue *q, void *v, int noCollector, ... )
newNode->idx = noCollector ? id : q->count;
newNode->val = v;
newNode->next = NULL;
if ( q->tail != NULL)
q->tail->next = newNode;
else
q->head = newNode;
q->tail = newNode;
q->tail = newNode;
q->count ++;
return newNode->idx;
}
void *queueIdx2val ( queue *q, int id )
{
node *curr;
curr = q->head;
while ( curr )
{
if ( curr->idx == id ) break;
......
......@@ -23,7 +23,7 @@
#define MAXLEVEL 10
#define MAXLEVELIDX 10
#define MAXRECORDS 10
#define MAXRECIDS 10
#define MAXRECIDS 10
#define MAXVARS 10
#define MAXTSTEPS 10
#define MAXFNAMES 10
......@@ -36,7 +36,7 @@
#define ddebug MAXDEBUG
typedef enum
typedef enum
{
FINALIZE,
METADATA
......@@ -74,18 +74,18 @@ void pcdiXMPIStat ( int, const char *, int, MPI_Status * );
#define xmpiStat(ret,stat) pcdiXMPIStat ( ret, __FILE__, __LINE__, stat )
void pcdiDebugComm ( const char *filename, const char *functionname, int line, \
MPI_Comm *comm );
MPI_Comm *comm );
#define xdebugComm(comm) pcdiDebugComm ( __FILE__, __func__, __LINE__, comm )
#endif
void pcdiDebugMsg ( const char *filename, const char *functionname, int line, \
int tag, int source, int nfinished );
int tag, int source, int nfinished );
#define xdebugMsg(tag,source,nfinished) pcdiDebugMsg ( __FILE__, __func__, \
__LINE__, tag, source,\
nfinished )
__LINE__, tag, source,\
nfinished )
void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line, \
int tag, int source, char * text );
int tag, int source, char * text );
#define xdebugMsg2(tag,source,text) pcdiDebugMsg ( __FILE__, __func__, \
__LINE__, tag, source, text )
__LINE__, tag, source, text )
#endif
......@@ -96,9 +96,9 @@ void arrayInitPointer ( void )
{
arrayResources[i][j].idx = namespaceIdxEncode2 ( i, j );
arrayResources[i][j].next = arrayResources[i] + j + 1;
arrayResources[i][j].ops = NULL;
arrayResources[i][j].ptr = NULL;
arrayResources[i][j].sent = 0;
arrayResources[i][j].ops = NULL;
arrayResources[i][j].ptr = NULL;
arrayResources[i][j].sent = 0;
}
arrayResources[i][arraySizeAllocated[i]-1].next = NULL;
......@@ -111,7 +111,7 @@ void arrayInitPointer ( void )
/**************************************************************/
static
static
void arrayDestroy ( void )
{
int i;
......@@ -119,8 +119,8 @@ void arrayDestroy ( void )
if ( arrayResources )
{
for ( i = 0; i < namespaceGetNumber (); i++ )
if ( arrayResources[i] )
free ( arrayResources[i] );
if ( arrayResources[i] )
free ( arrayResources[i] );
free ( arrayResources );
}
......@@ -171,7 +171,7 @@ void arraySizeExtend()
xrealloc(arrayResources[nsp], newArraySize * sizeof (arrayResources[0][0]));
for ( i = arraySizeAllocated[nsp]; i < newArraySize; ++i )
{
{
arrayResources[nsp][i].idx = namespaceIdxEncode2 ( nsp, i );
arrayResources[nsp][i].next = arrayResources[nsp] + i + 1;
}
......@@ -232,10 +232,10 @@ void reshRemove ( cdiResH idx, resOps * ops )
nspT = namespaceIdxDecode ( idx );
assert ( nspT.nsp == nsp &&
nspT.idx >= 0 &&
nspT.idx < arraySizeAllocated[nsp] &&
arrayResources[nsp][nspT.idx].ops &&
arrayResources[nsp][nspT.idx].ops == ops );
nspT.idx >= 0 &&
nspT.idx < arraySizeAllocated[nsp] &&
arrayResources[nsp][nspT.idx].ops &&
arrayResources[nsp][nspT.idx].ops == ops );
arrayResources[nsp][nspT.idx].next = freeListHead[nsp];
arrayResources[nsp][nspT.idx].ops = NULL;
......@@ -264,17 +264,17 @@ void *reshGetVal ( cdiResH idx, resOps * ops )
nspT = namespaceIdxDecode ( idx );
assert ( arrayInit &&
nspT.nsp == nsp &&
nspT.idx >= 0 &&
nspT.idx < arraySizeAllocated[nsp] );
assert ( arrayInit &&
nspT.nsp == nsp &&
nspT.idx >= 0 &&
nspT.idx < arraySizeAllocated[nsp] );
node = arrayResources[nsp] + nspT.idx;
ARRAY_UNLOCK ();
assert ( node &&
node->ops == ops );
node->ops == ops );
return node->ptr;
}
......@@ -288,19 +288,19 @@ void reshGetIndiceArrayOfType ( int c, int * indice, resOps * ops )
int i, j = 0, nsp;
assert ( arrayInit && indice && ops );
ARRAY_LOCK();
nsp = namespaceGetActive ();
for ( i = 0; i < arraySizeAllocated[nsp]; i++ )
if ( arrayResources[nsp][i].ptr && arrayResources[nsp][i].ops )
if ( arrayResources[nsp][i].ptr && arrayResources[nsp][i].ops )
if ( arrayResources[nsp][i].ops == ops )
{
indice[j++] = i;
if ( j == c ) break;
}
{
indice[j++] = i;
if ( j == c ) break;
}
ARRAY_UNLOCK();
}
......@@ -315,18 +315,18 @@ int reshCountType ( resOps * ops )
assert ( ops );
if ( !( arrayInit && ops )) return 0;
ARRAY_LOCK();
nsp = namespaceGetActive ();
for ( i = 0; i < arraySizeAllocated[nsp]; i++ )
if ( arrayResources[nsp][i].ptr )
if ( arrayResources[nsp][i].ptr )
if ( arrayResources[nsp][i].ops == ops )
countType++;
countType++;
ARRAY_UNLOCK();
return countType;
}
......@@ -341,21 +341,21 @@ size_t getPackBufferSize ()
node * curr;
nsp = namespaceGetActive ();
for ( i = 0; i < arraySizeAllocated[nsp]; i++ )
if ( arrayResources[nsp][i].ptr )
if ( arrayResources[nsp][i].ptr )
if ( ! arrayResources[nsp][i].sent )
{
curr = arrayResources[nsp] + i;
assert ( curr->ops );
{
curr = arrayResources[nsp] + i;
assert ( curr->ops );
if ( curr->ops != &gridOps )
continue;
size += curr->ops->valGetSize (( void * ) curr->ptr ) +
( 2 * sizeof ( int ));
}
if ( curr->ops != &gridOps )
continue;
size += curr->ops->valGetSize (( void * ) curr->ptr ) +
( 2 * sizeof ( int ));
}
return size;
}
......@@ -381,16 +381,16 @@ void reshPackBufferCreate ( char ** buffer, size_t * size, MPI_Comm comm )
xdebug ();
assert ( buffer );
ARRAY_LOCK();
nsp = namespaceGetActive ();
* size = getPackBufferSize () + sizeof ( int ) ;
* buffer = xcalloc ( 1, * size );
for ( i = 0; i < arraySizeAllocated[nsp]; i++ )
if ( arrayResources[nsp][i].ptr )
if ( arrayResources[nsp][i].ptr )
if ( ! arrayResources[nsp][i].sent )
{
curr = arrayResources[nsp] + i;
......@@ -418,10 +418,10 @@ void reshPackBufferCreate ( char ** buffer, size_t * size, MPI_Comm comm )
MPI_Pack ( &end, 1, MPI_INT, * buffer, * size, &position, comm );
xdebug ( "#### packed END token" );
xdebug ( "#### packed END token" );
}
#endif
#endif
void reshLock ()
......@@ -449,38 +449,38 @@ void reshArrayPrint ()
xdebug();
fprintf ( stdout, "arrayInit=%d\n", arrayInit );
if ( ! arrayInit ) return;
temp = namespaceGetActive ();
fprintf ( stdout, "\n\n##########################################\n#\n# print " \
"global resource array \n#\n" );
"global resource array \n#\n" );
for ( i = 0; i < namespaceGetNumber (); i++ )
{
namespaceSetActive ( i );
fprintf ( stdout, "\n" );
fprintf ( stdout, "##################################\n" );
fprintf ( stdout, "#\n" );
fprintf ( stdout, "# namespace=%d\n", i );
fprintf ( stdout, "#\n" );
fprintf ( stdout, "##################################\n\n" );
for ( j = 0; j < arraySizeAllocated[i]; j++)
{
curr = arrayResources[i] + j;
if ( curr->ops && curr->ptr )
{
curr->ops->valPrint (( void * ) curr->ptr );
fprintf ( stdout, "\n" );
}
}
{
curr = arrayResources[i] + j;
if ( curr->ops && curr->ptr )
{
curr->ops->valPrint (( void * ) curr->ptr );
fprintf ( stdout, "\n" );
}
}
}
fprintf ( stdout, "#\n# end global resource array" \
"\n#\n##########################################\n\n" );
"\n#\n##########################################\n\n" );
namespaceSetActive ( temp );
}
......@@ -56,6 +56,6 @@ void reshPackBufferDestroy ( char ** );
void reshLock ( void );
void reshUnlock ( void );
void reshUnlock ( void );
#endif
......@@ -568,7 +568,7 @@ static
size_t streamGetSizeP ( void * streamptr )
{
xdebug ();
return 0;
return 0;
}
......
This diff is collapsed.
......@@ -116,7 +116,7 @@ void zaxisInit (void)
if ( zaxisInitialized ) return;
zaxisInitialized = 1;
zaxisInitialized = 1;
env = getenv("ZAXIS_DEBUG");
if ( env ) ZAXIS_Debug = atoi(env);
......@@ -635,7 +635,7 @@ const double *zaxisInqLevelsPtr(int zaxisID)
@Parameter
@Item zaxisID Z-axis ID, from a previous call to @fref{zaxisCreate}
@Item levels Levels of the Z-axis
@Description
The function @func{zaxisInqLevels} returns all levels of a Z-axis.
......@@ -674,8 +674,8 @@ int zaxisInqLbounds(int zaxisID, double *lbounds)
size = zaxisptr->size;
if ( lbounds )
for ( i = 0; i < size; i++ )
lbounds[i] = zaxisptr->lbounds[i];
for ( i = 0; i < size; i++ )
lbounds[i] = zaxisptr->lbounds[i];
}
return (size);
......@@ -697,8 +697,8 @@ int zaxisInqUbounds(int zaxisID, double *ubounds)
size = zaxisptr->size;
if ( ubounds )
for ( i = 0; i < size; i++ )
ubounds[i] = zaxisptr->ubounds[i];
for ( i = 0; i < size; i++ )
ubounds[i] = zaxisptr->ubounds[i];
}
return (size);
......@@ -720,8 +720,8 @@ int zaxisInqWeights(int zaxisID, double *weights)
size = zaxisptr->size;
if ( weights )
for ( i = 0; i < size; i++ )
weights[i] = zaxisptr->weights[i];
for ( i = 0; i < size; i++ )
weights[i] = zaxisptr->weights[i];
}
return (size);
......@@ -816,43 +816,43 @@ void cdiCheckZaxis(int zaxisID)
zaxis_t *zaxisptr;
zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
zaxis_check_ptr(zaxisID, zaxisptr);
if ( zaxisInqType(zaxisID) == ZAXIS_GENERIC )
{
size = zaxisptr->size;
if ( size > 1 )
{
/* check direction */
if ( zaxisptr->direction == CDI_UNDEFID )
{
found = 0;
for ( i = 1; i < size; i++ )
if ( zaxisptr->vals[i] > zaxisptr->vals[i-1] )
found++;
if ( found == size-1 )
{
zaxisptr->direction = LevelUp;
}
else
{
found = 0;
for ( i = 1; i < size; i++ )
if ( zaxisptr->vals[i] < zaxisptr->vals[i-1] )
found++;
if ( found == size-1 )
{
zaxisptr->direction = LevelDown;
}
}
}
/* check consistent */
if ( zaxisptr->direction == CDI_UNDEFID )
{