lwang-astro / PeTar

PeTar is a high-performance N-body code for modelling the evolution of star clusters and tidal streams, including the effect of galactic potential, dynamics of binary and hierarchical system, single and binary stellar evolution.
MIT License
71 stars 19 forks source link

Galpy interface #16

Closed christianboily closed 3 years ago

christianboily commented 3 years ago

Hi, PeTar compiles fine with MPI + CUDA7.5 (but not higher versions) however the link to the galpy interface does not seem to work ? I installed Anaconda python + galpy (pip install galpy) at a local HPC so the python distribution is not cluster-wide.

the intel compiler mpic++ is icpc (ICC) 19.1.3.304 20200925

The galpy interface seems to miss a basic library - see the error message below - but I can see what is from with the C compiler ?

Here is the output :

make[1]: Entering directory `/home2020/home/observatoire/boily/PeTar/galpy-interface' mpic++ -O3 -Wall -I/usr/include -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/potential -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/potential/potential_c_ext -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/potential/interppotential_c_ext -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/potential/pycache -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/orbit -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/orbit/orbit_c_ext -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/orbit/pycache -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/df -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/df/pycache -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/df/data -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/snapshot -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/snapshot/pycache -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/pycache -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/actionAngle -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/actionAngle/actionAngleTorus_c_ext -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/actionAngle/actionAngle_c_ext -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/actionAngle/pycache -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/util -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/util/interp_2d -I/home2020/home/observatoire/boily/PeTar/../anaconda3/lib/python3.8/site-packages/galpy/util/pycache galpy_test.cxx -o petar.galpy -L./ -lgalpy -lgsl -lgslcblas -lm In file included from galpy_interface.h(9), from galpy_test.cxx(4): ../src/io.hpp(107): error #303: explicit type is missing ("int" assumed) for(auto iter = d_f64.begin(); iter!=d_f64.end(); iter++) fprintf(_fout, "%c %s %26.15e\n", IOParamsPrintHelp::getValueTypeShortName(iter->second->value), iter->first, iter->second->value); ^ In file included from galpy_interface.h(9), from galpy_test.cxx(4): ../src/io.hpp(107): error: no suitable conversion function from "std::_Rb_tree_iterator<std::pair<const char const, IOParams >>" to "int" exists for(auto iter = d_f64.begin(); iter!=d_f64.end(); iter++) fprintf(_fout, "%c %s %26.15e\n", IOParamsPrintHelp::getValueTypeShortName(iter->second->value), iter->first, iter->second->value); ^ etc etc : there are 100 x more lines like this, so clearly I should be switching to some other C compiler ? Trying gcc8.2 does not work (the default for my configuration at the HPC).

Many thanks for your help / hints,

Cheeers

lwang-astro commented 3 years ago

First, the c compiler is needed for Galpy library. Second, if you use Intel compiler for petar, it is necessary to use Intel compiler (icc) also for Galpy. If your system has the icpc and icc as default c++ and c compiler, the configure of petar should detect them automatically. If you manually set the C++ compiler by using MPICXX=mpic++ or CXX=icpc, c compiler also need to be set like CC=icc. Hope this can help you to solve the problem.

christianboily commented 3 years ago

Dear Long Wang, yes quite, there are conflicting (default) versions of the compilers when I log in, so I will try a local install of galpy with the same compiler version etc and that should fix it. Many thanks !

First, the c compiler is needed for Galpy library. Second, if you use Intel compiler for petar, it is necessary to use Intel compiler (icc) also for Galpy. If your system has the icpc and icc as default c++ and c compiler, the configure of petar should detect them automatically. If you manually set the C++ compiler by using MPICXX=mpic++ or CXX=icpc, c compiler also need to be set like CC=icc. Hope this can help you to solve the problem.

christianboily commented 3 years ago

ps - just to confirm that resetting my login @ HPC without intel20 compilers loaded, all GNU, worked well after I installed galpy locally. The GPU had to have v7.5, there's nothing I can do about that. Good to know : PeTar installed like a charm under OSX . The PeTar code is called : petar.mpi.omp.avx2.gpu.bse.galpy.

Many thanks again, all the best,