Comments (12)
So I have no idea if this breaks anything, but if you include omp.h in ctf.hpp before any ctf specific headers, the compilation bug goes away.
from ctf.
Could you please post the compiler message(s)? I have a feeling it might
have to do with a conflicting implicit declaration.
On 10/4/16 9:57 AM, Kevin Hannon wrote:
So I have no idea if this breaks anything, but if you include omp.h in
ctf.hpp before any ctf specific headers, the compilation bug goes away.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/solomonik/ctf/issues/27#issuecomment-251413355,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFAMoXBDg4TEEyjrpuHczfcPqfC4yrH1ks5qwmlhgaJpZM4KNxSK.
from ctf.
Here is the error:
mock_ctf.cc: In function ‘int main(int, char**)’:
mock_ctf.cc:18:37: error: ‘omp_get_max_threads’ was not declared in this scope
int nthread = omp_get_max_threads();
^
mock_ctf.cc:18:37: note: suggested alternative:
In file included from /home/kannon/src/ctf/include/../src/interface/../contraction/../shared/util.h:132:0,
from /home/kannon/src/ctf/include/../src/interface/../contraction/ctr_tsr.h:7,
from /home/kannon/src/ctf/include/../src/interface/../contraction/contraction.h:5,
from /home/kannon/src/ctf/include/../src/interface/functions.h:6,
from /home/kannon/src/ctf/include/../src/interface/tensor.h:4,
from /home/kannon/src/ctf/include/ctf.hpp:20,
from /home/kannon/src/ctf/Build/include/ctf.hpp:1,
from mock_ctf.cc:4:
/usr/lib64/gcc/x86_64-suse-linux/4.9/include/omp.h:73:12: note: ‘CTF_int::omp_get_max_threads’
extern int omp_get_max_threads (void) __GOMP_NOTHROW;
from ctf.
It looks like omp.h is being #included inside the CTF_int namespace
(src/shared/util.h:132). Should be an easy fix, although I'm not
actually sure how it works at all as it is.
On 10/4/16 10:19 AM, Kevin Hannon wrote:
|mock_ctf.cc: In function ‘int main(int, char**)’: mock_ctf.cc:18:37:
error: ‘omp_get_max_threads’ was not declared in this scope int
nthread = omp_get_max_threads(); ^ mock_ctf.cc:18:37: note: suggested
alternative: In file included from
/home/kannon/src/ctf/include/../src/interface/../contraction/../shared/util.h:132:0,
from
/home/kannon/src/ctf/include/../src/interface/../contraction/ctr_tsr.h:7,
from
/home/kannon/src/ctf/include/../src/interface/../contraction/contraction.h:5,
from /home/kannon/src/ctf/include/../src/interface/functions.h:6, from
/home/kannon/src/ctf/include/../src/interface/tensor.h:4, from
/home/kannon/src/ctf/include/ctf.hpp:20, from
/home/kannon/src/ctf/Build/include/ctf.hpp:1, from mock_ctf.cc:4:
/usr/lib64/gcc/x86_64-suse-linux/4.9/include/omp.h:73:12: note:
‘CTF_int::omp_get_max_threads’ extern int omp_get_max_threads (void)
__GOMP_NOTHROW; |—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/solomonik/ctf/issues/27#issuecomment-251420213,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFAModlrm3JRCXxW0grX4Vg_ZFseS_AHks5qwm6ZgaJpZM4KNxSK.
from ctf.
mock_ctf.cc
is not part of the CTF repo.
In any case, it seems that extern "C" { }
might be required, or some other fix for the namespace issue.
from ctf.
src/shared/util.h
has a lot of issues. omp.h
is not the only include that needs to happen outside of the CTF_int
namespace...
from ctf.
Thank you for the changes. mock_ctf.cc was what I called the test program I used.
from ctf.
Hi Kevin,
Thanks for the bug report. I just pushed a fix to master. As Jeff and Devin pointed out the omp.h include should not have been in the namespace CTF_int {} block. Moreover src/shared/util.h should not even be included from any interface files and is meant to be internal. I made changes to fix both.
Also, separately, you should initialize the random seed generator srand48(...) to something dependent on processor rank, before calling fill_random on CTF tensors. CTF does not perform any seeding itself, since its not evident how to do so robustly while preserving reproducibility.
Best regards,
Edgar
from ctf.
Thank you for your help.
from ctf.
Regarding srand48
, C++11 has great features for RNG...
from ctf.
If C++11 can't be required, Boost works.
I know I am a big hypocrite for recommending C++11 and Boost now, given my position in ~2012, but C++ compilers have had 4 years to stop sucking.
from ctf.
(Sorry for the off-topic discussion.) CTF currently requires C++11. I am happy to learn C++11 has more robust support for RNGs and will keep that in mind. However, I am not sure they provide a solution to the underlying problem with parallel RNG generation for a library like CTF. One can just generate non-deterministically, but determinism is extremely valuable for reproducible testing. However, then one has to insure that different processors get a different seed and different tensors get a different seed, and it becomes not so clear how to do that (e.g. on a CTF instance basis or via global counter) and how to let the user control it.
I guess the right solution might be to have fill_random_nondeterministic and fill_random_preseeded. Then it remains to figure out whether fill_random_preseeded should have all processor ranks with the same seed or with a different seed, and how to handle the former, which is where C++11 RNGs may help. And what fill_random should do for backwards comp.
from ctf.
Related Issues (20)
- Efficiency comparisons with einsum and opt-einsum and how to utilize symmetry? HOT 4
- ctf-einsum.py:78: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. HOT 1
- issues using sparse file io to load tensors HOT 4
- Compile error with GCC 11 HOT 10
- Wrong results when slicing a symmetric sparse tensor in python lib
- understanding performance overheads in CTF HOT 27
- ModuleNotFoundError: No module named 'ctf.core' HOT 1
- Comparing Fortran and CTF performance on symmetries in tensor contractions HOT 2
- segfault executing sparse inner product HOT 18
- oom/memory corruption running an SDDMM (using TTTP specialized routine) HOT 1
- unexpected performance for SpMV operation HOT 1
- [question] setting all nonzeros to a value HOT 2
- Warnings
- make test failure in SVD test HOT 3
- compiling issue when including ctf.hpp
- test_suite failure on Apple HOT 1
- compile issues with undefined references to mkl commands (that appear in the relevant folders) HOT 9
- Scale with Endomorphism
- Set values with low memory footprint
- ctf header error during installation on perlmutter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctf.