Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
6bbef50d
Commit
6bbef50d
authored
Jun 24, 2011
by
Deike Kleberg
Browse files
make all tests run
parent
ca7f6b61
Changes
14
Hide whitespace changes
Inline
Side-by-side
pioExamples/collectData.c
View file @
6bbef50d
...
...
@@ -144,11 +144,9 @@ int main (int argc, char *argv[])
MPI_Comm_set_errhandler
(
commGlob
,
MPI_ERRORS_RETURN
);
MPI_Comm_size
(
commGlob
,
&
sizeGlob
);
MPI_Comm_rank
(
commGlob
,
&
rankGlob
);
if
(
!
TEST_LOCAL
)
if
(
nProcsIO
<=
0
||
nProcsIO
>
(
float
)
sizeGlob
/
2
.
0
)
pcdiAbort
(
"bad distribution of tasks on PEs"
,
__FILE__
,
__func__
,
__LINE__
);
if
(
nProcsIO
<=
0
||
nProcsIO
>=
sizeGlob
)
xabort
(
"bad distribution of tasks on PEs"
);
commModel
=
pioInit_c
(
commGlob
,
nProcsIO
,
0
);
#endif
...
...
pioExamples/compareResourcesArray.c
View file @
6bbef50d
...
...
@@ -28,7 +28,7 @@ extern void arrayDestroy ( void );
#define nlev 5 // Number of levels
#define ntsteps 3 // Number of time steps
static
int
hasLocalFile
[]
=
{
0
,
1
};
static
int
hasLocalFile
[]
=
{
0
,
0
};
double
lons
[
nlon
]
=
{
0
,
30
,
60
,
90
,
120
,
150
,
180
,
210
,
240
,
270
,
300
,
330
};
double
lats
[
nlat
]
=
{
-
75
,
-
45
,
-
15
,
15
,
45
,
75
};
...
...
@@ -158,7 +158,6 @@ int defineVlist ( int gridID, int zaxisID, int taxisID )
vlistDefVarName
(
vlistID
,
varID2
,
"varname2"
);
vlistDefAttTxt
(
vlistID
,
varID2
,
"txt demo"
,
6
,
"banana"
);
vlistDefTaxis
(
vlistID
,
taxisID
);
return
vlistID
;
}
...
...
pioExamples/myModel.c
View file @
6bbef50d
...
...
@@ -78,8 +78,6 @@ void modelRun ()
int
rank
;
if
(
ddebug
>=
3
)
xdebug
();
#ifdef USE_MPI
namespaceInit
(
2
,
hlf
);
namespaceSetActive
(
0
);
...
...
@@ -222,7 +220,6 @@ void modelRun ()
zaxisDestroy
(
zaxisID1
);
zaxisDestroy
(
zaxisID2
);
gridDestroy
(
gridID
);
return
;
}
...
...
@@ -233,22 +230,15 @@ int main (int argc, char *argv[])
#ifdef USE_MPI
MPI_Comm
commGlob
,
commModel
;
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_dup
(
MPI_COMM_WORLD
,
&
commGlob
);
MPI_Comm_set_errhandler
(
commGlob
,
MPI_ERRORS_RETURN
);
MPI_Comm_size
(
commGlob
,
&
sizeGlob
);
MPI_Comm_rank
(
commGlob
,
&
rankGlob
);
if
(
nProcsIO
<=
0
||
nProcsIO
>=
sizeGlob
)
xabort
(
"bad distribution of tasks on PEs"
);
if
(
!
TEST_LOCAL
)
if
(
nProcsIO
<=
0
||
nProcsIO
>=
(
float
)
sizeGlob
/
2
.
0
)
pcdiAbort
(
"bad distribution of tasks on PEs"
,
__FILE__
,
__func__
,
__LINE__
);
#endif
xdebug
();
#ifdef USE_MPI
commModel
=
pioInit_c
(
commGlob
,
nProcsIO
,
0
);
#endif
...
...
src/cdi.h
View file @
6bbef50d
...
...
@@ -203,7 +203,8 @@ extern "C" {
#define PIO_POSIX_FPGUARD_THREAD_REFUSE 5
#define PIO_POSIX_FPGUARD_THREAD 6
#define TEST_LOCAL 0
//#define TEST_LOCAL 0
// set to 1 if running compareResourceArray with one PE
int
pioInit
(
int
,
int
,
int
);
...
...
@@ -216,7 +217,7 @@ void namespaceSetActive ( int );
void
gridGetIndexArray
(
int
,
int
*
);
void
streamGetIndexArray
(
int
,
int
*
);
void
zaxisGetIndexA
t
rray
(
int
,
int
*
);
void
zaxisGetIndexArray
(
int
,
int
*
);
void
vlistDefVarIOrank
(
int
,
int
,
int
);
int
vlistInqVarIOrank
(
int
,
int
);
...
...
src/cgribexlib.c
View file @
6bbef50d
...
...
@@ -18,6 +18,8 @@
#include
"calendar.h"
#include
"timebase.h"
#include
"pio_util.h"
#ifndef _GRIB_INT_H
#define _GRIB_INT_H
...
...
src/file.c
View file @
6bbef50d
...
...
@@ -25,6 +25,8 @@ size_t getpagesize(void);
#include
"pio.h"
#include
"cdi.h"
#include
"namespace.h"
#include
"pio_util.h"
extern
pioInfo
*
pioinfo
;
#endif
...
...
@@ -1066,15 +1068,12 @@ int fileOpen(const char *filename, const char *mode)
bfile_t
*
fileptr
=
NULL
;
/* begin deike */
if
(
!
namespaceHasLocalFile
(
namespaceGetActive
()))
return
0
;
#ifdef USE_MPI
if
(
!
TEST_LOCAL
)
if
(
memcmp
(
mode
,
"w"
,
1
)
==
0
&&
pioinfo
->
type
!=
PIO_NONE
)
return
pioFileOpenW
(
filename
);
#endif
/* end deike */
/* end deike */
FILE_INIT
...
...
@@ -1166,10 +1165,7 @@ int fileClose(int fileID)
bfile_t
*
fileptr
;
/* begin deike */
if
(
!
namespaceHasLocalFile
(
namespaceGetActive
()))
return
0
;
#ifdef USE_MPI
if
(
!
TEST_LOCAL
)
if
(
pioinfo
->
type
!=
PIO_NONE
)
return
pioFileClose
(
fileID
);
#endif
...
...
src/grid.c
View file @
6bbef50d
...
...
@@ -51,11 +51,11 @@ char *Grids[] = {
static
int
gridCompareP
(
void
*
gridptr1
,
void
*
gridptr2
);
static
void
gridDestroyP
(
void
*
gridptr
);
static
void
gridPrintP
(
void
*
gridptr
,
FILE
*
fp
);
static
int
gridTxCode
(
void
);
#ifdef USE_MPI
static
int
gridGetPackSize
(
void
*
gridptr
,
MPI_Comm
comm
);
static
void
gridPack
(
void
*
gridptr
,
void
*
buff
,
int
size
,
int
*
position
,
MPI_Comm
comm
);
static
int
gridTxCode
(
void
);
#endif
resOps
gridOps
=
{
gridCompareP
,
gridDestroyP
,
gridPrintP
...
...
@@ -4160,6 +4160,7 @@ void gridGetIndexArray ( int ngrids, int * gridIndexArray )
reshGetResHArrayOfType
(
ngrids
,
gridIndexArray
,
&
gridOps
);
}
#ifdef USE_MPI
static
int
...
...
@@ -4168,7 +4169,6 @@ gridTxCode ()
return
GRID
;
}
enum
{
gridNint
=
26
,
gridNdouble
=
24
,
gridNstrings
=
8
,
...
...
src/pio_rpc.c
View file @
6bbef50d
...
...
@@ -119,7 +119,6 @@ void streamUnpack ( char * unpackBuffer, int unpackBufferSize,
intBuffer
,
streamNint
,
MPI_INT
,
comm
));
xmpi
(
MPI_Unpack
(
unpackBuffer
,
unpackBufferSize
,
unpackBufferPos
,
&
d
,
1
,
MPI_DOUBLE
,
comm
));
if
(
xchecksum
(
DATATYPE_INT
,
streamNint
,
intBuffer
)
!=
d
)
xabort
(
""
);
xmpi
(
MPI_Unpack
(
unpackBuffer
,
unpackBufferSize
,
unpackBufferPos
,
...
...
src/resource_handle.c
View file @
6bbef50d
#if defined (HAVE_CONFIG_H)
# include "config.h"
#endif
#include
<stdlib.h>
#include
<stdio.h>
#include
<assert.h>
...
...
@@ -544,6 +548,8 @@ int reshArrayCompare ( int nsp0, int nsp1 )
int
i
,
valCompare
;
node
*
node0
,
*
node1
;
#ifdef USE_MPI
assert
(
arrayInit
&&
namespaceGetNumber
()
>
xmaxInt
(
nsp0
,
nsp1
)
&&
xminInt
(
nsp0
,
nsp1
)
>=
0
);
...
...
@@ -591,6 +597,8 @@ int reshArrayCompare ( int nsp0, int nsp1 )
xdebug
();
return
differ
;
}
#endif
return
equal
;
}
...
...
src/stream.c
View file @
6bbef50d
...
...
@@ -621,7 +621,6 @@ int streamOpen(const char *filename, const char *filemode, int filetype)
case
FILETYPE_GRB
:
case
FILETYPE_GRB2
:
{
xdebug
();
fileID
=
gribOpen
(
filename
,
filemode
);
record
=
(
Record
*
)
malloc
(
sizeof
(
Record
));
record
->
buffer
=
NULL
;
...
...
src/stream_grb.c
View file @
6bbef50d
...
...
@@ -578,24 +578,6 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
if
(
streamptr
->
comptype
==
COMPRESS_SZIP
)
nbytes
=
grbSzip
(
filetype
,
gribbuffer
,
nbytes
);
/* begin deike */
if
(
!
namespaceHasLocalFile
(
namespaceGetActive
()))
return
0
;
#ifdef USE_MPI
if
(
!
TEST_LOCAL
)
{
if
(
pioinfo
->
type
!=
PIO_NONE
)
nwrite
=
pioFileWrite
(
fileID
,
tsID
,
gribbuffer
,
nbytes
);
}
else
nwrite
=
fileWrite
(
fileID
,
gribbuffer
,
nbytes
);
#else
nwrite
=
fileWrite
(
fileID
,
gribbuffer
,
nbytes
);
#endif
/* end deike */
if
(
nwrite
!=
nbytes
)
perror
(
__func__
);
if
(
gribbuffer
)
free
(
gribbuffer
);
...
...
src/stream_int.c
View file @
6bbef50d
...
...
@@ -80,7 +80,7 @@ resOps streamOps = { streamCompareP, streamDestroyP, streamPrintP,
#ifdef USE_MPI
streamGetPackSize
,
streamPack
,
streamTxCode
,
streamTxCode
#endif
};
...
...
src/vlist_var.c
View file @
6bbef50d
...
...
@@ -5,7 +5,6 @@
#include
<limits.h>
#ifdef USE_MPI
#include
<mpi.h>
#include
"pio_util.h"
#endif
#include
"dmemory.h"
...
...
@@ -15,6 +14,7 @@
#include
"resource_handle.h"
#include
"vlist_att.h"
#include
"namespace.h"
#include
"pio_util.h"
extern
resOps
vlist_ops
;
...
...
@@ -1761,8 +1761,6 @@ void vlistVarPack(vlist_t *p, int varID, char * buf, int size, int *position,
var_t
*
var
=
p
->
vars
+
varID
;
int
tempbuf
[
vlistvar_nints
],
namesz
,
longnamesz
,
stdnamesz
,
unitssz
,
i
;
xdebug
(
"var->iorank=%d"
,
var
->
iorank
);
tempbuf
[
0
]
=
var
->
flag
;
tempbuf
[
1
]
=
var
->
gridID
;
tempbuf
[
2
]
=
var
->
zaxisID
;
...
...
src/zaxis.c
View file @
6bbef50d
...
...
@@ -14,7 +14,7 @@
#include
"resource_handle.h"
#include
"pio_rpc.h"
#include
"varscan.h"
#include
"namespace.h"
#define LevelUp 1
#define LevelDown 2
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment