Confirmed, Just testvector fails.
Regards, MAteusz Lacki
On Nov 29, 2011, at 3:49 AM, Synge Todo wrote:
Dear Matthias,
This patch also fixes the ticket #536 (Parameter parser does not work correctly with gcc 4.6) except for test_vector. Can I apply it to the trunk?
Best, Synge
On 2011/11/28, at 6:59, Mateusz Łącki wrote:
Dear Matthias, This patch made alps pass all the tests.
Thank you extremely much.
Regards, Mateusz
On Nov 27, 2011, at 5:50 PM, Matthias Troyer wrote:
Yes, that looks much better and now it might work for all tests.
Matthias
On Nov 27, 2011, at 5:47 PM, Mateusz Łącki wrote:
Dear Matthias, This is the new output:
Parameters: L = 10; T = 0.1; beta = 1/T; error = error;
The value of [sqrt(4)] is 2 The value of [3 + 5] is 8 The value of [L] is 10 The value of [T] is 0.1 The value of [1 / L] is 0.1 The value of [1 / T] is 10 The value of [2 * Pi / L] is 0.628319 The value of [L + T] is 10.1 The value of [L + 10] is 20 The value of [L - T] is 9.9 The value of [1 / T + 10] is 20 The value of [L / (1 / T + 10)] is 0.5 The value of [L * L] is 100 The value of [beta] is 10 The value of [sqrt(L)] is 3.16228 The value of [sin(2 * Pi / L)] is 0.587785 The value of [cos(2 * Pi / L)] is 0.809017 The value of [L^2] is 100 The value of [(L + 1)^3] is 1331 The value of [(L + 1)^-1 * 5] is 0.454545 The value of [random()] is 0.814724 The value of [random()] is 0.135477 The value of [random()] is 0.905792 The value of [integer_random(50)] is 41 The value of [integer_random(50)] is 6 The value of [integer_random(50)] is 48 The value of [gaussian_random()] is 0.604675 The value of [gaussian_random()] is -0.365983 The value of [gaussian_random(100, 20)] is 88.4347 Cannot evaluate [error]. The value of [sqrt(3.33)] is 1.82483 The value of [L*T] is 1 The value of [1/L] is 0.1 The value of [2*Pi*L] is 62.8319 Cannot evaluate [error].
to save time I did only "make expression" instead of full "make". Is the output correct? It looks fine... Now I am doing "make" then i will report on all the tests.
Regards, Mateusz
Can we try the following patches and see if that helps?
=================================================================== --- src/alps/expression/expression.h (revision 5795) +++ src/alps/expression/expression.h (working copy) @@ -214,7 +214,8 @@ is.putback(c); terms_.push_back(Term<T>(is,negate)); while(true) {
- is >> c;
- if(!(is >> c))
return true;
if (is.eof()) return true; if (c=='-') Index: src/alps/expression/term.h =================================================================== --- src/alps/expression/term.h (revision 5795) +++ src/alps/expression/term.h (working copy) @@ -140,9 +140,10 @@ terms_.push_back(Factor<T>(in,is_inverse)); while (true) { char c;
- in >> c;
- if (!in)
- if (!(in>>c)) break;
- if (in.eof())
break;
switch(c) { case '*': is_inverse=false; Index: src/alps/expression/factor.h =================================================================== --- src/alps/expression/factor.h (revision 5795) +++ src/alps/expression/factor.h (working copy) @@ -141,7 +141,7 @@ if(in && c=='(') term_.reset(new Function<T>(in,name)); else {
if (in)
in.putback(c); term_.reset(new Symbol<T>(name));if (in && !in.eof())
} Index: src/alps/parser/parser.C =================================================================== --- src/alps/parser/parser.C (revision 5795) +++ src/alps/parser/parser.C (working copy) @@ -58,7 +58,7 @@ char c; in >> c; std::string name;
- while (detail::is_identifier_char(c) || c==''' || c=='[') {
- while (in && !in.eof() && detail::is_identifier_char(c) || c==''' || c=='[') {
name+=c; if (c=='[') do { @@ -67,7 +67,8 @@ } while (c!=']'); c=in.get(); }
- in.putback(c);
- if (!in.eof())
- in.putback(c);
return name; }
On 27 Nov 2011, at 15:26, Mateusz Łącki wrote:
Dear Matthias. I have applied the patch and recompiled. If the problem in in standard library should I link with older one? This is what i got with the usual library:
Parameters: L = 10; T = 0.1; beta = 1/T; error = error;
The value of [sqrt(4)] is 2 The value of [3 + 5] is 8 The value of [L] is 10 The value of [T] is 0.1 The value of [1 / L] is 0.1 The value of [1 / T] is 10 The value of [2 * Pi / L] is 0.628319 The value of [L + T] is 10.1 The value of [L + 10] is 20 The value of [L - T] is 9.9 The value of [1 / T + 10] is 20 The value of [L / (1 / T + 10)] is 0.5 The value of [L * L] is 100 read: 0 Caught exception: Did not parse to end of string '1/T'
Regards, Mateusz
> This has to do with your standard library. Can you try with the following patch? > > Index: src/alps/expression/expression.h > =================================================================== > --- src/alps/expression/expression.h (revision 5795) > +++ src/alps/expression/expression.h (working copy) > @@ -193,8 +193,13 @@ > void Expression<T>::parse(const std::string& str) > { > std::istringstream in(str); > - if (!parse(in)) > + if (!parse(in)) { > + char c; > + in >> c; > + std::cerr << "read: " << int(c) << "\n"; > boost::throw_exception(std::runtime_error("Did not parse to end of string '" + str + "'")); > + > + } > } > > template<class T> > > > On 27 Nov 2011, at 14:02, Mateusz Łącki wrote: > >> Parameters: >> L = 10; >> T = 0.1; >> beta = 1/T; >> error = error; >> >> The value of [sqrt(4)] is 2 >> The value of [3 + 5] is 8 >> The value of [L] is 10 >> The value of [T] is 0.1 >> The value of [1 / L] is 0.1 >> The value of [1 / T] is 10 >> The value of [2 * Pi / L] is 0.628319 >> The value of [L + T] is 10.1 >> The value of [L + 10] is 20 >> The value of [L - T] is 9.9 >> The value of [1 / T + 10] is 20 >> The value of [L / (1 / T + 10)] is 0.5 >> The value of [L * L] is 100 >> Caught exception: Did not parse to end of string '1/T' >> >> Mateusz >> >> On Nov 27, 2011, at 1:56 PM, Matthias Troyer wrote: >> >>> Can you go to the parameter test directory and type >>> >>> ./expression < PATH_TO_YOUR_ALPS_SOURCES/test/parameter/expression.input >>> >>> That might help us a bit - it seems there is a problem with parsing input with your compiler. >>> >>> Matthias >>> >>> >>> On 27 Nov 2011, at 13:50, Mateusz Łącki wrote: >>> >>>> Dear Matthias, >>>> I did it and got: >>>> -bash-4.2$ ./model_example1 >>>> Caught exception: Illegal term in expression >>>> >>>> Regards, >>>> Mateusz >>>> >>>> On Nov 27, 2011, at 1:48 PM, Matthias Troyer wrote: >>>> >>>>> Can you just go to the alps/test/model directory and run the program ./model_example1 ? >>>>> >>>>> Matthias >>>>> >>>>> On 27 Nov 2011, at 13:09, Mateusz Łącki wrote: >>>>> >>>>>> I paste come of them: >>>>>> >>>>>> -bash-4.2$ cat expression_output >>>>>> Parameters: >>>>>> L = 10; >>>>>> T = 0.1; >>>>>> beta = 1/T; >>>>>> error = error; >>>>>> >>>>>> The value of [sqrt(4)] is 2 >>>>>> The value of [3 + 5] is 8 >>>>>> The value of [L] is 10 >>>>>> The value of [T] is 0.1 >>>>>> The value of [1 / L] is 0.1 >>>>>> The value of [1 / T] is 10 >>>>>> The value of [2 * Pi / L] is 0.628319 >>>>>> The value of [L + T] is 10.1 >>>>>> The value of [L + 10] is 20 >>>>>> The value of [L - T] is 9.9 >>>>>> The value of [1 / T + 10] is 20 >>>>>> The value of [L / (1 / T + 10)] is 0.5 >>>>>> The value of [L * L] is 100 >>>>>> >>>>>> expression2_output is empty >>>>>> model_example*_output are empty >>>>>> >>>>>> integer range_output: >>>>>> >>>>>> Parameters: >>>>>> L = 4; >>>>>> T = 0.5; >>>>>> Test for integer_range<int>: >>>>>> parse []: result [] >>>>>> parse [0:3]: result [0:3] >>>>>> parse [3:9]: result [3:9] >>>>>> parse [3:9:0]: integer_range: parse error: [3:9:0] >>>>>> parse [:3]: result [-2147483648:3] >>>>>> parse [-1:]: result [-1:2147483647] >>>>>> parse [3]: result [3:3] >>>>>> parse 6: result [6:6] >>>>>> parse [1/T:L^2]: Did not parse to end of string '1/T' >>>>>> parse [1/T]: Did not parse to end of string '1/T' >>>>>> parse [L:]: Did not parse to end of string 'L' >>>>>> parse [:L]: Did not parse to end of string 'L' >>>>>> parse [2*L]: Did not parse to end of string '2*L' >>>>>> parse exp(L): result [54:54] >>>>>> Test for integer_range<unsigned int>: >>>>>> parse [0:3]: result [0:3] >>>>>> parse [3:9]: result [3:9] >>>>>> parse [:3]: result [0:3] >>>>>> parse [1:]: result [1:4294967295] >>>>>> parse [-3:9]: integer_range: range error >>>>>> parse 6: result [6:6] >>>>>> initial: [0:5] >>>>>> 7 is included? 0 >>>>>> 3 is assigned: [3:3] >>>>>> 8 is included: [3:8] >>>>>> 7 is included? 1 >>>>>> initial: [3:2147483647] >>>>>> multiplied by 3.5: [10:2147483647] >>>>>> multiplied by 2000000000: [2147483647:2147483647] >>>>>> multiplied by 0.1: [0:214748364] >>>>>> initial: [0:5] >>>>>> overlap with [-2:3]: [0:3] >>>>>> union with [-2:3]: [-2:5] >>>>>> overlap with [-2:10]: [0:5] >>>>>> union with [-2:10]: [-2:10] >>>>>> overlap with [7:10]: [] >>>>>> union with [7:10]: no overlap >>>>>> >>>>>> >>>>>> Regards, >>>>>> Mateusz Lacki >>>>>> >>>>>> On Nov 27, 2011, at 12:54 PM, Matthias Troyer wrote: >>>>>> >>>>>>> We need to know why it fails. Can you send the *_output files of some of the failed tests. They are in the corresponding test directory in your build tree. >>>>>>> >>>>>>> On 27 Nov 2011, at 12:01, Mateusz Łącki wrote: >>>>>>> >>>>>>>> Dear Matthias, >>>>>>>> I have installed myself a gcc 4.4. It indeed compiles alps 2.0.2 with no error, however again there is issue of failed tests: >>>>>>>> >>>>>>>> The following tests FAILED: >>>>>>>> 68 - expression2 (Failed) >>>>>>>> 67 - expression (Failed) >>>>>>>> 58 - model_example18 (Failed) >>>>>>>> 57 - model_example17 (Failed) >>>>>>>> 56 - model_example16 (Failed) >>>>>>>> 55 - model_example15 (Failed) >>>>>>>> 54 - model_example14 (Failed) >>>>>>>> 53 - model_example13 (Failed) >>>>>>>> 52 - model_example12 (Failed) >>>>>>>> 51 - model_example11 (Failed) >>>>>>>> 87 - temperature_scan (Failed) >>>>>>>> 50 - model_example10 (Failed) >>>>>>>> 83 - integer_range (Failed) >>>>>>>> 79 - exmc_optimize (Failed) >>>>>>>> 25 - lattice_example2 (Failed) >>>>>>>> 24 - lattice_example1 (Failed) >>>>>>>> 26 - lattice_example3 (Failed) >>>>>>>> 4 - wanglandau (Failed) >>>>>>>> 3 - exchange (Failed) >>>>>>>> 2 - loop_single (Failed) >>>>>>>> 49 - model_example9 (Failed) >>>>>>>> 48 - model_example8 (Failed) >>>>>>>> 47 - model_example7 (Failed) >>>>>>>> 46 - model_example6 (Failed) >>>>>>>> 45 - model_example5 (Failed) >>>>>>>> 44 - model_example4 (Failed) >>>>>>>> 43 - model_example3 (Failed) >>>>>>>> 42 - model_example2 (Failed) >>>>>>>> 41 - model_example1 (Failed) >>>>>>>> 1 - ising_single (Failed) >>>>>>>> 37 - parity (Failed) >>>>>>>> 36 - coloring (Failed) >>>>>>>> 35 - lattice_label (Failed) >>>>>>>> 34 - lattice_example11 (Failed) >>>>>>>> 33 - lattice_example10 (Failed) >>>>>>>> 32 - lattice_example9 (Failed) >>>>>>>> 31 - lattice_example8 (Failed) >>>>>>>> 30 - lattice_example7 (Failed) >>>>>>>> 29 - lattice_example6 (Failed) >>>>>>>> 28 - lattice_example5 (Failed) >>>>>>>> 27 - lattice_example4 (Failed) >>>>>>>> >>>>>>>> >>>>>>>> On the other machine (that has gcc version 4.4 installed system-wide) all the tests pass. I can confirm that the same issue exists when compiling with icc v 12.1 and gcc v 4.6.1. One of the difference is that this machine (with gcc 4.4 installed in my home directory) has newer versions of all libraries installed. Could that be the problem? will binary release of alps 2.0.2 for linux be available anytime soon? This time it compiled its own boost. >>>>>>>> >>>>>>>> This is how linking is done: >>>>>>>> -bash-4.2$ ldd worm >>>>>>>> linux-vdso.so.1 => (0x00007fffddb46000) >>>>>>>> libz.so.1 => /lib64/libz.so.1 (0x0000003e59e00000) >>>>>>>> libalps.so.2 => /home/stefan/al/alps202-gcc44/src/alps/libalps.so.2 (0x00007f8bf6caf000) >>>>>>>> libboost.so => /home/stefan/al/alps202-gcc44/src/boost/libboost.so (0x00007f8bf6822000) >>>>>>>> libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x0000003e72c00000) >>>>>>>> libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e58e00000) >>>>>>>> libdl.so.2 => /lib64/libdl.so.2 (0x0000003e59200000) >>>>>>>> libutil.so.1 => /lib64/libutil.so.1 (0x0000003e6f600000) >>>>>>>> libhdf5.so.6 => /usr/lib64/libhdf5.so.6 (0x00000038de800000) >>>>>>>> libhdf5_hl.so.6 => /usr/lib64/libhdf5_hl.so.6 (0x0000003e58200000) >>>>>>>> libm.so.6 => /lib64/libm.so.6 (0x0000003e58a00000) >>>>>>>> libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003e5ea00000) >>>>>>>> libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x0000003e64600000) >>>>>>>> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003e59a00000) >>>>>>>> libc.so.6 => /lib64/libc.so.6 (0x0000003e58600000) >>>>>>>> /lib64/ld-linux-x86-64.so.2 (0x0000003e57e00000) >>>>>>>> librt.so.1 => /lib64/librt.so.1 (0x0000003e59600000) >>>>>>>> >>>>>>>> gcc: >>>>>>>> -bash-4.2$ gcc -v >>>>>>>> Using built-in specs. >>>>>>>> Target: x86_64-unknown-linux-gnu >>>>>>>> Configured with: ./configure --prefix=/home/stefan/opt/gcc-4.4.6 --disable-multilib >>>>>>>> Thread model: posix >>>>>>>> gcc version 4.4.6 (GCC) >>>>>>>> >>>>>>>> Regards, >>>>>>>> Mateusz Lacki >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >