browser-bug
browser-bug

Reputation: 2051

How to correcly upgrade your OpenMP version?

I'm trying to deploy an OpenMP/MPI project on some virtual machines through Amazon EC2. Every VM is running Ubuntu 16.04 and currently I have: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 and relative mpich.

I correctly tested my project on Ubuntu 18.04 with gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0. Basically I'm using OpenMP array reductions with custom reduction operators and to my knowledge this became available since OpenMP 4.5. This indeed is a problem since on my VMs I get the following error: error: ‘array1_test’ has invalid type for ‘reduction’.

I thought I simple upgrade would suffice (following this) but after that MPI was complaining with Please use the same version of GCC and g++ for compiling MPICH and user MPI programs. I tried reinstalling mpich but with no success.

I'm using cmake to compile. Linking MPI is done as following:

link_libraries(${MPI_CXX_LIBRARIES})
if(MPI_CXX_COMPILE_FLAGS)
  set_property(GLOBAL PROPERTY COMPILE_FLAGS "${MPI_CXX_COMPILE_FLAGS}")
endif()
if(MPI_CXX_LINK_FLAGS)
set_property(GLOBAL PROPERTY LINK_FLAGS "${MPI_CXX_LINK_FLAGS}")
endif()

What am I doing wrong and how can I correctly upgrade OpenMP without messing up the MPI configuration?

Upvotes: 0

Views: 1111

Answers (1)

browser-bug
browser-bug

Reputation: 2051

So for anyone experiencing my problem, I've solved the issue building from source MPICH as suggested by @Jérôme Richard.

1) I've installed a newer version of gcc in order to have a compatible OpenMP standard for my project (e.g. 4.5) and solve the error: ‘array1_test’ has invalid type for ‘reduction’ issue.

2) I've downloaded the source files from MPICH website (download section).

3) Following their installation guide I've managed to install mpich compiling with gcc 7.4.0 to solve the Please use the same version of GCC and g++ for compiling MPICH and user MPI programs issue.

Please note that I needed to stick to Ubuntu 16.04. All this trouble can be skipped by just using a newer Ubuntu release (e.g. >=18.04).

Upvotes: 1

Related Questions