Commit c02b2f69 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Merge branch 'develop' of git.mpimet.mpg.de:cdo into develop

parents fb4717c4 04ee03f5
# Makefile.in generated by automake 1.14 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -14,7 +14,17 @@ ...@@ -14,7 +14,17 @@
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \ am__make_running_with_option = \
case $${target_option-} in \ case $${target_option-} in \
?) ;; \ ?) ;; \
...@@ -78,19 +88,6 @@ POST_UNINSTALL = : ...@@ -78,19 +88,6 @@ POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
subdir = . subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(top_srcdir)/config/mkinstalldirs $(srcdir)/cdo.spec.in \
$(srcdir)/cdo.settings.in AUTHORS COPYING ChangeLog INSTALL \
NEWS README config/ar-lib config/compile config/config.guess \
config/config.sub config/depcomp config/install-sh \
config/missing config/mkinstalldirs config/ltmain.sh \
$(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
$(top_srcdir)/config/config.guess \
$(top_srcdir)/config/config.sub \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
$(top_srcdir)/config/missing \
$(top_srcdir)/config/tap-driver.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
...@@ -101,6 +98,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \ ...@@ -101,6 +98,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
...@@ -163,6 +162,18 @@ ETAGS = etags ...@@ -163,6 +162,18 @@ ETAGS = etags
CTAGS = ctags CTAGS = ctags
CSCOPE = cscope CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/cdo.settings.in \
$(srcdir)/cdo.spec.in $(top_srcdir)/config/ar-lib \
$(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
$(top_srcdir)/config/config.sub \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
$(top_srcdir)/config/missing \
$(top_srcdir)/config/mkinstalldirs \
$(top_srcdir)/config/tap-driver.sh AUTHORS COPYING ChangeLog \
INSTALL NEWS README config/ar-lib config/compile \
config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing \
config/mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION) distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir) top_distdir = $(distdir)
...@@ -407,7 +418,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi ...@@ -407,7 +418,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
...@@ -611,7 +621,7 @@ distdir: $(DISTFILES) ...@@ -611,7 +621,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)" || chmod -R a+r "$(distdir)"
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-bzip2: distdir dist-bzip2: distdir
...@@ -627,17 +637,17 @@ dist-xz: distdir ...@@ -627,17 +637,17 @@ dist-xz: distdir
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-tarZ: distdir dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \ @echo WARNING: "Support for distribution archives compressed with" \
"deprecated." >&2 "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-shar: distdir dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \ @echo WARNING: "Support for shar distribution archives is" \
"legacy program 'compress' is deprecated." >&2 "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zip: distdir dist-zip: distdir
...@@ -655,7 +665,7 @@ dist dist-all: ...@@ -655,7 +665,7 @@ dist dist-all:
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \ *.tar.lz*) \
...@@ -665,22 +675,23 @@ distcheck: dist ...@@ -665,22 +675,23 @@ distcheck: dist
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac
chmod -R a-w $(distdir) chmod -R a-w $(distdir)
chmod u+w $(distdir) chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir) chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \ test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \ && am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \ && $(am__cd) $(distdir)/_build/sub \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) check \
...@@ -857,6 +868,8 @@ uninstall-am: ...@@ -857,6 +868,8 @@ uninstall-am:
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
......
...@@ -162,6 +162,7 @@ libcdo_la_SOURCES = \ ...@@ -162,6 +162,7 @@ libcdo_la_SOURCES = \
uthash.h \ uthash.h \
util.cc \ util.cc \
util.h \ util.h \
varlist.h \
zaxis_print.cc \ zaxis_print.cc \
zaxis.cc zaxis.cc
libcdo_la_SOURCES += \ libcdo_la_SOURCES += \
......
# Makefile.in generated by automake 1.14 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
   
# Copyright (C) 1994-2013 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
   
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -16,7 +16,17 @@ ...@@ -16,7 +16,17 @@
   
   
VPATH = @srcdir@ VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \ am__make_running_with_option = \
case $${target_option-} in \ case $${target_option-} in \
?) ;; \ ?) ;; \
...@@ -84,9 +94,6 @@ bin_PROGRAMS = cdo$(EXEEXT) ...@@ -84,9 +94,6 @@ bin_PROGRAMS = cdo$(EXEEXT)
noinst_PROGRAMS = cdotest$(EXEEXT) noinst_PROGRAMS = cdotest$(EXEEXT)
@ENABLE_ALL_STATIC_TRUE@am__append_2 = -all-static @ENABLE_ALL_STATIC_TRUE@am__append_2 = -all-static
subdir = src subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/config.h.in $(top_srcdir)/config/mkinstalldirs \
$(top_srcdir)/config/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
...@@ -97,6 +104,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \ ...@@ -97,6 +104,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_HEADER = config.h CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
...@@ -355,6 +363,9 @@ am__define_uniq_tagged_files = \ ...@@ -355,6 +363,9 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)` done | $(am__uniquify_input)`
ETAGS = etags ETAGS = etags
CTAGS = ctags CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/config/depcomp \
$(top_srcdir)/config/mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
...@@ -569,8 +580,8 @@ libcdo_la_SOURCES = array.h array.cc cdo_int.h compare.h \ ...@@ -569,8 +580,8 @@ libcdo_la_SOURCES = array.h array.cc cdo_int.h compare.h \
remap_bicubic_scrip.cc remap_bilinear_scrip.cc stdnametable.cc \ remap_bicubic_scrip.cc remap_bilinear_scrip.cc stdnametable.cc \
stdnametable.h specspace.cc specspace.h statistic.cc \ stdnametable.h specspace.cc specspace.h statistic.cc \
statistic.h table.cc text.cc text.h timebase.h timer.cc \ statistic.h table.cc text.cc text.h timebase.h timer.cc \
userlog.cc uthash.h util.cc util.h zaxis_print.cc zaxis.cc \ userlog.cc uthash.h util.cc util.h varlist.h zaxis_print.cc \
json/jsmn.h json/jsmn.c kdtreelib/kdtree.h \ zaxis.cc json/jsmn.h json/jsmn.c kdtreelib/kdtree.h \
kdtreelib/kdtree_cartesian.cc kdtreelib/kdtree_common.cc \ kdtreelib/kdtree_cartesian.cc kdtreelib/kdtree_common.cc \
kdtreelib/kdtree_spherical.cc kdtreelib/qsort.cc \ kdtreelib/kdtree_spherical.cc kdtreelib/qsort.cc \
kdtreelib/pmergesort.cc kdtreelib/pqueue.cc kdtreelib/pqueue.h \ kdtreelib/pmergesort.cc kdtreelib/pqueue.cc kdtreelib/pqueue.h \
...@@ -669,7 +680,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi ...@@ -669,7 +680,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile $(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
...@@ -5037,6 +5047,8 @@ uninstall-am: uninstall-binPROGRAMS ...@@ -5037,6 +5047,8 @@ uninstall-am: uninstall-binPROGRAMS
pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-binPROGRAMS
   
.PRECIOUS: Makefile
# #
clean-local: clean-local-dirs clean-local: clean-local-dirs
.PHONY: clean-local-dirs .PHONY: clean-local-dirs
......
...@@ -29,44 +29,10 @@ ...@@ -29,44 +29,10 @@
#include <pthread.h> #include <pthread.h>
#include "pthread_debug.h" #include "pthread_debug.h"
#include "pstream.h"
#endif #endif
typedef struct {
bool check_datarange;
int gridsize;
int datatype;
double missval;
double addoffset;
double scalefactor;
} varlist_t;
typedef struct {
int self;
int mode;
int fileID;
int vlistID;
int tsID;
int filetype;
int tsID0;
int mfiles;
int nfiles;
int varID; /* next varID defined with streamDefVar */
bool ispipe;
bool isopen;
char *name;
char **mfnames;
varlist_t *varlist;
#if defined(HAVE_LIBPTHREAD)
void *argument;
struct pipe_s *pipe;
pthread_t rthreadID; /* read thread ID */
pthread_t wthreadID; /* write thread ID */
#endif
} pstream_t;
#if defined(HAVE_LIBPTHREAD) #if defined(HAVE_LIBPTHREAD)
struct pipe_s { struct pipe_s {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "util.h" #include "util.h"
#include "pstream_int.h" #include "pstream_int.h"
#include "dmemory.h" #include "dmemory.h"
#include "pthread.h"
#if defined(HAVE_LIBPTHREAD) #if defined(HAVE_LIBPTHREAD)
pthread_mutex_t processMutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t processMutex = PTHREAD_MUTEX_INITIALIZER;
...@@ -385,29 +386,6 @@ const char *processOperator(void) ...@@ -385,29 +386,6 @@ const char *processOperator(void)
return Process[processID].xoperator; return Process[processID].xoperator;
} }
static
char *getOperatorArg(const char *xoperator)
{
char *operatorArg = NULL;
if ( xoperator )
{
char *commapos = (char *)strchr(xoperator, ',');
if ( commapos )
{
size_t len = strlen(commapos+1);
if ( len )
{
operatorArg = (char*) Malloc(len+1);
strcpy(operatorArg, commapos+1);
}
}
}
return operatorArg;
}
static int skipInputStreams(int argc, char *argv[], int globArgc, int nstreams); static int skipInputStreams(int argc, char *argv[], int globArgc, int nstreams);
static static
...@@ -1000,3 +978,36 @@ int cdoStreamNumber() ...@@ -1000,3 +978,36 @@ int cdoStreamNumber()
return operatorStreamNumber(Process[processID].operatorName); return operatorStreamNumber(Process[processID].operatorName);
} }
void print_process(int p_process_id)
{
#if defined(HAVE_LIBPTHREAD)
std::cout << " threadID : " << Process[p_process_id].threadID << std::endl;
std::cout << " l_threadID : " << Process[p_process_id].l_threadID << std::endl;
#endif
std::cout << " nchild : " << Process[p_process_id].nchild << std::endl;
std::cout << " nInStream : " << Process[p_process_id].nInStream << std::endl;
std::cout << " nOutStream : " << Process[p_process_id].nOutStream << std::endl;
for(int i = 0; i < Process[p_process_id].nInStream; i++){
std::cout << " " << Process[p_process_id].inputStreams[i] << std::endl;
}
for(int i = 0; i < Process[p_process_id].nOutStream; i++){
std::cout << " " << Process[p_process_id].outputStreams[i] << std::endl;
}
std::cout << " s_utime : " << Process[p_process_id].s_utime << std::endl;
std::cout << " s_stime : " << Process[p_process_id].s_stime << std::endl;
std::cout << " a_utime : " << Process[p_process_id].a_utime << std::endl;
std::cout << " a_stime : " << Process[p_process_id].a_stime << std::endl;
std::cout << " cputime : " << Process[p_process_id].cputime << std::endl;
std::cout << " nvals : " << Process[p_process_id].nvals << std::endl;
std::cout << " nvars : " << Process[p_process_id].nvars << std::endl;
std::cout << " ntimesteps : " << Process[p_process_id].ntimesteps << std::endl;
std::cout << " streamCnt : " << Process[p_process_id].streamCnt << std::endl;
std::cout << " streamNames : " << Process[p_process_id].streamNames << std::endl;
std::cout << " xoperator : " << Process[p_process_id].xoperator << std::endl;
std::cout << " operatorName : " << Process[p_process_id].operatorName << std::endl;
std::cout << " operatorArg : " << Process[p_process_id].operatorArg << std::endl;
std::cout << " oargc : " << Process[p_process_id].oargc << std::endl;
std::cout << " noper : " << Process[p_process_id].noper << std::endl;
}
...@@ -104,4 +104,5 @@ const char *processInqOpername(void); ...@@ -104,4 +104,5 @@ const char *processInqOpername(void);
const char *processInqOpername2(int processID); const char *processInqOpername2(int processID);
const char *processInqPrompt(void); const char *processInqPrompt(void);
void print_process(int p_process_id);
#endif /* _PROCESS_H */ #endif /* _PROCESS_H */
...@@ -290,12 +290,12 @@ static void createPipeName(char *pipename, int pnlen){ ...@@ -290,12 +290,12 @@ static void createPipeName(char *pipename, int pnlen){
snprintf(pipename, pnlen, "(pipe%d.%d)", processSelf() + 1, processInqChildNum() + 1); snprintf(pipename, pnlen, "(pipe%d.%d)", processSelf() + 1, processInqChildNum() + 1);
} }
static pthread_t pCreateReadThread(char *newarg, argument_t *argument, const char *operatorName){ pthread_t pCreateReadThread(argument_t *argument){
pthread_attr_t attr; pthread_attr_t attr;
int status = pthread_attr_init(&attr); int status = pthread_attr_init(&attr);
if ( status ) SysError("pthread_attr_init failed for '%s'", newarg+1); if ( status ) SysError("pthread_attr_init failed for '%s'", argument->operatorName);
status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
if ( status ) SysError("pthread_attr_setdetachstate failed for '%s'", newarg+1); if ( status ) SysError("pthread_attr_setdetachstate failed for '%s'", argument->operatorName);
/* /*
param.sched_priority = 0; param.sched_priority = 0;
status = pthread_attr_setschedparam(&attr, &param); status = pthread_attr_setschedparam(&attr, &param);
...@@ -320,11 +320,11 @@ static pthread_t pCreateReadThread(char *newarg, argument_t *argument, const cha ...@@ -320,11 +320,11 @@ static pthread_t pCreateReadThread(char *newarg, argument_t *argument, const cha
} }
pthread_t thrID; pthread_t thrID;
int rval = pthread_create(&thrID, &attr, operatorModule(operatorName), argument); int rval = pthread_create(&thrID, &attr, operatorModule(argument->operatorName.c_str()), argument);
if ( rval != 0 ) if ( rval != 0 )
{ {
errno = rval; errno = rval;
SysError("pthread_create failed for '%s'", newarg+1); SysError("pthread_create failed for '%s'", argument->operatorName);
} }
return thrID; return thrID;
} }
...@@ -339,9 +339,10 @@ void pstreamOpenReadPipe(const argument_t *argument, pstream_t *pstreamptr) ...@@ -339,9 +339,10 @@ void pstreamOpenReadPipe(const argument_t *argument, pstream_t *pstreamptr)
char *pipename = (char*) Malloc(pnlen); char *pipename = (char*) Malloc(pnlen);
// struct sched_param param; // struct sched_param param;
argument_t *newargument = (argument_t*) Malloc(sizeof(argument_t)); argument_t *newargument = new argument_t();
newargument->argc = argument->argc + 1; newargument->argc = argument->argc + 1;
newargument->argv = (char **) Malloc(newargument->argc*sizeof(char *)); newargument->argv = (char **) Malloc(newargument->argc*sizeof(char *));
newargument->operatorName = "";
memcpy(newargument->argv, argument->argv, argument->argc*sizeof(char *)); memcpy(newargument->argv, argument->argv, argument->argc*sizeof(char *));
char *operatorArg = argument->argv[0]; char *operatorArg = argument->argv[0];
...@@ -356,6 +357,7 @@ void pstreamOpenReadPipe(const argument_t *argument, pstream_t *pstreamptr) ...@@ -356,6 +357,7 @@ void pstreamOpenReadPipe(const argument_t *argument, pstream_t *pstreamptr)
newargument->argv[argument->argc] = pipename; newargument->argv[argument->argc] = pipename;
newargument->args = newarg; newargument->args = newarg;
newargument->operatorName = std::string(operatorName,strlen(operatorName));
/* /*
printf("pstreamOpenRead: new args >%s<\n", newargument->args); printf("pstreamOpenRead: new args >%s<\n", newargument->args);
for ( int i = 0; i < newargument->argc; ++i ) for ( int i = 0; i < newargument->argc; ++i )
...@@ -370,7 +372,7 @@ void pstreamOpenReadPipe(const argument_t *argument, pstream_t *pstreamptr) ...@@ -370,7 +372,7 @@ void pstreamOpenReadPipe(const argument_t *argument, pstream_t *pstreamptr)
if ( ! cdoSilentMode ){ if ( ! cdoSilentMode ){
cdoPrint("Started child process \"%s\".", newarg+1); cdoPrint("Started child process \"%s\".", newarg+1);
} }
pCreateReadThread(newarg, newargument, operatorName); pCreateReadThread(newargument);
/* Free(operatorName); */ /* Free(operatorName); */
processAddInputStream(pstreamID); processAddInputStream(pstreamID);
/* pipeInqInfo(pstreamID); */ /* pipeInqInfo(pstreamID); */
...@@ -887,7 +889,7 @@ void pstreamClose(int pstreamID) ...@@ -887,7 +889,7 @@ void pstreamClose(int pstreamID)
argument_t *argument = (argument_t *) (pstreamptr->argument); argument_t *argument = (argument_t *) (pstreamptr->argument);
if ( argument->argv ) Free(argument->argv); if ( argument->argv ) Free(argument->argv);
if ( argument->args ) Free(argument->args); if ( argument->args ) Free(argument->args);
Free(argument); delete(argument);
} }
vlistDestroy(pstreamptr->vlistID); vlistDestroy(pstreamptr->vlistID);
pthread_mutex_unlock(pipe->mutex); pthread_mutex_unlock(pipe->mutex);
......
...@@ -19,9 +19,34 @@ ...@@ -19,9 +19,34 @@
#define PSTREAM_H #define PSTREAM_H
#include "pstream_write.h" #include "pstream_write.h"
#include "varlist.h"
#include <sys/types.h> /* off_t */ #include <sys/types.h> /* off_t */
typedef struct {
int self;
int mode;
int fileID;