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
e7ccd25b
Commit
e7ccd25b
authored
Apr 08, 2011
by
Deike Kleberg
Browse files
Let configure define USE_MPI in case MPI is available.
parent
d2de7a65
Changes
17
Hide whitespace changes
Inline
Side-by-side
configure
View file @
e7ccd25b
...
...
@@ -24005,14 +24005,13 @@ else
enable_mpi=no
fi
if test "${enable_mpi}" = "yes"; then :
if test "${host_os%???}" = "aix"; then :
replace_cc="mpicc"
else
replace_cc="mpcc_r"
if test x"${enable_mpi}" = x"yes"; then :
USE_MPI=yes
fi
else
replace_cc=$CC
if test x"$USE_MPI" = xyes; then :
$as_echo "#define USE_MPI 1" >>confdefs.h
fi
# ----------------------------------------------------------------------
# Create the Fortran Interface via iso_c_binding module (Fortran 2003 Standard)
...
...
@@ -24398,10 +24397,6 @@ fi
if test "x${replace_cc}" != "x"; then :
CC=$replace_cc
fi
ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings"
cat >confcache <<\_ACEOF
...
...
configure.ac
View file @
e7ccd25b
...
...
@@ -107,11 +107,10 @@ ACX_OPTIONS
# ----------------------------------------------------------------------
# Compile with MPI support
AC_ARG_ENABLE(mpi,AS_HELP_STRING([--enable-mpi],[Compile with MPI compiler [default=no]]),enable_mpi=${enableval},enable_mpi=no)
AS_IF([test "${enable_mpi}" = "yes"],
[AS_IF([test "${host_os%???}" = "aix"],
[replace_cc="mpicc"],
[replace_cc="mpcc_r"])],
[replace_cc=$CC])
AS_IF([test x"${enable_mpi}" = x"yes"],
[USE_MPI=yes])
AS_IF([test x"$USE_MPI" = xyes],
[AC_DEFINE([USE_MPI],[1],[parallel I/O requested and available])])
# ----------------------------------------------------------------------
# Create the Fortran Interface via iso_c_binding module (Fortran 2003 Standard)
AC_ARG_ENABLE(iso-c-interface,
...
...
@@ -181,8 +180,6 @@ ACX_CHECK_CFINT([$srcdir/src/cfortran.h])
AC_SUBST([CPPFLAGS])
AS_IF([test "x${replace_cc}" != "x"],[CC=$replace_cc])
AC_OUTPUT(Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings)
# ----------------------------------------------------------------------
...
...
src/config.h.in
View file @
e7ccd25b
...
...
@@ -161,6 +161,9 @@
/* User name */
#undef USER_NAME
/* parallel I/O requested and available */
#undef USE_MPI
/* Version number of package */
#undef VERSION
...
...
src/file.c
View file @
e7ccd25b
...
...
@@ -21,7 +21,7 @@ size_t getpagesize(void);
/* begin deike */
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
"pio.h"
#include
"cdi.h"
extern
pioInfo
*
pioinfo
;
...
...
@@ -1066,7 +1066,7 @@ int fileOpen(const char *filename, const char *mode)
bfile_t
*
fileptr
=
NULL
;
/* begin deike */
#if
n
def
NO
MPI
#ifdef
USE_
MPI
if
(
memcmp
(
mode
,
"w"
,
1
)
==
0
&&
pioinfo
->
type
!=
PIO_NONE
)
return
pioFileOpenW
(
filename
);
#endif
...
...
@@ -1161,7 +1161,7 @@ int fileClose(int fileID)
bfile_t
*
fileptr
;
/* begin deike */
#if
n
def
NO
MPI
#ifdef
USE_
MPI
if
(
pioinfo
->
type
!=
PIO_NONE
)
return
pioFileClose
(
fileID
);
#endif
...
...
src/make_cdilib
View file @
e7ccd25b
...
...
@@ -50,7 +50,7 @@ cat > ${PROG} << EOR
#include <aio.h>
#endif
#include <stdbool.h>
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include "mpi.h"
#endif
#include <assert.h>
...
...
src/pio.c
View file @
e7ccd25b
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include
<stdbool.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<unistd.h>
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
"mpi.h"
#include
"cdi.h"
...
...
@@ -15,7 +19,7 @@
bool
ddebug
=
false
;
#if
n
def
NO
MPI
#ifdef
USE_
MPI
char
*
command2charP
[
6
]
=
{
"IO_Open_file"
,
"IO_Close_file"
,
"IO_Get_fp"
,
"IO_Set_fp"
,
...
...
@@ -347,7 +351,7 @@ void setPioCommunicator ( MPI_Comm *myComm, MPI_Comm commF2C, int *color,
int
pioInit
(
int
ptype
,
int
commF
,
int
*
color
,
int
*
nnodes
,
int
*
pioCollComm2F
)
{
#if
n
def
NO
MPI
#ifdef
USE_
MPI
MPI_Comm
comm
;
int
size
,
rank
;
#endif
...
...
@@ -356,7 +360,7 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
*
color
=
1
;
*
pioCollComm2F
=
0
;
#if
n
def
NO
MPI
#ifdef
USE_
MPI
comm
=
MPI_COMM_NULL
;
...
...
@@ -442,7 +446,7 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
void
pioFinalize
()
{
#if
n
def
NO
MPI
#ifdef
USE_
MPI
switch
(
pioinfo
->
type
)
{
case
PIO_POSIX_FPGUARD_THREAD
:
...
...
src/pio.h
View file @
e7ccd25b
#ifndef _PIO_H
#define _PIO_H
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include
<stdlib.h>
#include
"mpi.h"
...
...
src/pio_dbuffer.c
View file @
e7ccd25b
#define _XOPEN_SOURCE 600
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include
<stdlib.h>
#include
<stdio.h>
#include
<stdbool.h>
...
...
@@ -7,7 +11,7 @@
#include
<unistd.h>
#include
<string.h>
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
"pio_impl.h"
bool
ldebug
=
true
;
...
...
src/pio_impl.h
View file @
e7ccd25b
#ifndef _PIO_IMPL_H
#define _PIO_IMPL_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include
<stdbool.h>
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
"mpi.h"
typedef
enum
...
...
src/pio_mpinonb.c
View file @
e7ccd25b
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include
<stdbool.h>
#include
<stdio.h>
...
...
src/pio_posixasynch.c
View file @
e7ccd25b
...
...
@@ -2,8 +2,12 @@
todo
README: specialRank Pe closes down, when all output files are closed
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#ifndef _SX
#include
<stdbool.h>
...
...
src/pio_posixfpguardsendrecv.c
View file @
e7ccd25b
...
...
@@ -4,7 +4,11 @@
( pioOpenFile member name, recv in tmpbuffer, if(!uniqueName(q,v,n))abort )
*/
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include
<stdio.h>
#include
<stdbool.h>
...
...
src/pio_posixfpguardthread.c
View file @
e7ccd25b
...
...
@@ -4,8 +4,11 @@
mutexes for each filedatas offset
mutex for queue
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
<pthread.h>
#include
<stdlib.h>
...
...
src/pio_posixfpguardthreadrefuse.c
View file @
e7ccd25b
...
...
@@ -12,7 +12,11 @@
change condition to refuse of message ( without hard coding )
*/
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include
<pthread.h>
#include
<stdlib.h>
...
...
src/pio_posixnonb.c
View file @
e7ccd25b
//pio_posixnonb.c:693: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
<stdbool.h>
#include
<stdio.h>
...
...
src/pio_queue.c
View file @
e7ccd25b
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include
<stdbool.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<stdarg.h>
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
"pio_impl.h"
queue
*
queueInit
(
valDestroyFunction
vD
,
keyCompareFunction
kC
)
...
...
src/stream_grb.c
View file @
e7ccd25b
#if
def
ined (
HAVE_CONFIG_H
)
#ifdef
HAVE_CONFIG_H
# include "config.h"
#endif
...
...
@@ -66,7 +66,7 @@ int grib2ltypeToZaxisType(int grib_ltype)
/* begin deike */
#if
n
def
NO
MPI
#ifdef
USE_
MPI
#include
"pio.h"
extern
pioInfo
*
pioinfo
;
#endif
...
...
@@ -579,7 +579,7 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
/* begin deike */
#if
n
def
NO
MPI
#ifdef
USE_
MPI
if
(
pioinfo
->
type
!=
PIO_NONE
)
nwrite
=
pioFileWrite
(
fileID
,
tsID
,
gribbuffer
,
nbytes
);
else
...
...
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