Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does gcollapse fail to load multi-threaded version; using fallback #9

Closed
felixholub opened this issue Aug 17, 2017 · 13 comments
Closed
Assignees
Labels

Comments

@felixholub
Copy link

felixholub commented Aug 17, 2017

When I run

sysuse auto
gcollapse mpg, by(foreign) verbose

The collapse works but I'm told that
note: failed to load multi-threaded version; using fallback, even though I'm running it with Stata-MP on multicore Linux (and WIN 7, but this is pointed out in TODO). Not sure if a bug or lack of understanding on my site.

@mcaceresb
Copy link
Owner

Whether or not Stata is MP should be irrelevant for this. From a terminal on linux, what is the output of

ldconfig -p | grep libgomp
echo $LD_LIBRARY_PATH

@felixholub
Copy link
Author

-bash: ldconfig: command not found
I would need to contact the system admin (it's a server) in case this is required.

@mcaceresb
Copy link
Owner

Try these:

locate libgomp
whereis libgomp.so
whereis libgomp.so.1

If it exists in your system, it may also be named libgomp.so.1.0 or libgomp.so.1.0.0 so try searching for them as well. Let me know if any of these commands fail.

@felixholub
Copy link
Author

Output of locate libgomp

/usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a
/usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.so
/usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.spec
/usr/lib/x86_64-linux-gnu/libgomp.so.1

/usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
/usr/share/doc/libgomp1
/usr/share/doc/gcc-4.7-base/test-summaries/libgomp.sum.gz
/var/lib/dpkg/info/libgomp1:amd64.list
/var/lib/dpkg/info/libgomp1:amd64.md5sums
/var/lib/dpkg/info/libgomp1:amd64.postinst
/var/lib/dpkg/info/libgomp1:amd64.postrm
/var/lib/dpkg/info/libgomp1:amd64.shlibs
/var/lib/dpkg/info/libgomp1:amd64.symbols

The output of the various whereis commands is always empty.

@mcaceresb
Copy link
Owner

I see. Can you try

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
stata

and then, from the stata command prompt,

sysuse auto
gcollapse mpg, by(foreign) verbose

And let me know the output? This may be an issue with stata being unable to find libgomp, which the plugin uses for parallelism. If this works, there may be a simple solution so you don't have to run this every time. Let me know.

@felixholub
Copy link
Author

felixholub commented Aug 18, 2017 via email

@mcaceresb
Copy link
Owner

Apologies for the tardiness debugging. I just tried this on a fresh Linux install and it worked. I have to assume it has to do with one of the following:

  • OS
  • Version
  • Processor

I will try to replicate your situation more closely. Can you run and paste the output of

cat /etc/*release*
uname -a
lscpu

@felixholub
Copy link
Author

PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
3.2.0-4-amd64 #1 SMP Debian 3.2.81-2 x86_64 GNU/Linux
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                32
On-line CPU(s) list:   0-31
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Stepping:              4
CPU MHz:               3300.402
BogoMIPS:              6599.92
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              25600K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31

mcaceresb added a commit that referenced this issue Sep 12, 2017
Bug fixes

* Should fix #9
  Added legacy plugin using older `libgomp.so` library.
mcaceresb added a commit that referenced this issue Sep 12, 2017
Added legacy plugin to Stata package index, which should fix
issue #9
@mcaceresb
Copy link
Owner

I was able to reproduce the bug. It seems it's just a versioning issue, but all the functionality appears to be compatible.

Can you try the latest development branch version? I have added a version of the plugin that uses an older version of libgomp.

net install gtools, from(https://raw.githubusercontent.com/mcaceresb/stata-gtools/develop/build/)
sysuse auto
gcollapse mpg, by(foreign) verbose

@mcaceresb mcaceresb self-assigned this Sep 12, 2017
@mcaceresb
Copy link
Owner

mcaceresb commented Sep 12, 2017

Actually, do not use the plugin just yet. It seems there is another problem with using the plugin on an older OS. The hashing function does not actually work and it will cause a segmentation fault (crash).

Integers are fine because they are not hashed, but anything other than integers is causing a crash for me. Can you run:

sysuse auto
gcollapse mpg, by(headroom make) verbose

I expect it will cause a crash. Let me know if it does.

@mcaceresb mcaceresb added bug and removed enhancement labels Sep 12, 2017
@mcaceresb
Copy link
Owner

Can you try again? Latest dev and using headroom make? It no longer crashes for me (version 0.6.14)

net install gtools, from(https://raw.githubusercontent.com/mcaceresb/stata-gtools/develop/build/)
sysuse auto
gcollapse mpg, by(headroom make) verbose

mcaceresb added a commit that referenced this issue Sep 12, 2017
Bug fixes

* Fixes #14
* Fixes #9
  (prior fixes were erratic; this should work)
@felixholub
Copy link
Author

Now it works indeed! Thanks a lot for the support Mauricio, keep up the great work!

mcaceresb added a commit that referenced this issue Sep 13, 2017
gtools-0.6.16 (2017-09-13)

* Improves the issues raised by #7
  Now the commands only fail if Stata hits the `matsize` limit (internally,
  the plugin no longer uses the `subinstr` hack to go from locals to mata
  string matrices and uses `tokens` instead, which is more appropriate;
  further, the plugin tries to set matsize to at least the number of variables
  and gives a verbose error if it fails).
* No longer crashes on Linux systems with older glibc versions.
* Fixes #14
* Should fix #12
* Fixes #9
* Fixed #8
  `gegen` is callable via `by:`; it also gives the stat for the
  overall group if called without a `by`.
@mcaceresb
Copy link
Owner

By the way, don't update the plugin. I have added new commands and this broke the legacy compatibility I added here. I'm reopening the issue until I figure out a fix for the new commands as well.

@mcaceresb mcaceresb reopened this Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants