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

Installing MESA into the AMUSE Framework #598

Closed
OrbitalMechanic opened this issue Feb 29, 2020 · 20 comments
Closed

Installing MESA into the AMUSE Framework #598

OrbitalMechanic opened this issue Feb 29, 2020 · 20 comments
Labels
question stale Issues that have been around for a while without updates

Comments

@OrbitalMechanic
Copy link

I presently have MESA (release r12115) installed and running on my Mac Pro (2019) running Mac OS X ver. 10.15.3 (Catalina). I'd like to install MESA into the AMUSE Framework. Is anyone aware of a procedure that performs the installation under the Anaconda distribution (ver. 3.7) on a Mac Pro under the Catalina operating system in zsh (z shell)?

Please advise.

Sam Dupree.

@rieder
Copy link
Member

rieder commented Feb 29, 2020 via email

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 1, 2020 via email

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 2, 2020

To follow up, I attempted to install MESA into AMUSE following the procedure posted at [https://amuse.readthedocs.io/en/latest/install/howto-install-AMUSE.html]https://amuse.readthedocs.io/en/latest/install/howto-install-AMUSE.html. The results were:

(amuse) user@Samuels-Mac-Pro amuse-master % make mesa.code DOWNLOAD_CODES=1
/Users/user/opt/anaconda3/envs/amuse/bin/python setup.py -v build_code --inplace --clean=yes --code-name=mesa
running build_code
cleaning src/amuse/community/mesa
make -C src/amuse/community/mesa clean
b'rm -f -f *~ *.pyc *.mod *.o worker_code worker_code.f90 ./src/mesa/lib/libstar.a'
b'rm -f -f mesa_worker mesa_worker_sockets worker_code-sockets.f90'
b'make -C ./mesa_reqs clean'
building libraries and community codes
build, for logging, see 'build.log'
[21:54:20] building mesa
make -C src/amuse/community/mesa all
b'amusifier --type=f90 interface.py MESAInterface -o worker_code.f90'
b'make -C . download'
b'rm -f -Rf src'
b'mkdir src'
b'/Users/user/opt/anaconda3/envs/amuse/bin/python ./download.py'
b'downloading version 2208 from http://amuse.strw.leidenuniv.nl/codes/mesa-r2208.tgz to mesa-r2208.tgz'
b'Traceback (most recent call last):'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 1254, in do_open'
b'    h.request(req.get_method(), req.selector, req.data, headers)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1107, in request'
b'    self._send_request(method, url, body, headers)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1152, in _send_request'
b'    self.endheaders(body)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1103, in endheaders'
b'    self._send_output(message_body)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 934, in _send_output'
b'    self.send(msg)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 877, in send'
b'    self.connect()'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1253, in connect'
b'    super().connect()'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 849, in connect'
b'    (self.host,self.port), self.timeout, self.source_address)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/socket.py", line 694, in create_connection'
b'    for res in getaddrinfo(host, port, 0, SOCK_STREAM):'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/socket.py", line 733, in getaddrinfo'
b'    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):'
b'socket.gaierror: [Errno 8] nodename nor servname provided, or not known'
b''
b'During handling of the above exception, another exception occurred:'
b''
b'Traceback (most recent call last):'
b'  File "./download.py", line 75, in <module>'
b'    main(**options.__dict__)'
b'  File "./download.py", line 58, in main'
b'    instance.start()'
b'  File "./download.py", line 50, in start'
b'    urllib.request.urlretrieve(url, filepath)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 188, in urlretrieve'
b'    with contextlib.closing(urlopen(url, data)) as fp:'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 163, in urlopen'
b'    return opener.open(url, data, timeout)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 472, in open'
b'    response = meth(req, response)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 582, in http_response'
b"    'http', request, response, code, msg, hdrs)"
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 504, in error'
b'    result = self._call_chain(*args)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 444, in _call_chain'
b'    result = func(*args)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 696, in http_error_302'
b'    return self.parent.open(new, timeout=req.timeout)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 466, in open'
b'    response = self._open(req, data)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 484, in _open'
b"    '_open', req)"
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 444, in _call_chain'
b'    result = func(*args)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 1297, in https_open'
b'    context=self._context, check_hostname=self._check_hostname)'
b'  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 1256, in do_open'
b'    raise URLError(err)'
b'urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>'
b'make[2]: *** [download] Error 1'
b'make[1]: *** [src/mesa/install] Error 2'
[21:54:21] building mesa, failed, see 'build.log' for error log
Environment variables
================================================================================
AMUSE_DIR	/Users/user/amuse-master
BOOSTLIBS	
CC	gcc
CFLAGS	-g -O2 -fPIC
CUDART_LIBS	-lnocudart
CUDA_LIBDIRS	-L/NOCUDACONFIGURED/lib -LNOCUDACONFIGURED/lib64
CUDA_LIBS	-lnocuda
CUDA_SDK	/NOCUDACONFIGURED
CUDA_TK	/NOCUDACONFIGURED
CXX	g++
CXXFLAGS	-g -O2 -fPIC
F90	gfortran
FC	gfortran
FFLAGS	-g -O2 -fPIC
FFTW_FLAGS	-I/opt/local/include
FFTW_LIBS	-L/opt/local/lib -lfftw3 -lfftw3_threads
FORTRAN	gfortran
GSL_FLAGS	-I/opt/local/include
GSL_LIBS	-L/opt/local/lib -lgsl -lgslcblas -lm
JAR	/usr/bin/jar
JAVA	/usr/bin/java
JAVAC	/usr/bin/javac
MPICC	mpicc
MPICXX	mpicxx
MPIF90	mpif90
MUSE_PACKAGE_DIR	/Users/user/amuse-master
OPENMP_CFLAGS	-fopenmp
OPENMP_FCFLAGS	-fopenmp
PYTHON	/Users/user/opt/anaconda3/envs/amuse/bin/python
SAPPORO_LIBS	-L/Users/user/amuse-master/lib/sapporo_light -lsapporo
Community codes not built (because of errors):
================================================================================
 * mesa
================================================================================
0 out of 1 codes built, 0 out of 0 libraries built
Traceback (most recent call last):
  File "setup.py", line 92, in <module>
    python_requires=">=3.5"
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/user/amuse-master/support/setup_codes.py", line 1214, in run
    BuildCodes.run(self)
  File "/Users/user/amuse-master/support/setup_codes.py", line 1093, in run
    raise Exception("No succesful builds detected. Aborting.")
Exception: No succesful builds detected. Aborting.
make: *** [mesa.code] Error 1
(amuse) user@Samuels-Mac-Pro amuse-master % 


A check of build.log showed
****************************************************************************************************
Building libraries and codes
****************************************************************************************************
****************************************************************************************************
Building code: mesa, target: all, in directory: src/amuse/community/mesa
****************************************************************************************************
amusifier --type=f90 interface.py MESAInterface -o worker_code.f90
make -C . download
rm -f -Rf src
mkdir src
/Users/user/opt/anaconda3/envs/amuse/bin/python ./download.py
downloading version 2208 from http://amuse.strw.leidenuniv.nl/codes/mesa-r2208.tgz to mesa-r2208.tgz
Traceback (most recent call last):
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 1254, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 1253, in connect
    super().connect()
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/socket.py", line 694, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/socket.py", line 733, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./download.py", line 75, in <module>
    main(**options.__dict__)
  File "./download.py", line 58, in main
    instance.start()
  File "./download.py", line 50, in start
    urllib.request.urlretrieve(url, filepath)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 188, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 504, in error
    result = self._call_chain(*args)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 696, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 1297, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/Users/user/opt/anaconda3/envs/amuse/lib/python3.5/urllib/request.py", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
make[2]: *** [download] Error 1
make[1]: *** [src/mesa/install] Error 2
****************************************************************************************************
********************************************************************************
Building finished
********************************************************************************
From the log and from pinging amuse.strw.leidenuniv.nl,

(base) user@Samuels-Mac-Pro ~ % ping amuse.strw.leidenuniv.nl
PING amuse.strw.leidenuniv.nl (132.229.214.36): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
Request timeout for icmp_seq 8
Request timeout for icmp_seq 9
Request timeout for icmp_seq 10
^C
--- amuse.strw.leidenuniv.nl ping statistics ---
12 packets transmitted, 0 packets received, 100.0% packet loss
(base) user@Samuels-Mac-Pro ~ % 

the server is either down or no longer there. What is the correct URL for a version of MESA that can be installed in AMUSE?

Please advise.

Sam Dupree.

@rieder
Copy link
Member

rieder commented Mar 2, 2020

Ah, that is a clear issue then. That server should be working, but clearly it isn't at the moment. I've asked the sysadmin to look into this, will get back to you once it's solved.

@OrbitalMechanic
Copy link
Author

Any status from the sysadmin?

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 11, 2020 via email

@rieder
Copy link
Member

rieder commented Mar 11, 2020

Hi @OrbitalMechanic,
That's strange, the server should be up and is reachable to me (it might not respond to pings though), could you try to download the mesa source files (http://amuse.strw.leidenuniv.nl/codes/mesa-r2208.tgz)?
This is currently working for me.

@rieder
Copy link
Member

rieder commented Mar 11, 2020

To import the current version of MESA into AMUSE will mostly require knowledge of the inner workings of MESA, i.e. how to reach all the information and how to set parameters/properties/etc. We have a tracking issue for this (#520), and we could definitely help with the AMUSE side of the interface.
A starting effort for a more modern MESA interface was made some years ago, but I am unsure where this ended up (@ipelupessy do you know this?).

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 11, 2020 via email

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 11, 2020 via email

@ipelupessy
Copy link
Member

@rieder its at https://github.com/amusecode/amuse-sandbox/tree/master/nathan/mesa6794
this is also quite old though...

@ipelupessy
Copy link
Member

@OrbitalMechanic yea, you need to have the framework build, if you are building from a repository checkout:

make framework

or

python setup.py develop_build

@OrbitalMechanic
Copy link
Author

Doing the framework build followed by the MESA build did the trick. Lastly, I do have one (I hope) final question dealing with testing.

I ran nosetest and got the following result:

(amuse) user@Samuels-Mac-Pro amuse-master % nosetests
EEEEEEEEEEEEEEEEEEEEEEE..--------------------------------------------------------------------------
WARNING: Open MPI failed to TCP connect to a peer MPI process. This
should not happen.

Your Open MPI job may now hang or fail.

Local host: Samuels-Mac-Pro
PID: 18311
Message: connect() to 100.98.14.14:1027 failed
Error: Operation now in progress (36)

I installed Open MPI using homebrew.

Any suggestions?

Sam Dupree.

@ipelupessy
Copy link
Member

ipelupessy commented Mar 12, 2020

can you try:

mpiexec nosetests

(are you trying all nosetests or just mesa ones?)

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 12, 2020 via email

@ipelupessy
Copy link
Member

can you try setting this environment var:

export OMPI_MCA_rmaps_base_oversubscribe=yes

@OrbitalMechanic
Copy link
Author

OrbitalMechanic commented Mar 12, 2020 via email

@ipelupessy
Copy link
Member

do you know if mpi by itself works? e.g.

mpiexec hostname

if this works, can you try an MPI hello world: https://mpitutorial.com/tutorials/mpi-hello-world/
after that: http://mpi.deino.net/mpi_functions/MPI_Comm_spawn.html for testing mpi spawn..
@rieder have you seen such problem on mac?
lastly, you can try putting a file in the amuse root with

[channel]
channel_type = sockets

(this doesn't use MPI)
(btw: putting -sv after nosetests gives a little bit more information, and you can also try to run only the first test that fails:

mpiexec nosetests -sv path/to/testfile.py:testclass.testmethod 

@stale
Copy link

stale bot commented Mar 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues that have been around for a while without updates label Mar 4, 2022
@ipelupessy
Copy link
Member

new mesa has been merged recently, further, this issue has diverged into another error discussion, please reopen this in new issue if necessary. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question stale Issues that have been around for a while without updates
Projects
None yet
Development

No branches or pull requests

3 participants