From tarjeik at chemcon.no Fri Jan 3 08:58:54 2003 From: tarjeik at chemcon.no (Tarjei Knapstad) Date: 03 Jan 2003 09:58:54 +0100 Subject: [pooma-dev] Using gcc3.0 to compile POOMA In-Reply-To: References: Message-ID: <1041584335.13901.139.camel@cc-intern01> On Thu, 2002-12-19 at 16:59, Richard Guenther wrote: > On Thu, 19 Dec 2002, Richard Guenther wrote: > > > Hi! > > > > I was just using gcc3.0 (CVS head) for POOMA and now noticed that > > even at -O the NearestNeighbors test from the Field testsuite is > > failing (works at -O0). > > Same problem with current gcc3.2 CVS (-O2 -fomit-frame-pointer > -march=athlon) :/ > Those nasties in 3.0 are apparently fixed in 3.2. Have you tried running that test through Valgrind (http://devel-home.kde.org/~sewardj/) and see if there's anything going bad in code execution? In my experience such behaviour as described, is (at least in my case :) almost allways due to bad code, not bad optimization on the compilers part. > With gcc3.3 CVS and the same flags the test segfaults... > Well, I wouldn't expect a development version to save the day :) > Oh well ;) > > > Also gcc3.0 contains loop optimizer bugs > > that cause lots of regressions if -funroll-loops is used. So I > > recommend people _not_ to use gcc3.0 to do anything with POOMA. > > > > I'll check whats up with gcc3.2, but that seems to be confused by > > either my binutils or my libc version. > > > > Richard. -- Tarjei -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From rguenth at tat.physik.uni-tuebingen.de Fri Jan 3 09:52:21 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Fri, 3 Jan 2003 10:52:21 +0100 (CET) Subject: [pooma-dev] Using gcc3.0 to compile POOMA In-Reply-To: <1041584335.13901.139.camel@cc-intern01> Message-ID: On 3 Jan 2003, Tarjei Knapstad wrote: > On Thu, 2002-12-19 at 16:59, Richard Guenther wrote: > > On Thu, 19 Dec 2002, Richard Guenther wrote: > > > > > Hi! > > > > > > I was just using gcc3.0 (CVS head) for POOMA and now noticed that > > > even at -O the NearestNeighbors test from the Field testsuite is > > > failing (works at -O0). > > > > Same problem with current gcc3.2 CVS (-O2 -fomit-frame-pointer > > -march=athlon) :/ > > > Those nasties in 3.0 are apparently fixed in 3.2. Have you tried running No - I see lots of extra failures on powerpc comapred to a ia32 run. > that test through Valgrind (http://devel-home.kde.org/~sewardj/) and see > if there's anything going bad in code execution? In my experience such Yes - there is nothing unusual going on (tested ia32 only, of course). > behaviour as described, is (at least in my case :) almost allways due to > bad code, not bad optimization on the compilers part. Maybe its time to try to construct smaller testcases for this... (from just looking at the faulty values, it seems gcc misoptimizes simple loops of the form for (int i=0; i<3; i++) a[i] = b[i]; but that would cause failures all over the place, I think, so there must be something else triggering the failure. Richard. From rguenth at tat.physik.uni-tuebingen.de Fri Jan 3 13:11:41 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Fri, 3 Jan 2003 14:11:41 +0100 (CET) Subject: [pooma-dev] Using gcc3.0 to compile POOMA In-Reply-To: Message-ID: On Fri, 3 Jan 2003, Richard Guenther wrote: > On 3 Jan 2003, Tarjei Knapstad wrote: > > > On Thu, 2002-12-19 at 16:59, Richard Guenther wrote: > > > On Thu, 19 Dec 2002, Richard Guenther wrote: > > > > > > > Hi! > > > > > > > > I was just using gcc3.0 (CVS head) for POOMA and now noticed that > > > > even at -O the NearestNeighbors test from the Field testsuite is > > > > failing (works at -O0). > > > > > > Same problem with current gcc3.2 CVS (-O2 -fomit-frame-pointer > > > -march=athlon) :/ > > > > > Those nasties in 3.0 are apparently fixed in 3.2. Have you tried running > > No - I see lots of extra failures on powerpc comapred to a ia32 run. Luck we are - with todays CVS of gcc 3.2 the failures are reduced, but not completely away (the just +PASSED lines are tests that segfaulted before): +PASSED ... array_test7 +PASSED ... array_test8 -FAILED ... array_test18 +PASSED ... array_test18 +PASSED ... array_test19 +PASSED ... IteratorPairDomainTest +PASSED ... brick_test2 +PASSED ... brick_test3 +PASSED ... brickview_test2 +PASSED ... ump_test4: guard cell fill test. +PASSED ... ump_test5: guard cell fill test. -FAILED ... ump_test8 +PASSED ... ump_test8 +PASSED ... ump_test9: dirty flag test. +PASSED ... gmp_test4 (Guard cell fill test) -FAILED ... ReductionTest1 +PASSED ... ReductionTest1 +PASSED ... LocalPatch -FAILED ... ScalarCode +PASSED ... ScalarCode +PASSED ... rngArray +PASSED ... GridLayout operations +PASSED ... UniformGridLayout operations +PASSED ... Particles with spatial layout +PASSED ... Particles with uniform layout +PASSED ... TestTrace +PASSED ... TestTranspose +PASSED ... GridBroadcast Test From rguenth at tat.physik.uni-tuebingen.de Fri Jan 3 17:23:50 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Fri, 3 Jan 2003 18:23:50 +0100 (CET) Subject: [RFC] Array/tests/ScalarAdvection.cpp Message-ID: Hi! The ScalarAdvection.cpp test beyond Array/tests is neither a test, nor an Array test (it uses the Field abstraction). Ok to either - move it to the examples directory, beyond Field and a new directory ScalarAdvection2 - kill it (seems to be very similar to examples/Field/ScalarAdvection) - merge/improve it with examples/Field/ScalarAdvection (builds) and examples/Field/ScalarAdvection1d (does not build due to old Field abstraction) Any ideas? Richard. From rguenth at tat.physik.uni-tuebingen.de Fri Jan 3 20:20:29 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Fri, 3 Jan 2003 21:20:29 +0100 (CET) Subject: [RFC] Change Pooma/tests Message-ID: Hi! Instead of virtually running two times the same test, I'd rather kill the finalize.cpp test and split the relevant part (testing pAbort mechanism) to a abort.cpp test and keep the basic debug/output/finalize stuff in pooma.cpp. Comments? Richard. From tarjeik at chemcon.no Mon Jan 6 14:14:59 2003 From: tarjeik at chemcon.no (Tarjei Knapstad) Date: 06 Jan 2003 15:14:59 +0100 Subject: CVS missing patches Message-ID: <1041862500.13769.6.camel@cc-intern01> I recently decided to evaluate the Intel compiler for use at our company, and after doing some preliminary testing of our own code decided to try compiling POOMA. I couldn't find any configuration for LINUXicc in 2.4.0, so I browsed the mailing list archives and found a patch posted by Richard Guenther July last year. The patch works fine, but why is it not in CVS? I checked out the latest revision in case there were some more important fixes, and was a bit surprised not to find this patch there... Regards, -- Tarjei -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From rguenth at tat.physik.uni-tuebingen.de Mon Jan 6 14:48:29 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Mon, 6 Jan 2003 15:48:29 +0100 (CET) Subject: [pooma-dev] CVS missing patches In-Reply-To: <1041862500.13769.6.camel@cc-intern01> Message-ID: On 6 Jan 2003, Tarjei Knapstad wrote: > I recently decided to evaluate the Intel compiler for use at our > company, and after doing some preliminary testing of our own code > decided to try compiling POOMA. > > I couldn't find any configuration for LINUXicc in 2.4.0, so I browsed > the mailing list archives and found a patch posted by Richard Guenther > July last year. > > The patch works fine, but why is it not in CVS? I checked out the latest > revision in case there were some more important fixes, and was a bit > surprised not to find this patch there... As copyright issues have been worked out, I am slowly merging pending patches from me making sure I dont introduce new regressions. Richard. From oldham at codesourcery.com Mon Jan 6 16:21:12 2003 From: oldham at codesourcery.com (Jeffrey D. Oldham) Date: Mon, 6 Jan 2003 08:21:12 -0800 Subject: [pooma-dev] Using gcc3.0 to compile POOMA In-Reply-To: References: Message-ID: <20030106162112.GA17017@vaio.codesourcery.com> On Fri, Jan 03, 2003 at 02:11:41PM +0100, Richard Guenther wrote: > On Fri, 3 Jan 2003, Richard Guenther wrote: > > Luck we are - with todays CVS of gcc 3.2 the failures are reduced, but not > completely away (the just +PASSED lines are tests that segfaulted before): > > +PASSED ... array_test7 > +PASSED ... array_test8 > -FAILED ... array_test18 > +PASSED ... array_test18 > +PASSED ... array_test19 > +PASSED ... IteratorPairDomainTest > +PASSED ... brick_test2 > +PASSED ... brick_test3 > +PASSED ... brickview_test2 > +PASSED ... ump_test4: guard cell fill test. > +PASSED ... ump_test5: guard cell fill test. > -FAILED ... ump_test8 > +PASSED ... ump_test8 > +PASSED ... ump_test9: dirty flag test. > +PASSED ... gmp_test4 (Guard cell fill test) > -FAILED ... ReductionTest1 > +PASSED ... ReductionTest1 > +PASSED ... LocalPatch > -FAILED ... ScalarCode > +PASSED ... ScalarCode > +PASSED ... rngArray > +PASSED ... GridLayout operations > +PASSED ... UniformGridLayout operations > +PASSED ... Particles with spatial layout > +PASSED ... Particles with uniform layout > +PASSED ... TestTrace > +PASSED ... TestTranspose > +PASSED ... GridBroadcast Test This is good news. Mark Mitchell (mark at codesourcery.com) recently checked in a complete revision of gcc's C++ parser. Also, the compiler now passes almost all of CodeSourcery's C++ ABI Testsuite because of work by Nathan Sidwell (nathan at codesourcery.com) of CodeSourcery, LLC. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From oldham at codesourcery.com Mon Jan 6 16:33:39 2003 From: oldham at codesourcery.com (Jeffrey D. Oldham) Date: Mon, 6 Jan 2003 08:33:39 -0800 Subject: [pooma-dev] [RFC] Change Pooma/tests In-Reply-To: References: Message-ID: <20030106163339.GB17017@vaio.codesourcery.com> On Fri, Jan 03, 2003 at 09:20:29PM +0100, Richard Guenther wrote: > Hi! > > Instead of virtually running two times the same test, I'd rather kill the > finalize.cpp test and split the relevant part (testing pAbort mechanism) > to a abort.cpp test and keep the basic debug/output/finalize stuff in > pooma.cpp. I think this is a good idea. Do you think that introducing your patch to support Intel's icc should be the next patch to introduce? The next day, making this change and other small outstanding patches? I do not have access to Intel's compiler so I cannot check the status of the regression tests. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From tarjeik at chemcon.no Mon Jan 6 16:42:24 2003 From: tarjeik at chemcon.no (Tarjei Knapstad) Date: 06 Jan 2003 17:42:24 +0100 Subject: [pooma-dev] [RFC] Change Pooma/tests In-Reply-To: <20030106163339.GB17017@vaio.codesourcery.com> References: <20030106163339.GB17017@vaio.codesourcery.com> Message-ID: <1041871344.13773.13.camel@cc-intern01> On Mon, 2003-01-06 at 17:33, Jeffrey D. Oldham wrote: > On Fri, Jan 03, 2003 at 09:20:29PM +0100, Richard Guenther wrote: > > Hi! > > > > Instead of virtually running two times the same test, I'd rather kill the > > finalize.cpp test and split the relevant part (testing pAbort mechanism) > > to a abort.cpp test and keep the basic debug/output/finalize stuff in > > pooma.cpp. > > I think this is a good idea. Do you think that introducing your patch > to support Intel's icc should be the next patch to introduce? The > next day, making this change and other small outstanding patches? > > I do not have access to Intel's compiler so I cannot check the status > of the regression tests. > I've just succesfully built POOMA (current CVS) with the latest Intel compiler on Linux together with all the tests except for the Connect directory. If you'd like test results I'd be happy to compile some for you tomorrow. My current setup: Intel(R) C++ Compiler for 32-bit applications, Version 7.0 Build 20021021Z Copyright (C) 1985-2002 Intel Corporation. All rights reserved. FOR NON-COMMERCIAL USE ONLY GNU ld version 2.13.90.0.2 20020802 Supported emulations: elf_i386 i386linux elf_i386_glibc21 Cheers, -- Tarjei -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From oldham at codesourcery.com Mon Jan 6 16:44:27 2003 From: oldham at codesourcery.com (Jeffrey D. Oldham) Date: Mon, 6 Jan 2003 08:44:27 -0800 Subject: [RFC] Array/tests/ScalarAdvection.cpp In-Reply-To: References: Message-ID: <20030106164427.GA17676@vaio.codesourcery.com> On Fri, Jan 03, 2003 at 06:23:50PM +0100, Richard Guenther wrote: > Hi! > > The ScalarAdvection.cpp test beyond Array/tests is neither a test, nor an > Array test (it uses the Field abstraction). Ok to either > - move it to the examples directory, beyond Field and a new directory > ScalarAdvection2 > - kill it (seems to be very similar to examples/Field/ScalarAdvection) > - merge/improve it with examples/Field/ScalarAdvection (builds) and > examples/Field/ScalarAdvection1d (does not build due to old Field > abstraction) > > Any ideas? I guess I favor removing it if, in fact, it performs a similar computation to the Field scalar advection example. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Tue Jan 7 10:20:27 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 7 Jan 2003 11:20:27 +0100 (CET) Subject: [PATCH] Fix Utilities/Inform.h for icc Message-ID: Hi! The following patch is necessary to build pooma with icc (apart from the LINUXICC.conf file which I added yesterday already). Together with this patch all tests pass as expected. Ok to commit? Richard. diff --minimal -Nru a/r2/src/Utilities/Inform.h b/r2/src/Utilities/Inform.h --- a/r2/src/Utilities/Inform.h Wed Jul 24 10:53:59 2002 +++ b/r2/src/Utilities/Inform.h Wed Jul 24 10:53:59 2002 @@ -278,7 +278,8 @@ void output() { flush(); } #if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) \ - || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) + || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) \ + || (defined(__ICC)) typedef std::ios_base::fmtflags FmtFlags_t; #else typedef long FmtFlags_t; From rguenth at tat.physik.uni-tuebingen.de Tue Jan 7 11:32:06 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 7 Jan 2003 12:32:06 +0100 (CET) Subject: [pooma-dev] [RFC] Change Pooma/tests In-Reply-To: <1041871344.13773.13.camel@cc-intern01> Message-ID: On 6 Jan 2003, Tarjei Knapstad wrote: > > I do not have access to Intel's compiler so I cannot check the status > > of the regression tests. > > > I've just succesfully built POOMA (current CVS) with the latest Intel > compiler on Linux together with all the tests except for the Connect > directory. If you'd like test results I'd be happy to compile some for > you tomorrow. > > My current setup: > > Intel(R) C++ Compiler for 32-bit applications, Version 7.0 Build > 20021021Z With Intel(R) C++ Compiler for 32-bit applications, Version 7.0 Build 20021212Z I get those additional failures (compared to a run with a gcc3.2 that still contains the loop optimizer bug fixed around Dec20) (-PASSED lines usually mean compile failures or segfaults of the tests): -FAILED ... array_test27 +PASSED ... array_test27 +PASSED ... MP DynamicArray w/ shared layouts FAILED ... DynamicArray dynamic ops w/views FAILED ... NearestNeighbors -PASSED ... DiskLayoutTest1 -PASSED ... FileSetWriterTest2 Unfortunately gcc from todays gcc-3_2 branch fixes none of the above bugs (I didnt see array_test27 failure on powerpc, it seems a floating point comparison failure which might be fixed using -ffloat-store or changing precision to 64bits rather than 80 which is default for gcc but not icc). One may also note that compiling poom and running the complete testsuite takes around the same time with gcc-3.2 and icc 7.0 when using -O2 on both builds (this is of course mainly compile time and IO). Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From jcrotinger at proximation.com Tue Jan 7 14:14:39 2003 From: jcrotinger at proximation.com (James Crotinger) Date: Tue, 7 Jan 2003 07:14:39 -0700 Subject: [pooma-dev] [PATCH] Fix Utilities/Inform.h for icc Message-ID: This looks like a case where the logic should probably be reversed, checking for the compilers that don't know about std::ios_base::fmtflags. Jim -----Original Message----- From: Richard Guenther [mailto:rguenth at tat.physik.uni-tuebingen.de] Sent: Tuesday, January 07, 2003 3:20 AM To: Jeffrey D. Oldham Cc: pooma-dev at pooma.codesourcery.com Subject: [pooma-dev] [PATCH] Fix Utilities/Inform.h for icc Hi! The following patch is necessary to build pooma with icc (apart from the LINUXICC.conf file which I added yesterday already). Together with this patch all tests pass as expected. Ok to commit? Richard. diff --minimal -Nru a/r2/src/Utilities/Inform.h b/r2/src/Utilities/Inform.h --- a/r2/src/Utilities/Inform.h Wed Jul 24 10:53:59 2002 +++ b/r2/src/Utilities/Inform.h Wed Jul 24 10:53:59 2002 @@ -278,7 +278,8 @@ void output() { flush(); } #if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) \ - || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) + || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) \ + || (defined(__ICC)) typedef std::ios_base::fmtflags FmtFlags_t; #else typedef long FmtFlags_t; -------------- next part -------------- An HTML attachment was scrubbed... URL: From rguenth at tat.physik.uni-tuebingen.de Tue Jan 7 14:17:55 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 7 Jan 2003 15:17:55 +0100 (CET) Subject: [pooma-dev] [PATCH] Fix Utilities/Inform.h for icc In-Reply-To: Message-ID: On Tue, 7 Jan 2003, James Crotinger wrote: > This looks like a case where the logic should probably be reversed, checking > for the compilers that don't know about std::ios_base::fmtflags. Yes, but for these we dont know ;) Of course this is fixed by autodetecting this with a configure test (I'll try to merge the compiler feature tests using autoconf next). The patch just makes builds using the intel compiler possible. Richard. > To: Jeffrey D. Oldham > Cc: pooma-dev at pooma.codesourcery.com > Subject: [pooma-dev] [PATCH] Fix Utilities/Inform.h for icc > > Hi! > > The following patch is necessary to build pooma with icc (apart from > the LINUXICC.conf file which I added yesterday already). Together with > this patch all tests pass as expected. Ok to commit? > > Richard. > > diff --minimal -Nru a/r2/src/Utilities/Inform.h > b/r2/src/Utilities/Inform.h > --- a/r2/src/Utilities/Inform.h Wed Jul 24 10:53:59 2002 > +++ b/r2/src/Utilities/Inform.h Wed Jul 24 10:53:59 2002 > @@ -278,7 +278,8 @@ > void output() { flush(); } > > #if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) \ > - || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) > + || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) \ > + || (defined(__ICC)) > typedef std::ios_base::fmtflags FmtFlags_t; > #else > typedef long FmtFlags_t; > -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From tarjeik at chemcon.no Tue Jan 7 14:28:18 2003 From: tarjeik at chemcon.no (Tarjei Knapstad) Date: 07 Jan 2003 15:28:18 +0100 Subject: -ftemplate-depth not deep enough for benchmarks (gcc) Message-ID: <1041949698.13769.93.camel@cc-intern01> The Doof3D benchmark does not compile with gcc 3.2 because the template instantiation depth exceeds 60 as set in LINUXgcc.conf I don't know the exact depth needed, but setting it to 200 at least made it compile (as well as the rest of the benchmarks). Tarjei -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From rguenth at tat.physik.uni-tuebingen.de Tue Jan 7 14:29:40 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 7 Jan 2003 15:29:40 +0100 (CET) Subject: [pooma-dev] -ftemplate-depth not deep enough for benchmarks (gcc) In-Reply-To: <1041949698.13769.93.camel@cc-intern01> Message-ID: On 7 Jan 2003, Tarjei Knapstad wrote: > The Doof3D benchmark does not compile with gcc 3.2 because the template > instantiation depth exceeds 60 as set in LINUXgcc.conf > > I don't know the exact depth needed, but setting it to 200 at least made > it compile (as well as the rest of the benchmarks). I have a LINUXGCC3.conf - setting the template depth to 80 was enough for my needs. Also you want to change the compiler characteristic to something resembling ANSI C++. Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 10:49:33 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 8 Jan 2003 11:49:33 +0100 (CET) Subject: [PATCH] Use autoconf for basic configuration stuff Message-ID: Hi! I extracted and cleaned up the autoconfiscation of the compiler/library features. This allows the addition of a "default" architecture (done) suited to a gnu toolchain and then run pooma configuration by just > ./configure --serial --opt or even > ./configure --serial --opt --cpp icpc and succeed. Adding external packages to the build (like cheetah using --messaging) works by setting the appropriate environment variable as checked by the old-style configure script (here $CHEETAHDIR). This is the least intrusive way of introducing autoconf to handle some of the configuration mess. I probably dont have time to autoconfiscate the whole build, so all old makefiles stay, so does the backward compatible installation and external packages support (which is probably a good idea anyway -- no changes needed to application makefiles). Tested by running the above quoted configurations and building the library. Tested by using this sort of configuration for my own work for a few month now, too. Ok to apply? Richard. # This is a BitKeeper generated patch for the following project: # Project Name: pooma/cheetah repository tracking CVS/tarball # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.11 -> 1.17 # r2/src/IO/tests/DiskLayoutTest1.cpp 1.1 -> 1.2 # r2/src/IO/tests/FileSetReaderTest0.cpp 1.1 -> 1.2 # r2/src/Tiny/Vector.h 1.1 -> 1.2 # r2/configure 1.2 -> 1.6 # r2/src/IO/FileSetReader.cpp 1.1 -> 1.2 # r2/src/Field/FieldCentering.h 1.1 -> 1.2 # r2/bin/makeinstall 1.1 -> 1.2 # r2/src/IO/tests/dumper.cpp 1.1 -> 1.2 # r2/src/IO/DiskLayout.h 1.1 -> 1.2 # r2/src/IO/DiskLayout.cmpl.cpp 1.1 -> 1.2 # r2/src/IO/FileSetReader.cmpl.cpp 1.1 -> 1.2 # r2/src/Utilities/Inform.h 1.1 -> 1.2 # r2/src/Tiny/TinyMatrix.h 1.1 -> 1.2 # (new) -> 1.1 r2/config/arch/default.conf # (new) -> 1.3 r2/scripts/configure.in # (new) -> 1.2 r2/scripts/acconfig.h # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/01/08 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.12 # autoconf configure script introduction for detecting compiler/library features # -------------------------------------------- # 03/01/08 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.13 # handle compilers not supporting template function default template arguments (like gcc 2.95) # -------------------------------------------- # 03/01/08 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.14 # Add missing include # -------------------------------------------- # 03/01/08 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.15 # Inform.h: # use POOMA_NO_IOSBASE_FMTFLAGS # acconfig.h: # POOMA_NO_IOSBASE_FMTFLAGS # configure.in: # add check for ios_base::fmtflags type # -------------------------------------------- # 03/01/08 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.16 # make autoconf configuration parallel suite safe # -------------------------------------------- # 03/01/08 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.17 # Added default configuration suited to gnu toolchain. # -------------------------------------------- # diff -Nru a/r2/bin/makeinstall b/r2/bin/makeinstall --- a/r2/bin/makeinstall Wed Jan 8 11:42:22 2003 +++ b/r2/bin/makeinstall Wed Jan 8 11:42:22 2003 @@ -141,12 +141,14 @@ makefilename=Makefile.$libbase$extensions hdrdirname=PoomaConfiguration$extensions configfilename=PoomaConfiguration.h +autoconfigfilename=PoomaAutoconf.h rm -rf $libdir/$makefilename $libdir/$libfilename $libdir/$hdrdirname cp lib/$suite/$makefilename $libdir/$makefilename cp lib/$suite/$libfilename $libdir/$libfilename mkdir $libdir/$hdrdirname cp lib/$suite/$configfilename $libdir/$hdrdirname/$configfilename +cp lib/$suite/$autoconfigfilename $libdir/$hdrdirname/$autoconfigfilename ### Copy binary files to bin directory diff -Nru a/r2/config/arch/default.conf b/r2/config/arch/default.conf --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/r2/config/arch/default.conf Wed Jan 8 11:42:22 2003 @@ -0,0 +1,283 @@ +# Perl input file +# ACL:license +# ---------------------------------------------------------------------- +# This software and ancillary information (herein called "SOFTWARE") +# called POOMA (Parallel Object-Oriented Methods and Applications) is +# made available under the terms described here. The SOFTWARE has been +# approved for release with associated LA-CC Number LA-CC-98-65. +# +# Unless otherwise indicated, this SOFTWARE has been authored by an +# employee or employees of the University of California, operator of the +# Los Alamos National Laboratory under Contract No. W-7405-ENG-36 with +# the U.S. Department of Energy. The U.S. Government has rights to use, +# reproduce, and distribute this SOFTWARE. The public may copy, distribute, +# prepare derivative works and publicly display this SOFTWARE without +# charge, provided that this Notice and any statement of authorship are +# reproduced on all copies. Neither the Government nor the University +# makes any warranty, express or implied, or assumes any liability or +# responsibility for the use of this SOFTWARE. +# +# If SOFTWARE is modified to produce derivative works, such modified +# SOFTWARE should be clearly marked, so as not to confuse it with the +# version available from LANL. +# +# For more information about POOMA, send e-mail to pooma at acl.lanl.gov, +# or visit the POOMA web page at http://www.acl.lanl.gov/pooma/. +# ---------------------------------------------------------------------- +# ACL:license + +########################################################################### +# POOMA configuration settings +# +# Platform: default, gnu toolchain +# Compiler: gcc +# +########################################################################### +# +# This file contains specialized settings indicating how to build POOMA +# with this platform and compiler. This is a perl script executed by +# the 'configure' script at the top level of the POOMA directory structure. +# This file has two sections: +# 1) The locations of include files and libraries for external packages. +# 3) The specialized settings on how to use this platform and compiler. +# You should edit the lines in section 1) to the proper location of the +# external packages. Do not edit the lines in section 2) unless you +# know what you're doing. +# +########################################################################### + +########################################################################### +# Section 0: architecture type +########################################################################### + +$archtype = "gnu"; + +########################################################################### +# Section 1: external package locations. +# Include search directories should have a '-I' prepended. +# Library search directories should have a '-L' prepended. +# Library filenames should just list the name or use -l prefix as needed. +# Required defines should have -a '-D' prepended. +########################################################################### + +### location of SMARTS files for threads + +$threads_able = 1; +$threads_default_dir = "/home/smarts/build/smarts-current"; +$threads_lib_subdir = "$archtype/lib"; +$threads_basic_makefile = "Makefile.smarts-g++"; +$threads_profile_makefile = "Makefile.smarts-tau-g++"; + + +### location of TAU files for profiling + +$profile_able = 1; +$profile_default_dir = "/home/tau/build/tau-current"; +$ductape_default_dir = "/usr/local/pooma/packages/ductape"; +$profile_archtype = "i386_linux"; +$profile_lib_subdir = "$profile_archtype/lib"; +$profile_basic_makefile = "Makefile.tau-gcc"; +$profile_smarts_makefile = "Makefile.tau-smarts-gcc"; +$profile_pthreads_makefile = "Makefile.tau-pthread-gcc"; + + +### location of PAWS files for program coupling + +$paws_able = 1; +$paws_default_dir = "/home/paws/build/paws-current"; +$paws_lib_subdir = "$archtype/lib"; +$paws_makefile = "Makefile.paws-gcc"; + + +### location of HDF5 files for I/O + +$hdf5_able = 1; +$hdf5_default_dir = "/usr/local/pooma/packages/hdf5"; + + +### location of FFTW files for ffts + +$fftw_able = 1; +$fftw_default_dir = "/home/pooma/packages/fftw/$archtype"; + + +### location of cheetah + +$cheetah_able = 1; +$cheetah_default_dir = "/home/cheetah/build/cheetah-1.0.0"; +$cheetah_arch = "$archtype"; +$cheetah_lib_subdir = "lib/g++"; +$cheetah_include_makefile = "Makefile.cheetah"; + + +### location of LUX files for runtime visualization + +$lux_able = 0; + + +### location and names of Purify analysis package + +$purify_able = 0; + + +### location and names of Insure++ analysis package + +$insure_able = 0; + + +########################################################################### +# Section 2: compilation settings +########################################################################### + +################### +### characteristics +################### + +$comptype = "gcc"; +$compext = "-gcc"; + +### are shared libraries supported? + +$canmakesharedlib = 0; + +### other special characteristics: for all special cases for this +### architecture that differ from the standard, include a line +### here to indicate what the differences are, setting a variable +### equal to one. If the architecture does the "right thing", though, +### there is no reason to mention anything here, although you can set +### the special characteristics variables to 0 if you want. + +# gcc does not have restrict (use __restrict__) +$no_restrict = 1; + +# Must include to get POSIX file modes +$inc_sys_stat_h_file_modes = 1; + +# Use gettimeofday in Utilities/Clock.h +$clock_uses_gettimeofday = 1; + +################ +### C++ settings +################ + +### general settings for using the C++ compiler, for both libs and apps + +$cpp = "g++"; +$cppargs = "-ftemplate-depth-80 -Drestrict=__restrict__"; +$cppex = ""; # flag to use exceptions +$cppnoex = "-fno-exceptions"; # flag to use to turn off exceptions +$cppverbose = "-Wall"; # flag for verbose compiler output +$cpponeper = ""; # flag to turn on one-instantance-per-obj +$cppstrict = " -ansi"; # flag for ANSI conformance checking + + +### debug or optimized build settings for C++ applications + +$cppdbg_app = "-g"; +$cppopt_app = "-DNOPAssert -DNOCTAssert -O2"; + + +### debug or optimized build settings for C++ libraries + +$cppdbg_lib = $cppdbg_app; +$cppopt_lib = $cppopt_app; + + +############## +### C settings +############## + +### general settings for using the C compiler, for both libs and apps + +$c = "gcc"; +$cargs = "-Drestrict=__restrict__"; +$cverbose = "-Wall"; + + +### debug or optimized build settings for C applications + +$cdbg_app = "-g"; +$copt_app = "-O2"; + + +### debug or optimized build settings for C libraries + +$cdbg_lib = $cdbg_app; +$copt_lib = $copt_app; + + +################ +### F77 settings +################ + +### general settings for using the F77 compiler, for both libs and apps + +$f77 = "g77"; +$f77args = ""; +$f77libs = ""; +$f77verbose = ""; + + +### debug or optimized build settings for F77 applications + +$f77dbg_app = "-g"; +$f77opt_app = "-O2"; + + +### debug or optimized build settings for F77 libraries + +$f77dbg_lib = $f77dbg_app; +$f77opt_lib = $f77opt_app; + + +################### +### linker settings +################### + +$link = $cpp; +$linkargs = ""; +$linkverbose = "-Wl,-v"; + +##################### +### archiver settings +##################### + +$ar = "ar"; # program to make static lib + +# arguments for making static lib +$arargs = "rc"; + +# flag to turn on verbose ar output +$arverbose = ""; + +# flag for exceptions +$arex = ""; + +# flag for no exceptions +$arnoex = ""; + +# flag for one instantiation per object +$aroneper = ""; + +# flag for ANSI conformance checking +$arstrict = ""; + +### debug or optimized build settings for archiving libraries + +$ardbg = ""; +$aropt = ""; + + +# ACL:rcsinfo +# ---------------------------------------------------------------------- +# $RCSfile: LINUXgcc.conf,v $ $Author: oldham $ +# $Revision: 1.4 $ $Date: 2001/10/15 17:34:28 $ +# ---------------------------------------------------------------------- +# ACL:rcsinfo + +########################################################################### +# the last line of this file must be a '1' so that Perl sees a non-zero +# results from this file +########################################################################### +1; + diff -Nru a/r2/configure b/r2/configure --- a/r2/configure Wed Jan 8 11:42:22 2003 +++ b/r2/configure Wed Jan 8 11:42:22 2003 @@ -774,7 +774,8 @@ } else { - printerror "You must specify an architecture with $archnm "; + print "Using default architecture file - override with --arch \n"; + $arch = "default"; } $archfile = $configarchdir . "/" . $arch . $archfileext; -r $archfile or die "Cannot find architecture file $archfile."; @@ -822,6 +823,11 @@ if (scalar @{$arghash{$cppnm}} > 1) { $cpp = $arghash{$cppnm}[1]; + # if no link cmd is specified, use $cpp + if (scalar @{$arghash{$linknm}} == 0) + { + $link = $cpp; + } } else { @@ -875,7 +881,7 @@ { $arargs .= " $arghash{$arargnm}[$i]"; } - for $i (2 .. $#{$arghash{$linkargnm}}) + for $i (1 .. $#{$arghash{$linkargnm}}) { $linkargs .= " $arghash{$linkargnm}[$i]"; } @@ -1695,13 +1701,13 @@ ### add settings for non-standard behavior sub setcharacteristics { - # if the system does not have the stringstream class, must use workaround - add_yesno_define("POOMA_NO_STRINGSTREAM", - $no_stringstream); - - # if the system is missing some of the iostream manipulators, must avoid them - add_yesno_define("POOMA_MISSING_IOMANIPS", - $no_complete_iomanips); +# # if the system does not have the stringstream class, must use workaround +# add_yesno_define("POOMA_NO_STRINGSTREAM", +# $no_stringstream); + +# # if the system is missing some of the iostream manipulators, must avoid them +# add_yesno_define("POOMA_MISSING_IOMANIPS", +# $no_complete_iomanips); # if the C++ compiler does not allow templated friends, must say so add_yesno_define("POOMA_NO_TEMPLATE_FRIENDS", @@ -1716,34 +1722,34 @@ add_yesno_define("POOMA_NO_OSTREAM_ITERATOR_1ARG", $no_ostream_iterator_1arg); - # if the compiler does not allow definitions of placement delete operations - add_yesno_define("POOMA_NO_PLACEMENT_DELETE", - $no_placement_delete); +# # if the compiler does not allow definitions of placement delete operations +# add_yesno_define("POOMA_NO_PLACEMENT_DELETE", +# $no_placement_delete); # should we include extra specializations of some things for small dim? add_yesno_define("POOMA_SMALL_DIM_SPECIALIZATIONS", $small_dim_specializations); - # if the C++ compiler does not allow template parameters to be dependent, - # on others (e.g., template, must say so - add_yesno_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS", - $no_dependent_templ_args); - - # if the C++ library does not have templated complex number class, say so - add_yesno_define("POOMA_NO_TEMPLATED_COMPLEX", - $no_templated_complex); - - # if the C++ library does not have complex number class in std::, say so - add_yesno_define("POOMA_NO_STD_COMPLEX", - $no_std_complex); +# # if the C++ compiler does not allow template parameters to be dependent, +# # on others (e.g., template, must say so +# add_yesno_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS", +# $no_dependent_templ_args); + +# # if the C++ library does not have templated complex number class, say so +# add_yesno_define("POOMA_NO_TEMPLATED_COMPLEX", +# $no_templated_complex); + +# # if the C++ library does not have complex number class in std::, say so +# add_yesno_define("POOMA_NO_STD_COMPLEX", +# $no_std_complex); # if the C++ library has O_BINARY defined add_yesno_define("POOMA_HAS_O_BINARY_OPEN_MODE", $o_binary_open_mode); - # if the C++ library does not have ios_base class in std::, say so - add_yesno_define("POOMA_NO_STD_IOSBASE", - $no_std_iosbase); +# # if the C++ library does not have ios_base class in std::, say so +# add_yesno_define("POOMA_NO_STD_IOSBASE", +# $no_std_iosbase); # if must include for POSIX file modes, say so add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", @@ -1855,7 +1861,7 @@ # put all the link options together my $totlibraries = "$preliblist $midliblist $postliblist"; my $liblinkargs="$linkshare $totlibraries"; - my $totlinkargs = "$linkargs $liblinkargs"; + my $totlinkargs = "$liblinkargs $linkargs"; # open the suite file and write out a prefix print "Writing suite file $suitefile ...\n"; @@ -2093,6 +2099,8 @@ print FHEADER "#ifndef POOMA_GENERATED_CONFIG_H\n"; print FHEADER "#define POOMA_GENERATED_CONFIG_H\n"; print FHEADER "\n"; + print FHEADER "#include \"PoomaAutoconf.h\"\n"; + print FHEADER "\n"; # go through all the defines, and write them out. First find max length # of macro names to get spacing right @@ -2196,7 +2204,7 @@ } # put all the link options together - my $totlinkargs = "$linkargs $linkshare $preliblist $midliblist $postliblist"; + my $totlinkargs = "$linkshare $preliblist $midliblist $postliblist $linkargs"; # put all the includes together my $totinclist = "-I\$(POOMA_LIBDIR)/$versionheaderbase$extensions $inclist"; @@ -2316,6 +2324,16 @@ close MFILE; } +sub runautoconf +{ + system("cp scripts/configure scripts/PoomaAutoconf.h.in lib/$suite/") == 0 + or die "Unable to copy autoconf configuration files: $?\n"; + chdir("lib/$suite"); + unlink("config.cache"); + system("env CXX=$cpp ./configure") == 0 + or die "Autoconf configuration failed: $?\n"; + chdir("../../"); +} ########################################################################### # @@ -2408,6 +2426,9 @@ ### create dependencies writedependfile; + +### run autoconfiguration part +runautoconf; ### print out final instructions printinstructions; diff -Nru a/r2/scripts/acconfig.h b/r2/scripts/acconfig.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/r2/scripts/acconfig.h Wed Jan 8 11:42:22 2003 @@ -0,0 +1,10 @@ +#undef POOMA_NO_STRINGSTREAM +#undef POOMA_MISSING_IOMANIPS +#undef POOMA_NO_STD_IOSBASE +#undef POOMA_NO_STD_COMPLEX +#undef POOMA_NO_TEMPLATED_COMPLEX +#undef POOMA_NO_DEPENDENT_TEMPLATE_ARGS +#undef POOMA_NO_PLACEMENT_DELETE +#undef POOMA_NO_TEMPLATEFUNC_DEFAULTARGS +#undef POOMA_NO_IOS_HEADER +#undef POOMA_NO_IOSBASE_FMTFLAGS diff -Nru a/r2/scripts/configure.in b/r2/scripts/configure.in --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/r2/scripts/configure.in Wed Jan 8 11:42:22 2003 @@ -0,0 +1,164 @@ +AC_INIT(configure) +AC_CONFIG_HEADER([PoomaAutoconf.h]) + +AC_PROG_CXX +AC_PROG_CXXCPP + +AC_LANG_CPLUSPLUS + +dnl +dnl check for IO manipulators +dnl +AC_MSG_CHECKING([wether we have complete IO manipulators]) +AC_TRY_COMPILE([ +#include +#include +], [ + std::cout << std::left; +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_MISSING_IOMANIPS) +]) + +dnl +dnl check for std iosbase +dnl +AC_MSG_CHECKING([wether we have a standard iosbase class]) +AC_TRY_COMPILE([ +#include +#include +class Inform; +inline Inform &operator<<(Inform &o, std::ios_base &(*d)(std::ios_base &)) +{ +} +], [ +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_STD_IOSBASE) +]) + +dnl +dnl check for stringstream +dnl +AC_MSG_CHECKING([wether we have sstream]) +AC_TRY_COMPILE([ +#include +], [ + std::ostringstream *msg; +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_STRINGSTREAM) +]) + +dnl +dnl check for complex in std and templated complex +dnl +AC_MSG_CHECKING([wether we have a complex inside std]) +AC_TRY_COMPILE([ +#include +], [ + std::complex val; +], [ +complexok=yes +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_STD_COMPLEX) +]) +if test x$complexok != xyes; then + AC_MSG_CHECKING([wether we have a not-templated complex]) + AC_TRY_COMPILE([ + #include + ], [ + complex val; + ], [ + AC_MSG_RESULT([no]) + ] , [ + AC_MSG_RESULT([yes]) + AC_DEFINE(POOMA_NO_TEMPLATED_COMPLEX) + ]) +fi + +dnl +dnl check for dependent template arguments +dnl +AC_MSG_CHECKING([wether we support dependent template arguments]) +AC_TRY_COMPILE([ +template +class Foo; +template +class Foo { +}; +], [ +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_DEPENDENT_TEMPLATE_ARGS) +]) + +dnl +dnl check for placement delete operator support +dnl +AC_MSG_CHECKING([wether we support delete operators with placement argument]) +AC_TRY_COMPILE([ +class foo { + void operator delete(void *, void *) { } +}; +], [ +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_PLACEMENT_DELETE) +]) + +dnl +dnl check for correct handling of default arguments to specialized +dnl template functions +dnl +AC_MSG_CHECKING([wether we handle default args to template functions correct]) +AC_TRY_COMPILE([ +template +class Centering {}; +template +const Centering test(int a, int b = 0); +template <> +const Centering<1> test<1>(int a, int b); +], [ + Centering<1> c = test<1>(1); +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_TEMPLATEFUNC_DEFAULTARGS) +]) + +dnl +dnl check for ios header, use iostream if not +dnl +AC_CHECK_HEADER([ios], , [ AC_DEFINE(POOMA_NO_IOS_HEADER) ]) + +dnl +dnl check for std::ios_base::fmtflags +dnl +AC_MSG_CHECKING([wether we have std::ios_base::fmtflags]) +AC_TRY_COMPILE([ +#include +typedef std::ios_base::fmtflags FmtFlags_t; +], [ + FmtFlags_t f; +], [ +AC_MSG_RESULT([yes]) +] , [ +AC_MSG_RESULT([no]) +AC_DEFINE(POOMA_NO_IOSBASE_FMTFLAGS) +]) + +AC_OUTPUT() diff -Nru a/r2/src/Field/FieldCentering.h b/r2/src/Field/FieldCentering.h --- a/r2/src/Field/FieldCentering.h Wed Jan 8 11:42:22 2003 +++ b/r2/src/Field/FieldCentering.h Wed Jan 8 11:42:22 2003 @@ -538,11 +538,19 @@ extern const CanonicalCentering<2> canonicalCenteringTwo_g; extern const CanonicalCentering<3> canonicalCenteringThree_g; +#if POOMA_NO_TEMPLATEFUNC_DEFAULTARGS +template +const Centering canonicalCentering + (const enum CenteringType type, + const enum ContinuityType discontinuous, + const int dimension); +#else template const Centering canonicalCentering (const enum CenteringType type, const enum ContinuityType discontinuous, const int dimension = 0); +#endif template <> const Centering<1> canonicalCentering<1> @@ -561,6 +569,16 @@ (const enum CenteringType type, const enum ContinuityType discontinuous, const int dimension); + +#if POOMA_NO_TEMPLATEFUNC_DEFAULTARGS +template +inline const Centering canonicalCentering + (const enum CenteringType type, + const enum ContinuityType discontinuous) +{ + return canonicalCentering(type, discontinuous, 0); +} +#endif //----------------------------------------------------------------------------- // diff -Nru a/r2/src/IO/DiskLayout.cmpl.cpp b/r2/src/IO/DiskLayout.cmpl.cpp --- a/r2/src/IO/DiskLayout.cmpl.cpp Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/DiskLayout.cmpl.cpp Wed Jan 8 11:42:22 2003 @@ -53,9 +53,7 @@ #include "Layout/UniformGridLayout.h" #include "Tulip/RemoteProxy.h" -// Re-check this when GCC 3.0 is ported - -#if defined(__CYGWIN32__) +#if POOMA_NO_IOS_HEADER #include #else #include diff -Nru a/r2/src/IO/DiskLayout.h b/r2/src/IO/DiskLayout.h --- a/r2/src/IO/DiskLayout.h Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/DiskLayout.h Wed Jan 8 11:42:22 2003 @@ -58,6 +58,7 @@ #include // file I/O #include // node lists +#include //----------------------------------------------------------------------------- // struct DiskNode diff -Nru a/r2/src/IO/FileSetReader.cmpl.cpp b/r2/src/IO/FileSetReader.cmpl.cpp --- a/r2/src/IO/FileSetReader.cmpl.cpp Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/FileSetReader.cmpl.cpp Wed Jan 8 11:42:22 2003 @@ -43,9 +43,7 @@ #include -// Really should add a POOMA_HAS_IOS_INCLUDE config macro. - -#if !(defined(__GNUC__) && (__GNUC__ < 3)) +#if !POOMA_NO_IOS_HEADER # include #endif diff -Nru a/r2/src/IO/FileSetReader.cpp b/r2/src/IO/FileSetReader.cpp --- a/r2/src/IO/FileSetReader.cpp Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/FileSetReader.cpp Wed Jan 8 11:42:22 2003 @@ -44,9 +44,7 @@ #include -// Really should add a POOMA_HAS_IOS_INCLUDE config macro. - -#if !(defined(__GNUC__) && (__GNUC__ < 3)) +#if !POOMA_NO_IOS_HEADER # include #endif diff -Nru a/r2/src/IO/tests/DiskLayoutTest1.cpp b/r2/src/IO/tests/DiskLayoutTest1.cpp --- a/r2/src/IO/tests/DiskLayoutTest1.cpp Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/tests/DiskLayoutTest1.cpp Wed Jan 8 11:42:22 2003 @@ -48,7 +48,7 @@ #include -#if !defined(__CYGWIN32__) +#if !POOMA_NO_IOS_HEADER # include #endif diff -Nru a/r2/src/IO/tests/FileSetReaderTest0.cpp b/r2/src/IO/tests/FileSetReaderTest0.cpp --- a/r2/src/IO/tests/FileSetReaderTest0.cpp Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/tests/FileSetReaderTest0.cpp Wed Jan 8 11:42:22 2003 @@ -44,7 +44,7 @@ #include -#if !(defined(__GNUC__) && __GNUC__ < 3) +#if !POOMA_NO_IOS_HEADER # include #endif diff -Nru a/r2/src/IO/tests/dumper.cpp b/r2/src/IO/tests/dumper.cpp --- a/r2/src/IO/tests/dumper.cpp Wed Jan 8 11:42:22 2003 +++ b/r2/src/IO/tests/dumper.cpp Wed Jan 8 11:42:22 2003 @@ -32,8 +32,8 @@ #include #include // replace -#if !(defined(__GNUC__) && __GNUC__ < 3) -#include +#if !POOMA_NO_IOS_HEADER +# include #endif using std::cout; diff -Nru a/r2/src/Tiny/TinyMatrix.h b/r2/src/Tiny/TinyMatrix.h --- a/r2/src/Tiny/TinyMatrix.h Wed Jan 8 11:42:22 2003 +++ b/r2/src/Tiny/TinyMatrix.h Wed Jan 8 11:42:22 2003 @@ -56,7 +56,11 @@ #include "Tiny/TinyMatrixEngine.h" #include "Tiny/TinyMatrixElements.h" #include "Tiny/TinyMatrixOperators.h" +#if POOMA_NO_IOS_HEADER +#include +#else #include +#endif //----------------------------------------------------------------------------- // Forward Declarations: diff -Nru a/r2/src/Tiny/Vector.h b/r2/src/Tiny/Vector.h --- a/r2/src/Tiny/Vector.h Wed Jan 8 11:42:22 2003 +++ b/r2/src/Tiny/Vector.h Wed Jan 8 11:42:22 2003 @@ -56,7 +56,11 @@ #include "Tiny/VectorEngine.h" #include "Tiny/VectorElements.h" #include "Tiny/VectorOperators.h" +#if POOMA_NO_IOS_HEADER +#include +#else #include +#endif //----------------------------------------------------------------------------- // Forward Declarations: diff -Nru a/r2/src/Utilities/Inform.h b/r2/src/Utilities/Inform.h --- a/r2/src/Utilities/Inform.h Wed Jan 8 11:42:22 2003 +++ b/r2/src/Utilities/Inform.h Wed Jan 8 11:42:22 2003 @@ -275,8 +275,7 @@ void print() { flush(); } void output() { flush(); } -#if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) \ - || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) +#if !POOMA_NO_IOSBASE_FMTFLAGS typedef std::ios_base::fmtflags FmtFlags_t; #else typedef long FmtFlags_t; From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 13:49:08 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 8 Jan 2003 14:49:08 +0100 (CET) Subject: [RFC] PatchFunction cleanup/extension Message-ID: Hi! I'm in the beginning of cleaning up PatchFunction and make it do what I need. I stumbled over the DataObjectRequest<> object and wonder, if the order of requesting read and write locks matter? I.e. is DataObjectRequest writeReq(*this); engineFunctor(engine1,writeReq); DataObjectRequest readReq(writeReq); engineFunctor(engine2,readReq); the same as DataObjectRequest writeReq(*this); DataObjectRequest readReq(writeReq); engineFunctor(engine2,readReq); engineFunctor(engine1,writeReq); ? A little cleanup of PatchFunction/PatchKernel sofar brought control over read/write attributes of PatchTag type operations, like the ParticleTags and reduces the number of sourcelines by using overloads rather than partial specializations for the PatchEvaluator<> class. Is this sound? Other Comments? Richard. Oh - in the near future I need about 5-7 arrays I can operate on with PatchFunction<> and support for Remote MultiPatch engines, too. If we only had a "real" preprocessor... ===== PatchFunction.h 1.2 vs edited ===== --- 1.2/r2/src/Evaluator/PatchFunction.h Thu Dec 19 10:37:26 2002 +++ edited/PatchFunction.h Wed Jan 8 14:40:02 2003 @@ -36,32 +36,11 @@ ////////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// Overview: -// -// PatchFunction is mix-in class that encapsulates evaluation of patch-based -// functors in parallel. -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// Typedefs: -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// Includes: -//----------------------------------------------------------------------------- - -#include "PETE/PETE.h" -#include "Pooma/PETE/AssertEquals.h" -#include "Evaluator/EvaluatorTags.h" -#include "Evaluator/Evaluator.h" -#include "Evaluator/PatchKernel.h" -#include "Engine/EnginePatch.h" -#include "Threads/PoomaCSem.h" - -//----------------------------------------------------------------------------- -// -// Full Description: +/** @file + * @ingroup Evaluator + * @brief + * PatchFunction is mix-in class that encapsulates evaluation of patch-based + * functors in parallel. // // PatchFunctions are tools that allow you to apply a functor to the patches // in an array in parallel. For example, you could write a functor: @@ -89,20 +68,55 @@ // Constructor arguments are passed to the constructor of a functor object // of type Functor. Tag is a policy tag specifying the type of action // performed. Currently the following tags are supported: -// +*/ + +//----------------------------------------------------------------------------- +// Typedefs: +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Includes: //----------------------------------------------------------------------------- +#include "PETE/PETE.h" +#include "Pooma/PETE/AssertEquals.h" +#include "Evaluator/EvaluatorTags.h" +#include "Evaluator/Evaluator.h" +#include "Evaluator/PatchKernel.h" +#include "Engine/EnginePatch.h" +#include "Threads/PoomaCSem.h" + + //----------------------------------------------------------------------------- // Policy tags for patch functions. -// -// PatchParticleN - recommended for operations on particles, bypasses the -// intersection process and just loops through the patches. //----------------------------------------------------------------------------- -struct PatchTag1 { }; -struct PatchReadTag1 { }; -struct PatchTag2 { }; -struct PatchTag3 { }; +// Patch tags that include intersection process. + +template +struct PatchRWTag1 { + enum { write1 = Write1, + any = Write1 }; +}; +template +struct PatchRWTag2 { + enum { write1 = Write1, write2 = Write2, + any = Write1 || Write2 }; +}; +template +struct PatchRWTag3 { + enum { write1 = Write1, write2 = Write2, write3 = Write3, + any = Write1 || Write2 || Write3 }; +}; + +// Backward compatibility typedefs. +typedef PatchRWTag1 PatchTag1; +typedef PatchRWTag1 PatchReadTag1; +typedef PatchRWTag2 PatchTag2; +typedef PatchRWTag3 PatchTag3; + +// PatchParticleN - recommended for operations on particles, bypasses the +// intersection process and just loops through the patches. template struct PatchParticle1 { }; @@ -134,31 +148,16 @@ ~PatchEvaluator() {} - template + template void evaluate(const A1& a1, const Function& function) const { - typedef typename EvaluatorTag1::Evaluator_t Evaluator_t; - PatchEvaluator evaluator; - Pooma::Scheduler_t &scheduler = Pooma::scheduler(); - scheduler.beginGeneration(); - evaluator.evaluate(a1(), function); - notifyEngineWrite(a1.engine()); - scheduler.endGeneration(); - - if (Pooma::blockingExpressions()) - { - Pooma::blockAndEvaluate(); - } - } - - template - void evaluateRead(const A1& a1, const Function& function) const - { - typedef typename EvaluatorTag1::Evaluator_t Evaluator_t; - PatchEvaluator evaluator; + typedef typename EvaluatorTag1::Evaluator_t Eval_t; + PatchEvaluator evaluator; Pooma::Scheduler_t &scheduler = Pooma::scheduler(); scheduler.beginGeneration(); - evaluator.evaluateRead(a1(), function); + evaluator.evaluate(a1(), function); + if (ReadWriteTag::write1) + notifyEngineWrite(a1.engine()); scheduler.endGeneration(); if (Pooma::blockingExpressions()) @@ -167,16 +166,19 @@ } } - template - void evaluate2(const A1& a1, const A2& a2, + template + void evaluate(const A1& a1, const A2& a2, const Function& function) const { typedef typename EvaluatorTag::Evaluator_t Eval_t; PatchEvaluator evaluator; Pooma::Scheduler_t &scheduler = Pooma::scheduler(); scheduler.beginGeneration(); - evaluator.evaluate2(a1(), a2(), function); - notifyEngineWrite(a1.engine()); + evaluator.evaluate(a1(), a2(), function); + if (ReadWriteTag::write1) + notifyEngineWrite(a1.engine()); + if (ReadWriteTag::write2) + notifyEngineWrite(a2.engine()); scheduler.endGeneration(); if (Pooma::blockingExpressions()) @@ -185,8 +187,8 @@ } } - template - void evaluate3(const A1& a1, const A2& a2, const A3 &a3, + template + void evaluate(const A1& a1, const A2& a2, const A3 &a3, const Function& function) const { typedef typename EvaluatorTag1::Evaluator_t Eval2_t; @@ -198,8 +200,13 @@ PatchEvaluator evaluator; Pooma::Scheduler_t &scheduler = Pooma::scheduler(); scheduler.beginGeneration(); - evaluator.evaluate3(a1(), a2(), a3(), function); - notifyEngineWrite(a1.engine()); + evaluator.evaluate(a1(), a2(), a3(), function); + if (ReadWriteTag::write1) + notifyEngineWrite(a1.engine()); + if (ReadWriteTag::write2) + notifyEngineWrite(a2.engine()); + if (ReadWriteTag::write3) + notifyEngineWrite(a3.engine()); scheduler.endGeneration(); if (Pooma::blockingExpressions()) @@ -231,37 +238,29 @@ // ~PatchEvaluator() {} - template + template void evaluate(const A1& a1, const Function& function) const { - Pooma::Iterate_t *iterate = new PatchKernel(a1,function); - Pooma::scheduler().handOff(iterate); - } - - template - void evaluateRead(const A1& a1, const Function& function) const - { - Pooma::Iterate_t *iterate = new PatchKernel(a1,function); + Pooma::Iterate_t *iterate = + new PatchKernel(a1,function); Pooma::scheduler().handOff(iterate); } - template - void evaluate2(const A1 &a1, const A2 &a2, + template + void evaluate(const A1 &a1, const A2 &a2, const Function &function) const { Pooma::Iterate_t *iterate = - new PatchKernel2(a1,a2,function); - + new PatchKernel2(a1,a2,function); Pooma::scheduler().handOff(iterate); } - template - void evaluate3(const A1 &a1, const A2 &a2, const A3 &a3, + template + void evaluate(const A1 &a1, const A2 &a2, const A3 &a3, const Function &function) const { Pooma::Iterate_t *iterate = - new PatchKernel3(a1,a2,a3,function); - + new PatchKernel3(a1,a2,a3,function); Pooma::scheduler().handOff(iterate); } @@ -290,7 +289,7 @@ // ~PatchEvaluator() {} - template + template void evaluate(const A1& a1,const Function& function) const { typedef Intersector Inter_t; @@ -301,20 +300,14 @@ typename Inter_t::const_iterator i = inter.begin(); while (i != inter.end()) { - PatchEvaluator().evaluate(a1(*i),function); + PatchEvaluator(). + evaluate(a1(*i),function); ++i; } } - template - inline - void evaluateRead(const A1& a1,const Function& function) const - { - evaluate(a1,function); - } - - template - void evaluate2(const A1& a1, const A2& a2, + template + void evaluate(const A1& a1, const A2& a2, const Function& function) const { typedef Intersector Inter_t; @@ -326,16 +319,15 @@ typename Inter_t::const_iterator i = inter.begin(); while (i != inter.end()) { - PatchEvaluator().evaluate2(a1(*i), a2(*i), - function - ); + PatchEvaluator(). + evaluate(a1(*i), a2(*i), function); ++i; } } - template - void evaluate3(const A1 &a1, const A2 &a2, const A3 &a3, - const Function& function) const + template + void evaluate(const A1 &a1, const A2 &a2, const A3 &a3, + const Function& function) const { typedef Intersector Inter_t; Inter_t inter; @@ -348,7 +340,7 @@ while (i != inter.end()) { PatchEvaluator(). - evaluate3(a1(*i), a2(*i), a3(*i), function); + evaluate(a1(*i), a2(*i), a3(*i), function); ++i; } } @@ -651,38 +643,9 @@ { } -template +template class PatchFunction { -}; - -template -class PatchFunction -{ -public: - - PatchFunction() { } - PatchFunction(const Function &function) : function_m(function) { } - - POOMA_PATCHFUNCTION_ARGUMENT_CONSTRUCTORS(PatchFunction,function_m) - - template - inline void - operator()(const Array& a) const - { - PatchEvaluator().evaluate(a,function()); - } - - inline const Function &function() const { return function_m; } - -private: - - Function function_m; -}; - -template -class PatchFunction -{ public: PatchFunction() { } @@ -690,57 +653,25 @@ POOMA_PATCHFUNCTION_ARGUMENT_CONSTRUCTORS(PatchFunction,function_m) - template + template inline void - operator()(const Array& a) const + operator()(const Array1& a) const { - PatchEvaluator().evaluateRead(a,function()); + PatchEvaluator().evaluate(a,function()); } - inline const Function &function() const { return function_m; } - -private: - - Function function_m; -}; - -template -class PatchFunction -{ -public: - PatchFunction() { } - PatchFunction(const Function &function) : function_m(function) { } - - POOMA_PATCHFUNCTION_ARGUMENT_CONSTRUCTORS(PatchFunction,function_m) - template inline void operator()(const Array1 &a1, const Array2 &a2) const { - PatchEvaluator().evaluate2(a1,a2,function()); + PatchEvaluator().evaluate(a1,a2,function()); } - inline const Function &function() const { return function_m; } - -private: - - Function function_m; -}; - -template -class PatchFunction -{ -public: - PatchFunction() { } - PatchFunction(const Function &function) : function_m(function) { } - - POOMA_PATCHFUNCTION_ARGUMENT_CONSTRUCTORS(PatchFunction,function_m) - template inline void operator()(const Array1 &a1, const Array2 &a2, const Array3 &a3) const { - PatchEvaluator().evaluate3(a1,a2,a3,function()); + PatchEvaluator().evaluate(a1,a2,a3,function()); } inline const Function &function() const { return function_m; } ===== PatchKernel.h 1.2 vs edited ===== --- 1.2/r2/src/Evaluator/PatchKernel.h Thu Dec 19 10:37:26 2002 +++ edited/PatchKernel.h Wed Jan 8 14:40:02 2003 @@ -36,11 +36,12 @@ ////////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// Overview: -// A PatchKernel encapsulates performing operations on a patch of an -// expression. -//----------------------------------------------------------------------------- +/** @file + * @ingroup Evaluator + * @brief + * A PatchKernel encapsulates performing operations on a patch of an + * expression. + */ //----------------------------------------------------------------------------- // Typedefs: @@ -63,30 +64,28 @@ // Forward Declarations: //----------------------------------------------------------------------------- -template +template class PatchKernel : public Pooma::Iterate_t { public: - PatchKernel(const A1& a1, const Function& function, bool write = true) + PatchKernel(const A1& a1, const Function& function) : Pooma::Iterate_t(Pooma::scheduler()), - write_m(write), a1_m(a1), function_m(function) + a1_m(a1), function_m(function) { DataObjectRequest getAffinity; hintAffinity(engineFunctor(a1_m.engine(),getAffinity)); // Request locks - // currently we ignore write_m, because I'm not sure if iterates + // currently we ignore ReadWriteTag::write1, because I'm not sure if iterates // will run if they don't have a write lock requested. DataObjectRequest writeReq(*this); engineFunctor(a1_m.engine(),writeReq); - } virtual ~PatchKernel() { - DataObjectRequest writeReq; engineFunctor(a1_m.engine(),writeReq); } @@ -97,13 +96,11 @@ } private: - - bool write_m; A1 a1_m; Function function_m; }; -template +template class PatchKernel2 : public Pooma::Iterate_t { @@ -124,7 +121,10 @@ // on the right. DataObjectRequest writeReq(*this); - engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write1 || !ReadWriteTag::any) + engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write2) + engineFunctor(a2_m.engine(),writeReq); // Now make the read request. // Use the remembered write request block to check and see @@ -132,24 +132,32 @@ // iterated instead of a request of the data object. DataObjectRequest readReq(writeReq); - engineFunctor(a2_m.engine(),readReq); - } + if (!ReadWriteTag::write1 && ReadWriteTag::any) + engineFunctor(a1_m.engine(),readReq); + if (!ReadWriteTag::write2) + engineFunctor(a2_m.engine(),readReq); + } virtual ~PatchKernel2() { - // The write request remembers the data block it sees on the left // so that it can check and see if it finds it on the right. DataObjectRequest writeReq; - engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write1 || !ReadWriteTag::any) + engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write2) + engineFunctor(a2_m.engine(),writeReq); // The read request checks to see if the data object for the left // appears on the right. If it does, it doesn't do a release for it // since a request wasn't generated above. DataObjectRequest readReq(writeReq); - engineFunctor(a2_m.engine(),readReq); + if (!ReadWriteTag::write1 && ReadWriteTag::any) + engineFunctor(a1_m.engine(),readReq); + if (!ReadWriteTag::write2) + engineFunctor(a2_m.engine(),readReq); } virtual void run() @@ -158,14 +166,14 @@ } private: - A1 a1_m; A2 a2_m; Function function_m; }; -template -class PatchKernel3 : public Pooma::Iterate_t +template +class PatchKernel3 + : public Pooma::Iterate_t { public: PatchKernel3(const A1 &a1, const A2 &a2, const A3 &a3, @@ -184,7 +192,12 @@ // on the right. DataObjectRequest writeReq(*this); - engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write1 || !ReadWriteTag::any) + engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write2) + engineFunctor(a2_m.engine(),writeReq); + if (ReadWriteTag::write3) + engineFunctor(a3_m.engine(),writeReq); // Now make the read request. // Use the remembered write request block to check and see @@ -192,8 +205,12 @@ // iterated instead of a request of the data object. DataObjectRequest readReq(writeReq); - engineFunctor(a2_m.engine(),readReq); - engineFunctor(a3_m.engine(),readReq); + if (!ReadWriteTag::write1 && ReadWriteTag::any) + engineFunctor(a1_m.engine(),readReq); + if (!ReadWriteTag::write2) + engineFunctor(a2_m.engine(),readReq); + if (!ReadWriteTag::write2) + engineFunctor(a3_m.engine(),readReq); } virtual ~PatchKernel3() @@ -202,15 +219,24 @@ // so that it can check and see if it finds it on the right. DataObjectRequest writeReq; - engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write1 || !ReadWriteTag::any) + engineFunctor(a1_m.engine(),writeReq); + if (ReadWriteTag::write2) + engineFunctor(a2_m.engine(),writeReq); + if (ReadWriteTag::write3) + engineFunctor(a3_m.engine(),writeReq); // The read request checks to see if the data object for the left // appears on the right. If it does, it doesn't do a release for it // since a request wasn't generated above. DataObjectRequest readReq(writeReq); - engineFunctor(a2_m.engine(),readReq); - engineFunctor(a3_m.engine(),readReq); + if (!ReadWriteTag::write1 && ReadWriteTag::any) + engineFunctor(a1_m.engine(),readReq); + if (!ReadWriteTag::write2) + engineFunctor(a2_m.engine(),readReq); + if (!ReadWriteTag::write3) + engineFunctor(a3_m.engine(),readReq); } virtual void run() From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 14:11:06 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 8 Jan 2003 15:11:06 +0100 (CET) Subject: [pooma-dev] [RFC] PatchFunction cleanup/extension In-Reply-To: Message-ID: On Wed, 8 Jan 2003, Richard Guenther wrote: > Oh - in the near future I need about 5-7 arrays I can operate on with > PatchFunction<> and support for Remote MultiPatch engines, too. If we > only had a "real" preprocessor... I'm thinking along using the MultiArgX<> classes for this and partially specialize PatchKernel<> on the MultiArgX<> class. But of course this would break backward compatibility (which one could perhaps workaround in PatchFunction<>). Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 16:10:02 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 8 Jan 2003 17:10:02 +0100 (CET) Subject: [PATCH] prevent make from going crazy without SUITE Message-ID: Hi! The following patch prevents make from going crazy without a configured tree (i.e. no SUITE) (remember: exit 1 doesnt do anything good in $(shell ...) invocations...) Ok? Richard. diff -Nru a/r2/config/Shared/findsuite.sh b/r2/config/Shared/findsuite.sh --- a/r2/config/Shared/findsuite.sh Wed Jan 8 17:09:35 2003 +++ b/r2/config/Shared/findsuite.sh Wed Jan 8 17:09:35 2003 @@ -28,11 +28,12 @@ cd $1 -flist=`ls -1 config/*.suite.mk` +flist=`ls 2>/dev/null -1 config/*.suite.mk` -if [ "$flist" = "" ]; then - echo "Cannot find SUITE file. SUITE not set." - exit 1 +if test -z "$flist"; then +# return some weird suite to let make fail + echo "#NoSuiteFound" + exit fi for f in $flist; do From oldham at codesourcery.com Wed Jan 8 16:14:14 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Wed, 08 Jan 2003 08:14:14 -0800 Subject: [PATCH] prevent make from going crazy without SUITE References: Message-ID: <3E1C4E56.2030503@codesourcery.com> Richard Guenther wrote: > Hi! > > The following patch prevents make from going crazy without a > configured tree (i.e. no SUITE) (remember: exit 1 doesnt do > anything good in $(shell ...) invocations...) > > Ok? > > Richard. > > diff -Nru a/r2/config/Shared/findsuite.sh b/r2/config/Shared/findsuite.sh > --- a/r2/config/Shared/findsuite.sh Wed Jan 8 17:09:35 2003 > +++ b/r2/config/Shared/findsuite.sh Wed Jan 8 17:09:35 2003 > @@ -28,11 +28,12 @@ > > > cd $1 > -flist=`ls -1 config/*.suite.mk` > +flist=`ls 2>/dev/null -1 config/*.suite.mk` > > -if [ "$flist" = "" ]; then > - echo "Cannot find SUITE file. SUITE not set." > - exit 1 > +if test -z "$flist"; then > +# return some weird suite to let make fail > + echo "#NoSuiteFound" > + exit > fi > > for f in $flist; do I believe the original echo message provides more intuitive information to the user. Can we use it with your change to 'exit'? Thanks, Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 20:58:24 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 8 Jan 2003 21:58:24 +0100 (CET) Subject: [PATCH] prevent make from going crazy without SUITE In-Reply-To: <3E1C4E56.2030503@codesourcery.com> Message-ID: On Wed, 8 Jan 2003, Jeffrey Oldham wrote: > Richard Guenther wrote: > > Hi! > > > > The following patch prevents make from going crazy without a > > configured tree (i.e. no SUITE) (remember: exit 1 doesnt do > > anything good in $(shell ...) invocations...) > > I believe the original echo message provides more intuitive information > to the user. Can we use it with your change to 'exit'? Well :) The message isnt going to the user, but is used as value for SUITE in the makefile - remember, a makefile $(shell cmd) cmd does not care about exit values of the command, but just evaluates to the cmds output. So at the moment SUITE becomes 'no such file config/*.suite.mk' or the like, with my changes it becomes '#NoSuiteFile' and this value causes the makefile to abort later rather than going completely crazy and creating random directories and files around the curren directory. Now ok without changes? Richard. From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 21:33:40 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 8 Jan 2003 22:33:40 +0100 (CET) Subject: [pooma-dev] [PATCH] Use autoconf for basic configuration stuff In-Reply-To: Message-ID: On Wed, 8 Jan 2003, Richard Guenther wrote: > I extracted and cleaned up the autoconfiscation of the compiler/library > features. Oh btw. - how do we handle autogenerated files and CVS? Check them (the configure script) in? If so, I'll convert this to autoconf 2.5 syntax first. Richard. From oldham at codesourcery.com Wed Jan 8 22:42:43 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Wed, 08 Jan 2003 14:42:43 -0800 Subject: [PATCH] prevent make from going crazy without SUITE References: Message-ID: <3E1CA963.9050504@codesourcery.com> Richard Guenther wrote: > On Wed, 8 Jan 2003, Jeffrey Oldham wrote: > > >>Richard Guenther wrote: >> >>>Hi! >>> >>>The following patch prevents make from going crazy without a >>>configured tree (i.e. no SUITE) (remember: exit 1 doesnt do >>>anything good in $(shell ...) invocations...) >> >>I believe the original echo message provides more intuitive information >>to the user. Can we use it with your change to 'exit'? > > > Well :) The message isnt going to the user, but is used as value for SUITE > in the makefile - remember, a makefile $(shell cmd) cmd does not care > about exit values of the command, but just evaluates to the cmds output. > > So at the moment SUITE becomes 'no such file config/*.suite.mk' or the > like, with my changes it becomes '#NoSuiteFile' and this value causes the > makefile to abort later rather than going completely crazy and creating > random directories and files around the curren directory. > > Now ok without changes? > > Richard. Yes. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Wed Jan 8 23:07:10 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 9 Jan 2003 00:07:10 +0100 (CET) Subject: [PATCH] Detect correct make command in configure Message-ID: Hi! On debian, GNU make is installed as make while gmake is not available. So setting $make to gmake in configure fails to create the suite directories and thus the build fails. Ok? Richard. 2002Jan09 Richard Guenther * configure: use make, if gmake is not available. diff -u -u -r1.106 configure --- configure 6 Jan 2003 17:49:58 -0000 1.106 +++ configure 8 Jan 2003 23:04:27 -0000 @@ -100,8 +100,15 @@ # ########################################################################### -### the name of the make program -$makecmd = gmake; +### the name of the make program - gmake if available, else make +if ( system("gmake README") == 0 ) + { + $makecmd = gmake; + } +else + { + $makecmd = make; + } ### the directory of the config and arch files, and the archfile extension $configsuitedir = "config"; From oldham at codesourcery.com Wed Jan 8 23:10:56 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Wed, 08 Jan 2003 15:10:56 -0800 Subject: [pooma-dev] [PATCH] Detect correct make command in configure References: Message-ID: <3E1CB000.7080808@codesourcery.com> Richard Guenther wrote: > Hi! > > On debian, GNU make is installed as make while gmake is not available. > So setting $make to gmake in configure fails to create the suite > directories and thus the build fails. > > Ok? Yes. > Richard. > > 2002Jan09 Richard Guenther > > * configure: use make, if gmake is not available. > > diff -u -u -r1.106 configure > --- configure 6 Jan 2003 17:49:58 -0000 1.106 > +++ configure 8 Jan 2003 23:04:27 -0000 > @@ -100,8 +100,15 @@ > # > ########################################################################### > > -### the name of the make program > -$makecmd = gmake; > +### the name of the make program - gmake if available, else make > +if ( system("gmake README") == 0 ) > + { > + $makecmd = gmake; > + } > +else > + { > + $makecmd = make; > + } > > ### the directory of the config and arch files, and the archfile extension > $configsuitedir = "config"; > -- Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Fri Jan 10 21:52:34 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Fri, 10 Jan 2003 22:52:34 +0100 (CET) Subject: [PATCH] Introduce autoconf Message-ID: Hi! The following patch is a further reduced introduction of autoconfisciation of parts of the configuration process. It introduces scripts/configure.ac (and scripts/configure, if autogenerated files should be in CVS) and changes the toplevel configure script to write the suite file, the makefile stub and the pooma configuration header as .in file and pass it down through a autoconf configure script. For now some of the compiler feature bits are checked and substituted in the pooma configuration header. Tested by configuring and installing on ia32-gnu-linux and configuring on HP-UX (aCC sucks) and IRIX (CC sucks, too). Ok? Richard. 2002Jan10 Richard Guenther * scripts/configure.ac: new. configure: generate lib/$suite/suite.mk.in, lib/$suite/Makefile.pooma.in and lib/$suite/PoomaConfiguration.h.in and from them generate using scripts/configure autoconf script the config/$suite.suite.mk, lib/$suite/Makefile.pooma-EXT and lib/$suite/PoomaConfiguration.h files. Use scripts/configure to check for compiler feature bits. Index: configure =================================================================== RCS file: /home/pooma/Repository/r2/configure,v retrieving revision 1.107 diff -u -u -r1.107 configure --- configure 8 Jan 2003 23:18:47 -0000 1.107 +++ configure 10 Jan 2003 21:41:33 -0000 @@ -101,7 +101,7 @@ ########################################################################### ### the name of the make program - gmake if available, else make -if ( system("gmake README") == 0 ) +if ( system("gmake -v >/dev/null 2>&1") == 0 ) { $makecmd = gmake; } @@ -548,6 +548,9 @@ ### list of defines that should be surrounded by #ifndef checks @protecteddeflist = (); +### list of autoconfigured #define statements in header + at autoconfdeflist = (); + ### list of -D define statements that should go with each compilation $defines = ""; @@ -669,6 +672,20 @@ } +### adds a define stub that gets substituted by autoconf +sub add_autoconf_define +{ + my ($argstring) = @_; + if (not $argstring) + { + die "Error in add_yesno_define: must supply one arguments.\n"; + } + $argstring .= "=\@$argstring\@"; + print " Adding autoconf define string = $argstring.\n" if $dbgprnt; + push @autoconfdeflist, $argstring; +} + + ### if the second argument is true, add a define to our list of the form ### FIRSTARG=POOMA_YES; otherwise, add it as FIRSTARG=POOMA_NO ### Same as add_yesno_define, except protected @@ -829,6 +846,11 @@ if (scalar @{$arghash{$cppnm}} > 1) { $cpp = $arghash{$cppnm}[1]; + # if no link cmd is specified, use $cpp + if (scalar @{$arghash{$linknm}} == 0) + { + $link = $cpp; + } } else { @@ -882,7 +904,7 @@ { $arargs .= " $arghash{$arargnm}[$i]"; } - for $i (2 .. $#{$arghash{$linkargnm}}) + for $i (1 .. $#{$arghash{$linkargnm}}) { $linkargs .= " $arghash{$linkargnm}[$i]"; } @@ -1703,12 +1725,10 @@ sub setcharacteristics { # if the system does not have the stringstream class, must use workaround - add_yesno_define("POOMA_NO_STRINGSTREAM", - $no_stringstream); + add_autoconf_define("POOMA_NO_STRINGSTREAM"); # if the system is missing some of the iostream manipulators, must avoid them - add_yesno_define("POOMA_MISSING_IOMANIPS", - $no_complete_iomanips); + add_autoconf_define("POOMA_MISSING_IOMANIPS"); # if the C++ compiler does not allow templated friends, must say so add_yesno_define("POOMA_NO_TEMPLATE_FRIENDS", @@ -1724,8 +1744,7 @@ $no_ostream_iterator_1arg); # if the compiler does not allow definitions of placement delete operations - add_yesno_define("POOMA_NO_PLACEMENT_DELETE", - $no_placement_delete); + add_autoconf_define("POOMA_NO_PLACEMENT_DELETE"); # should we include extra specializations of some things for small dim? add_yesno_define("POOMA_SMALL_DIM_SPECIALIZATIONS", @@ -1733,24 +1752,20 @@ # if the C++ compiler does not allow template parameters to be dependent, # on others (e.g., template, must say so - add_yesno_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS", - $no_dependent_templ_args); + add_autoconf_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS"); # if the C++ library does not have templated complex number class, say so - add_yesno_define("POOMA_NO_TEMPLATED_COMPLEX", - $no_templated_complex); + add_autoconf_define("POOMA_NO_TEMPLATED_COMPLEX"); # if the C++ library does not have complex number class in std::, say so - add_yesno_define("POOMA_NO_STD_COMPLEX", - $no_std_complex); + add_autoconf_define("POOMA_NO_STD_COMPLEX"); # if the C++ library has O_BINARY defined add_yesno_define("POOMA_HAS_O_BINARY_OPEN_MODE", $o_binary_open_mode); # if the C++ library does not have ios_base class in std::, say so - add_yesno_define("POOMA_NO_STD_IOSBASE", - $no_std_iosbase); + add_autoconf_define("POOMA_NO_STD_IOSBASE"); # if must include for POSIX file modes, say so add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", @@ -1862,11 +1877,11 @@ # put all the link options together my $totlibraries = "$preliblist $midliblist $postliblist"; my $liblinkargs="$linkshare $totlibraries"; - my $totlinkargs = "$linkargs $liblinkargs"; + my $totlinkargs = "$liblinkargs $linkargs"; # open the suite file and write out a prefix - print "Writing suite file $suitefile ...\n"; - open(FSUITE,">$suitefile") or die "Cannot open $suitefile for write.\n"; + print "Writing suite file lib/$suite/suite.mk.in ...\n"; + open(FSUITE,">lib/$suite/suite.mk.in") or die "Cannot open lib/$suite/suite.mk.in for write.\n"; print FSUITE "##########################################################\n"; print FSUITE "# POOMA suite file for suite: $suite\n"; print FSUITE "# Created $datestr by $userstr on $hoststr\n"; @@ -2089,8 +2104,8 @@ } # open the output file, and write header - print "Writing version info header file $vheader ...\n"; - open(FHEADER,">$vheader") or die "Cannot open $vheader for write.\n"; + print "Writing version info header file $vheader.in ...\n"; + open(FHEADER,">$vheader.in") or die "Cannot open $vheader.in for write.\n"; print FHEADER "/*******************************************************\n"; print FHEADER " * POOMA version information file for suite: $suite\n"; print FHEADER " * Created $datestr by $userstr on $hoststr\n"; @@ -2120,6 +2135,14 @@ my $spaces = length $symbol; $maxmacrolen = $spaces + 1 if $spaces >= $maxmacrolen; } + foreach $d (@autoconfdeflist) + { + my $symbol = ""; + my $value = ""; + ($symbol, $value) = split /=/, $d, 2; + my $spaces = length $symbol; + $maxmacrolen = $spaces + 1 if $spaces >= $maxmacrolen; + } foreach $d (@deflist) { @@ -2142,6 +2165,16 @@ print FHEADER "#endif\n\n"; } + foreach $d (@autoconfdeflist) + { + my $symbol = ""; + my $value = ""; + ($symbol, $value) = split /=/, $d, 2; + my $spaces = $maxmacrolen - (length $symbol); + print FHEADER "#define $symbol" . " " x $spaces . "$value\n"; + } + print FHEADER "\n"; + # finished writing header file print FHEADER "#endif\n"; print FHEADER "\n"; @@ -2203,7 +2236,7 @@ } # put all the link options together - my $totlinkargs = "$linkargs $linkshare $preliblist $midliblist $postliblist"; + my $totlinkargs = "$linkshare $preliblist $midliblist $postliblist $linkargs"; # put all the includes together my $totinclist = "-I\$(POOMA_LIBDIR)/$versionheaderbase$extensions $inclist"; @@ -2212,8 +2245,8 @@ my $totdefines = "$defines"; # open the makefile stub file and write out a prefix - print "Writing makefile stub $mfile ...\n"; - open(MFILE,">$mfile") or die "Cannot open $mfile for write.\n"; + print "Writing makefile stub lib/$suite/$makefilestub.in ...\n"; + open(MFILE,">lib/$suite/$makefilestub.in") or die "Cannot open lib/$suite/$makefilestub.in for write.\n"; print MFILE "##########################################################\n"; print MFILE "# POOMA application makefile stub for suite: $suite\n"; print MFILE "# Created $datestr by $userstr on $hoststr\n"; @@ -2323,6 +2356,23 @@ close MFILE; } +sub runautoconf +{ + # change to libdir, remove autoconf cache + chdir("lib/$suite"); + unlink("config.cache"); + + # run configure + system("env CXX=$cpp CXXFLAGS=\"$cppargs\" ../../scripts/configure") == 0 + or die "Autoconf configuration failed: $?\n"; + + # move generated files to their place + system("mv -f suite.mk ../../$suitefile"); + system("mv -f Makefile.pooma $makefilestub$extensions"); + + # go back + chdir("../../"); +} ########################################################################### # @@ -2403,8 +2453,10 @@ setshared; # figure out if a shared lib should be made setarchfns; # figure out if we enable arch-specific init fns -### write out the suite file, and run 'make dirs' to create the directory -### where the header file will go +### create the lib dir to write the following stuff to +system("mkdir -p lib/$suite"); + +### write out the suite file writesuitefile; ### write out the header file with versions information, in the lib dir @@ -2412,6 +2464,12 @@ ### write out a makefile stub that other users can include, in the lib dir writemakestub; + +### run autoconfiguration part +runautoconf; + +### create remaining dirs +system("$makecmd dirs SUITE=$suite"); ### create dependencies writedependfile; --- /dev/null 2002-12-29 19:08:32.000000000 +0100 +++ scripts/configure.ac 2003-01-10 21:57:10.000000000 +0100 @@ -0,0 +1,188 @@ +AC_INIT(pooma, 2.4.0) + +AC_ARG_VAR(CXX, [C++ compiler]) +AC_ARG_VAR(CXXFLAGS, [C++ compiler flags]) + +AC_PROG_CXX +AC_PROG_CXXCPP + + +AC_LANG_CPLUSPLUS + +dnl +dnl check for IO manipulators +dnl +AC_MSG_CHECKING([wether we have complete IO manipulators]) +AC_TRY_COMPILE([ +#include +#include +], [ + std::cout << std::left; +], [ +AC_MSG_RESULT([yes]) +POOMA_MISSING_IOMANIPS=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_MISSING_IOMANIPS=POOMA_YES +]) +AC_SUBST(POOMA_MISSING_IOMANIPS) + +dnl +dnl check for std iosbase +dnl +AC_MSG_CHECKING([wether we have a standard iosbase class]) +AC_TRY_COMPILE([ +#include +#include +class Inform; +inline Inform &operator<<(Inform &o, std::ios_base &(*d)(std::ios_base &)) +{ +} +], [ +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_STD_IOSBASE=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_STD_IOSBASE=POOMA_YES +]) +AC_SUBST(POOMA_NO_STD_IOSBASE) + +dnl +dnl check for stringstream +dnl +AC_MSG_CHECKING([wether we have sstream]) +AC_TRY_COMPILE([ +#include +], [ + std::ostringstream *msg; +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_STRINGSTREAM=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_STRINGSTREAM=POOMA_YES +]) +AC_SUBST(POOMA_NO_STRINGSTREAM) + +dnl +dnl check for complex in std and templated complex +dnl +AC_MSG_CHECKING([wether we have a complex inside std]) +AC_TRY_COMPILE([ +#include +], [ + std::complex val; +], [ +complexok=yes +AC_MSG_RESULT([yes]) +POOMA_NO_STD_COMPLEX=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_STD_COMPLEX=POOMA_YES +]) +POOMA_NO_TEMPLATED_COMPLEX=POOMA_NO +if test x$complexok != xyes; then + AC_MSG_CHECKING([wether we have a not-templated complex]) + AC_TRY_COMPILE([ + #include + ], [ + complex val; + ], [ + AC_MSG_RESULT([no]) + ] , [ + AC_MSG_RESULT([yes]) + POOMA_NO_TEMPLATED_COMPLEX=POOMA_YES + ]) +fi +AC_SUBST(POOMA_NO_STD_COMPLEX) +AC_SUBST(POOMA_NO_TEMPLATED_COMPLEX) + +dnl +dnl check for dependent template arguments +dnl +AC_MSG_CHECKING([wether we support dependent template arguments]) +AC_TRY_COMPILE([ +template +class Foo; +template +class Foo { +}; +], [ +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_DEPENDENT_TEMPLATE_ARGS=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_DEPENDENT_TEMPLATE_ARGS=POOMA_YES +]) +AC_SUBST(POOMA_NO_DEPENDENT_TEMPLATE_ARGS) + +dnl +dnl check for placement delete operator support +dnl +AC_MSG_CHECKING([wether we support delete operators with placement argument]) +AC_TRY_COMPILE([ +class foo { + void operator delete(void *, void *) { } +}; +], [ +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_PLACEMENT_DELETE=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_PLACEMENT_DELETE=POOMA_YES +]) +AC_SUBST(POOMA_NO_PLACEMENT_DELETE) + +dnl +dnl check for correct handling of default arguments to specialized +dnl template functions +dnl +AC_MSG_CHECKING([wether we handle default args to template functions correct]) +AC_TRY_COMPILE([ +template +class Centering {}; +template +const Centering test(int a, int b = 0); +template <> +const Centering<1> test<1>(int a, int b); +], [ + Centering<1> c = test<1>(1); +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_TEMPLATEFUNC_DEFAULTARGS=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_TEMPLATEFUNC_DEFAULTARGS=POOMA_YES +]) +AC_SUBST(POOMA_NO_TEMPLATEFUNC_DEFAULTARGS) + +dnl +dnl check for ios header, use iostream if not +dnl +AC_CHECK_HEADER([ios], + [POOMA_NO_IOS_HEADER=POOMA_NO], + [POOMA_NO_IOS_HEADER=POOMA_YES]) +AC_SUBST(POOMA_NO_IOS_HEADER) + +dnl +dnl check for std::ios_base::fmtflags +dnl +AC_MSG_CHECKING([wether we have std::ios_base::fmtflags]) +AC_TRY_COMPILE([ +#include +typedef std::ios_base::fmtflags FmtFlags_t; +], [ + FmtFlags_t f; +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_IOSBASE_FMTFLAGS=POOMA_NO +] , [ +AC_MSG_RESULT([no]) +POOMA_NO_IOSBASE_FMTFLAGS=POOMA_YES +]) +AC_SUBST(POOMA_NO_IOSBASE_FMTFLAGS) + +AC_OUTPUT(PoomaConfiguration.h suite.mk Makefile.pooma) From oldham at codesourcery.com Fri Jan 10 22:33:21 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Fri, 10 Jan 2003 14:33:21 -0800 Subject: [PATCH] Introduce autoconf References: Message-ID: <3E1F4A31.4070202@codesourcery.com> Richard Guenther wrote: > Hi! > > The following patch is a further reduced introduction of autoconfisciation > of parts of the configuration process. It introduces scripts/configure.ac > (and scripts/configure, if autogenerated files should be in CVS) and > changes the toplevel configure script to write the suite file, the > makefile stub and the pooma configuration header as .in file and pass it > down through a autoconf configure script. > > For now some of the compiler feature bits are checked and substituted in > the pooma configuration header. > > Tested by configuring and installing on ia32-gnu-linux and configuring > on HP-UX (aCC sucks) and IRIX (CC sucks, too). > > Ok? I think this is a great step forward. Using your patch, the installation process is now ./configure make ? I think it is acceptable to place 'configure' under CVS control. Would you be willing to write installation steps and put them into README or INSTALL.*, as appropriate? Thanks, Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Fri Jan 10 23:06:56 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Sat, 11 Jan 2003 00:06:56 +0100 (CET) Subject: [pooma-dev] Re: [PATCH] Introduce autoconf In-Reply-To: <3E1F4A31.4070202@codesourcery.com> Message-ID: On Fri, 10 Jan 2003, Jeffrey Oldham wrote: > I think this is a great step forward. Using your patch, the > installation process is now > > ./configure > make Not really - but it is now possible to have a unified arch file for f.i. the gnu toolchain with the possibility to switch to "compatible" compilers, like the intel one with just doing ./configure --cpp icpc Note that configuration syntax for other parameters are unchanged, i.e. the toplevel configure is _not_ the autoconf one, but the old one and just parts of the arch files are under autoconf control (with the possiblity to gradually switch to "complete" autoconf). > ? I think it is acceptable to place 'configure' under CVS control. Ok. > Would you be willing to write installation steps and put them into > README or INSTALL.*, as appropriate? They are unchanged, but I look over the current documentation and try to do improvements. So the patch is ok? Can I install documentation update for this without explicit permission? Thanks, Richard. From oldham at codesourcery.com Fri Jan 10 23:10:18 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Fri, 10 Jan 2003 15:10:18 -0800 Subject: [pooma-dev] Re: [PATCH] Introduce autoconf References: Message-ID: <3E1F52DA.9070107@codesourcery.com> Richard Guenther wrote: > >>Would you be willing to write installation steps and put them into >>README or INSTALL.*, as appropriate? > > > They are unchanged, but I look over the current documentation and try to > do improvements. If there is no change to the user interface for installation, please do not feel obligated to update the documentation. > So the patch is ok? Can I install documentation update for this without > explicit permission? Yes. Yes. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Fri Jan 10 23:51:05 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Sat, 11 Jan 2003 00:51:05 +0100 (CET) Subject: [PATCH] Use configure results for compile time decisions Message-ID: Hi! This patch cleans up the conditional inclusion of ios/iostream and the std::ios_base::fmtflags issue remaining for intel compiler support. Ok? Richard. 2002Jan11 Richard Guenther * src/IO/DiskLayout.cmpl.cpp: include ios, if available, else iostream. src/IO/FileSetReader.cmpl.cpp: likewise. src/IO/FileSetReader.cpp: likewise. src/IO/tests/DiskLayoutTest1.cpp: likewise. src/IO/tests/FileSetReaderTest0.cpp: likewise. src/IO/tests/dumper.cpp: likewise. src/Tiny/TinyMatrix.h: likewise. src/Tiny/Vector.h: likewise. src/Utilities/Inform.h: use POOMA_NO_IOSBASE_FMTFLAGS rather than compiler dependend symbols for decision of std::ios_base::fmtflags. Index: src/IO/DiskLayout.cmpl.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/DiskLayout.cmpl.cpp,v retrieving revision 1.8 diff -u -r1.8 DiskLayout.cmpl.cpp --- src/IO/DiskLayout.cmpl.cpp 15 Oct 2001 17:34:30 -0000 1.8 +++ src/IO/DiskLayout.cmpl.cpp 10 Jan 2003 23:46:19 -0000 @@ -53,9 +53,7 @@ #include "Layout/UniformGridLayout.h" #include "Tulip/RemoteProxy.h" -// Re-check this when GCC 3.0 is ported - -#if defined(__CYGWIN32__) +#if POOMA_NO_IOS_HEADER #include #else #include Index: src/IO/FileSetReader.cmpl.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/FileSetReader.cmpl.cpp,v retrieving revision 1.9 diff -u -r1.9 FileSetReader.cmpl.cpp --- src/IO/FileSetReader.cmpl.cpp 15 Oct 2001 17:34:31 -0000 1.9 +++ src/IO/FileSetReader.cmpl.cpp 10 Jan 2003 23:46:20 -0000 @@ -43,9 +43,7 @@ #include -// Really should add a POOMA_HAS_IOS_INCLUDE config macro. - -#if !(defined(__GNUC__) && (__GNUC__ < 3)) +#if !POOMA_NO_IOS_HEADER # include #endif Index: src/IO/FileSetReader.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/FileSetReader.cpp,v retrieving revision 1.6 diff -u -r1.6 FileSetReader.cpp --- src/IO/FileSetReader.cpp 15 Oct 2001 17:34:31 -0000 1.6 +++ src/IO/FileSetReader.cpp 10 Jan 2003 23:46:22 -0000 @@ -44,9 +44,7 @@ #include -// Really should add a POOMA_HAS_IOS_INCLUDE config macro. - -#if !(defined(__GNUC__) && (__GNUC__ < 3)) +#if !POOMA_NO_IOS_HEADER # include #endif Index: src/IO/tests/DiskLayoutTest1.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/tests/DiskLayoutTest1.cpp,v retrieving revision 1.6 diff -u -r1.6 DiskLayoutTest1.cpp --- src/IO/tests/DiskLayoutTest1.cpp 3 Oct 2001 21:09:53 -0000 1.6 +++ src/IO/tests/DiskLayoutTest1.cpp 10 Jan 2003 23:46:22 -0000 @@ -48,7 +48,7 @@ #include -#if !defined(__CYGWIN32__) +#if !POOMA_NO_IOS_HEADER # include #endif Index: src/IO/tests/FileSetReaderTest0.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/tests/FileSetReaderTest0.cpp,v retrieving revision 1.1 diff -u -r1.1 FileSetReaderTest0.cpp --- src/IO/tests/FileSetReaderTest0.cpp 3 Oct 2001 21:11:22 -0000 1.1 +++ src/IO/tests/FileSetReaderTest0.cpp 10 Jan 2003 23:46:23 -0000 @@ -44,7 +44,7 @@ #include -#if !(defined(__GNUC__) && __GNUC__ < 3) +#if !POOMA_NO_IOS_HEADER # include #endif Index: src/IO/tests/dumper.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/tests/dumper.cpp,v retrieving revision 1.4 diff -u -r1.4 dumper.cpp --- src/IO/tests/dumper.cpp 3 Oct 2001 17:40:17 -0000 1.4 +++ src/IO/tests/dumper.cpp 10 Jan 2003 23:46:24 -0000 @@ -32,8 +32,8 @@ #include #include // replace -#if !(defined(__GNUC__) && __GNUC__ < 3) -#include +#if !POOMA_NO_IOS_HEADER +# include #endif using std::cout; Index: src/Tiny/TinyMatrix.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Tiny/TinyMatrix.h,v retrieving revision 1.13 diff -u -r1.13 TinyMatrix.h --- src/Tiny/TinyMatrix.h 18 Sep 2001 05:17:48 -0000 1.13 +++ src/Tiny/TinyMatrix.h 10 Jan 2003 23:46:25 -0000 @@ -56,7 +56,11 @@ #include "Tiny/TinyMatrixEngine.h" #include "Tiny/TinyMatrixElements.h" #include "Tiny/TinyMatrixOperators.h" +#if POOMA_NO_IOS_HEADER +#include +#else #include +#endif //----------------------------------------------------------------------------- // Forward Declarations: Index: src/Tiny/Vector.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Tiny/Vector.h,v retrieving revision 1.28 diff -u -r1.28 Vector.h --- src/Tiny/Vector.h 5 Mar 2002 16:14:38 -0000 1.28 +++ src/Tiny/Vector.h 10 Jan 2003 23:46:26 -0000 @@ -56,7 +56,11 @@ #include "Tiny/VectorEngine.h" #include "Tiny/VectorElements.h" #include "Tiny/VectorOperators.h" +#if POOMA_NO_IOS_HEADER +#include +#else #include +#endif //----------------------------------------------------------------------------- // Forward Declarations: Index: src/Utilities/Inform.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Utilities/Inform.h,v retrieving revision 1.29 diff -u -r1.29 Inform.h --- src/Utilities/Inform.h 23 Mar 2001 15:34:54 -0000 1.29 +++ src/Utilities/Inform.h 10 Jan 2003 23:46:27 -0000 @@ -275,8 +275,7 @@ void print() { flush(); } void output() { flush(); } -#if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) \ - || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129) +#if !POOMA_NO_IOSBASE_FMTFLAGS typedef std::ios_base::fmtflags FmtFlags_t; #else typedef long FmtFlags_t; From rguenth at tat.physik.uni-tuebingen.de Fri Jan 10 23:55:25 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Sat, 11 Jan 2003 00:55:25 +0100 (CET) Subject: [PATCH] Fix some warnings Message-ID: Hi! The following patch fixes some warnings and missing includes. Ok? Richard. 2002Jan11 Richard Guenther * src/IO/DiskLayout.h: include . src/Utilities/Pool.cmpl.cpp: reorder initializers to match declaration order. Index: src/IO/DiskLayout.h =================================================================== RCS file: /home/pooma/Repository/r2/src/IO/DiskLayout.h,v retrieving revision 1.4 diff -u -r1.4 DiskLayout.h --- src/IO/DiskLayout.h 3 Oct 2001 21:07:48 -0000 1.4 +++ src/IO/DiskLayout.h 10 Jan 2003 23:53:36 -0000 @@ -58,6 +58,7 @@ #include // file I/O #include // node lists +#include //----------------------------------------------------------------------------- // struct DiskNode Index: src/Utilities/Pool.cmpl.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/Utilities/Pool.cmpl.cpp,v retrieving revision 1.12 diff -u -r1.12 Pool.cmpl.cpp --- src/Utilities/Pool.cmpl.cpp 7 Mar 2000 13:18:27 -0000 1.12 +++ src/Utilities/Pool.cmpl.cpp 10 Jan 2003 23:53:36 -0000 @@ -41,14 +41,14 @@ Pool::Pool(size_t sz) : + // The first one. Start out with nothing there. + head_m(0), // The number of outstanding allocs. outstandingAllocs_m(0), // The size of each block bsize_m(roundToAlign(sz)), // Number of blocks - nblock_m(blocksInPage(bsize_m)), - // The first one. Start out with nothing there. - head_m(0) + nblock_m(blocksInPage(bsize_m)) { } @@ -60,14 +60,14 @@ Pool::Pool() : + // The first one. Start out with nothing there. + head_m(0), // The number of outstanding allocs. outstandingAllocs_m(0), // The size of each block bsize_m(0), // Number of blocks - nblock_m(0), - // The first one. Start out with nothing there. - head_m(0) + nblock_m(0) { } From rguenth at tat.physik.uni-tuebingen.de Fri Jan 10 23:58:18 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Sat, 11 Jan 2003 00:58:18 +0100 (CET) Subject: [PATCH] Allow compiling with gcc 2.95 Message-ID: Hi! The following patch allows compiling with gcc 2.95 (dont know if this is a good idea - could not test whole testsuite because compilation aborts with out of memory). Ok? Richard. 2002Jan11 Richard Guenther * src/Field/FieldCentering.h: honour POOMA_NO_TEMPLATEFUNC_DEFAULTARGS. Index: src/Field/FieldCentering.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Field/FieldCentering.h,v retrieving revision 1.3 diff -u -r1.3 FieldCentering.h --- src/Field/FieldCentering.h 5 Oct 2001 01:19:07 -0000 1.3 +++ src/Field/FieldCentering.h 10 Jan 2003 23:56:13 -0000 @@ -538,11 +538,19 @@ extern const CanonicalCentering<2> canonicalCenteringTwo_g; extern const CanonicalCentering<3> canonicalCenteringThree_g; +#if POOMA_NO_TEMPLATEFUNC_DEFAULTARGS +template +const Centering canonicalCentering + (const enum CenteringType type, + const enum ContinuityType discontinuous, + const int dimension); +#else template const Centering canonicalCentering (const enum CenteringType type, const enum ContinuityType discontinuous, const int dimension = 0); +#endif template <> const Centering<1> canonicalCentering<1> @@ -561,6 +569,16 @@ (const enum CenteringType type, const enum ContinuityType discontinuous, const int dimension); + +#if POOMA_NO_TEMPLATEFUNC_DEFAULTARGS +template +inline const Centering canonicalCentering + (const enum CenteringType type, + const enum ContinuityType discontinuous) +{ + return canonicalCentering(type, discontinuous, 0); +} +#endif //----------------------------------------------------------------------------- // From rguenth at tat.physik.uni-tuebingen.de Sat Jan 11 00:22:25 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Sat, 11 Jan 2003 01:22:25 +0100 (CET) Subject: [RFC] remove src/arch/* Message-ID: Hi! src/arch/* seems to be unused. At least building pooma does not require it, greping for includes also does not show up anything. Can this be removed? Thanks, Richard. From rguenth at tat.physik.uni-tuebingen.de Sun Jan 12 16:27:56 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Sun, 12 Jan 2003 17:27:56 +0100 (CET) Subject: [PATCH] Remove config/arch/*EGCS.conf Message-ID: Hi! egcs is obsolete - and the differences between the EGCS and gcc variants are now handled by autoconf configure (apart from detecting restrict, which I will fix, soon). Ok to remove all *EGCS.conf files? Thanks, Richard. From oldham at codesourcery.com Tue Jan 14 00:02:19 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Mon, 13 Jan 2003 16:02:19 -0800 Subject: [PATCH] Use configure results for compile time decisions References: Message-ID: <3E23538B.5010708@codesourcery.com> Richard Guenther wrote: > Hi! > > This patch cleans up the conditional inclusion of ios/iostream and the > std::ios_base::fmtflags issue remaining for intel compiler support. > > Ok? This looks good. Please commit it. Jeffrey D. Oldham oldham at codesourcery.com From oldham at codesourcery.com Tue Jan 14 00:04:38 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Mon, 13 Jan 2003 16:04:38 -0800 Subject: [PATCH] Fix some warnings References: Message-ID: <3E235416.9080008@codesourcery.com> Richard Guenther wrote: > Hi! > > The following patch fixes some warnings and missing includes. > > Ok? > > Richard. Looks good. Please commit it. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From oldham at codesourcery.com Tue Jan 14 00:07:02 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Mon, 13 Jan 2003 16:07:02 -0800 Subject: [PATCH] Remove config/arch/*EGCS.conf References: Message-ID: <3E2354A6.9030402@codesourcery.com> Richard Guenther wrote: > Hi! > > egcs is obsolete - and the differences between the EGCS and gcc variants > are now handled by autoconf configure (apart from detecting restrict, > which I will fix, soon). > > Ok to remove all *EGCS.conf files? Fine. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From oldham at codesourcery.com Tue Jan 14 00:09:17 2003 From: oldham at codesourcery.com (Jeffrey Oldham) Date: Mon, 13 Jan 2003 16:09:17 -0800 Subject: [PATCH] Allow compiling with gcc 2.95 References: Message-ID: <3E23552D.5020806@codesourcery.com> Richard Guenther wrote: > Hi! > > The following patch allows compiling with gcc 2.95 (dont know if this is a > good idea - could not test whole testsuite because compilation aborts with > out of memory). Compiling with gcc2.95 is a good idea because these compilers will continue to be used for the next few years. Please commit the patch. Thanks, Jeffrey D. Oldham oldham at codesourcery.com From mark at codesourcery.com Tue Jan 14 00:31:25 2003 From: mark at codesourcery.com (Mark Mitchell) Date: Mon, 13 Jan 2003 16:31:25 -0800 Subject: [PATCH] Allow compiling with gcc 2.95 In-Reply-To: Message-ID: <964510000.1042504285@warlock.codesourcery.com> --On Saturday, January 11, 2003 12:58:18 AM +0100 Richard Guenther wrote: > The following patch allows compiling with gcc 2.95 (dont know if this is a > good idea - could not test whole testsuite because compilation aborts with > out of memory). I'd recommend against supporting GCC 2.95; I think that's going to be nothing but headaches. But, it's Jeffrey's call. -- Mark Mitchell mark at codesourcery.com CodeSourcery, LLC http://www.codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Tue Jan 14 18:04:46 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 14 Jan 2003 19:04:46 +0100 (CET) Subject: [PATCH] More autoconfisciation Message-ID: The attached patch moves the rest of the compiler/library dependend config to autoconf. Tested by building and running regtests on ppc-linux with gcc2.95 and gcc3.2 and on IRIX with CC (doesnt build all tests unfortunately, not before and not after the autoconf patches). Ok? 2002Jan14 Richard Guenther * configure: hand off more variables to autoconf. scripts/configure.ac: more tests. scripts/configure: re-generated. Index: configure =================================================================== RCS file: /home/pooma/Repository/r2/configure,v retrieving revision 1.108 diff -u -r1.108 configure --- configure 10 Jan 2003 23:38:18 -0000 1.108 +++ configure 14 Jan 2003 18:01:03 -0000 @@ -367,23 +367,7 @@ $pool = 1; ### special characteristics that some architectures have -$no_stringstream = 0; # if 1, lacks header -$no_complete_iomanips = 0; # if 1, missing some IO manipulators (left etc) -$no_templated_friends = 0; # if 1, cannot use template classes as friends -$no_ostream_iterator_1arg = 0; # if 1, cannot use ostream_iterator w/1 param -$no_restrict = 0; # if 1, does not allow 'restrict' keyword -$no_placement_delete = 0; # if 1, does not allow placement delete opers -$no_dependent_templ_args = 0; # if 1, has problems with dep template args $small_dim_specializations = 0; # if 1, include extra specializations for for file modes -$no_std_min_max = 0; # if 1, no std::min, std::max -$no_std_iterator = 0; # if 1, iterator traits broken (i.e. Windows) -$clock_uses_gettimeofday = 0; # if 1, use gettimeofday in Clock -$clock_uses_clock_gettime = 0; # if 1, use clock_gettime in Clock ### default settings for source code options like data types and bounds checks $default_float_type = "double"; @@ -847,7 +831,7 @@ { $cpp = $arghash{$cppnm}[1]; # if no link cmd is specified, use $cpp - if (scalar @{$arghash{$linknm}} == 0) + if (scalar @{$arghash{$linknm}} <= 1) { $link = $cpp; } @@ -1731,17 +1715,14 @@ add_autoconf_define("POOMA_MISSING_IOMANIPS"); # if the C++ compiler does not allow templated friends, must say so - add_yesno_define("POOMA_NO_TEMPLATE_FRIENDS", - $no_templated_friends); + add_autoconf_define("POOMA_NO_TEMPLATE_FRIENDS"); # if the C++ compiler does not allow restrict, must say so - add_yesno_define("POOMA_NO_RESTRICT", - $no_restrict); + add_autoconf_define("POOMA_NO_RESTRICT"); # if the system does not have a version of ostream_iterator that can # be constructed with one template arg, must use two - add_yesno_define("POOMA_NO_OSTREAM_ITERATOR_1ARG", - $no_ostream_iterator_1arg); + add_autoconf_define("POOMA_NO_OSTREAM_ITERATOR_1ARG"); # if the compiler does not allow definitions of placement delete operations add_autoconf_define("POOMA_NO_PLACEMENT_DELETE"); @@ -1754,38 +1735,44 @@ # on others (e.g., template, must say so add_autoconf_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS"); + # if the C++ compiler does not allow defaults to template parameters + # for template functions to be specified, must say so + add_autoconf_define("POOMA_NO_TEMPLATEFUNC_DEFAULTARGS"); + # if the C++ library does not have templated complex number class, say so add_autoconf_define("POOMA_NO_TEMPLATED_COMPLEX"); # if the C++ library does not have complex number class in std::, say so add_autoconf_define("POOMA_NO_STD_COMPLEX"); - # if the C++ library has O_BINARY defined - add_yesno_define("POOMA_HAS_O_BINARY_OPEN_MODE", - $o_binary_open_mode); +# # if the C++ library has O_BINARY defined +# add_yesno_define("POOMA_HAS_O_BINARY_OPEN_MODE", +# $o_binary_open_mode); + + # if the C++ library does not have the ios header, say so + add_autoconf_define("POOMA_NO_IOS_HEADER"); # if the C++ library does not have ios_base class in std::, say so add_autoconf_define("POOMA_NO_STD_IOSBASE"); - # if must include for POSIX file modes, say so - add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", - $inc_sys_stat_h_file_modes); + # if the C++ library does not have std::ios_base::fmtflags type, say so + add_autoconf_define("POOMA_NO_IOSBASE_FMTFLAGS"); + +# # if must include for POSIX file modes, say so +# add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", +# $inc_sys_stat_h_file_modes); # if the C++ library does not have std::min, std::max, etc. - add_yesno_define("POOMA_NO_STD_MIN_MAX", - $no_std_min_max); + add_autoconf_define("POOMA_NO_STD_MIN_MAX"); # use gettimeofday for Clock - add_yesno_define("POOMA_CLOCK_USES_GETTIMEOFDAY", - $clock_uses_gettimeofday); + add_autoconf_define("POOMA_CLOCK_USES_GETTIMEOFDAY"); # use clock_gettime for Clock - add_yesno_define("POOMA_CLOCK_USES_CLOCK_GETTIME", - $clock_uses_clock_gettime); + add_autoconf_define("POOMA_CLOCK_USES_CLOCK_GETTIME"); # if the C++ library has a nonstandard iterator or iterator_traits - add_yesno_define("POOMA_NONSTANDARD_ITERATOR", - $no_std_iterator); + add_autoconf_define("POOMA_NONSTANDARD_ITERATOR"); } @@ -1972,10 +1959,10 @@ print FSUITE "LD = $link\n"; print FSUITE "\n"; print FSUITE "### flags for applications\n"; - print FSUITE "CXX_OPT_LIB_ARGS = $cppargs $cppshare $cppopt_lib\n"; - print FSUITE "CXX_DBG_LIB_ARGS = $cppargs $cppshare $cppdbg_lib\n"; - print FSUITE "CXX_OPT_APP_ARGS = $cppargs $cppopt_app\n"; - print FSUITE "CXX_DBG_APP_ARGS = $cppargs $cppdbg_app\n"; + print FSUITE "CXX_OPT_LIB_ARGS = \@cppargs\@ $cppshare $cppopt_lib\n"; + print FSUITE "CXX_DBG_LIB_ARGS = \@cppargs\@ $cppshare $cppdbg_lib\n"; + print FSUITE "CXX_OPT_APP_ARGS = \@cppargs\@ $cppopt_app\n"; + print FSUITE "CXX_DBG_APP_ARGS = \@cppargs\@ $cppdbg_app\n"; print FSUITE "\n"; print FSUITE "C_OPT_LIB_ARGS = $cargs $cshare $copt_lib\n"; print FSUITE "C_DBG_LIB_ARGS = $cargs $cshare $cdbg_lib\n"; @@ -2333,8 +2320,8 @@ print MFILE "LD_PARALLEL = 1\n"; print MFILE "\n"; print MFILE "### flags for applications\n"; - print MFILE "POOMA_CXX_OPT_ARGS = $cppargs $cppopt_app\n"; - print MFILE "POOMA_CXX_DBG_ARGS = $cppargs $cppdbg_app\n"; + print MFILE "POOMA_CXX_OPT_ARGS = \@cppargs\@ $cppopt_app\n"; + print MFILE "POOMA_CXX_DBG_ARGS = \@cppargs\@ $cppdbg_app\n"; print MFILE "\n"; print MFILE "POOMA_CC_OPT_ARGS = $cargs $copt_app\n"; print MFILE "POOMA_CC_DBG_ARGS = $cargs $cdbg_app\n"; Index: scripts/configure.ac =================================================================== RCS file: /home/pooma/Repository/r2/scripts/configure.ac,v retrieving revision 1.1 diff -u -r1.1 configure.ac --- scripts/configure.ac 10 Jan 2003 23:38:18 -0000 1.1 +++ scripts/configure.ac 14 Jan 2003 18:01:05 -0000 @@ -185,4 +185,148 @@ ]) AC_SUBST(POOMA_NO_IOSBASE_FMTFLAGS) +dnl +dnl check for restrict support and form +dnl +AC_MSG_CHECKING([wether we have restrict support]) +acx_cv_c_restrict=unsupported +for acx_kw in restrict __restrict__ __restrict; do + AC_TRY_COMPILE([], [float * $acx_kw x;], [acx_cv_c_restrict=$acx_kw; break]) +done +if test "$acx_cv_c_restrict" = "unsupported"; then + POOMA_NO_RESTRICT=POOMA_YES + AC_MSG_RESULT([no]) +else + POOMA_NO_RESTRICT=POOMA_NO + AC_MSG_RESULT([$acx_cv_c_restrict]) + if test "$acx_cv_c_restrict" != "restrict"; then + CXXFLAGS="$CXXFLAGS -Drestrict=$acx_cv_c_restrict" + fi +fi +AC_SUBST(POOMA_NO_RESTRICT) + +dnl +dnl check for clock_gettime/gettimeofday +dnl +AC_MSG_CHECKING([for clock method to use]) +POOMA_CLOCK_USES_CLOCK_GETTIME=POOMA_NO +POOMA_CLOCK_USES_GETTIMEOFDAY=POOMA_NO +AC_TRY_LINK([ +#include +], [ + timespec ts; +#if defined(CLOCK_SGI_CYCLE) + clock_gettime(CLOCK_SGI_CYCLE, &ts); +#else + clock_gettime(CLOCK_REALTIME, &ts); +#endif +], [ +AC_MSG_RESULT([clock_gettime]) +POOMA_CLOCK_USES_CLOCK_GETTIME=POOMA_YES +], [ + AC_TRY_LINK([ + #include + #include + ], [ + timeval tv; + gettimeofday(&tv, 0); + ], [ + AC_MSG_RESULT([gettimeofday]) + POOMA_CLOCK_USES_GETTIMEOFDAY=POOMA_YES + ], [ + AC_MSG_RESULT([clock]) + ]) +]) +AC_SUBST(POOMA_CLOCK_USES_CLOCK_GETTIME) +AC_SUBST(POOMA_CLOCK_USES_GETTIMEOFDAY) + +dnl +dnl Check for support of templated friends. +dnl +AC_MSG_CHECKING([for support of templated firends]) +AC_TRY_COMPILE([ +template +class A { + void bar(); +public: + template + void foo(const A& a) { + a.bar(); + } + template + friend class A; +}; +], [ + A a; + A b; + a.foo(b); +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_TEMPLATE_FRIENDS=POOMA_NO +], [ +AC_MSG_RESULT([no]) +POOMA_NO_TEMPLATE_FRIENDS=POOMA_YES +]) +AC_SUBST(POOMA_NO_TEMPLATE_FRIENDS) + +dnl +dnl Check for std::ostream_iterator. +dnl +AC_MSG_CHECKING([numer of template arguments of std::ostream_iterator]) +AC_TRY_COMPILE([ +#include +#include +], [ + std::ostream_iterator i(std::cout); +], [ +AC_MSG_RESULT([1]) +POOMA_NO_OSTREAM_ITERATOR_1ARG=POOMA_NO +], [ +AC_MSG_RESULT([2]) +POOMA_NO_OSTREAM_ITERATOR_1ARG=POOMA_YES +]) +AC_SUBST(POOMA_NO_OSTREAM_ITERATOR_1ARG) + +dnl +dnl Check for std::min(), std::max(). +dnl +AC_MSG_CHECKING([for std::min(), std::max()]) +AC_TRY_LINK([ +#include +], [ + int a, b, c; + a = std::min(b, c); + b = std::max(a, c); +], [ +AC_MSG_RESULT([yes]) +POOMA_NO_STD_MIN_MAX=POOMA_NO +], [ +AC_MSG_RESULT([no]) +POOMA_NO_STD_MIN_MAX=POOMA_YES +]) +AC_SUBST(POOMA_NO_STD_MIN_MAX) + +dnl +dnl Check for standard conforming iterators. +dnl +AC_MSG_CHECKING([for standard conforming iterators]) +AC_TRY_LINK([ +#include +#include +], [ + std::vector v; + typedef std::iterator_traits::const_iterator>::difference_type Diff_t; + std::reverse_iterator::iterator> ri(v.end()); +], [ +AC_MSG_RESULT([yes]) +POOMA_NONSTANDARD_ITERATOR=POOMA_NO +], [ +AC_MSG_RESULT([no]) +POOMA_NONSTANDARD_ITERATOR=POOMA_YES +]) +AC_SUBST(POOMA_NONSTANDARD_ITERATOR) + +cppargs=$CXXFLAGS +AC_SUBST(cppargs) + AC_OUTPUT(PoomaConfiguration.h suite.mk Makefile.pooma) From rguenth at tat.physik.uni-tuebingen.de Wed Jan 15 13:55:39 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 15 Jan 2003 14:55:39 +0100 (CET) Subject: [BUG] ScalarCode does not work for Arrays Message-ID: Hi! Due to the mess (it seems to me...) of the different domain() access functions for Arrays and Fields (namely physicalDomain() having different semantics), ScalarCode does not work for Arrays. To summarize: Array.domain() -> engine.domain() -> layout->domain() Array.physicalDomain() -> engine.domain() -> layout->domain() Array.totalDomain() -> engine.domain() -> layout->domain() Field.domain() -> fieldEngine.physicalDomain() -> (effectively) layout->innerDomain() Field.physicalDomain() -> fieldEngine.physicalDomain() -> (effectively) layout->innerDomain() Field.totalDomain() -> fieldEngine.totalDomain() -> (effectively) layout->baseDomain() but all those dependend on centering (i.e. vertex vs. cell domains) Layout.domain() == Layout.baseDomain() So I propose to make Engine's domain access interface match FieldEngine's, i.e. add Engine->physicalDomain(), make Array.physicalDomain() call that and return Layout->innerDomain() for this. Other suggestions? Thanks, Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Wed Jan 15 16:24:52 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 15 Jan 2003 17:24:52 +0100 (CET) Subject: [PATCH] Re: [pooma-dev] [BUG] ScalarCode does not work for Arrays In-Reply-To: Message-ID: On Wed, 15 Jan 2003, Richard Guenther wrote: > So I propose to make Engine's domain access interface match FieldEngine's, > i.e. add Engine->physicalDomain(), make Array.physicalDomain() call that > and return Layout->innerDomain() for this. I looked at the various engines and a physicalDomain() method can not consitently defined for all of them, so I decided to go the simple way of just fixing Array.physicalDomain(). The following patch does exactly this and introduces a testcase that fails before and succeeds after the patch (test with assertions on). Ok? (dont know if changing Array.physicalDomain() has any negative impact on user code - the testsuite doesnt care) Richard. diff -Nru a/r2/src/Array/Array.h b/r2/src/Array/Array.h --- a/r2/src/Array/Array.h Wed Jan 15 17:12:42 2003 +++ b/r2/src/Array/Array.h Wed Jan 15 17:12:42 2003 @@ -1810,7 +1810,7 @@ inline Domain_t physicalDomain() const { - return engine_m.domain(); + return engine_m.layout().innerDomain(); } inline Domain_t totalDomain() const diff -Nru a/r2/src/Evaluator/tests/evaluatorTest2.cpp b/r2/src/Evaluator/tests/evaluatorTest2.cpp --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/r2/src/Evaluator/tests/evaluatorTest2.cpp Wed Jan 15 17:12:42 2003 @@ -0,0 +1,173 @@ +// -*- C++ -*- +// ACL:license +// ---------------------------------------------------------------------- +// This software and ancillary information (herein called "SOFTWARE") +// called POOMA (Parallel Object-Oriented Methods and Applications) is +// made available under the terms described here. The SOFTWARE has been +// approved for release with associated LA-CC Number LA-CC-98-65. +// +// Unless otherwise indicated, this SOFTWARE has been authored by an +// employee or employees of the University of California, operator of the +// Los Alamos National Laboratory under Contract No. W-7405-ENG-36 with +// the U.S. Department of Energy. The U.S. Government has rights to use, +// reproduce, and distribute this SOFTWARE. The public may copy, distribute, +// prepare derivative works and publicly display this SOFTWARE without +// charge, provided that this Notice and any statement of authorship are +// reproduced on all copies. Neither the Government nor the University +// makes any warranty, express or implied, or assumes any liability or +// responsibility for the use of this SOFTWARE. +// +// If SOFTWARE is modified to produce derivative works, such modified +// SOFTWARE should be clearly marked, so as not to confuse it with the +// version available from LANL. +// +// For more information about POOMA, send e-mail to pooma at acl.lanl.gov, +// or visit the POOMA web page at http://www.acl.lanl.gov/pooma/. +// ---------------------------------------------------------------------- +// ACL:license + +//----------------------------------------------------------------------------- +// evaluatorTest2 - a simple patch function using ScalarCode +//----------------------------------------------------------------------------- + +#include "Pooma/Pooma.h" +#include "Pooma/Arrays.h" +#include "Pooma/Fields.h" // for PerformUpdateTag() only! +#include "Evaluator/ScalarCode.h" +#include "Utilities/Tester.h" +#include + +// This really simple example doesn't do anything a stencil couldn't do, +// but you could imagine writing something more complicated. + +struct MyFunction +{ + MyFunction() {} + + template + void operator()(const A &a, const Loc<1> &i) const + { + if (a(i)>5.0) + { + a(i) /= 4.0; + } + } + + void scalarCodeInfo(ScalarCodeInfo& i) const + { + i.arguments(1); + i.dimensions(1); + i.lowerExtent(0) = 0; + i.upperExtent(0) = 0; + i.write(0, true); + i.useGuards(0, false); + } +}; + +struct MyFunction2 +{ + MyFunction2() {} + + template + void operator()(const Array1 &a, const Array2 &b, const Loc<2> &i) const + { + Loc<2> dx(1, 0), dy(0, 1); + a(i) = 0.25 * (b(i-dx) + b(i+dx) + b(i-dy) + b(i+dy)); + } + + void scalarCodeInfo(ScalarCodeInfo& i) const + { + i.arguments(2); + i.dimensions(2); + i.lowerExtent(0) = 1; + i.upperExtent(0) = 1; + i.lowerExtent(1) = 1; + i.upperExtent(1) = 1; + i.write(0, true); + i.write(1, false); + i.useGuards(0, false); + i.useGuards(1, true); + } +}; + +int main(int argc, char *argv[]) +{ + // Initialize POOMA and output stream, using Tester class + Pooma::initialize(argc, argv); + Pooma::Tester tester(argc, argv); + + { + int size = 120; + + Interval<1> domain(size); + UniformGridPartition<1> partition(Loc<1>(10)); + UniformGridLayout<1> layout(domain, partition, ReplicatedTag()); + + Array<1,double,MultiPatch > a(layout),b(layout); + + int i; + for (i = 0; i < size; ++i ) + { + a(i) = i; + } + b = where(a>5.0,a/4.0,a); + + ScalarCode()(a); + + tester.out() << a << std::endl; + tester.out() << b << std::endl; + + tester.check(sum((a-b)*(a-b))<0.001); + } + + { + Interval<2> domain(9, 9); + UniformGridLayout<2> layout(domain, Loc<2>(3, 3), + GuardLayers<2>(1), ReplicatedTag()); + + Array<2, double, MultiPatch > a(layout), b(layout), c(layout); + + a(a.domain()) = 1.0; + b(b.domain()) = iota(b.domain()).comp(0) + iota(b.domain()).comp(1); + c(domain) = 0.25 * (b(domain - Loc<2>(1, 0)) + b(domain + Loc<2>(1, 0)) + + b(domain - Loc<2>(0, 1)) + b(domain + Loc<2>(0, 1))); + ScalarCode()(a, b); + + tester.out() << a << std::endl; + tester.out() << c << std::endl; + + tester.check("MultiPatch setup", all(a(domain) == c(domain))); + } + + { + Interval<2> domain(9, 9); + UniformGridLayout<2> layout(domain, Loc<2>(3, 3), + GuardLayers<2>(1), DistributedTag()); + + Array<2, double, MultiPatch > > a(layout), b(layout), c(layout); + + a(a.domain()) = 1.0; + b(b.domain()) = iota(b.domain()).comp(0) + iota(b.domain()).comp(1); + c(domain) = 0.25 * (b(domain - Loc<2>(1, 0)) + b(domain + Loc<2>(1, 0)) + + b(domain - Loc<2>(0, 1)) + b(domain + Loc<2>(0, 1))); + ScalarCode()(a, b); + + tester.out() << a << std::endl; + tester.out() << c << std::endl; + + tester.check("Remote MultiPatch setup", all(a(domain) == c(domain))); + } + + int retval = tester.results("evaluatorTest2 (ScalarCode)"); + + Pooma::finalize(); + + return retval; +} + +// ACL:rcsinfo +// ---------------------------------------------------------------------- +// $RCSfile: evaluatorTest3.cpp,v $ $Author: sa_smith $ +// $Revision: 1.13 $ $Date: 2000/06/05 18:03:35 $ +// ---------------------------------------------------------------------- +// ACL:rcsinfo diff -Nru a/r2/src/Evaluator/tests/makefile b/r2/src/Evaluator/tests/makefile --- a/r2/src/Evaluator/tests/makefile Wed Jan 15 17:12:42 2003 +++ b/r2/src/Evaluator/tests/makefile Wed Jan 15 17:12:42 2003 @@ -34,7 +34,8 @@ PASS=APP -TESTS = compressibleTest1 evaluatorTest1 evaluatorTest3 \ +TESTS = compressibleTest1 \ + evaluatorTest1 evaluatorTest2 evaluatorTest3 \ ReductionTest1 ReductionTest2 ReductionTest3 ReductionTest4 default:: build From jcrotinger at proximation.com Wed Jan 15 16:25:39 2003 From: jcrotinger at proximation.com (James Crotinger) Date: Wed, 15 Jan 2003 09:25:39 -0700 Subject: [pooma-dev] [BUG] ScalarCode does not work for Arrays Message-ID: I don't think this makes sense. Engine is about data storage, not about spatial stuff, guards, etc., so I don't think it should have anything but "domain()". Of course, I would say the same thing about Array - I don't know when Array acquired a physicalDomain(). I'm sure this was to simplify some generic code, but this could have been done with traits without making an unnecessary expansion of Array's interface. Anyway, that's my 2 cents, Jim -----Original Message----- From: Richard Guenther [mailto:rguenth at tat.physik.uni-tuebingen.de] Sent: Wednesday, January 15, 2003 6:56 AM To: pooma-dev at pooma.codesourcery.com Subject: [pooma-dev] [BUG] ScalarCode does not work for Arrays Hi! Due to the mess (it seems to me...) of the different domain() access functions for Arrays and Fields (namely physicalDomain() having different semantics), ScalarCode does not work for Arrays. To summarize: Array.domain() -> engine.domain() -> layout->domain() Array.physicalDomain() -> engine.domain() -> layout->domain() Array.totalDomain() -> engine.domain() -> layout->domain() Field.domain() -> fieldEngine.physicalDomain() -> (effectively) layout->innerDomain() Field.physicalDomain() -> fieldEngine.physicalDomain() -> (effectively) layout->innerDomain() Field.totalDomain() -> fieldEngine.totalDomain() -> (effectively) layout->baseDomain() but all those dependend on centering (i.e. vertex vs. cell domains) Layout.domain() == Layout.baseDomain() So I propose to make Engine's domain access interface match FieldEngine's, i.e. add Engine->physicalDomain(), make Array.physicalDomain() call that and return Layout->innerDomain() for this. Other suggestions? Thanks, Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rguenth at tat.physik.uni-tuebingen.de Wed Jan 15 21:51:59 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 15 Jan 2003 22:51:59 +0100 (CET) Subject: [pooma-dev] [BUG] ScalarCode does not work for Arrays In-Reply-To: Message-ID: On Wed, 15 Jan 2003, James Crotinger wrote: > I don't think this makes sense. Engine is about data storage, not about > spatial stuff, guards, etc., so I don't think it should have anything but > "domain()". Of course, I would say the same thing about Array - I don't > know when Array acquired a physicalDomain(). I'm sure this was to simplify > some generic code, but this could have been done with traits without making > an unnecessary expansion of Array's interface. > > Anyway, that's my 2 cents, What about my proposed patch? I.e. make Array.physicalDomain() actually return the physical domain and so make ScalarCode work for Arrays? I need this for wrapping old fortran code inside PatchCode (which I will submit soon, its just ScalarCode without loop-apply, but just a patch-function) and also find it useful for doing parallel iterative matrix solvers. Do you have other suggestions to fix ScalarCode? Thanks, Richard. From rguenth at tat.physik.uni-tuebingen.de Thu Jan 16 14:24:03 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 16 Jan 2003 15:24:03 +0100 (CET) Subject: [PATCH] Fix errorneous Field/tests/NearestNeighbours.cpp test Message-ID: I'll apply the following patch as obvious tonight. Richard. --- 1.2/r2/src/Field/tests/NearestNeighbors.cpp Thu Dec 19 10:37:26 2002 +++ edited/NearestNeighbors.cpp Thu Jan 16 15:22:12 2003 @@ -94,7 +94,7 @@ inline double manhattanDistance(const Vector &difference) { - double answer; + double answer = 0.0; for (int coordinate = Dim-1; coordinate >= 0; --coordinate) answer += std::abs(difference(coordinate)); return answer; -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From mark at codesourcery.com Thu Jan 16 17:46:44 2003 From: mark at codesourcery.com (Mark Mitchell) Date: Thu, 16 Jan 2003 09:46:44 -0800 Subject: [PATCH] Allow compiling with gcc 2.95 In-Reply-To: <3E23552D.5020806@codesourcery.com> Message-ID: <50180000.1042739204@warlock.codesourcery.com> --On Monday, January 13, 2003 04:09:17 PM -0800 Jeffrey Oldham wrote: > Richard Guenther wrote: >> Hi! >> >> The following patch allows compiling with gcc 2.95 (dont know if this is >> a good idea - could not test whole testsuite because compilation aborts >> with out of memory). > > Compiling with gcc2.95 is a good idea because these compilers will > continue to be used for the next few years. Please commit the patch. Red Hat shipped its GCC 2.95 (more like 3.0 than 2.95) in Red Hat 7.x, which is now a couple of years old. I can say with certainty that no CodeSourcery customer who would want to do anything like POOMA will be using GCC 2.95 at this point. My guess is that Intel's icc compiler is going to be the most common compiler for high-performance computing; our government is building almost exclusively Pentium4-based supercomputers over the next couple of years. icc uses the EDG front end and generates very good code. FYI, -- Mark Mitchell mark at codesourcery.com CodeSourcery, LLC http://www.codesourcery.com From mark at codesourcery.com Thu Jan 16 17:48:58 2003 From: mark at codesourcery.com (Mark Mitchell) Date: Thu, 16 Jan 2003 09:48:58 -0800 Subject: [PATCH] More autoconfisciation In-Reply-To: Message-ID: <51220000.1042739338@warlock.codesourcery.com> --On Tuesday, January 14, 2003 07:04:46 PM +0100 Richard Guenther wrote: > +# # if must include for POSIX file modes, say so > +# add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", > +# $inc_sys_stat_h_file_modes); Let's just remove these if they're not needed. (I have no idea whether they are or not!) Thanks, -- Mark Mitchell mark at codesourcery.com CodeSourcery, LLC http://www.codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Thu Jan 16 17:58:01 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 16 Jan 2003 18:58:01 +0100 (CET) Subject: [pooma-dev] Re: [PATCH] More autoconfisciation In-Reply-To: <51220000.1042739338@warlock.codesourcery.com> Message-ID: On Thu, 16 Jan 2003, Mark Mitchell wrote: > > > --On Tuesday, January 14, 2003 07:04:46 PM +0100 Richard Guenther > wrote: > > > +# # if must include for POSIX file modes, say so > > +# add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", > > +# $inc_sys_stat_h_file_modes); > > Let's just remove these if they're not needed. > > (I have no idea whether they are or not!) They are used nowhere inside the pooma sources, probably remanents from old versions. I'll remove these. Ok after those changes? Richard. From mark at codesourcery.com Thu Jan 16 17:59:35 2003 From: mark at codesourcery.com (Mark Mitchell) Date: Thu, 16 Jan 2003 09:59:35 -0800 Subject: [pooma-dev] Re: [PATCH] More autoconfisciation In-Reply-To: Message-ID: <55850000.1042739975@warlock.codesourcery.com> --On Thursday, January 16, 2003 06:58:01 PM +0100 Richard Guenther wrote: > On Thu, 16 Jan 2003, Mark Mitchell wrote: > >> >> >> --On Tuesday, January 14, 2003 07:04:46 PM +0100 Richard Guenther >> wrote: >> >> > +# # if must include for POSIX file modes, say so >> > +# add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES", >> > +# $inc_sys_stat_h_file_modes); >> >> Let's just remove these if they're not needed. >> >> (I have no idea whether they are or not!) > > They are used nowhere inside the pooma sources, probably remanents from > old versions. I'll remove these. > > Ok after those changes? Fine by me, but it's not my decision. I just nitpick from the sidelines. :-) -- Mark Mitchell mark at codesourcery.com CodeSourcery, LLC http://www.codesourcery.com From rguenth at tat.physik.uni-tuebingen.de Thu Jan 16 19:13:09 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 16 Jan 2003 20:13:09 +0100 (CET) Subject: [PATCH] Dont run examples from makefile Message-ID: Hi! The following patch disables running the examples after a 'make'. Ok? Richard. diff -ur cvs/r2/examples/Solvers/BlockDecomposed/FivePoint/makefile pooma-testsuite/r2/examples/Solvers/BlockDecomposed/FivePoint/makefile --- cvs/r2/examples/Solvers/BlockDecomposed/FivePoint/makefile 2001-10-15 19:34:29.000000000 +0200 +++ pooma-testsuite/r2/examples/Solvers/BlockDecomposed/FivePoint/makefile 2002-12-17 21:24:41.000000000 +0100 @@ -36,7 +36,6 @@ default:: FivePointSolve FivePointSolve: $(ODIR)/FivePointSolve - $(ODIR)/FivePointSolve $(ODIR)/FivePointSolve: $(ODIR)/FivePointSolve.o $(LinkToSuite) diff -ur cvs/r2/examples/Solvers/BlockDecomposed/NinePoint/makefile pooma-testsuite/r2/examples/Solvers/BlockDecomposed/NinePoint/makefile --- cvs/r2/examples/Solvers/BlockDecomposed/NinePoint/makefile 2001-10-15 19:34:29.000000000 +0200 +++ pooma-testsuite/r2/examples/Solvers/BlockDecomposed/NinePoint/makefile 2002-12-17 21:24:41.000000000 +0100 @@ -36,7 +36,6 @@ default:: NinePointSolve NinePointSolve: $(ODIR)/NinePointSolve - $(ODIR)/NinePointSolve $(ODIR)/NinePointSolve: $(ODIR)/NinePointSolve.o $(LinkToSuite) From rguenth at tat.physik.uni-tuebingen.de Thu Jan 16 19:15:08 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 16 Jan 2003 20:15:08 +0100 (CET) Subject: [PATCH] Use ln rather than cp for * -> *_APP Message-ID: Hi! The following patch reduces diskspace needed for testsuite compile by a factor of two. Ok? Richard. diff -ur cvs/r2/config/Shared/rules.mk pooma-testsuite/r2/config/Shared/rules.mk --- cvs/r2/config/Shared/rules.mk 2001-04-14 20:27:25.000000000 +0200 +++ pooma-testsuite/r2/config/Shared/rules.mk 2003-01-03 21:24:22.000000000 +0100 @@ -229,7 +229,7 @@ @echo LinkToSuite... See $(subst $(THISDIR)/,,$(INFO_FILE));\ echo "$(PRE_CMDLINE) $(LD_LINK_CMDLINE)" | $(PERL) $(SHARED_ROOT)/pretty.pl ld >> $(INFO_FILE); @$(PRE_CMDLINE) $(LD_LINK_CMDLINE) $(SUITE_REDIRECT) - @-cp $@ $@_$(PASS) + @-ln -f $@ $@_$(PASS) $(infotimestamp) @if [ ! -r $@ ]; then \ echo "Error linking $@";\ From rguenth at tat.physik.uni-tuebingen.de Thu Jan 16 20:07:39 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 16 Jan 2003 21:07:39 +0100 (CET) Subject: [RFC] Preparing reference manual merge Message-ID: Hi! I'd like starting to merge support for doxygen to create a reference manual for pooma. For the results you can view http://www.tat.physik.uni-tuebingen.de/~rguenth/pooma/reference/ There are a few new files to be placed at a sensible location and a location to be choosen for the reference documentation. I'd suggest creating a docs/reference directory and place doxygen.conf, a Makefile and all summary documentation there. The generated html documentation would go to docs/reference/html. Any other/better suggestions? Now to the merge itself (source file comments need to be changed). I have patches that - add per-file documentation (@file) - change class/function documentation to be recognized by doxygen (for class documentation I chose /** */ style, for methods/types/etc. /// style) A typical diff would look like the one below. I just like people to give comments to the style so I can try to improve it. Of course there is the possibility that a merge of these changes is not appreciated, if this is the case I'd like to hear that, too, of course. Thanks for your time, Richard. ===== Field.h 1.1 vs edited ===== --- 1.1/r2/src/Field/Field.h Mon May 13 17:47:35 2002 +++ edited/Field.h Thu Jan 16 20:46:37 2003 @@ -34,12 +34,11 @@ #ifndef POOMA_FIELD_FIELD_H #define POOMA_FIELD_FIELD_H -//----------------------------------------------------------------------------- -// Overview: -// -// Field -// - ties together the notions of field-category and mesh. -//----------------------------------------------------------------------------- +/** @file + * @ingroup Field + * @brief + * ties together the notions of field-category and mesh. + */ //----------------------------------------------------------------------------- // Includes: @@ -104,6 +103,7 @@ class FieldOffsetList; //----------------------------------------------------------------------------- +/** @name assign // Prototypes for the assign function used to assign an expression to a Field. // // Prototypes defined here: @@ -120,8 +120,11 @@ // // where "yourclass" is the class that you would like to work on the // right-hand side in an expression with a Field on the left-hand side. +*/ //----------------------------------------------------------------------------- - + +//@{ + template const Field & @@ -146,9 +149,13 @@ assign(const Array &lhs, const Field &rhs, const Op &op); +//@} + //----------------------------------------------------------------------------- +/** // SubFieldView is used to implement the syntax f[i], which selects the // ith SubField for field f. +*/ //----------------------------------------------------------------------------- struct SubFieldViewFunctorTag; @@ -241,12 +248,14 @@ //----------------------------------------------------------------------------- +/** // View1Implementation specialization for indexing a field // with a single domain. There is a single-valued version (SV == true) // and a multi-valued version (SV == false). // // Any changes to View1Implementation should also be made to // AltView1Implementation. +*/ //----------------------------------------------------------------------------- // Single-valued version. Handles scalars and Locs. @@ -483,11 +492,13 @@ //----------------------------------------------------------------------------- +/** // AltView1Implementation avoids an instantiation problem that arises when two // classes use each other. This class's definition should be exactly // the same as View1Implementation except omitting member functions. // // Do NOT explicitly instantiate this class. +*/ //----------------------------------------------------------------------------- // Single-valued version. Handles scalars and Locs. @@ -536,9 +547,11 @@ //----------------------------------------------------------------------------- +/** // View1 specialization for indexing a field with a single domain. // // Any changes to View1 should also be made to AltView1. +*/ //----------------------------------------------------------------------------- template @@ -587,9 +600,11 @@ //----------------------------------------------------------------------------- +/** // View1 specialization for indexing a field with an int. // // Any changes to View1 should also be made to AltView1. +*/ //----------------------------------------------------------------------------- template @@ -633,11 +648,13 @@ //----------------------------------------------------------------------------- +/** // AltView1 avoids an instantiation problem that arises when two // classes use each other. This class's definition should be exactly // the same as View1 except omitting member functions. // // Do NOT explicitly instantiate this class. +*/ //----------------------------------------------------------------------------- template @@ -675,11 +692,13 @@ //----------------------------------------------------------------------------- +/** // AltView1 avoids an instantiation problem that arises when two // classes use each other. This class's definition should be exactly // the same as View1 except omitting member functions. // // Do NOT explicitly instantiate this class. +*/ //----------------------------------------------------------------------------- template @@ -698,8 +717,10 @@ //----------------------------------------------------------------------------- +/** // View2 specialization for indexing a field with two // domains. +*/ //----------------------------------------------------------------------------- template specialization for indexing a field with two // integers. +*/ //----------------------------------------------------------------------------- template @@ -792,8 +815,10 @@ //----------------------------------------------------------------------------- +/** // View2, Loc > specialization for // indexing a field with a FieldOffset and a Loc. +*/ //----------------------------------------------------------------------------- template @@ -865,8 +890,10 @@ //----------------------------------------------------------------------------- +/** // View3 specialization for indexing a field with three // domains. +*/ //----------------------------------------------------------------------------- template specialization for indexing a field with three // integers. +*/ //----------------------------------------------------------------------------- template @@ -1066,7 +1095,7 @@ //----------------------------------------------------------------------------- -// Field. +/// Field. //----------------------------------------------------------------------------- template This_t; - // The field engine type. + /// The field engine type. typedef FieldEngine FieldEngine_t; - // The dimension (i.e., the number of indices required to select a point). + /// The dimension (i.e., the number of indices required to select a point). enum { dimensions = FieldEngine_t::dimensions }; - // The engine type. + /// The engine type. typedef Engine Engine_t; - // Element_t is the type of elements managed by this field's engine. - // ElementRef_t is the writable version. - + /// Element_t is the type of elements managed by this field's engine. typedef typename Engine_t::Element_t Element_t; + /// ElementRef_t is the writable version. typedef typename Engine_t::ElementRef_t ElementRef_t; - // Layout_t is the Engine's layout. + /// Layout_t is the Engine's layout. typedef typename Engine_t::Layout_t Layout_t; - // The types of the our domains. + /// The types of the our domains. typedef typename Engine_t::Domain_t Domain_t; - // The types of the our centering. + /// The types of the our centering. typedef Centering Centering_t; //--------------------------------------------------------------------------- - // User-callable constructors. These ctors are meant to be called by users. - - // Mesh/centering/layout constructors. We use the specified mesh - // object to initialize our mesh and the layout to initialize - // the engines. Clearly, these must be synchronized. This is appropriate - // for multi-patch engines. We just store the centering. + /// @name User-callable constructors + /// These ctors are meant to be called by users. + //@{ + + /// Mesh/centering/layout constructors. We use the specified mesh + /// object to initialize our mesh and the layout to initialize + /// the engines. Clearly, these must be synchronized. This is appropriate + /// for multi-patch engines. We just store the centering. Field() : fieldEngine_m() { } - // This version is used for expressions. + /// This version is used for expressions. template explicit Field(const I1 &i1) : fieldEngine_m(i1) { } - // Layout is templated so you can use a compatible layout to construct the - // engine. + /// Layout is templated so you can use a compatible layout to construct the + /// engine. template Field(const Centering_t ¢ering, const Layout2 &layout, const Mesh_t &mesh) @@ -1172,20 +1202,20 @@ : fieldEngine_m(centering, layout, Mesh_t(layout, i1, i2), materials) { } - // Copy constructor. + /// Copy constructor. Field(const This_t &model) : fieldEngine_m(model.fieldEngine()) { } - // Copy initializer. + /// Copy initializer. void initialize(const This_t &model) { fieldEngine_m = model.fieldEngine(); } - // Initializers that are equivalent to the constructors. + /// Initializers that are equivalent to the constructors. template void @@ -1209,12 +1239,16 @@ fieldEngine_m = FieldEngine_t(centering, layout, Mesh_t(layout)); } + //@} + //--------------------------------------------------------------------------- - // Internal POOMA constructors. These ctors are used internally by POOMA. - // They are not really meant to be called by users. + /// @name Internal POOMA constructors + /// These ctors are used internally by POOMA. + /// They are not really meant to be called by users. + //@{ - // Model-initializer constructor. Used by SubFieldView and - // View1Implementation above and by MakeFieldReturn in FieldCreateLeaf.h. + /// Model-initializer constructor. Used by SubFieldView and + /// View1Implementation above and by MakeFieldReturn in FieldCreateLeaf.h. template Field(const Field &model, const Initializer &i) @@ -1232,13 +1266,15 @@ { } //--------------------------------------------------------------------------- - // Empty destructor is fine for us. + /// Empty destructor is fine for us. ~Field() { } + //@} //--------------------------------------------------------------------------- - // Accessors. + /// @name Accessors + //@{ inline const Engine_t &engine() const { @@ -1330,11 +1366,13 @@ { return fieldEngine_m.engine().layout(); } + + //@} //--------------------------------------------------------------------------- - // Instruct the field to make its own copy of its data. - // Recursively call ourself with subfield views of this field. When we're - // through, tell the fieldEngine to make a distinct copy of itself. + /// Instruct the field to make its own copy of its data. + /// Recursively call ourself with subfield views of this field. When we're + /// through, tell the fieldEngine to make a distinct copy of itself. void makeOwnCopy() { @@ -1345,10 +1383,10 @@ //--------------------------------------------------------------------------- - // Sub-field view creation function. - // A field consists of (potentially) several sub-fields. This function - // returns a view of one of these. - + /// @name Sub-field view creation functions + /// A field consists of (potentially) several sub-fields. This function + /// returns a view of one of these. + //@{ inline typename SubFieldView::Type_t operator[](int iSubfield) const { @@ -1377,13 +1415,16 @@ typedef SubFieldView Ret_t; return Ret_t::make(*this, m); } + //@} //--------------------------------------------------------------------------- - // View-creation operations. These operator() and read() functions take - // zero or more sub-domains, which combine to form a domain with - // dimensionality identical to the rank of the field. The zero argument - // version returns a view of the physical domain and the 'All'-suffixed - // versions return a view of the total domain. + /// @name View-creation operations + /// These operator() and read() functions take + /// zero or more sub-domains, which combine to form a domain with + /// dimensionality identical to the rank of the field. The zero argument + /// version returns a view of the physical domain and the 'All'-suffixed + /// versions return a view of the total domain. + //@{ inline typename AltView1::ReadType_t read() const @@ -1460,11 +1501,13 @@ typedef View3 Ret_t; return Ret_t::make(*this, s1, s2, s3); } - + //@} //--------------------------------------------------------------------------- - // Component-forwarding functions. These work quite similarly to the - // ones from Array except we produce a Field with the same Mesh. + /// @name Component-forwarding functions + /// These work quite similarly to the + /// ones from Array except we produce a Field with the same Mesh. + //@{ inline typename ComponentView, This_t>::Type_t comp(const int &i1) const @@ -1484,11 +1527,11 @@ { return ComponentView::make(*this, loc); } - + //@} //--------------------------------------------------------------------------- - // Patch accessor functions returns the i'th patch. - + /// @name Patch accessor functions returns the i'th patch. + //@{ inline typename Patch::Type_t patchLocal(EnginePatch::PatchID_t i) const { @@ -1500,14 +1543,17 @@ { return engineFunctor(engine(), EngineNumPatches()); } + //@} //--------------------------------------------------------------------------- - // Copy assignment operators. We pack this assignment expression into a - // PETE binary expression tree node and then use this to construct an - // array with an expression engine. We then pass this on to an evaluator, - // which handles the computation. The first three versions handle assigning - // Arrays and ConstArrays to Arrays and the fourth one handles assigning - // scalars. + /// @name Copy assignment operators + /// We pack this assignment expression into a + /// PETE binary expression tree node and then use this to construct an + /// array with an expression engine. We then pass this on to an evaluator, + /// which handles the computation. The first three versions handle assigning + /// Arrays and ConstArrays to Arrays and the fourth one handles assigning + /// scalars. + //@{ This_t &operator=(const This_t &rhs) { @@ -1526,11 +1572,13 @@ return assign(*this, rhs, OpAssign()); } + //@} //--------------------------------------------------------------------------- - // Op-assignment operators. + /// @name Op-assignment operators + //@{ - // Addition. + /// Addition. template const This_t &operator+=(const T1 &rhs) const @@ -1538,7 +1586,7 @@ return assign(*this, rhs, OpAddAssign()); } - // Subtraction. + /// Subtraction. template const This_t &operator-=(const T1 &rhs) const @@ -1546,7 +1594,7 @@ return assign(*this, rhs, OpSubtractAssign()); } - // Multiplication. + /// Multiplication. template const This_t &operator*=(const T1 &rhs) const @@ -1554,7 +1602,7 @@ return assign(*this, rhs, OpMultiplyAssign()); } - // Division. + /// Division. template const This_t &operator/=(const T1 &rhs) const @@ -1562,7 +1610,7 @@ return assign(*this, rhs, OpDivideAssign()); } - // Modulus. + /// Modulus. template const This_t &operator%=(const T1 &rhs) const @@ -1570,7 +1618,7 @@ return assign(*this, rhs, OpModAssign()); } - // Bitwise-Or. + /// Bitwise-Or. template const This_t &operator|=(const T1 &rhs) const @@ -1578,7 +1626,7 @@ return assign(*this, rhs, OpBitwiseOrAssign()); } - // Bitwise-And. + /// Bitwise-And. template const This_t &operator&=(const T1 &rhs) const @@ -1586,7 +1634,7 @@ return assign(*this, rhs, OpBitwiseAndAssign()); } - // Bitwise-Xor. + /// Bitwise-Xor. template const This_t &operator^=(const T1 &rhs) const @@ -1594,7 +1642,7 @@ return assign(*this, rhs, OpBitwiseXorAssign()); } - // Left shift. + /// Left shift. template const This_t &operator<<=(const T1 &rhs) const @@ -1602,7 +1650,7 @@ return assign(*this, rhs, OpLeftShiftAssign()); } - // Right shift. + /// Right shift. template const This_t &operator>>=(const T1 &rhs) const @@ -1610,17 +1658,21 @@ return assign(*this, rhs, OpRightShiftAssign()); } + //@} //--------------------------------------------------------------------------- - // Relation support. - + /// @name Relation support + //@{ + + /// add a relation void addRelation(RelationListItem *item) const { PAssert(numSubFields() == 0); fieldEngine_m.relations().addRelation(item); } - + + /// remove all relations void removeRelations() { for (int m = 0; m < numMaterials(); ++m) @@ -1631,7 +1683,8 @@ } } } - + + /// trigger all relations dirty (or all, if makeDirty is set) void applyRelations(bool makeDirty = false) const { for (int m = 0; m < numMaterials(); ++m) @@ -1644,7 +1697,8 @@ } } } - + + /// dirty field, dirtying all relations void setDirty() const { for (int m = 0; m < numMaterials(); ++m) @@ -1655,7 +1709,8 @@ } } } - + + /// clear dirty flag of field, clearing all relations dirty flag void clearDirty() const { for (int m = 0; m < numMaterials(); ++m) @@ -1667,6 +1722,7 @@ } } + //@} private: From rguenth at tat.physik.uni-tuebingen.de Tue Jan 21 14:36:04 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 21 Jan 2003 15:36:04 +0100 (CET) Subject: [PATCH] Correct typos (obvious) Message-ID: The following patch corrects typos found by famous new g++ parser. Ok? Ok to apply similar fixes once I find errors as obvious? Thanks, Richard. 2003Jan21 Richard Guenther * src/DynamicArray/DynamicArray.h: s/Dim/1/ src/Field/DiffOps/FieldOffsetReduction.h: s/outputputCentering_m/outputCentering_m/ src/Field/Field.h: s/field/f/ src/Field/Relations/Relations.h: s/r1/r/ src/Engine/IsValidLocation.h: protect against multiple inclusion. diff -Nru a/r2/src/DynamicArray/DynamicArray.h b/r2/src/DynamicArray/DynamicArray.h --- a/r2/src/DynamicArray/DynamicArray.h Tue Jan 21 15:31:05 2003 +++ b/r2/src/DynamicArray/DynamicArray.h Tue Jan 21 15:31:05 2003 @@ -370,7 +370,7 @@ template DynamicArray(const Sub1 &s1, const ModelElement &model) - : Array(s1, model) + : Array<1, T, EngineTag>(s1, model) { CTAssert(dynamic == true); } diff -Nru a/r2/src/Engine/IsValidLocation.h b/r2/src/Engine/IsValidLocation.h --- a/r2/src/Engine/IsValidLocation.h Tue Jan 21 15:31:05 2003 +++ b/r2/src/Engine/IsValidLocation.h Tue Jan 21 15:31:05 2003 @@ -26,6 +26,9 @@ // ---------------------------------------------------------------------- // ACL:license +#ifndef POOMA_ENGINE_ISVALIDLOCATION_H +#define POOMA_ENGINE_ISVALIDLOCATION_H + //----------------------------------------------------------------------------- // These helper functions are used to determine if a particular location // or region of a object is defined. For all objects _not_ based @@ -113,3 +116,5 @@ { return true; } + +#endif diff -Nru a/r2/src/Field/DiffOps/FieldOffsetReduction.h b/r2/src/Field/DiffOps/FieldOffsetReduction.h --- a/r2/src/Field/DiffOps/FieldOffsetReduction.h Tue Jan 21 15:31:05 2003 +++ b/r2/src/Field/DiffOps/FieldOffsetReduction.h Tue Jan 21 15:31:05 2003 @@ -93,7 +93,7 @@ const Centering &outputCentering() const { - return outputputCentering_m; + return outputCentering_m; } const Centering &inputCentering() const diff -Nru a/r2/src/Field/Field.h b/r2/src/Field/Field.h --- a/r2/src/Field/Field.h Tue Jan 21 15:31:05 2003 +++ b/r2/src/Field/Field.h Tue Jan 21 15:31:05 2003 @@ -1743,7 +1743,7 @@ Type_t apply(const Subject_t &f, const DataObjectRequest &functor) { - return LeafFunctor_t::apply(field.fieldEngine(), functor); + return LeafFunctor_t::apply(f.fieldEngine(), functor); } }; diff -Nru a/r2/src/Field/Relations/Relations.h b/r2/src/Field/Relations/Relations.h --- a/r2/src/Field/Relations/Relations.h Tue Jan 21 15:31:05 2003 +++ b/r2/src/Field/Relations/Relations.h Tue Jan 21 15:31:05 2003 @@ -185,7 +185,7 @@ Relation1(const Target &t, const R1 &r, const RelationFunctor &f) - : RelationBase(t, f), r1_m(r1) + : RelationBase(t, f), r1_m(r) { } //--------------------------------------------------------------------------- From tarjeik at chemcon.no Tue Jan 21 15:54:24 2003 From: tarjeik at chemcon.no (Tarjei Knapstad) Date: 21 Jan 2003 16:54:24 +0100 Subject: [pooma-dev] [PATCH] Use ln rather than cp for * -> *_APP In-Reply-To: References: Message-ID: <1043164465.4176.74.camel@cc-intern01> On Thu, 2003-01-16 at 20:15, Richard Guenther wrote: > Hi! > > The following patch reduces diskspace needed for testsuite compile > by a factor of two. > I had thought of suggesting that, but completely forgot. What is the reason for having the *_APP files there at all? Grepping? > Ok? > Almost. I would suggest using soft (symbolic) links instead, i.e. ln -sf instead of ln -f. -- Tarjei -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From rguenth at tat.physik.uni-tuebingen.de Tue Jan 21 16:01:21 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Tue, 21 Jan 2003 17:01:21 +0100 (CET) Subject: [pooma-dev] [PATCH] Use ln rather than cp for * -> *_APP In-Reply-To: <1043164465.4176.74.camel@cc-intern01> Message-ID: On 21 Jan 2003, Tarjei Knapstad wrote: > On Thu, 2003-01-16 at 20:15, Richard Guenther wrote: > > Hi! > > > > The following patch reduces diskspace needed for testsuite compile > > by a factor of two. > > > I had thought of suggesting that, but completely forgot. What is the > reason for having the *_APP files there at all? Grepping? Dont know myself... > > Ok? > > > Almost. I would suggest using soft (symbolic) links instead, i.e. ln -sf > instead of ln -f. Thought of this, too, but assuming makefiles from users that delete either of the variant using symlinks does no longer work for them, using hardlinks does. I'd rather drop the damn thing completely... Anybody still knows why these dups were introduced? Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From jcrotinger at proximation.com Tue Jan 21 18:48:35 2003 From: jcrotinger at proximation.com (James Crotinger) Date: Tue, 21 Jan 2003 11:48:35 -0700 Subject: [pooma-dev] [PATCH] Use ln rather than cp for * -> *_APP Message-ID: Beats me. The entire original Build setup was taken wholesale from the Blanca project as they liked it better than the POOMA r1 build system. Perhaps Julian understood what all this stuff was for, but I never did. :) Jim -----Original Message----- From: Tarjei Knapstad [mailto:tarjeik at chemcon.no] Sent: Tuesday, January 21, 2003 8:54 AM To: Pooma-dev Subject: Re: [pooma-dev] [PATCH] Use ln rather than cp for * -> *_APP On Thu, 2003-01-16 at 20:15, Richard Guenther wrote: > Hi! > > The following patch reduces diskspace needed for testsuite compile > by a factor of two. > I had thought of suggesting that, but completely forgot. What is the reason for having the *_APP files there at all? Grepping? > Ok? > Almost. I would suggest using soft (symbolic) links instead, i.e. ln -sf instead of ln -f. -- Tarjei -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarjeik at chemcon.no Tue Jan 21 19:46:43 2003 From: tarjeik at chemcon.no (Tarjei Knapstad) Date: 21 Jan 2003 20:46:43 +0100 Subject: [pooma-dev] [PATCH] Use ln rather than cp for * -> *_APP In-Reply-To: References: Message-ID: <1043178403.4684.82.camel@cc-intern01> On Tue, 2003-01-21 at 17:01, Richard Guenther wrote: > On 21 Jan 2003, Tarjei Knapstad wrote: > > > On Thu, 2003-01-16 at 20:15, Richard Guenther wrote: > > > Hi! > > > > > > The following patch reduces diskspace needed for testsuite compile > > > by a factor of two. > > > > > I had thought of suggesting that, but completely forgot. What is the > > reason for having the *_APP files there at all? Grepping? > > Dont know myself... > > > > Ok? > > > > > Almost. I would suggest using soft (symbolic) links instead, i.e. ln -sf > > instead of ln -f. > > Thought of this, too, but assuming makefiles from users that delete either > of the variant using symlinks does no longer work for them, using > hardlinks does. I'd rather drop the damn thing completely... > Well, I guess that's a (minor) point. I would vote for dropping it completely as I can't see that it makes any sense. > Anybody still knows why these dups were introduced? > The only reason I can think of is that there may have been some make rule once upon a time that went through every example/benchmark subdir and ran the binary with _APP in it's filename, but then what would be the point in having a binary without the _APP suffix? Maybe new rules were made that didn't need the _APP suffix, but it was kept for backwards compatibility, who knows. Tarjei -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From jhall at swcp.com Tue Jan 21 22:39:08 2003 From: jhall at swcp.com (John H. Hall) Date: Tue, 21 Jan 2003 15:39:08 -0700 Subject: [pooma-dev] [PATCH] Use ln rather than cp for * -> *_APP In-Reply-To: <1043178403.4684.82.camel@cc-intern01> Message-ID: <27227960-2D91-11D7-AB17-0003938E6E0A@swcp.com> Gang: The idea here was that at the time KCC/SGI CC took a long time (days) to compile in Optimized mode. So the trick (recommended to us by KAI) was to build a debug version and get the ii_files (later ti_files) built and then remove the objects a make a single pass to get the optimized object files (which still took a while). But, we wanted to keep the Debug version of the executable as well as the optimized version, hence the copies. Our scripts referred to a common name for the executable and it was either a debug version or an optimized version depending on the link. By adding the "_1" in our case we could specifically get the debug version, and a "_2" for optimized (user selectable for the names). Also, the old version of the make system went to great pains to keep the builds in what we called suites so that we could simultaneously on our many, many processors, build all the versions at once (for our regression tests, up to 64 simultaneous builds). This meant we had to even have a different TMPDIR for each build to avoid file naming collisions. John On Tuesday, January 21, 2003, at 12:46 PM, Tarjei Knapstad wrote: > On Tue, 2003-01-21 at 17:01, Richard Guenther wrote: >> On 21 Jan 2003, Tarjei Knapstad wrote: >> >>> On Thu, 2003-01-16 at 20:15, Richard Guenther wrote: >>>> Hi! >>>> >>>> The following patch reduces diskspace needed for testsuite compile >>>> by a factor of two. >>>> >>> I had thought of suggesting that, but completely forgot. What is the >>> reason for having the *_APP files there at all? Grepping? >> >> Dont know myself... >> >>>> Ok? >>>> >>> Almost. I would suggest using soft (symbolic) links instead, i.e. ln >>> -sf >>> instead of ln -f. >> >> Thought of this, too, but assuming makefiles from users that delete >> either >> of the variant using symlinks does no longer work for them, using >> hardlinks does. I'd rather drop the damn thing completely... >> > Well, I guess that's a (minor) point. I would vote for dropping it > completely as I can't see that it makes any sense. > >> Anybody still knows why these dups were introduced? >> > The only reason I can think of is that there may have been some make > rule once upon a time that went through every example/benchmark subdir > and ran the binary with _APP in it's filename, but then what would be > the point in having a binary without the _APP suffix? Maybe new rules > were made that didn't need the _APP suffix, but it was kept for > backwards compatibility, who knows. > > Tarjei > From rguenth at tat.physik.uni-tuebingen.de Thu Jan 23 16:21:55 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 23 Jan 2003 17:21:55 +0100 (CET) Subject: [PATCH] Make two-arg where() work for Fields. Message-ID: Just stumbled over the following patch in one of my repositories... Ok? Richard. 2003Jan23 Richard Guenther * src/Field/Field.h: add assign(,WhereProxy,), add necessary specializations for ExpressionTraits, CombineExpressionTraits and ConvertWhereProxy. src/Field/tests/WhereTest.cpp: enable checking of two-argument where() for Fields. # This is a BitKeeper generated patch for the following project: # Project Name: pooma/cheetah repository tracking CVS/tarball # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.25 -> 1.26 # r2/src/Field/Field.h 1.3 -> 1.5 # r2/src/Field/tests/WhereTest.cpp 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/01/23 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.26 # Two-arg where() support for Fields. # -------------------------------------------- # diff -Nru a/r2/src/Field/Field.h b/r2/src/Field/Field.h --- a/r2/src/Field/Field.h Thu Jan 23 17:18:40 2003 +++ b/r2/src/Field/Field.h Thu Jan 23 17:18:40 2003 @@ -146,6 +146,13 @@ assign(const Array &lhs, const Field &rhs, const Op &op); +template +const Field & +assign(const Field &lhs, + const WhereProxy &rhs, + const Op &op); + //----------------------------------------------------------------------------- // SubFieldView is used to implement the syntax f[i], which selects the // ith SubField for field f. @@ -2010,6 +2017,49 @@ //----------------------------------------------------------------------------- +// Traits class for expressions containing fields. +//----------------------------------------------------------------------------- + +struct ExpressionIsField { }; + +template +struct ExpressionTraits > +{ + typedef ExpressionIsField Type_t; +}; + +template<> +struct CombineExpressionTraits +{ + typedef ExpressionIsField Type_t; +}; + +template<> +struct CombineExpressionTraits +{ + typedef ExpressionIsField Type_t; +}; + +template<> +struct CombineExpressionTraits +{ + typedef ExpressionIsField Type_t; +}; + +template<> +struct CombineExpressionTraits +{ + typedef ExpressionIsField Type_t; +}; + +template<> +struct CombineExpressionTraits +{ + typedef ExpressionIsField Type_t; +}; + + +//----------------------------------------------------------------------------- // assign() function for Field assign-op array. //----------------------------------------------------------------------------- @@ -2138,6 +2188,28 @@ Evaluator().evaluate(lhs, op, rhs); + return lhs; +} + + +//----------------------------------------------------------------------------- +// assign() function for Field assign-op WhereProxy. +//----------------------------------------------------------------------------- + +template +struct ConvertWhereProxy +{ + typedef MakeFieldReturn Make_t; +}; + +template +const Field & +assign(const Field &lhs, + const WhereProxy &rhs, const Op &op) +{ + assign(lhs, rhs.whereMask(), rhs.opMask(op)); + return lhs; } diff -Nru a/r2/src/Field/tests/WhereTest.cpp b/r2/src/Field/tests/WhereTest.cpp --- a/r2/src/Field/tests/WhereTest.cpp Thu Jan 23 17:18:40 2003 +++ b/r2/src/Field/tests/WhereTest.cpp Thu Jan 23 17:18:40 2003 @@ -111,26 +111,15 @@ Vector<2> line(1.0, 1.0); + + // 3-arg where + a = where(dot(x, line) > 8.0, x.comp(0), x.comp(1)); // equivalent to: // a = where(x.comp(0) + x.comp(1) > 8.0, x.comp(0), x.comp(1)); - // These fail to compile: - - // b = where(dot(x, line) > 8.0, x.comp(0)); - // c = where(dot(x, line) <= 8.0, x.comp(1)); - - tester.out() << a << std::endl; - - // tester.out().setf(std::ios_base::fixed, std::ios_base::floatfield); - - // tester.out() << sum(a[0]) << std::endl; - // tester.out() << sum(a[0] * x[0].comp(0)) << std::endl; - // tester.out() << sum(a[0] * x[0].comp(1)) << std::endl; - // tester.out() << sum(a[1]) << std::endl; - // tester.out() << sum(a[1] * x[1].comp(0)) << std::endl; - // tester.out() << sum(a[1] * x[1].comp(1)) << std::endl; + tester.out() << "where(dot(x, line) > 8.0, x.comp(0), x.comp(1))\n" << a << std::endl; // Should verify these results by hand. // These are basically regression tests. @@ -141,6 +130,30 @@ tester.check("sum a[1]", sum(a[1]), 387.0); tester.check("sum a[1]*x[1](0)", sum(a[1] * x[1].comp(0)), 2161.5); tester.check("sum a[1]*x[1](1)", sum(a[1] * x[1].comp(1)), 1990.5); + + + // 2-arg where + + b = where(dot(x, line) > 8.0, x.comp(0)); + c = where(dot(x, line) <= 8.0, x.comp(1)); + + tester.out() << "where(dot(x, line) > 8.0, x.comp(0))" << b << std::endl; + tester.out() << "where(dot(x, line) <= 8.0, x.comp(1))" << c << std::endl; + + // verify using 3-arg where verified above + + tester.check("twoarg where result 0.0 part, centering zero", + all(where(dot(x.subField(0, 0), line) > 8.0, + c.subField(0, 0), b.subField(0, 0)) == 0.0)); + tester.check("twoarg where result 0.0 part, centering one", + all(where(dot(x.subField(0, 1), line) > 8.0, + c.subField(0, 1), b.subField(0, 1)) == 0.0)); + tester.check("twoarg where result dirtied part, centering zero", + all(where(dot(x.subField(0, 0), line) > 8.0, + b.subField(0, 0), c.subField(0, 0)) == a.subField(0, 0))); + tester.check("twoarg where result dirtied part, centering one", + all(where(dot(x.subField(0, 1), line) > 8.0, + b.subField(0, 1), c.subField(0, 1)) == a.subField(0, 1))); int ret = tester.results("WhereTest"); Pooma::finalize(); From rguenth at tat.physik.uni-tuebingen.de Thu Jan 23 19:47:20 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 23 Jan 2003 20:47:20 +0100 (CET) Subject: [PATCH] avoid warnings from dont-use-functions. Message-ID: The following patch changes dont-use functions to cause link-time rather than runtime errors. Ok? Richard. 2003Jan23 Richard Guenther * src/Field/FieldCentering.cmpl.cpp: dont define canonicalCentering(...) for unsupported dimensions. src/Particles/AttributeWrapper.h: dont define AttributeWrapper(), destructor and assignment operator. src/Particles/KillBC.h: dont define ParticleBC(). # This is a BitKeeper generated patch for the following project: # Project Name: pooma/cheetah repository tracking CVS/tarball # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.22 -> 1.23 # r2/src/Particles/KillBC.h 1.1 -> 1.2 # r2/src/Field/FieldCentering.cmpl.cpp 1.3 -> 1.4 # r2/src/Particles/AttributeWrapper.h 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/01/23 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.23 # Turn runtime error into link-time error to avoid -ansi/-pedantic failures # -------------------------------------------- # diff -Nru a/r2/src/Field/FieldCentering.cmpl.cpp b/r2/src/Field/FieldCentering.cmpl.cpp --- a/r2/src/Field/FieldCentering.cmpl.cpp Thu Jan 23 20:43:20 2003 +++ b/r2/src/Field/FieldCentering.cmpl.cpp Thu Jan 23 20:43:20 2003 @@ -314,10 +314,7 @@ const Centering canonicalCentering (const enum CenteringType type, const enum ContinuityType discontinuous, - const int dimension) -{ - PInsist (false, "Unsupported dimension."); -} + const int dimension); // Unsupported dimension template <> const Centering<1> canonicalCentering<1> diff -Nru a/r2/src/Particles/AttributeWrapper.h b/r2/src/Particles/AttributeWrapper.h --- a/r2/src/Particles/AttributeWrapper.h Thu Jan 23 20:43:20 2003 +++ b/r2/src/Particles/AttributeWrapper.h Thu Jan 23 20:43:20 2003 @@ -208,21 +208,11 @@ // Make copy consructor, default constructor, and operator= private // and undefined since they should not be used - AttributeWrapper() - { - PInsist(false, "Called AttributeWrapper default constructor."); - } + AttributeWrapper(); - AttributeWrapper(const This_t &) - { - PInsist(false, "Called AttributeWrapper copy constructor."); - } + AttributeWrapper(const This_t &); - const This_t &operator=(const This_t &) - { - PInsist(false, "Called AttributeWrapper operator=."); - return *this; - } + const This_t &operator=(const This_t &); }; diff -Nru a/r2/src/Particles/KillBC.h b/r2/src/Particles/KillBC.h --- a/r2/src/Particles/KillBC.h Thu Jan 23 20:43:20 2003 +++ b/r2/src/Particles/KillBC.h Thu Jan 23 20:43:20 2003 @@ -162,7 +162,7 @@ private: // Can't call default constructor. - ParticleBC() { } + ParticleBC(); // Subject of the boundary condition. Subject_t subject_m; From rguenth at tat.physik.uni-tuebingen.de Thu Jan 23 19:50:23 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 23 Jan 2003 20:50:23 +0100 (CET) Subject: [PATCH] add necessary includes to autogenerated files Message-ID: The following dubious patch adds includes of required standard headers to PETE autogenerated files. This is necessary to allow compiling the lib with -ansi. Better ideas? (to protect all includers requires touching about 10 files) Ok? Richard. 2003Jan23 Richard Guenther * src/Pooma/PoomaOperatorTags.h: include and . src/PETE/OperatorTags.h: include . # This is a BitKeeper generated patch for the following project: # Project Name: pooma/cheetah repository tracking CVS/tarball # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.23 -> 1.24 # r2/src/Pooma/PoomaOperatorTags.h 1.1 -> 1.2 # r2/src/PETE/OperatorTags.h 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/01/23 rguenth at bellatrix.tat.physik.uni-tuebingen.de 1.24 # temporary fixes to autogenerated(!) files # -------------------------------------------- # diff -Nru a/r2/src/PETE/OperatorTags.h b/r2/src/PETE/OperatorTags.h --- a/r2/src/PETE/OperatorTags.h Thu Jan 23 20:47:39 2003 +++ b/r2/src/PETE/OperatorTags.h Thu Jan 23 20:47:39 2003 @@ -41,6 +41,7 @@ // /////////////////////////////////////////////////////////////////////////////// +#include struct FnArcCos { diff -Nru a/r2/src/Pooma/PoomaOperatorTags.h b/r2/src/Pooma/PoomaOperatorTags.h --- a/r2/src/Pooma/PoomaOperatorTags.h Thu Jan 23 20:47:39 2003 +++ b/r2/src/Pooma/PoomaOperatorTags.h Thu Jan 23 20:47:39 2003 @@ -13,6 +13,8 @@ // /////////////////////////////////////////////////////////////////////////////// +#include +#include #if defined(POOMA_POOMA_POOMAOPERATORTAGS_H) template class Tensor; From rguenth at tat.physik.uni-tuebingen.de Thu Jan 23 21:42:44 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 23 Jan 2003 22:42:44 +0100 (CET) Subject: [PATCH] Fix more ISO conformance problems Message-ID: Ok? 2003Jan23 Richard Guenther * src/Array/tests/ScalarAdvection.cpp: forward declare badOption() and badValue(). src/Domain/NewDomain.h: use enum rather than not compile-time constant const int. src/Layout/GridLayout.cpp: use GCFillInfo_t typename for constructing LayoutBaseData::GCFillInfo. src/Layout/SparseTileLayout.cpp: likewise. src/Layout/UniformGridLayout.cpp: likewise. Index: src/Array/tests/ScalarAdvection.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/Array/tests/ScalarAdvection.cpp,v retrieving revision 1.5 diff -u -u -r1.5 ScalarAdvection.cpp --- src/Array/tests/ScalarAdvection.cpp 10 Oct 2001 17:55:01 -0000 1.5 +++ src/Array/tests/ScalarAdvection.cpp 23 Jan 2003 21:39:40 -0000 @@ -72,6 +72,12 @@ template void print(const SAOptions &opts, OStr &out); +template +void badOption(OStr &out, const char *str, const std::string &option); + +template +void badValue(OStr &out, const std::string &option); + template class SAOptions { Index: src/Domain/NewDomain.h =================================================================== RCS file: /home/pooma/Repository/r2/src/Domain/NewDomain.h,v retrieving revision 1.31 diff -u -u -r1.31 NewDomain.h --- src/Domain/NewDomain.h 14 Jan 2002 16:48:21 -0000 1.31 +++ src/Domain/NewDomain.h 23 Jan 2003 21:39:49 -0000 @@ -417,8 +417,8 @@ inline static RT &fillSlice(RT &retval, const UT &u, const T1 &a, const T2 &b) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>:: combine(retval,u,a); CombineSliceDomain0 && RDX)>:: @@ -828,8 +828,8 @@ inline static RT &fillSlice(RT &retval, const UT &u, const T1 &a) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>::combine(retval,u,a); return retval; } @@ -878,8 +878,8 @@ inline static RT &fillSlice(RT &retval, const UT &u, const T1 &a, const T2 &b, const T3 &c) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>::combine(retval,u,a); CombineSliceDomain0 && RDX)>::combine(retval,u,b); CombineSliceDomain0 && RDX)>:: @@ -939,8 +939,8 @@ const T1 &a, const T2 &b, const T3 &c, const T4 &d) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>::combine(retval,u,a); CombineSliceDomain0 && RDX)>::combine(retval,u,b); CombineSliceDomain0 && RDX)>:: @@ -1005,8 +1005,8 @@ const T1 &a, const T2 &b, const T3 &c, const T4 &d, const T5 &e) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>::combine(retval,u,a); CombineSliceDomain0 && RDX)>::combine(retval,u,b); CombineSliceDomain0 && RDX)>:: @@ -1080,8 +1080,8 @@ const T1 &a, const T2 &b, const T3 &c, const T4 &d, const T5 &e, const T6 &f) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>::combine(retval,u,a); CombineSliceDomain0 && RDX)>::combine(retval,u,b); CombineSliceDomain0 && RDX)>:: @@ -1166,8 +1166,8 @@ const T5 &e, const T6 &f, const T7 &g) { - const bool RDX = - DomainTraits::dimensions > DomainTraits::sliceDimensions; + enum { RDX = + DomainTraits::dimensions > DomainTraits::sliceDimensions }; CombineSliceDomain0 && RDX)>::combine(retval,u,a); CombineSliceDomain0 && RDX)>::combine(retval,u,b); CombineSliceDomain0 && RDX)>:: Index: src/Layout/GridLayout.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/Layout/GridLayout.cpp,v retrieving revision 1.87 diff -u -u -r1.87 GridLayout.cpp --- src/Layout/GridLayout.cpp 23 Jan 2003 21:29:49 -0000 1.87 +++ src/Layout/GridLayout.cpp 23 Jan 2003 21:39:56 -0000 @@ -429,8 +429,7 @@ // Now, push IDs and source into cache... - this->gcFillList_m.push_back(LayoutBaseData::GCFillInfo(gcdom, - sourceID, destID)); + this->gcFillList_m.push_back(GCFillInfo_t(gcdom, sourceID, destID)); } } } @@ -482,8 +481,7 @@ // Now, push IDs and source into cache... - this->gcFillList_m.push_back(LayoutBaseData::GCFillInfo(gcdom, - sourceID, destID)); + this->gcFillList_m.push_back(GCFillInfo_t(gcdom, sourceID, destID)); } } } Index: src/Layout/SparseTileLayout.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/Layout/SparseTileLayout.cpp,v retrieving revision 1.29 diff -u -u -r1.29 SparseTileLayout.cpp --- src/Layout/SparseTileLayout.cpp 23 Jan 2003 21:29:49 -0000 1.29 +++ src/Layout/SparseTileLayout.cpp 23 Jan 2003 21:40:00 -0000 @@ -449,9 +449,9 @@ for ( ; GCLstart!=GCLend ; ++GCLstart ) { // removed the external guard layer area. - this->gcFillList_m.push_back(LayoutBaseData::GCFillInfo((*GCLstart).domain(), - (*GCLstart).globalID(), - (*start)->globalID())); + this->gcFillList_m.push_back(GCFillInfo_t((*GCLstart).domain(), + (*GCLstart).globalID(), + (*start)->globalID())); } tlist.clear(); } Index: src/Layout/UniformGridLayout.cpp =================================================================== RCS file: /home/pooma/Repository/r2/src/Layout/UniformGridLayout.cpp,v retrieving revision 1.38 diff -u -u -r1.38 UniformGridLayout.cpp --- src/Layout/UniformGridLayout.cpp 23 Jan 2003 21:29:49 -0000 1.38 +++ src/Layout/UniformGridLayout.cpp 23 Jan 2003 21:40:01 -0000 @@ -370,7 +370,7 @@ this->all_m[sourceID]->context() == Pooma::context() || this->all_m[destID]->context() == Pooma::context() ) - this->gcFillList_m.push_back(LayoutBaseData::GCFillInfo(gcdom,sourceID,destID)); + this->gcFillList_m.push_back(GCFillInfo_t(gcdom,sourceID,destID)); } } @@ -417,7 +417,7 @@ this->all_m[sourceID]->context() == Pooma::context() || this->all_m[destID]->context() == Pooma::context() ) - this->gcFillList_m.push_back(LayoutBaseData::GCFillInfo(gcdom,sourceID,destID)); + this->gcFillList_m.push_back(GCFillInfo_t(gcdom,sourceID,destID)); } } } From rguenth at tat.physik.uni-tuebingen.de Wed Jan 29 10:27:22 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 29 Jan 2003 11:27:22 +0100 (CET) Subject: [Q] Field/Relations/RelationList.h:makeOwnCopy() Message-ID: Hi! In the RelationList class there is a makeOwnCopy() method which seems to do two things rather than one - it makes a private copy of the relation list _and_ retargets its items to another target. Did this make sense or is this bad design? I.e. are the "old" targets after copying invalid? Does it make sense to split the method into makeOwnCopy() and retarget()? Is this (global) retarget feature used/needed at all? I'm just thinking again about Field/FieldEngine/FieldEngine.h::makeOwnCopy()'s semantics... Any ideas? Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Wed Jan 29 12:12:25 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 29 Jan 2003 13:12:25 +0100 (CET) Subject: SMARTS at CodeSourcery Message-ID: Hi! Is the smarts module in the CodeSourcery cvs repository the "current" version or is smarts maintained somewhere else? Thanks, Richard. -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Wed Jan 29 15:59:52 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 29 Jan 2003 16:59:52 +0100 (CET) Subject: [pooma-dev] [Q] Field/Relations/RelationList.h:makeOwnCopy() In-Reply-To: Message-ID: Thinking more about it it seems you need the RelationList::makeOwnCopy(Target&) Target parameter only for the type of the current target (which is the only one expected to be passed) and use the retarget() machinery to clone the list item. The same goes with FieldEngine::makeOwnCopy() which needs to pass down the subject (of Field type)... Um well ;) I'll add some docs to the functions. Thanks anyway, Richard. On Wed, 29 Jan 2003, Richard Guenther wrote: > Hi Scott > > Jim just suggested to ping you about this... btw. just grepping for uses > of makeOwnCopy() in the pooma sources I find exactly one instance of > FieldEngine::makeOwnCopy() (Field::makeOwnCopy()) and this is invoked > with a *this as its argument. > > Any suggestions? > > Thanks, Richard. > > > > > Hi Richard, > > My recollection is that this was necessary and used, and probably subtle. It > might have been better to factor it into two things, but I really can't > remember the details. I don't know if Scott Haney still subscribes to this > list - you might ping him at scotth at proximation.com. > > Jim > > -----Original Message----- > From: Richard Guenther [mailto:rguenth at tat.physik.uni-tuebingen.de] > Sent: Wednesday, January 29, 2003 3:27 AM > To: pooma-dev at pooma.codesourcery.com > Subject: [pooma-dev] [Q] Field/Relations/RelationList.h:makeOwnCopy() > > Hi! > > In the RelationList class there is a makeOwnCopy() method which > seems to do two things rather than one - it makes a private copy > of the relation list _and_ retargets its items to another target. > Did this make sense or is this bad design? I.e. are the "old" > targets after copying invalid? Does it make sense to split the > method into makeOwnCopy() and retarget()? Is this (global) retarget > feature used/needed at all? I'm just thinking again about > Field/FieldEngine/FieldEngine.h::makeOwnCopy()'s semantics... > > Any ideas? > > Richard. > > -- > Richard Guenther > WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ > > -- Richard Guenther WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ From rguenth at tat.physik.uni-tuebingen.de Wed Jan 29 19:42:32 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Wed, 29 Jan 2003 20:42:32 +0100 (CET) Subject: [pooma-dev] [Q] Field/Relations/RelationList.h:makeOwnCopy() In-Reply-To: Message-ID: On Wed, 29 Jan 2003, Richard Guenther wrote: > Thinking more about it it seems you need the > RelationList::makeOwnCopy(Target&) Target parameter only for the type of > the current target (which is the only one expected to be passed) and use > the retarget() machinery to clone the list item. > > The same goes with FieldEngine::makeOwnCopy() which needs to pass down > the subject (of Field type)... Actually this caused me thinking about Fields and Relations some more and I believe the current code is as correct as it can be. I.e. both the parameter to makeOwnCopy() and the retarget operation is actually necessary. BUT - there is no way we can make this work in all cases, consider: Field<...> a; Field<... View<..> > b(a); ... add some relations to a ... a.makeOwnCopy(); ... now we're left with b having relations with still a as target :( so strictly we need to add some asserts to FieldEngine::makeOwnCopy, somethig like &s != any of the relation targets || no relations || fieldengine not shared all in pseudocode, as these are not simple tests. At least we ought to document that unsharing the target of relations leads to undefined behavior. Or am I wrong again? Richard. From rguenth at tat.physik.uni-tuebingen.de Thu Jan 30 11:18:49 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 30 Jan 2003 12:18:49 +0100 (CET) Subject: [PATCH] Fix dynamic_array_test5 Message-ID: Hi! The following patch fixes dynamic_array_test5 on targets that dont support auto-converting std::vector::iterator to int* by introducing an extra constructor to IteratorPairDomain that does this conversion explicitly. Ok? Richard. diff -Nru a/r2/src/Domain/IteratorPairDomain.h b/r2/src/Domain/IteratorPairDomain.h --- a/r2/src/Domain/IteratorPairDomain.h Thu Jan 30 12:16:28 2003 +++ b/r2/src/Domain/IteratorPairDomain.h Thu Jan 30 12:16:28 2003 @@ -199,6 +199,17 @@ size_m = std::distance(begin_m,end_m); } + // Secondary constructor taking two "compatible" iterators. + // Works around the problem with std::vector::iterator not + // convertible to int*. Ideally we would enable this specialized + // for Iter == int*/const int* only. + template + IteratorPairDomain(Iter2 begin, Iter2 end) + : begin_m(&*begin), end_m(&*end) + { + size_m = std::distance(begin_m,end_m); + } + // Copy constructors IteratorPairDomain(const This_t &a) diff -Nru a/r2/src/DynamicArray/tests/dynamic_array_test5.cpp b/r2/src/DynamicArray/tests/dynamic_array_test5.cpp --- a/r2/src/DynamicArray/tests/dynamic_array_test5.cpp Thu Jan 30 12:16:28 2003 +++ b/r2/src/DynamicArray/tests/dynamic_array_test5.cpp Thu Jan 30 12:16:28 2003 @@ -214,29 +214,7 @@ // No destroy method specified --- should use BackFill() by default. - // NOTE: This may not compile!!! It depends on vector::iterator - // being assignable to "const int *", which is not guaranteed. The - // problem is that the patch-based destroy operation results in a - // virtual function call to all observers of the underlying layout, - // with the type of the event passed via an event base class. The - // handler code must then determine the event type, which is - // different for every possible domain type. The problem is that - // vector::const_iterator is usually a typedef for "const int - // *" (and vector::iterator is a typedef for "int *"), and thus - // this code will work (and furthermore it is impossible to - // enumerate them as different types, since they're not). But on - // some systems this isn't the case. It would be nice to support - // vector::iterator even when it is a separate type, but I - // don't know how to do this within the language. If someone else - // wants to conditionally compile a seperate execution path for - // this, and add the necessary configuration options, that would - // probably be the best solution. For now, I've put #if 1...#endif - // around the call and if it fails to compile, just change it to - // #if 0. [JAC] - -#if 1 b2.destroy(kfoo.begin(),kfoo.end(),6); -#endif a2.sync(); From rguenth at tat.physik.uni-tuebingen.de Thu Jan 30 11:20:38 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 30 Jan 2003 12:20:38 +0100 (CET) Subject: [PATCH] Fix dynamic_array_badcreate test Message-ID: Hi! The following patch disables part of the dynamic_array_badcreate test which seems to be bogous according to comments in the instrumented code. Ok? Richard. diff -Nru a/r2/src/DynamicArray/tests/dynamic_array_badcreate.cpp b/r2/src/DynamicArray/tests/dynamic_array_badcreate.cpp --- a/r2/src/DynamicArray/tests/dynamic_array_badcreate.cpp Thu Jan 30 12:19:23 2003 +++ b/r2/src/DynamicArray/tests/dynamic_array_badcreate.cpp Thu Jan 30 12:19:23 2003 @@ -109,6 +109,14 @@ tester.out() << "a = " << a << std::endl; tester.check(a.domain().size() == (D1.size() + 2)); +#if 0 + // This test is bogous, as the comment in Engine/DynamicEngine.cpp::create() + // tells (the check for shared data is commented out): + // "It would be nice to assert that no-one else is looking at the engine + // when we perform dynamic operations, but all the particle swap operations + // take place inside iterates which means the engine is a copy of another + // engine, so the data is shared." + // Call a function which takes a view and the original DynamicArray std::cout << "The program should abort in the next operation when it\n"; @@ -116,6 +124,7 @@ std::cout << std::endl; tester.out() << "Calling testview with a and a(1,3) ..." << std::endl; tester.check(testview(tester, a, a(Interval<1>(1,3)))); +#endif // Return resulting error code and exit; Tester will shut down POOMA. From rguenth at tat.physik.uni-tuebingen.de Thu Jan 30 19:58:52 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Thu, 30 Jan 2003 20:58:52 +0100 (CET) Subject: Pooma: CoordinateSystems/tests/makefile In-Reply-To: <3E396499.7000105@codesourcery.com> Message-ID: On Thu, 30 Jan 2003, Jeffrey Oldham wrote: > Richard Guenther wrote: > > On Wed, 29 Jan 2003, Jeffrey Oldham wrote: > > > > > >>Has the makefile in Pooma's src/CorodinateSystems/tests been upgraded to > >>your new format with 'TESTS' and 'build'? The Pooma CVS repository > >>seems to have the old version. > > > > > > It was not updated, as the whole directory is unused (remanent of r1 > > fields) and has been removed out of all my local repositories. > > Good. Should it be removed from the Pooma CVS repository? I think yes, but lets see if anyone complains. I suggest to just remove it from the automatic regression testing for now. Richard.