- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I need to compile user defined functions in C language for Postgres. These functions may offload some work to MIC.
The problem is that Postgres drop session on any #pragma offload.
I make minimal example. I made a simple DSO library, simple direct call tester and testing with Postgres (in attachments).
I use next compilation commands:
[bash]
CC=icc
CFLAGS=-Wall -openmp
PG_PATH_BIN=/storage/home/xxx/postgresql-9.1.9-build/bin
PG_SERVER_INCLUDE_DIR_PATH=-I`$(PG_PATH_BIN)/pg_config --includedir-server`
SO_FLAG=-shared
$(CC) $(CFLAGS) $(SO_FLAG) $(PG_SERVER_INCLUDE_DIR_PATH) -fPIC pgMIC.c -o libpgMIC.so
$(CC) exec.o -L. -lpgMIC -o exec.out
[/bash]
exec.out returns: add_one1(5) = 11
Postgres psql call returns:
postgres=# CREATE FUNCTION add_one(integer) returnS integer AS 'libpgMIC', 'add_one' LANGUAGE C STRICT;
CREATE FUNCTION
postgres=# SELECT add_one(5);
The connection to the server was lost. Attempting reset: Succeeded
Postgres log shows: LOG: server process (PID 25489) was terminated by signal 11: Segmentation fault
If I comment out #pragma offload Postgres is OK.
Can anybody give some advice what is the problem, how to get more information about segmentation fault reason? Maybe I forgot some compile options?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Unfortunately, your post fell through the cracks.
Do you still need an answer?
Regards
--
Taylor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Taylor!
Happens strange thing - the problem fixed suddenly without any changes in code. Now it is not reproducable. I don't know what was the reason and what solved the problem.
So for now question is closed.
Regards
--
Timofey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
(I don't know what was the reason and what solved the problem.)
Probably it's only refresh (ldconfig) when you have reboot.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Timofey,
If you have anything other problems or if it shows back up again, please let us know.
Regards
--
Taylor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To bustaf:
I'm just user of cluster not sysadmin so I can't reboot node. I just can try to move to other node. Problem reproduced on all nodes which I tried to use. Possibly sysadmins made some magic so it starts work again.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
In system you have (cron) that could run this task automatically without
query accord of your admin.
I think functions dissociated on each database
Personally I not use OpenMp directly on function database
exist several problems conflicts I use only on an backend ..
with using (PTH) it's better but it's also not perfect.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Look the last Babar 9.3 , I think you have is tailor for your Phi card.
(postgres_fdw)
http://www.postgresql.org/docs/9.3/static/postgres-fdw.h.t.m.l (remove the (.) h.t.m.l)
http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3
It's sure that when you have the system is specifically builded to databases
and is not unique imposed same here, it could be more simple to manage...
About other sides he seem improved compared the precedent version.
Maybe, yet, two new future version, I think that with , all functions are added each
upgrade ,it will be reserved only accessible for Einstein.
Regards
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page