Dear all,
In an attempt to get to grips with ALPS 2, I've ran the example from example/parapack/exchange directory. When compiled and run from the command line, it produces both xml and hdf output files:
br@ymir:~/sweethome/adatoms/par_temp/parapack_example$ ll total 10064 drwxr-xr-x 2 br br 4096 2011-04-25 18:57 ./ drwxr-xr-x 3 br br 4096 2011-04-25 16:06 ../ -rw-r--r-- 1 br br 13276 2011-04-25 16:17 ALPS.xsl -rw-r--r-- 1 br br 1862 2011-04-25 16:11 ising.C -rw-r--r-- 1 br br 6696 2011-04-25 16:06 ising.h -rw-r--r-- 1 br br 1353 2011-04-25 16:05 main.C -rw-r--r-- 1 br br 483 2011-04-25 16:09 Makefile -rw-r--r-- 1 br br 10068 2011-04-25 16:20 mpir.txt -rwxr-xr-x 1 br br 752957 2011-04-25 16:11 pa_ex* -rw-r--r-- 1 br br 217 2011-04-25 16:06 params-ising -rw-r--r-- 1 br br 463 2011-04-25 16:12 params-ising.in.xml -rw-r--r-- 1 br br 729 2011-04-25 16:13 params-ising.out.xml -rw-r--r-- 1 br br 46708 2011-04-25 16:13 params-ising.task1.clone1 -rw-r--r-- 1 br br 2831368 2011-04-25 16:13 params-ising.task1.clone1.h5 -rw-r--r-- 1 br br 780 2011-04-25 16:12 params-ising.task1.in.xml -rw-r--r-- 1 br br 168452 2011-04-25 18:57 params-ising.task1.out.xml -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica10.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica11.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica12.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica13.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica14.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica15.h5 -rw-r--r-- 1 br br 388560 2011-04-25 18:57 params-ising.task1.replica16.h5 -rw-r--r-- 1 br br 407752 2011-04-25 18:57 params-ising.task1.replica1.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica2.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica3.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica4.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica5.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica6.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica7.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica8.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica9.h5 -rwxr--r-- 1 br br 227 2011-04-25 18:54 readin.py*
Then I'm trying to load the simulation results using python tools, and that's where I seem to hit a snag. I follow the tutorial at http://alps.comp-phys.org/mediawiki/index.php/ALPS_using_Python#Loading_the_simulation_results, here's the exact script:
br@ymir:~/sweethome/adatoms/par_temp/parapack_example$ cat readin.py #!/usr/bin/python import pyalps import matplotlib.pyplot as plt import pyalps.plot
result_files = pyalps.getResultFiles(prefix='params-ising') print result_files obslist=pyalps.loadObservableList(result_files)
This fails with the following error message:
br@ymir:~/sweethome/adatoms/par_temp/parapack_example$ ./readin.py ['./params-ising.task1.out.xml'] Traceback (most recent call last): File "./readin.py", line 8, in <module> obslist=pyalps.loadObservableList(result_files) File "/home/br/ALPS2/lib/pyalps/load.py", line 611, in loadObservableList res = ll.GetProperties(files,proppath,respath,verbose=verbose) File "/home/br/ALPS2/lib/pyalps/load.py", line 126, in GetProperties fs = self.GetFileNames(flist) File "/home/br/ALPS2/lib/pyalps/load.py", line 108, in GetFileNames log( "FILE ", f, "DOES NOT EXIST!") TypeError: log() takes exactly 1 argument (3 given)
Running the same sequence of commands in alpspython interpreter produces the same error message. From what I can see, there are two issues here: 1) GetFileNames() function of the Hdf5Loader class does not handle the replica#.h5 file endings. 2) there's a problem with log() function which the interpreter reports,
Or am I doing something wrong here? Or, more to the point, how do I load the simulation results into python?
Thanks in advance,
Zhenya
Brigitte and Synge,
I don't think we ever tested HDF5-loading from Python from such files? Could you two please take a look? Probably one will need to create a special loader or check for the replica files.
Matthias
On Apr 26, 2011, at 3:09 PM, Evgeny Burovskiy wrote:
Dear all,
In an attempt to get to grips with ALPS 2, I've ran the example from example/parapack/exchange directory. When compiled and run from the command line, it produces both xml and hdf output files:
br@ymir:~/sweethome/adatoms/par_temp/parapack_example$ ll total 10064 drwxr-xr-x 2 br br 4096 2011-04-25 18:57 ./ drwxr-xr-x 3 br br 4096 2011-04-25 16:06 ../ -rw-r--r-- 1 br br 13276 2011-04-25 16:17 ALPS.xsl -rw-r--r-- 1 br br 1862 2011-04-25 16:11 ising.C -rw-r--r-- 1 br br 6696 2011-04-25 16:06 ising.h -rw-r--r-- 1 br br 1353 2011-04-25 16:05 main.C -rw-r--r-- 1 br br 483 2011-04-25 16:09 Makefile -rw-r--r-- 1 br br 10068 2011-04-25 16:20 mpir.txt -rwxr-xr-x 1 br br 752957 2011-04-25 16:11 pa_ex* -rw-r--r-- 1 br br 217 2011-04-25 16:06 params-ising -rw-r--r-- 1 br br 463 2011-04-25 16:12 params-ising.in.xml -rw-r--r-- 1 br br 729 2011-04-25 16:13 params-ising.out.xml -rw-r--r-- 1 br br 46708 2011-04-25 16:13 params-ising.task1.clone1 -rw-r--r-- 1 br br 2831368 2011-04-25 16:13 params-ising.task1.clone1.h5 -rw-r--r-- 1 br br 780 2011-04-25 16:12 params-ising.task1.in.xml -rw-r--r-- 1 br br 168452 2011-04-25 18:57 params-ising.task1.out.xml -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica10.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica11.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica12.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica13.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica14.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica15.h5 -rw-r--r-- 1 br br 388560 2011-04-25 18:57 params-ising.task1.replica16.h5 -rw-r--r-- 1 br br 407752 2011-04-25 18:57 params-ising.task1.replica1.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica2.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica3.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica4.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica5.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica6.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica7.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica8.h5 -rw-r--r-- 1 br br 398984 2011-04-25 18:57 params-ising.task1.replica9.h5 -rwxr--r-- 1 br br 227 2011-04-25 18:54 readin.py*
Then I'm trying to load the simulation results using python tools, and that's where I seem to hit a snag. I follow the tutorial at http://alps.comp-phys.org/mediawiki/index.php/ALPS_using_Python#Loading_the_simulation_results, here's the exact script:
br@ymir:~/sweethome/adatoms/par_temp/parapack_example$ cat readin.py #!/usr/bin/python import pyalps import matplotlib.pyplot as plt import pyalps.plot
result_files = pyalps.getResultFiles(prefix='params-ising') print result_files obslist=pyalps.loadObservableList(result_files)
This fails with the following error message:
br@ymir:~/sweethome/adatoms/par_temp/parapack_example$ ./readin.py ['./params-ising.task1.out.xml'] Traceback (most recent call last): File "./readin.py", line 8, in <module> obslist=pyalps.loadObservableList(result_files) File "/home/br/ALPS2/lib/pyalps/load.py", line 611, in loadObservableList res = ll.GetProperties(files,proppath,respath,verbose=verbose) File "/home/br/ALPS2/lib/pyalps/load.py", line 126, in GetProperties fs = self.GetFileNames(flist) File "/home/br/ALPS2/lib/pyalps/load.py", line 108, in GetFileNames log( "FILE ", f, "DOES NOT EXIST!") TypeError: log() takes exactly 1 argument (3 given)
Running the same sequence of commands in alpspython interpreter produces the same error message. From what I can see, there are two issues here:
- GetFileNames() function of the Hdf5Loader class does not handle the
replica#.h5 file endings. 2) there's a problem with log() function which the interpreter reports,
Or am I doing something wrong here? Or, more to the point, how do I load the simulation results into python?
Thanks in advance,
Zhenya
comp-phys-alps-users@lists.phys.ethz.ch