[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
patch: Set up parallel service(s) during testing.
- To: VSIPL++ Developers List <vsipl++@xxxxxxxxxxxxxxxx>
- Subject: patch: Set up parallel service(s) during testing.
- From: Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
- Date: Wed, 25 Jan 2006 18:10:02 -0500
The attached patch adds a new 'ParallelService' resource to the
test database which, if lam is used, runs 'lamboot' in its SetUp
method and 'wipe' during CleanUp. (We can complete this whenever
other services are needed for other MPI implementations.)
This new resource is associated with all tests that live under
the 'parallel/' subdirectory. (The next logical step is thus to
identify all tests requiring this service and move them.)
Ok to commit ?
Regards,
Stefan
Index: ChangeLog
===================================================================
RCS file: /home/cvs/Repository/vpp/ChangeLog,v
retrieving revision 1.389
diff -u -r1.389 ChangeLog
--- ChangeLog 24 Jan 2006 17:33:15 -0000 1.389
+++ ChangeLog 25 Jan 2006 23:07:48 -0000
@@ -1,3 +1,13 @@
+2006-01-25 Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
+
+ * configure.ac: Emit variable PAR_SERVICE.
+ * vsipl++.pc.in: Publish it.
+ * tests/GNUmakefile.inc.in: Propagate it...
+ * tests/context-installed.pre.in: ...here.
+ * tests/context.in: Use it.
+ * tests/QMTest/vpp_database.py: Define new ParallelService resource.
+ * tests/QMTest/classes.qmc: Declare it.
+
2006-01-24 Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
* GNUmakefile.in: Add 'libs' target.
Index: configure.ac
===================================================================
RCS file: /home/cvs/Repository/vpp/configure.ac,v
retrieving revision 1.78
diff -u -r1.78 configure.ac
--- configure.ac 22 Jan 2006 08:56:22 -0000 1.78
+++ configure.ac 25 Jan 2006 23:07:48 -0000
@@ -704,6 +704,7 @@
fi
+PAR_SERVICE=none
#
# Find the parallel service library, if enabled.
# At present, only MPI is supported.
@@ -738,16 +739,16 @@
[The name of the header to include for the MPI interface, with <> quotes.])
# Find the library.
- vsipl_lib_style=unknown
+ PAR_SERVICE=unknown
# Both MPICH 1 and 2 define MPICH_NAME.
- AC_CHECK_DECL([MPICH_NAME], [vsipl_lib_style=mpich],,
+ AC_CHECK_DECL([MPICH_NAME], [PAR_SERVICE=mpich],,
[#include VSIP_IMPL_MPI_H])
- if test $vsipl_lib_style = unknown; then
- AC_CHECK_DECL([LAM_MPI], [vsipl_lib_style=lam],,
+ if test $PAR_SERVICE = unknown; then
+ AC_CHECK_DECL([LAM_MPI], [PAR_SERVICE=lam],,
[#include VSIP_IMPL_MPI_H])
fi
- case $vsipl_lib_style in
+ case $PAR_SERVICE in
unknown)
AC_MSG_ERROR([unrecognized MPI implementation])
;;
@@ -807,6 +808,7 @@
else
vsipl_par_service=0
fi
+AC_SUBST(PAR_SERVICE)
if test $vsipl_par_service != 0; then
AC_SUBST(USE_PAR, 1)
@@ -1441,6 +1443,20 @@
AC_SUBST(INT_CPPFLAGS)
#
+# Print summary.
+#
+AC_MSG_NOTICE(Summary)
+AC_MSG_RESULT([Build in maintainer-mode: $maintainer_mode])
+AC_MSG_RESULT([Using config suffix: $suffix])
+AC_MSG_RESULT([Exceptions enabled: $enable_exceptions])
+AC_MSG_RESULT([With mpi enabled: $enable_mpi])
+if test "$enable_mpi" != "no"; then
+ AC_MSG_RESULT([With parallel servicetation: $PAR_SERVICE])
+fi
+AC_MSG_RESULT([With SAL: $enable_sal])
+AC_MSG_RESULT([With IPP: $enable_ipp])
+
+#
# Done.
#
AC_OUTPUT
Index: vsipl++.pc.in
===================================================================
RCS file: /home/cvs/Repository/vpp/vsipl++.pc.in,v
retrieving revision 1.8
diff -u -r1.8 vsipl++.pc.in
--- vsipl++.pc.in 6 Jan 2006 22:24:35 -0000 1.8
+++ vsipl++.pc.in 25 Jan 2006 23:07:48 -0000
@@ -6,6 +6,7 @@
cppflags=-I${includedir} @CPPFLAGS@
cxxflags=@CXXFLAGS@
ldflags=@LDFLAGS@
+par_service=@PAR_SERVICE@
Name: Sourcery VSIPL++
Description: CodeSourcery VSIPL++ library
Index: tests/GNUmakefile.inc.in
===================================================================
RCS file: /home/cvs/Repository/vpp/tests/GNUmakefile.inc.in,v
retrieving revision 1.11
diff -u -r1.11 GNUmakefile.inc.in
--- tests/GNUmakefile.inc.in 24 Jan 2006 17:33:15 -0000 1.11
+++ tests/GNUmakefile.inc.in 25 Jan 2006 23:07:49 -0000
@@ -35,7 +35,9 @@
sed -e "s|@CXX_@|`$(tests_pkgconfig) --variable=cxx`|" | \
sed -e "s|@CPPFLAGS_@|`$(tests_pkgconfig) --variable=cppflags`|" | \
sed -e "s|@CXXFLAGS_@|`$(tests_pkgconfig) --variable=cxxflags`|" | \
- sed -e "s|@LIBS_@|`$(tests_pkgconfig) --libs`|" > tests/context-installed
+ sed -e "s|@LIBS_@|`$(tests_pkgconfig) --libs`|" | \
+ sed -e "s|@PAR_SERVICE_@|`$(tests_pkgconfig) --variable=par_service`|" \
+ > tests/context-installed
cd tests; \
qmtest run -C context-installed -o results$(suffix).qmr $(tests_ids); \
result=$$?; test $$tmp=0 || $$tmp=2
Index: tests/context-installed.pre.in
===================================================================
RCS file: /home/cvs/Repository/vpp/tests/context-installed.pre.in,v
retrieving revision 1.1
diff -u -r1.1 context-installed.pre.in
--- tests/context-installed.pre.in 23 Dec 2005 20:03:55 -0000 1.1
+++ tests/context-installed.pre.in 25 Jan 2006 23:07:49 -0000
@@ -6,3 +6,4 @@
GPPInit.options=
GPPInit.library_directories=
DejaGNUTest.target= @host@
+par_service=@PAR_SERVICE_@
Index: tests/context.in
===================================================================
RCS file: /home/cvs/Repository/vpp/tests/context.in,v
retrieving revision 1.5
diff -u -r1.5 context.in
--- tests/context.in 21 Dec 2005 14:52:42 -0000 1.5
+++ tests/context.in 25 Jan 2006 23:07:49 -0000
@@ -6,3 +6,4 @@
GPPInit.options=
GPPInit.library_directories=
DejaGNUTest.target= @host@
+par_service=@PAR_SERVICE@
Index: tests/QMTest/classes.qmc
===================================================================
RCS file: /home/cvs/Repository/vpp/tests/QMTest/classes.qmc,v
retrieving revision 1.3
diff -u -r1.3 classes.qmc
--- tests/QMTest/classes.qmc 16 Sep 2005 19:10:54 -0000 1.3
+++ tests/QMTest/classes.qmc 25 Jan 2006 23:07:49 -0000
@@ -7,4 +7,5 @@
<class kind="test" name="vpp_database.VPPTest"/>
<class kind="resource" name="vpp_database.VPPResource"/>
<class kind="test" name="vpp_database.VPPCompTest"/>
+ <class kind="resource" name="vpp_database.ParallelService"/>
</class-directory>
Index: tests/QMTest/vpp_database.py
===================================================================
RCS file: /home/cvs/Repository/vpp/tests/QMTest/vpp_database.py,v
retrieving revision 1.5
diff -u -r1.5 vpp_database.py
--- tests/QMTest/vpp_database.py 31 Oct 2005 15:57:46 -0000 1.5
+++ tests/QMTest/vpp_database.py 25 Jan 2006 23:07:49 -0000
@@ -20,7 +20,7 @@
import qm
import qm.test.base
from qm.fields import *
-from qm.executable import RedirectedExecutable
+from qm.executable import *
from qm.attachment import Attachment, FileAttachmentStore
from qm.test.database import *
from qm.test.test import Test
@@ -60,6 +60,32 @@
self._GetSourcePath())
+class ParallelService(Resource):
+
+ def SetUp(self, context, result):
+
+ setup = Executable()
+ command = []
+ self.cleanup_command = []
+
+ service = context.get('par_service')
+ if service == 'lam':
+ command = ['lamboot']
+ self.cleanup_command = ['wipe']
+
+ if command:
+ status = setup.Run(command)
+ result.CheckExitStatus('ParallelService', ' '.join(command), status)
+
+ def CleanUp(self, result):
+
+ if self.cleanup_command:
+ command = self.cleanup_command
+ cleanup = Executable()
+ status = cleanup.Run(command)
+ result.CheckExitStatus('ParallelService', ' '.join(command), status)
+
+
class VPPCompTest(Test):
data_file = AttachmentField(title="Data File", description="The input data.")
@@ -70,15 +96,7 @@
data = self.data_file.GetDataFile()
executable = RedirectedExecutable()
status = executable.Run([driver, data])
- if os.WIFSIGNALED(status):
- result.Fail('program killed with signal %i'%os.WTERMSIG(status),
- {'VPPCompTest.command': '%s %s'%(driver, data)})
-
- elif os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0:
- result.Fail('program exit value : %i'%os.WEXITSTATUS(status),
- {'VPPCompTest.command': '%s %s'%(driver, data)})
- if executable.stderr:
- result['VPPCompTest.error'] = executable.stderr
+ result.CheckExitStatus('VPPCompTest', driver, status)
class VPPDatabase(Database):
@@ -166,15 +184,25 @@
'resource',
self)
return resource_class({},
- qmtest_id = 'compiler_table',
- qmtest_database = self)
+ qmtest_id = item_id, qmtest_database = self)
+ elif item_id == 'parallel_service':
+ return ParallelService({},
+ qmtest_id = item_id, qmtest_database = self)
+
id_components = self.GetLabelComponents(item_id)
# 'data' subdirectories have special meaning, and so
# are not allowed as label components.
if 'data' in id_components:
return None
+ resources = ['compiler_table']
+
+ # Everything in the 'parallel' subdirectory requires
+ # some parallel service to be set up first:
+ if id_components[0] == 'parallel':
+ resources.append('parallel_service')
+
dirname = os.path.join(self.GetRoot(), *id_components[:-1])
basename = id_components[-1]
@@ -193,7 +221,7 @@
self.GetAttachmentStore())
arguments = {}
arguments['source_file'] = attachment
- arguments['resources'] = ['compiler_table']
+ arguments['resources'] = resources
return VPPResource(arguments,
qmtest_id = item_id,
qmtest_database = self)
@@ -216,7 +244,7 @@
if len(src) > 1:
raise database.DatabaseError,\
'multiple source files found in %s'%dirname
- resources = [self.JoinLabels(*(id_components[:-1] + src))]
+ resources.append(self.JoinLabels(*(id_components[:-1] + src)))
arguments = {}
arguments['data_file'] = attachment
@@ -240,7 +268,7 @@
arguments = {}
arguments['source_file'] = attachment
- arguments['resources'] = ['compiler_table']
+ arguments['resources'] = resources
return VPPTest(arguments,
qmtest_id = item_id,