Strange save / load_graph behaviour
Hi list, hi Tiago, First thank you for graph tool, that's a great package. I run in a very strange problem when reloading a xml graph file with an 'internalized' PropertyMap. the minimum script does the following: * test1: create, internalize the PropertyMap pos1, save the graph in xml * test2: load the graph from xml, read the internalized PropertyMap pos2 Depending whether the two tests are ran in separate processes are in the same process, the two Propertymaps will not have the same values: test1 and 2 in the same process: pos1 == pos2 test1 and test2 in different processes pos1 != pos2 -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
I don't know if my previous message past. I forgot to say I'm using a standard ubuntu 12.04 python+numpy+scipy+graph-tool setup installed with apt-get Can this be a compiler issue? Guillaume -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
Here is a minimal code that shows this behaviour: #!/usr/bin/env python # -*- coding: utf-8 -*- import sys from numpy import array import graph_tool.all as gt print 'Graph_tool version : %s' % gt.__version__ def test1(): print ('\n' 'Performing test1:\n' '-----------------') graph1 = gt.lattice((2,2), periodic=False) pos = graph1.new_vertex_property('float') pos.a = array([0.0,0.1, 1.0, 1.1]) graph1.vertex_properties['pos'] = pos print ('\n' 'original pos: %s\n' 'reload graph property:\n' ' %s\n') % (str(pos.a), str(graph1.vertex_properties['pos'].a)) graph1.save("graph_tool_io_test1.xml") return graph1 def test2(): print ('\n' 'Performing test2:\n' '-----------------') graph2 = gt.load_graph("graph_tool_io_test1.xml") pos = array([0.0,0.1, 1.0, 1.1]) print ('\n' 'original pos: %s\n' 'reload graph property:\n' ' %s\n') % (str(pos), str(graph2.vertex_properties['pos'].a)) return graph2 def test3(): graph3 = gt.lattice((2,2), periodic=False) pos = graph3.new_vertex_property('float') pos.a = array([0.0,0.1, 1.0, 1.1]) graph3.load("graph_tool_io_test1.xml") print ('\n' 'original graph property: %s\n' 'reload graph property: %s\n') % (str(pos.a), str(graph3.vertex_properties['pos'].a)) return graph3 if __name__ == '__main__': switch = sys.argv[1] if switch == 'all': graph1 = test1() graph2 = test2() graph3 = test3() elif switch == 'test1': graph1 = test1() elif switch == 'test2': graph2 = test2() elif switch == 'test3': graph3 = test3() elif switch == 'import-only': print 'Imports only' else: print 'Usage: python test.py {all|test1|test2|test3}' ##### End Le 02/10/2012 14:37, Guillaume a écrit :
Hi list, hi Tiago,
First thank you for graph tool, that's a great package.
I run in a very strange problem when reloading a xml graph file with an 'internalized' PropertyMap. the minimum script does the following: * test1: create, internalize the PropertyMap pos1, save the graph in xml * test2: load the graph from xml, read the internalized PropertyMap pos2
Depending whether the two tests are ran in separate processes are in the same process, the two Propertymaps will not have the same values:
test1 and 2 in the same process: pos1 == pos2 test1 and test2 in different processes pos1 != pos2
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com. _______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
Hi Guillaume, On 10/03/2012 07:59 AM, Guillaume Gay wrote:
Here is a minimal code that shows this behaviour:
[...] I cannot see any issue... Here is the output of your test code with the latest git version: $ ./test.py all Graph_tool version : 2.2.18dev (commit 1b433d91, Fri Aug 3 17:23:40 2012 +0200) Performing test1: ----------------- original pos: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 0.1 1. 1.1] Performing test2: ----------------- original pos: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 0.1 1. 1.1] original graph property: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 0.1 1. 1.1] I get the same values if I run test1/2/3 separately. What do you observe? Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Hi Tiago Le 03/10/2012 14:07, Tiago Peixoto [via Main discussion list for the graph-tool project] a écrit :
Hi Guillaume,
On 10/03/2012 07:59 AM, Guillaume Gay wrote:
Here is a minimal code that shows this behaviour:
[...]
I cannot see any issue... Here is the output of your test code with the latest git version:
$ ./test.py all Graph_tool version : 2.2.18dev (commit 1b433d91, Fri Aug 3 17:23:40 2012 +0200)
Performing test1: -----------------
original pos: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 0.1 1. 1.1]
Performing test2: -----------------
original pos: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 0.1 1. 1.1]
original graph property: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 0.1 1. 1.1]
I get the same values if I run test1/2/3 separately. What do you observe?
Performing test2 alone returns this: # python graph_io_test.py test2 Graph_tool version : 2.2.17 (commit d058ad14, Tue Jun 19 22:27:35 2012 +0200) Performing test2: ----------------- original pos: [ 0. 0.1 1. 1.1] reload graph property: [ 0. 1. 1. 1.] So as you can see the second and fourth values od the array are changed Thx for looking into it! Guillaume
Cheers, Tiago
-- Tiago de Paula Peixoto <[hidden email] </user/SendEmail.jtp?type=node&node=4024791&i=0>>
_______________________________________________ graph-tool mailing list [hidden email] </user/SendEmail.jtp?type=node&node=4024791&i=1> http://lists.skewed.de/mailman/listinfo/graph-tool
*signature.asc* (563 bytes) Download Attachment <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/attachment/4024791/0/signature.asc> -- Tiago de Paula Peixoto <tiago@skewed.de>
------------------------------------------------------------------------ If you reply to this email, your message will be added to the discussion below: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/...
To unsubscribe from Strange save / load_graph behaviour, click here <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4024788&code=Z3VpbGxhdW1lQG1pdG90aWMtbWFjaGluZS5vcmd8NDAyNDc4OHwxODE0OTk1MzEw>. NAML <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 10/03/2012 04:42 PM, Guillaume wrote:
Graph_tool version : 2.2.17 (commit d058ad14, Tue Jun 19 22:27:35 2012 +0200)
It seems you are not using the most current git version... Please try with it, since I fixed the problem you reported previously. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Test passes with the current git version... Guillaume Le 03/10/2012 17:09, Tiago Peixoto [via Main discussion list for the graph-tool project] a écrit :
On 10/03/2012 04:42 PM, Guillaume wrote:
Graph_tool version : 2.2.17 (commit d058ad14, Tue Jun 19 22:27:35 2012 +0200)
It seems you are not using the most current git version... Please try with it, since I fixed the problem you reported previously.
Cheers, Tiago
-- Tiago de Paula Peixoto <[hidden email] </user/SendEmail.jtp?type=node&node=4024793&i=0>>
_______________________________________________ graph-tool mailing list [hidden email] </user/SendEmail.jtp?type=node&node=4024793&i=1> http://lists.skewed.de/mailman/listinfo/graph-tool
*signature.asc* (563 bytes) Download Attachment <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/attachment/4024793/0/signature.asc> -- Tiago de Paula Peixoto <tiago@skewed.de>
------------------------------------------------------------------------ If you reply to this email, your message will be added to the discussion below: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/...
To unsubscribe from Strange save / load_graph behaviour, click here <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4024788&code=Z3VpbGxhdW1lQG1pdG90aWMtbWFjaGluZS5vcmd8NDAyNDc4OHwxODE0OTk1MzEw>. NAML <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
Hi Tiago, hi list, Trying to compile from the github repo, I run into this error with make: make[4]: entrant dans le répertoire « /home/guillaume/Python/src/graph-tool/src/graph/layout » CXX graph_sfdp.lo virtual memory exhausted: Cannot allocate memory make[4]: *** [graph_sfdp.lo] Erreur 1 I tried to pump up virtual memory with ulimit -n 4096 but that didn't help, also I can see the allocated memory steadily rising while make is executed. Any hint? Cheers, Guillaume
On 10/04/2012 11:51 AM, Guillaume Gay wrote:
Hi Tiago, hi list,
Trying to compile from the github repo, I run into this error with make:
make[4]: entrant dans le répertoire « /home/guillaume/Python/src/graph-tool/src/graph/layout » CXX graph_sfdp.lo virtual memory exhausted: Cannot allocate memory make[4]: *** [graph_sfdp.lo] Erreur 1
It takes quite a bit of memory to compile graph-tool, due to the heavy use of template metaprogramming. Current compilers such as GCC still use much more memory than optimal... However if you have more than 4G ram, you should be able to compile it with a current GCC version. Just make sure there are no other programs using significant amounts of memory. If you still don't have enough ram, you can try compiling with clang which manages to use less memory than GCC. If you want to artificially increase the amount of virtual memory you have, you have to increase your swap. But note that if you rely too heavily on this, the compilation time will become very, very high. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
I have just 4 Gb. I am not directly using the layout algorithms. Is it possible to compile all but that? I tried to modify configure.ac and Makefile.am to remove reference to those, but make fails. If not I guess I'am in for some shopping. Guillaume Le 04/10/2012 12:09, Tiago Peixoto [via Main discussion list for the graph-tool project] a écrit :
On 10/04/2012 11:51 AM, Guillaume Gay wrote:
Hi Tiago, hi list,
Trying to compile from the github repo, I run into this error with make:
make[4]: entrant dans le répertoire « /home/guillaume/Python/src/graph-tool/src/graph/layout » CXX graph_sfdp.lo virtual memory exhausted: Cannot allocate memory make[4]: *** [graph_sfdp.lo] Erreur 1
It takes quite a bit of memory to compile graph-tool, due to the heavy use of template metaprogramming. Current compilers such as GCC still use much more memory than optimal... However if you have more than 4G ram, you should be able to compile it with a current GCC version. Just make sure there are no other programs using significant amounts of memory.
If you still don't have enough ram, you can try compiling with clang which manages to use less memory than GCC.
If you want to artificially increase the amount of virtual memory you have, you have to increase your swap. But note that if you rely too heavily on this, the compilation time will become very, very high.
Cheers, Tiago
-- Tiago de Paula Peixoto <[hidden email] </user/SendEmail.jtp?type=node&node=4024795&i=0>>
_______________________________________________ graph-tool mailing list [hidden email] </user/SendEmail.jtp?type=node&node=4024795&i=1> http://lists.skewed.de/mailman/listinfo/graph-tool
*signature.asc* (563 bytes) Download Attachment <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/attachment/4024795/0/signature.asc> -- Tiago de Paula Peixoto <tiago@skewed.de>
------------------------------------------------------------------------ If you reply to this email, your message will be added to the discussion below: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/...
To unsubscribe from Strange save / load_graph behaviour, click here <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4024788&code=Z3VpbGxhdW1lQG1pdG90aWMtbWFjaGluZS5vcmd8NDAyNDc4OHwxODE0OTk1MzEw>. NAML <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
participants (3)
-
Guillaume -
Guillaume Gay -
Tiago de Paula Peixoto