Re: [hpx-users] Program failing when not compiling with -O3

2015-11-17 Thread Andreas Schäfer
So, Zach and I have hit the same error when interfacing dg-swem with
HPX+LGD, but here we weren't able to work around it via adding -O3.
Any ideas for another workaround?

Thomas said he's suspecting a bug in HPX, but I can't really figure
out what's going wrong.

Thanks!
-Andreas


On 23:49 Sun 15 Nov , Andreas Schäfer wrote:
> Heya,
> 
> I've recently seen some of my HPX applications terminating right
> before hpx_init() is called. Strangely the build system did seem to
> determine whether the same code would either run flawlessly, or crash.
> 
> Please find attached a (sort of) minimal example that reproduces the
> error. Below is a log of me compiling the code manually. The only
> difference here is that for the first run I did add -O3, for the
> second run that option was omitted. Any ideas what's going on here?
> 
> > gentryx@neuromancer ~ $ time (rm -f test_hpx && 
> > /usr/lib64/ccache/bin/g++-4.9.3 -O3-L/home/gentryx/local_install/lib 
> > -lhpx test_hpx.cpp   -o test_hpx -std=c++11 
> > -I/home/gentryx/local_install/include 
> > -I/home/gentryx/local_install/include/hpx/external -lboost_chrono 
> > -lboost_date_time -lboost_filesystem -lboost_program_options -lboost_system 
> >  -lboost_thread -lhpx_init -lhpx -ldl -lrt && 
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  && 
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx) 
> > ok
> > 
> > real0m28.162s
> > user0m27.490s
> > sys 0m0.630s
> > 
> > 23:43:58 - 0
> > gentryx@neuromancer ~ $ time (rm -f test_hpx && 
> > /usr/lib64/ccache/bin/g++-4.9.3-L/home/gentryx/local_install/lib -lhpx 
> > test_hpx.cpp   -o test_hpx -std=c++11 -I/home/gentryx/local_install/include 
> > -I/home/gentryx/local_install/include/hpx/external -lboost_chrono 
> > -lboost_date_time -lboost_filesystem -lboost_program_options -lboost_system 
> >  -lboost_thread -lhpx_init -lhpx -ldl -lrt && 
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  && 
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx) 
> > terminate called after throwing an instance of 
> > 'boost::exception_detail::clone_impl
> >  >'
> >   what():  attempt to insert a GVA with an invalid type, 
> > gid({00010001, 0001}), gva(({0001, 
> > } component_invalid[-1] 1 0xa41640 0)), 
> > locality({0001, }): HPX(bad_parameter)
> > 
> > real0m22.700s
> > user0m21.910s
> > sys 0m0.740s
> > 
> > 23:44:41 - 134
> 
> Thanks!
> -Andreas
> 
> 
> -- 
> ==
> Andreas Schäfer
> HPC and Grid Computing
> Department of Computer Science 3
> Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
> +49 9131 85-27910
> PGP/GPG key via keyserver
> http://www.libgeodecomp.org
> ==
> 
> (\___/)
> (+'.'+)
> (")_(")
> This is Bunny. Copy and paste Bunny into your
> signature to help him gain world domination!

> #include 
> #include 
> 
> #include 
> #include 
> #include 
> #include 
> 
> namespace {
> template
> class hpx_plugin_exporter_factory;
> 
> template
> class init_registry_factory_static;
> 
> template
> class hpx_plugin_exporter_registry;
> 
> }
> 
> namespace LibGeoDecomp {
> 
> /**
>  * Instantiate this template to ensure the instantiation of an HPX
>  * component template is actually registered. See HPXReceiver for an
>  * example on how to use this class and its assorted macros.
>  */
> template
> class HPXComponentRegistrator
> {
> public:
> virtual ~HPXComponentRegistrator()
> {}
> 
> static 
> hpx::components::component_factory
>  > *instanceA;
> static hpx::components::component_registry< 
> hpx::components::simple_component, 
> ::hpx::components::factory_check> *instanceB;
> 
> virtual 
> hpx::components::component_factory
>  > *foo1()
> {
> instanceA = new 
> hpx::components::component_factory
>  >(0, 0, false);
> return instanceA;
> }
> 
> virtual hpx::components::component_registry< 
> hpx::components::simple_component, 
> ::hpx::components::factory_check> *foo2()
> {
> instanceB = new hpx::components::component_registry< 
> hpx::components::simple_component, 
> ::hpx::components::factory_check>();
> return instanceB;
> }
> };
> 
> template
> hpx::components::component_factory
>  > *HPXComponentRegistrator::instanceA;
> 
> template
> hpx::components::component_registry< 
> hpx::components::simple_component, 
> ::hpx::components::factory_check> 
> *HPXComponentRegistrator::instanceB;
> 
> }
> 
> // fixme: lacks deletion of parentheses
> #define LIBGEODECOMP_REGISTER_HPX_COMPONENT_TEMPLATE(PARAMS, TEMPLATE)  \
> extern "C" __attribute__((visibility ("default")))  \
> std::map * 
> hpx_exported_plugins_list_hpx_factory(); \
> \
> namespace { 

Re: [hpx-users] Program failing when not compiling with -O3

2015-11-17 Thread Hartmut Kaiser
Andy,

Why do you need your own component registry etc.?

Regards Hartmut
---
http://boost-spirit.com
http://stellar.cct.lsu.edu


> -Original Message-
> From: hpx-users-boun...@stellar.cct.lsu.edu [mailto:hpx-users-
> boun...@stellar.cct.lsu.edu] On Behalf Of Andreas Schäfer
> Sent: Sunday, November 15, 2015 4:50 PM
> To: HPX Users 
> Subject: [hpx-users] Program failing when not compiling with -O3
> 
> Heya,
> 
> I've recently seen some of my HPX applications terminating right
> before hpx_init() is called. Strangely the build system did seem to
> determine whether the same code would either run flawlessly, or crash.
> 
> Please find attached a (sort of) minimal example that reproduces the
> error. Below is a log of me compiling the code manually. The only
> difference here is that for the first run I did add -O3, for the
> second run that option was omitted. Any ideas what's going on here?
> 
> > gentryx@neuromancer ~ $ time (rm -f test_hpx &&
> /usr/lib64/ccache/bin/g++-4.9.3 -O3-L/home/gentryx/local_install/lib -
> lhpx test_hpx.cpp   -o test_hpx -std=c++11 -
> I/home/gentryx/local_install/include -
> I/home/gentryx/local_install/include/hpx/external -lboost_chrono -
> lboost_date_time -lboost_filesystem -lboost_program_options -lboost_system
> -lboost_thread -lhpx_init -lhpx -ldl -lrt &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx)
> > ok
> >
> > real0m28.162s
> > user0m27.490s
> > sys 0m0.630s
> >
> > 23:43:58 - 0
> > gentryx@neuromancer ~ $ time (rm -f test_hpx &&
> /usr/lib64/ccache/bin/g++-4.9.3-L/home/gentryx/local_install/lib -lhpx
> test_hpx.cpp   -o test_hpx -std=c++11 -
> I/home/gentryx/local_install/include -
> I/home/gentryx/local_install/include/hpx/external -lboost_chrono -
> lboost_date_time -lboost_filesystem -lboost_program_options -lboost_system
> -lboost_thread -lhpx_init -lhpx -ldl -lrt &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx)
> > terminate called after throwing an instance of
> 'boost::exception_detail::clone_impl njector >'
> >   what():  attempt to insert a GVA with an invalid type,
> gid({00010001, 0001}), gva(({0001,
> } component_invalid[-1] 1 0xa41640 0)),
> locality({0001, }): HPX(bad_parameter)
> >
> > real0m22.700s
> > user0m21.910s
> > sys 0m0.740s
> >
> > 23:44:41 - 134
> 
> Thanks!
> -Andreas
> 
> 
> --
> ==
> Andreas Schäfer
> HPC and Grid Computing
> Department of Computer Science 3
> Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
> +49 9131 85-27910
> PGP/GPG key via keyserver
> http://www.libgeodecomp.org
> ==
> 
> (\___/)
> (+'.'+)
> (")_(")
> This is Bunny. Copy and paste Bunny into your
> signature to help him gain world domination!

___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] Program failing when not compiling with -O3

2015-11-17 Thread Hartmut Kaiser

> So, Zach and I have hit the same error when interfacing dg-swem with
> HPX+LGD, but here we weren't able to work around it via adding -O3.
> Any ideas for another workaround?
> 
> Thomas said he's suspecting a bug in HPX, but I can't really figure
> out what's going wrong.

As said, I don't understand what you're doing with that code. The
component-registry stuff is very subtle to get right and I don't see any
obvious reason you create your own.

Regards Hartmut
---
http://boost-spirit.com
http://stellar.cct.lsu.edu


> 
> Thanks!
> -Andreas
> 
> 
> On 23:49 Sun 15 Nov , Andreas Schäfer wrote:
> > Heya,
> >
> > I've recently seen some of my HPX applications terminating right
> > before hpx_init() is called. Strangely the build system did seem to
> > determine whether the same code would either run flawlessly, or crash.
> >
> > Please find attached a (sort of) minimal example that reproduces the
> > error. Below is a log of me compiling the code manually. The only
> > difference here is that for the first run I did add -O3, for the
> > second run that option was omitted. Any ideas what's going on here?
> >
> > > gentryx@neuromancer ~ $ time (rm -f test_hpx &&
> /usr/lib64/ccache/bin/g++-4.9.3 -O3-L/home/gentryx/local_install/lib -
> lhpx test_hpx.cpp   -o test_hpx -std=c++11 -
> I/home/gentryx/local_install/include -
> I/home/gentryx/local_install/include/hpx/external -lboost_chrono -
> lboost_date_time -lboost_filesystem -lboost_program_options -lboost_system
> -lboost_thread -lhpx_init -lhpx -ldl -lrt &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx)
> > > ok
> > >
> > > real0m28.162s
> > > user0m27.490s
> > > sys 0m0.630s
> > >
> > > 23:43:58 - 0
> > > gentryx@neuromancer ~ $ time (rm -f test_hpx &&
> /usr/lib64/ccache/bin/g++-4.9.3-L/home/gentryx/local_install/lib -lhpx
> test_hpx.cpp   -o test_hpx -std=c++11 -
> I/home/gentryx/local_install/include -
> I/home/gentryx/local_install/include/hpx/external -lboost_chrono -
> lboost_date_time -lboost_filesystem -lboost_program_options -lboost_system
> -lboost_thread -lhpx_init -lhpx -ldl -lrt &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  &&
> LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx)
> > > terminate called after throwing an instance of
> 'boost::exception_detail::clone_impl njector >'
> > >   what():  attempt to insert a GVA with an invalid type,
> gid({00010001, 0001}), gva(({0001,
> } component_invalid[-1] 1 0xa41640 0)),
> locality({0001, }): HPX(bad_parameter)
> > >
> > > real0m22.700s
> > > user0m21.910s
> > > sys 0m0.740s
> > >
> > > 23:44:41 - 134
> >
> > Thanks!
> > -Andreas
> >
> >
> > --
> > ==
> > Andreas Schäfer
> > HPC and Grid Computing
> > Department of Computer Science 3
> > Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
> > +49 9131 85-27910
> > PGP/GPG key via keyserver
> > http://www.libgeodecomp.org
> > ==
> >
> > (\___/)
> > (+'.'+)
> > (")_(")
> > This is Bunny. Copy and paste Bunny into your
> > signature to help him gain world domination!
> 
> > #include 
> > #include 
> >
> > #include 
> > #include 
> > #include 
> > #include 
> >
> > namespace {
> > template
> > class hpx_plugin_exporter_factory;
> >
> > template
> > class init_registry_factory_static;
> >
> > template
> > class hpx_plugin_exporter_registry;
> >
> > }
> >
> > namespace LibGeoDecomp {
> >
> > /**
> >  * Instantiate this template to ensure the instantiation of an HPX
> >  * component template is actually registered. See HPXReceiver for an
> >  * example on how to use this class and its assorted macros.
> >  */
> > template
> > class HPXComponentRegistrator
> > {
> > public:
> > virtual ~HPXComponentRegistrator()
> > {}
> >
> > static
> hpx::components::component_factory NENT> > *instanceA;
> > static hpx::components::component_registry<
> hpx::components::simple_component,
> ::hpx::components::factory_check> *instanceB;
> >
> > virtual
> hpx::components::component_factory NENT> > *foo1()
> > {
> > instanceA = new
> hpx::components::component_factory NENT> >(0, 0, false);
> > return instanceA;
> > }
> >
> > virtual hpx::components::component_registry<
> hpx::components::simple_component,
> ::hpx::components::factory_check> *foo2()
> > {
> > instanceB = new hpx::components::component_registry<
> hpx::components::simple_component,
> ::hpx::components::factory_check>();
> > return instanceB;
> > }
> > };
> >
> > template
> >
> hpx::components::component_factory NENT> > *HPXComponentRegistrator::instanceA;
> >
> > template
> > hpx::components::component_registry<
> hpx::components::simple_component,
> ::hpx::components::factory_check>
> *HPXComponentRegistrator

Re: [hpx-users] Program failing when not compiling with -O3

2015-11-17 Thread Andreas Schäfer
On 15:08 Tue 17 Nov , Hartmut Kaiser wrote:
> Why do you need your own component registry etc.?

I can't use macros because a user would need to instantiate them
manually. Users forget about that stuff, so we do it for them.

Cheers
-Andi


-- 
==
Andreas Schäfer
HPC and Grid Computing
Department of Computer Science 3
Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
+49 9131 85-27910
PGP/GPG key via keyserver
http://www.libgeodecomp.org
==

(\___/)
(+'.'+)
(")_(")
This is Bunny. Copy and paste Bunny into your
signature to help him gain world domination!


signature.asc
Description: Digital signature
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] Program failing when not compiling with -O3

2015-11-17 Thread Thomas Heller
Am 17.11.2015 11:39 nachm. schrieb "Andreas Schäfer" :
>
> On 15:08 Tue 17 Nov , Hartmut Kaiser wrote:
> > Why do you need your own component registry etc.?
>
> I can't use macros because a user would need to instantiate them
> manually. Users forget about that stuff, so we do it for them.

Did you try to explicitly call the macros for the components you use
instead of your auto registration of components?

>
> Cheers
> -Andi
>
>
> --
> ==
> Andreas Schäfer
> HPC and Grid Computing
> Department of Computer Science 3
> Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
> +49 9131 85-27910
> PGP/GPG key via keyserver
> http://www.libgeodecomp.org
> ==
>
> (\___/)
> (+'.'+)
> (")_(")
> This is Bunny. Copy and paste Bunny into your
> signature to help him gain world domination!
>
> ___
> hpx-users mailing list
> hpx-users@stellar.cct.lsu.edu
> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
>
___
hpx-users mailing list
hpx-users@stellar.cct.lsu.edu
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users


Re: [hpx-users] Program failing when not compiling with -O3

2015-11-17 Thread Thomas Heller
Am 17.11.2015 10:10 nachm. schrieb "Hartmut Kaiser" <
hartmut.kai...@gmail.com>:
>
>
> > So, Zach and I have hit the same error when interfacing dg-swem with
> > HPX+LGD, but here we weren't able to work around it via adding -O3.
> > Any ideas for another workaround?
> >
> > Thomas said he's suspecting a bug in HPX, but I can't really figure
> > out what's going wrong.
>
> As said, I don't understand what you're doing with that code. The
> component-registry stuff is very subtle to get right and I don't see any
> obvious reason you create your own.

Does it work when you use the HPX provided registration macros?

>
> Regards Hartmut
> ---
> http://boost-spirit.com
> http://stellar.cct.lsu.edu
>
>
> >
> > Thanks!
> > -Andreas
> >
> >
> > On 23:49 Sun 15 Nov , Andreas Schäfer wrote:
> > > Heya,
> > >
> > > I've recently seen some of my HPX applications terminating right
> > > before hpx_init() is called. Strangely the build system did seem to
> > > determine whether the same code would either run flawlessly, or crash.
> > >
> > > Please find attached a (sort of) minimal example that reproduces the
> > > error. Below is a log of me compiling the code manually. The only
> > > difference here is that for the first run I did add -O3, for the
> > > second run that option was omitted. Any ideas what's going on here?
> > >
> > > > gentryx@neuromancer ~ $ time (rm -f test_hpx &&
> > /usr/lib64/ccache/bin/g++-4.9.3 -O3
-L/home/gentryx/local_install/lib -
> > lhpx test_hpx.cpp   -o test_hpx -std=c++11 -
> > I/home/gentryx/local_install/include -
> > I/home/gentryx/local_install/include/hpx/external -lboost_chrono -
> > lboost_date_time -lboost_filesystem -lboost_program_options
-lboost_system
> > -lboost_thread -lhpx_init -lhpx -ldl -lrt &&
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  &&
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx)
> > > > ok
> > > >
> > > > real0m28.162s
> > > > user0m27.490s
> > > > sys 0m0.630s
> > > >
> > > > 23:43:58 - 0
> > > > gentryx@neuromancer ~ $ time (rm -f test_hpx &&
> > /usr/lib64/ccache/bin/g++-4.9.3-L/home/gentryx/local_install/lib
-lhpx
> > test_hpx.cpp   -o test_hpx -std=c++11 -
> > I/home/gentryx/local_install/include -
> > I/home/gentryx/local_install/include/hpx/external -lboost_chrono -
> > lboost_date_time -lboost_filesystem -lboost_program_options
-lboost_system
> > -lboost_thread -lhpx_init -lhpx -ldl -lrt &&
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  &&
> > LD_LIBRARY_PATH=/home/gentryx/local_install/lib  ./test_hpx)
> > > > terminate called after throwing an instance of
> >
'boost::exception_detail::clone_impl > njector >'
> > > >   what():  attempt to insert a GVA with an invalid type,
> > gid({00010001, 0001}), gva(({0001,
> > } component_invalid[-1] 1 0xa41640 0)),
> > locality({0001, }): HPX(bad_parameter)
> > > >
> > > > real0m22.700s
> > > > user0m21.910s
> > > > sys 0m0.740s
> > > >
> > > > 23:44:41 - 134
> > >
> > > Thanks!
> > > -Andreas
> > >
> > >
> > > --
> > > ==
> > > Andreas Schäfer
> > > HPC and Grid Computing
> > > Department of Computer Science 3
> > > Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
> > > +49 9131 85-27910
> > > PGP/GPG key via keyserver
> > > http://www.libgeodecomp.org
> > > ==
> > >
> > > (\___/)
> > > (+'.'+)
> > > (")_(")
> > > This is Bunny. Copy and paste Bunny into your
> > > signature to help him gain world domination!
> >
> > > #include 
> > > #include 
> > >
> > > #include 
> > > #include 
> > > #include 
> > > #include 
> > >
> > > namespace {
> > > template
> > > class hpx_plugin_exporter_factory;
> > >
> > > template
> > > class init_registry_factory_static;
> > >
> > > template
> > > class hpx_plugin_exporter_registry;
> > >
> > > }
> > >
> > > namespace LibGeoDecomp {
> > >
> > > /**
> > >  * Instantiate this template to ensure the instantiation of an HPX
> > >  * component template is actually registered. See HPXReceiver for an
> > >  * example on how to use this class and its assorted macros.
> > >  */
> > > template
> > > class HPXComponentRegistrator
> > > {
> > > public:
> > > virtual ~HPXComponentRegistrator()
> > > {}
> > >
> > > static
> >
hpx::components::component_factory > NENT> > *instanceA;
> > > static hpx::components::component_registry<
> > hpx::components::simple_component,
> > ::hpx::components::factory_check> *instanceB;
> > >
> > > virtual
> >
hpx::components::component_factory > NENT> > *foo1()
> > > {
> > > instanceA = new
> >
hpx::components::component_factory > NENT> >(0, 0, false);
> > > return instanceA;
> > > }
> > >
> > > virtual hpx::components::component_registry<
> > hpx::components::simple_component,
> > ::hpx::components::factory_check> *foo2()
> > > {
> > >