Issue 1:
Please go to Stack Overflow for help and support:

https://stackoverflow.com/questions/tagged/tensorflow

If you open a GitHub issue, here is our policy:

It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).

The form below must be filled out.

It shouldn't be a TensorBoard issue. Those go here.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:

TensorFlow installed from (source or binary):

TensorFlow version (use command below):

Python version:

Bazel version (if compiling from source):

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version:

GPU model and memory:

Exact command to reproduce:

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

Issue 2:
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04 LTS

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -

TensorFlow installed from (source or binary): from source

TensorFlow version: 1.13.1

Python version: Bazel used 2.7 as default, however I have also access to 3.6

Installed using virtualenv? pip? conda?: -

Bazel version (if compiling from source): 0.26

GCC/Compiler version (if compiling from source): 7.4.0

CUDA/cuDNN version: -

GPU model and memory: - (no GPU)

Describe the problem

I am using Tensorflow's C API within a C++ simulation software for fluid dynamics (OpenFOAM). So far I used the standard C API available here (https://www.tensorflow.org/install/lang_c). Everything worked well, both doing my computations on one core as well as using OpenMPI to parallelize the fluid dynamics part. As I wanted to speed up my inference I wanted to try out AVX / AVX2 support, as my CPU supports AVX / AVX2. To do so I compiled Tensorflow from source:

Installation of Bazel 0.26.1

clone from Github: git clone https://github.com/tensorflow/tensorflow.git

cd tensorflow -> ./configure

I chose these steps for configuration:

Please specify the location of python. [Default is /usr/bin/python]: default

-Please input the desired Python library path to use. Default is [/usr/local/lib/python2.7/dist-packages]: default

Do you wish to build TensorFlow with XLA JIT support? [Y/n]: Y

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: N

Do you wish to build TensorFlow with ROCm support? [y/N]: N

Do you wish to build TensorFlow with CUDA support? [y/N]: N

Do you wish to download a fresh release of clang? (Experimental) [y/N]: N

Do you wish to build TensorFlow with MPI support? [y/N]: y

Please specify the MPI toolkit folder. [Default is /usr]: default

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: default

Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: N

Test: bazel test --config opt //tensorflow/tools/lib_package:libtensorflow_test

Build: bazel build --config opt //tensorflow/tools/lib_package:libtensorflow

Included the header files and linked the libraries

Unfortunately, although everything seemed to be fine, I get an error. As I mentioned, using the standard C API downloaded from the homepage everything was fine. Now i can still to my computations if i do not parallelize my fluid dynamics software. However if I run my fluid dynamics simulation in parallel, this happens:

`

[node134:18796] *** Process received signal ***

[node134:18796] Signal: Segmentation fault (11)

[node134:18796] Signal code: Address not mapped (1)

[node134:18796] Failing at address: (nil)

[node134:18796] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fec1c96ff20]

[node134:18796] [ 1] /home/elias/OpenFOAM/elias-4.1/platforms/linux64GccDPInt32Opt/lib/libtensorflow_framework.so(hwloc_bitmap_and+0x14)[0x7fec01c21534]

[node134:18796] [ 2] /usr/lib/x86_64-linux-gnu/libopen-pal.so.20(opal_hwloc_base_filter_cpus+0x380)[0x7febe59d6b80]

[node134:18796] [ 3] /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_ess_pmi.so(+0x2b4e)[0x7febe4902b4e]

[node134:18796] [ 4] /usr/lib/x86_64-linux-gnu/libopen-rte.so.20(orte_init+0x22e)[0x7febe5c2a1de]

[node134:18796] [ 5] /usr/lib/x86_64-linux-gnu/libmpi.so.20(ompi_mpi_init+0x30e)[0x7febffdbc27e]

[node134:18796] [ 6] /usr/lib/x86_64-linux-gnu/libmpi.so.20(MPI_Init+0x6b)[0x7febffddd2ab]

[node134:18796] [ 7] /opt/OpenFOAM/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so(_ZN4Foam8UPstream4initERiRPPc+0x1f)[0x7fec1c72843f]

[node134:18796] [ 8] /opt/OpenFOAM/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam7argListC1ERiRPPcbbb+0x719)[0x7fec1db36ed9]

[node134:18796] [ 9] tabulatedCombustionFoam(+0x279b8)[0x55fe6eb489b8]

[node134:18796] [10] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fec1c952b97]

[node134:18796] [11] tabulatedCombustionFoam(+0x30a0a)[0x55fe6eb51a0a]

[node134:18796] *** End of error message ***`

I do not think that my code has any errors, as with the C API I downloaded directly from the Tensorflow homepage everything worked fine. More probably it seems to be a collision between OpenMPI called from Tensorflow and OpenMPI called from OpenFOAM (the fluid dynamics software). Moreover the run crashes immediately after I start the simulation and far before it reaches my own code.

My questions:

Is there a procedure I can follow to get rid of the bug?

What would I have to do to reproduce exactly the version of the C API that one can download from your homepage? Because as mentioned using this version everything worked fine. Can I find out where the precompiled C API looks for openmpi? Or can you tell me the path?

From this post (https://www.cfd-online.com/Forums/openfoam-solving/133913-problems-running-openfoam-2-3-parallel.html) I learned that OpenFOAM uses an own OpenMPI version, however this one worked perfectly fine together with my initial Tensorflow C API stuff that i downloaded. Can you maybe define what the correct MPI toolkit path must contain? Then I could possibly use the one also used by OpenFOAM.