MCT error Inlet test case on a Mac

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

MCT error Inlet test case on a Mac

#1 Unread post by moritz.wandres »

Hey all,

I'm having troubles compiling the inlet test case.
It might have something to do with how I compiled MCT?!
I'm running ROMS on a Mac (Mountain Lion).
I compiled MCT using

./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++ CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib --prefix=/opt/local --enable-mpiserial

The MCT example cases can be made so it seems like it's all good there.

I compiled my openmpi using

./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++ CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --prefix=/usr/local

When I run the build.bash for the inlet case I get the following error:

USE m_MCTWorld, ONLY : MCTWorld_init => init
1
Fatal Error: Can't open module file 'm_mctworld.mod' for reading at (1): No such file or directory
make: *** [/Users/Hawky/ROMS/Projects/test2//Build/ocean_coupler.o] Error 1


I changed the Darwin-gfortran.mk compiler (saw that in another post) to include the directories of the MCT into

ifdef USE_MCT
MCT_INCDIR ?= /opt/local/include
MCT_LIBDIR ?= /opt/local/lib
FFLAGS += -I$(MCT_INCDIR)
LIBS += -L$(MCT_LIBDIR) -lmct -lmpeu
endif



and now I get the following error:

USE distribute_mod, ONLY : mp_reduce
1
Error: Symbol 'mp_reduce' referenced at (1) not found in module 'distribute_mod'
ocean_coupler.f90:362.57:

Asize=GlobalSegMap_lsize (GSMapROMS, OCN_COMM_WORLD)
1
Error: Symbol 'ocn_comm_world' at (1) has no IMPLICIT type
ocean_coupler.f90:160.49:

CALL MCTWorld_init (Nmodels, MPI_COMM_WORLD, OCN_COMM_WORLD, &
1
Error: Symbol 'mpi_comm_world' at (1) has no IMPLICIT type
ocean_coupler.f90:155.40:

CALL mpi_comm_rank (OCN_COMM_WORLD, MyRank, MyError)
1
Error: Symbol 'ocn_comm_world' at (1) has no IMPLICIT type
make: *** [/Users/Hawky/ROMS/Projects/test2//Build/ocean_coupler.o] Error 1


Any ideas what I did wrong or where the issue might be?
Cheers!
Moritz

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: MCT error Inlet test case on a Mac

#2 Unread post by jcwarner »

"USE m_MCTWorld, ONLY : MCTWorld_init => init
1
Fatal Error: Can't open module file 'm_mctworld.mod' for reading at (1): No such file or directory
make: *** [/Users/Hawky/ROMS/Projects/test2//Build/ocean_coupler.o] Error 1"

I have seen this before. it sounds like issues related to the "make install" portion for MCT. make sure the *.mod files and *.libs for mct have been copied to your
usr/local/include and usr/local/lib (or other apporpriate dirs) and that those dirs are in your path.

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#3 Unread post by moritz.wandres »

Thanks for the answer, as I said before, it was a path error but after setting the paths correctly it still leaves me with this error message:

USE distribute_mod, ONLY : mp_reduce
1
Error: Symbol 'mp_reduce' referenced at (1) not found in module 'distribute_mod'
ocean_coupler.f90:362.57:

Asize=GlobalSegMap_lsize (GSMapROMS, OCN_COMM_WORLD)
1
Error: Symbol 'ocn_comm_world' at (1) has no IMPLICIT type
ocean_coupler.f90:160.49:

CALL MCTWorld_init (Nmodels, MPI_COMM_WORLD, OCN_COMM_WORLD, &
1
Error: Symbol 'mpi_comm_world' at (1) has no IMPLICIT type
ocean_coupler.f90:155.40:

CALL mpi_comm_rank (OCN_COMM_WORLD, MyRank, MyError)
1
Error: Symbol 'ocn_comm_world' at (1) has no IMPLICIT type
make: *** [/Users/Hawky/ROMS/Projects/test2//Build/ocean_coupler.o] Error 1


Could be that I made a mistake in installing OpenMPI?

Thanks for any suggestions.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: MCT error Inlet test case on a Mac

#4 Unread post by jcwarner »

"Error: Symbol 'ocn_comm_world' at (1) has no IMPLICIT type
ocean_coupler.f90:160.49:"

did you define to use MPI in the bash file?

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#5 Unread post by moritz.wandres »

Of course thanks!
I had
USE_OpenMP=on

instead of
USE_MPI=on
USE_MPIF90=on

I guess I got confused with the open MPI. I can compile it now, however I can't run the model.
To run it I type

mpirun -np 4 oceanM ocean_inlet_test.in

and get


Coupled Input File name = ocean_inlet_test.in

MOD_COUPLER - Unable to open variable information file:

Default file is located in source directory.
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 15625 on
node Moritzs-MacBook-Pro.local exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in
the job did. This can cause a job to hang indefinitely while it waits
for all processes to call "init". By rule, if one process calls "init",
then ALL processes must call "init" prior to termination.

2. this process called "init", but exited without calling "finalize".
By rule, all processes that call "init" MUST call "finalize" prior to
exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).


Any ideas?
Cheers,

Moritz

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: MCT error Inlet test case on a Mac

#6 Unread post by jcwarner »

mpirun -np 4 oceanM ocean_inlet_test.in
you need to point to the coupling_inlet_test.in, not the ocean.in

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#7 Unread post by moritz.wandres »

Hi,
Thanks for the help.
I now get the following error:


Node # 0 (pid= 847) is active.
Node # 1 (pid= 848) is active.
[Moritzs-MacBook-Pro.local:848] *** An error occurred in MPI_Gather
[Moritzs-MacBook-Pro.local:848] *** on communicator MPI COMMUNICATOR 3 SPLIT FROM 0
[Moritzs-MacBook-Pro.local:848] *** MPI_ERR_TYPE: invalid datatype
[Moritzs-MacBook-Pro.local:848] *** MPI_ERRORS_ARE_FATAL: your MPI job will now abort
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 848 on
node Moritzs-MacBook-Pro.local exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in
the job did. This can cause a job to hang indefinitely while it waits
for all processes to call "init". By rule, if one process calls "init",
then ALL processes must call "init" prior to termination.

2. this process called "init", but exited without calling "finalize".
By rule, all processes that call "init" MUST call "finalize" prior to
exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[Moritzs-MacBook-Pro.local:00845] 1 more process has sent help message help-mpi-errors.txt / mpi_errors_are_fatal
[Moritzs-MacBook-Pro.local:00845] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

Any idea what I'm doing wrong?

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: MCT error Inlet test case on a Mac

#8 Unread post by jcwarner »

you need to make sure that you launch the job with the same number of procs that are being used. so if you use
mpirun -np 4
then in the coupling.in file you need to assign 4 procs, lets say 2 to roms and 2 to swan. Then you need to make sure the roms ocean.in file has ntileI and ntileJ to be set for 2 procs. you do not need to set anything in the swan input file to set the number of procs, it figures it out.

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#9 Unread post by moritz.wandres »

Thanks for the answer,

in the coupling.in I have

Nthreads(ocean) = 2
Nthreads(waves) = 2

and in the ocean.in I have

NtileI == 2 ! I-direction partition
NtileJ == 1 ! J-direction partition

so it should work? I keep getting the error as above though.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: MCT error Inlet test case on a Mac

#10 Unread post by jcwarner »

maybe if i could see the whole stdout that might help.
-j

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#11 Unread post by moritz.wandres »

Here it is. The PRINT-001 and -002 files and the Errfiles created by SWAN are empty.

Moritzs-MacBook-Pro:test2 Hawky$ mpirun -np 4 oceanM coupling_inlet_test.in

Code: Select all

 Coupled Input File name = coupling_inlet_test.in

 Model Coupling Parallel Threads:

   Ocean Model MPI nodes:   000 - 001
   Waves Model MPI nodes:   002 - 003


   Ocean Export: bath:SSH:Ubar:Vbar:ZO
   Waves Export: Wdir:Wamp:Wlen:Wptop:Wpbot:Wubot


 Model Input Parameters:  ROMS/TOMS version 3.6  
                          Wednesday - May 1, 2013 -  3:52:06 PM
 -----------------------------------------------------------------------------

 Inlet Test Case

 Operating system : Darwin
 CPU/hardware     : x86_64
 Compiler system  : gfortran
 Compiler command : /usr/local/bin/mpif90
 Compiler flags   : -frepack-arrays -O3 -ffast-math -I/usr/local/include -ffree-form -ffree-line-length-none -ffree-form -ffree-line-length-none -ffree-form -ffree-line-length-none

 Input Script  : /Users/Hawky/ROMS/Projects/test2/ocean_inlet_test.in

 SVN Root URL  : https://www.myroms.org/svn/src/trunk
 SVN Revision  : 655M

 Local Root    : /Users/Hawky/ROMS/trunk
 Header Dir    : /Users/Hawky/ROMS/Projects/test2
 Header file   : inlet_test.h
 Analytical Dir: /Users/Hawky/ROMS/Projects/test2

 Resolution, Grid 01: 0075x0070x008,  Parallel Nodes:   2,  Tiling: 002x001


 Physical Parameters, Grid: 01
 =============================

      34560  ntimes          Number of timesteps for 3-D equations.
      5.000  dt              Timestep size (s) for 3-D equations.
         20  ndtfast         Number of timesteps for 2-D equations between
                               each 3D timestep.
          1  ERstr           Starting ensemble/perturbation run number.
          1  ERend           Ending ensemble/perturbation run number.
          0  nrrec           Number of restart records to read from disk.
          T  LcycleRST       Switch to recycle time-records in restart file.
        720  nRST            Number of timesteps between the writing of data
                               into restart fields.
          1  ninfo           Number of timesteps between print of information
                               to standard output.
          T  ldefout         Switch to create a new output NetCDF file(s).
        720  nHIS            Number of timesteps between the writing fields
                               into history file.
 1.0000E-03  nl_visc2        NLM Horizontal, harmonic mixing coefficient
                               (m2/s) for momentum.
 5.0000E-06  Akt_bak(01)     Background vertical mixing coefficient (m2/s)
                               for tracer 01: temp
 5.0000E-06  Akt_bak(02)     Background vertical mixing coefficient (m2/s)
                               for tracer 02: salt
 5.0000E-05  Akv_bak         Background vertical mixing coefficient (m2/s)
                               for momentum.
 3.0000E-04  rdrg            Linear bottom drag coefficient (m/s).
 2.5000E-02  rdrg2           Quadratic bottom drag coefficient.
 1.5000E-02  Zob             Bottom roughness (m).
          1  Vtransform      S-coordinate transformation equation.
          1  Vstretching     S-coordinate stretching function.
 1.0000E+00  theta_s         S-coordinate surface control parameter.
 1.0000E+00  theta_b         S-coordinate bottom  control parameter.
      0.000  Tcline          S-coordinate surface/bottom layer width (m) used
                               in vertical coordinate stretching.
   1025.000  rho0            Mean density (kg/m3) for Boussinesq approximation.
      0.000  dstart          Time-stamp assigned to model initialization (days).
       0.00  time_ref        Reference time for units attribute (yyyymmdd.dd)
 0.0000E+00  Tnudg(01)       Nudging/relaxation time scale (days)
                               for tracer 01: temp
 0.0000E+00  Tnudg(02)       Nudging/relaxation time scale (days)
                               for tracer 02: salt
 0.0000E+00  Znudg           Nudging/relaxation time scale (days)
                               for free-surface.
 0.0000E+00  M2nudg          Nudging/relaxation time scale (days)
                               for 2D momentum.
 0.0000E+00  M3nudg          Nudging/relaxation time scale (days)
                               for 3D momentum.
 0.0000E+00  obcfac          Factor between passive and active
                               open boundary conditions.
          F  VolCons(1)      NLM western  edge boundary volume conservation.
          F  VolCons(2)      NLM southern edge boundary volume conservation.
          F  VolCons(3)      NLM eastern  edge boundary volume conservation.
          F  VolCons(4)      NLM northern edge boundary volume conservation.
     10.000  T0              Background potential temperature (C) constant.
     30.000  S0              Background salinity (PSU) constant.
   1027.000  R0              Background density (kg/m3) used in linear Equation
                               of State.
 1.7000E-04  Tcoef           Thermal expansion coefficient (1/Celsius).
 7.6000E-04  Scoef           Saline contraction coefficient (1/PSU).
      1.000  gamma2          Slipperiness variable: free-slip (1.0) or 
                                                    no-slip (-1.0).
          T  Hout(idFsur)    Write out free-surface.
          T  Hout(idUbar)    Write out 2D U-momentum component.
          T  Hout(idVbar)    Write out 2D V-momentum component.
          T  Hout(idUvel)    Write out 3D U-momentum component.
          T  Hout(idVvel)    Write out 3D V-momentum component.
          T  Hout(idWvel)    Write out W-momentum component.
          T  Hout(idOvel)    Write out omega vertical velocity.
          T  Hout(idTvar)    Write out tracer 01: temp
          T  Hout(idTvar)    Write out tracer 02: salt
          T  Hout(idW2xx)    Write out 2D radiation stress, Sxx.
          T  Hout(idW2xy)    Write out 2D radiation stress, Sxy.
          T  Hout(idW2yy)    Write out 2D radiation stress, Syy.
          T  Hout(idWamp)    Write out wave height.
          T  Hout(idWlen)    Write out wavelength.
          T  Hout(idWdir)    Write out wave direction.

 Output/Input Files:

             Output Restart File:  ocean_rst.nc
             Output History File:  ocean_his.nc
        Physical parameters File:  /Users/Hawky/ROMS/Projects/test2/ocean_inlet_test.in
                 Input Grid File:  inlet_test_grid.nc

 Tile partition information for Grid 01:  0075x0070x0008  tiling: 002x001

     tile     Istr     Iend     Jstr     Jend     Npts

        0        1       38        1       70    21280
        1       39       75        1       70    20720

 Tile minimum and maximum fractional grid coordinates:
   (interior points only)

     tile     Xmin     Xmax     Ymin     Ymax     grid

        0     0.50    38.50     0.50    70.50  RHO-points
        1    38.50    75.50     0.50    70.50  RHO-points

        0     1.00    38.50     0.50    70.50    U-points
        1    38.50    75.00     0.50    70.50    U-points

        0     0.50    38.50     1.00    70.00    V-points
        1    38.50    75.50     1.00    70.00    V-points

 Maximum halo size in XI and ETA directions:

               HaloSizeI(1) =     150
               HaloSizeJ(1) =     243
                TileSide(1) =      75
                TileSize(1) =    3300


 Lateral Boundary Conditions: NLM
 ============================

 Variable               Grid    West Edge   South Edge  East Edge   North Edge
 ---------              ----    ----------  ----------  ----------  ----------

 zeta                     1     ?!O  ?/? L    H%

 ubar                     1     ?!O  ?/? L    H%

 vbar                     1     ?!O  ?/? L    H%

 u                        1     ?!O  ?/? L    H%

 v                        1     ?!O  ?/? L    H%

 temp                     1     ?!O  ?/? L    H%

 salt                     1     ?!O  ?/? L    H%

 Activated C-preprocessing Options:

 INLET_TEST          Inlet Test Case
 ANA_BSFLUX          Analytical kinematic bottom salinity flux.
 ANA_BTFLUX          Analytical kinematic bottom temperature flux.
 ANA_FSOBC           Analytical free-surface boundary conditions.
 ANA_INITIAL         Analytical initial conditions.
 ANA_M2OBC           Analytical 2D momentum boundary conditions.
 ANA_SMFLUX          Analytical kinematic surface momentum flux.
 ANA_SSFLUX          Analytical kinematic surface salinity flux.
 ANA_STFLUX          Analytical kinematic surface temperature flux.
 ASSUMED_SHAPE       Using assumed-shape arrays.
 DJ_GRADPS           Parabolic Splines density Jacobian (Shchepetkin, 2002).
 DOUBLE_PRECISION    Double precision arithmetic.
 FSOBC_REDUCED       Using free-surface data in reduced physics conditions
 MASKING             Land/Sea masking.
 MCT_LIB             Using Model Coupling Toolkit library.
 MIX_S_UV            Mixing of momentum along constant S-surfaces.
 MPI                 MPI distributed-memory configuration.
 NEARSHORE_MELLOR08  Nearshore Radiation Stress Terms (Mellor 2008).
 NONLINEAR           Nonlinear Model.
 !NONLIN_EOS         Linear Equation of State for seawater.
 POWER_LAW           Power-law shape time-averaging barotropic filter.
 PROFILE             Time profiling activated .
 !RST_SINGLE         Double precision fields in restart NetCDF file.
 SOLVE3D             Solving 3D Primitive Equations.
 SPLINES             Conservative parabolic spline reconstruction.
 SWAN_COUPLING       Two-way SWAN/ROMS coupling.
 TS_MPDATA           Recursive flux corrected MPDATA 3D advection of tracers.
 UV_ADV              Advection of momentum.
 UV_U3HADVECTION     Third-order upstream horizontal advection of 3D momentum.
 UV_C4VADVECTION     Fourth-order centered vertical advection of momentum.
 UV_LDRAG            Linear bottom stress.
 UV_VIS2             Harmonic mixing of momentum.
 VAR_RHO_2D          Variable density barotropic mode.
 WAVES_OCEAN         Two-way wave-ocean models coupling.

 Process Information:

 Node #  0 (pid=    1477) is active.
 Node #  1 (pid=    1478) is active.
[Moritzs-MacBook-Pro.local:1478] *** An error occurred in MPI_Gather
[Moritzs-MacBook-Pro.local:1478] *** on communicator MPI COMMUNICATOR 3 SPLIT FROM 0
[Moritzs-MacBook-Pro.local:1478] *** MPI_ERR_TYPE: invalid datatype
[Moritzs-MacBook-Pro.local:1478] *** MPI_ERRORS_ARE_FATAL: your MPI job will now abort
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 1478 on
node Moritzs-MacBook-Pro.local exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in
the job did. This can cause a job to hang indefinitely while it waits
for all processes to call "init". By rule, if one process calls "init",
then ALL processes must call "init" prior to termination.

2. this process called "init", but exited without calling "finalize".
By rule, all processes that call "init" MUST call "finalize" prior to
exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[Moritzs-MacBook-Pro.local:01474] 1 more process has sent help message help-mpi-errors.txt / mpi_errors_are_fatal
[Moritzs-MacBook-Pro.local:01474] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: MCT error Inlet test case on a Mac

#12 Unread post by jcwarner »

i am not sure. you could try to use 1 proc for each model and see if that works. if you are getting an Errfile from SWAN, then something is wrong with the swan input files. if you run w/ just 1 proc for swan, then those files usually get written to.

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: MCT error Inlet test case on a Mac

#13 Unread post by arango »

I just ran the INLET_TEST on my MacBook Pro using gfortran and two CPUs and it finished successfully. I am using the latest version of the code (revision 661) and all the input scripts distributed in the ROMS test repository :arrow: https://www.myroms.org/svn/src/test.

It seems to me that you are doing something that it is inconsistent. The MCT library and ROMS needs to be compiled with the same version of the gfortran compiler and the OpenMPI library. Also, you need to use the appropriate mpirun associated with that version of the OpenMPI library. Many users have problems with this test case because this inconsistency.

I noticed that the ROMS standard output has a lot weird characters when reporting the lateral boundary conditions. It is always useful to put such text in this forum using the Code tag for easy read.

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#14 Unread post by moritz.wandres »

Thanks for the replies.
i am not sure. you could try to use 1 proc for each model and see if that works. if you are getting an Errfile from SWAN, then something is wrong with the swan input files. if you run w/ just 1 proc for swan, then those files usually get written to.
My SWAN output tells me that there's an input file missing. I have defined the locations for inlet_test_grid_coord.grd and inlet_test_bathy.bot though. Any other input files I could be missing?
I just ran the INLET_TEST on my MacBook Pro using gfortran and two CPUs and it finished successfully. I am using the latest version of the code (revision 661) and all the input scripts distributed in the ROMS test repository https://www.myroms.org/svn/src/test.
The INLET_TEST on the site is for sediment transport so I guess I have to modify it to couple ocean_inlet_test.in with swan_inlet_test.in instead of sediment_inlet_test.in?
Is there a chance that there's something wrong with my header file when compiling the model? Here's my header file.

Code: Select all

/*
** svn $Id: inlet_test.h 645 2013-01-22 23:21:54Z arango $
*******************************************************************************
** Copyright (c) 2002-2013 The ROMS/TOMS Group                               **
**   Licensed under a MIT/X style license                                    **
**   See License_ROMS.txt                                                    **
*******************************************************************************
**
** Options for Inlet Test Case, waves-ocean (SWAN/ROMS) two-way coupling.
**
** Application flag:   INLET_TEST
** Input script:       ocean_inlet_test.in
**                     coupling_inlet_test.in
**                     swan_inlet_test.in
*/

#define UV_VIS2
#define MIX_S_UV
#define MASKING
#define UV_ADV
#define TS_MPDATA
#define DJ_GRADPS
#define SOLVE3D
#define SPLINES

#define ANA_INITIAL
#define ANA_SMFLUX
#define ANA_FSOBC
#define ANA_M2OBC
#undef  UV_COR
#define UV_LDRAG
#define FSOBC_REDUCED

#define SWAN_COUPLING
#define NEARSHORE_MELLOR08

#ifdef SOLVE3D

#define GLS_MIXING
#ifdef GLS_MIXING
#  define KANTHA_CLAYSON
#  define N2S2_HORAVG
# endif

#define ANA_STFLUX
#define ANA_SSFLUX
#define ANA_BPFLUX
#define ANA_BTFLUX
#define ANA_BSFLUX
#define ANA_SPFLUX
#define ANA_SRFLUX

#endif

#ifdef SWAN_COUPLING
# define MCT_LIB
#endif
The MCT library and ROMS needs to be compiled with the same version of the gfortran compiler and the OpenMPI library. Also, you need to use the appropriate mpirun associated with that version of the OpenMPI library. Many users have problems with this test case because this inconsistency.
I have compiled MCT using

Code: Select all

./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++ CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --prefix=/usr/local --enable-mpiserial
and openmpi using

Code: Select all

./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++ CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --prefix=/usr/local 
So I'm using the same flags for both. Anything else I could try?

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: MCT error Inlet test case on a Mac

#15 Unread post by arango »

As I mentioned above, you just need to download the test repository and check the inlet_test sub-directory to see how everything is set-up. Check the input scripts and inlet_test/Data sub-directory. You can find all your answers there...

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#16 Unread post by moritz.wandres »

I did download it but the header file says

Code: Select all

** Application flag:   INLET_TEST
** Input script:       ocean_inlet_test.in
**                     coupling_inlet_test.in
**                     sediment_inlet_test.in
and I want to use swan_inlet_test.in as input so I assume I have to modify the header file, which I did, as stated above.

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#17 Unread post by moritz.wandres »

Just a quick update.
Like I suspected, I made the error when compiling MCT.
I compiled MCT without openMPI using --enable-mpiserial
To get it to work I had to compile openmpi first using

Code: Select all

./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++ CC=gcc CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --prefix=/usr/local 
and then MCT using

Code: Select all

./configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --prefix=/usr/local
Now it's all good.

ssorou1
Posts: 10
Joined: Mon Feb 23, 2015 4:29 pm
Location: Louisiana State University

Re: MCT error Inlet test case on a Mac

#18 Unread post by ssorou1 »

Hi,

I have a similar problem with MCT on my mac. I am using macbook late 2009 Core 2 Duo. Procedure for installation of ROMS is followed based on https://www.myroms.org/wiki/ROMS_Mac_Snow_Leopard and The upwelling case is run successfully. Netcdf-3.6.3 is installed using post: viewtopic.php?f=14&t=4156
Openmpi is successfully installed with slight modification from previous post as follows:

$ ./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++45 CC=gcc45 CPPFLAGS=-I/opt/gfortransoft/openmpi/openmpi-1.4.5/include LDFLAGS=-L/opt/gfortransoft/openmpi/openmpi-1.4.5/lib --prefix=/opt/gfortransoft/openmpi/openmpi-1.4.5
$ make -j 4
$ make -j 4 check
$ sudo make install

However, installation of MCT did not work out. I tried various ways for instance:

$ ./configure FC=gfortran F77=gfortran F90=gfortran CXX=g++45 CC=gcc45 CPPFLAGS=-I/opt/gfortransoft/openmpi/openmpi-1.4.5/include LDFLAGS=-L/opt/gfortransoft/openmpi/openmpi-1.4.5/lib --prefix=/opt/gfortransoft/openmpi/openmpi-1.4.5

or

$ ./configure CPPFLAGS=-I/opt/gfortransoft/openmpi/openmpi-1.4.5/include LDFLAGS=-L/opt/gfortransoft/openmpi/openmpi-1.4.5/lib --prefix=/opt/gfortransoft/openmpi/openmpi-1.4.5

The configure part goes well, but when I try make, I get the following error:

$ make
make[1]: Entering directory `/Users/soroush/source_builds/MCT/mpeu'
gfortran -c -I. -I../ -DSYSDARWIN -DCPRGNU -O2 m_mpif.F90
m_mpif.F90:60: Error: Can't open included file 'mpif.h'
make[1]: *** [m_mpif.o] Error 1
make[1]: Leaving directory `/Users/soroush/source_builds/MCT/mpeu'
make: *** [subdirs] Error 2

I very much appreciate any help and advice how to install MCT. Config.log file is also attached.

Many thanks,

Soroush
Attachments
config.log
(28.96 KiB) Downloaded 510 times

moritz.wandres
Posts: 21
Joined: Fri Mar 15, 2013 1:30 pm
Location: UWA Oceans Institute

Re: MCT error Inlet test case on a Mac

#19 Unread post by moritz.wandres »

Hi Soroush,

It looks like it can't find your mpif.h file.
I did a quick google search and it seems like your problem is similar to this one here https://bb.cgd.ucar.edu/node/1001293
Maybe this helps?

ssorou1
Posts: 10
Joined: Mon Feb 23, 2015 4:29 pm
Location: Louisiana State University

Re: MCT error Inlet test case on a Mac

#20 Unread post by ssorou1 »

Moritz,

Thank you very much for your response. I agree that mpif.h is probably not found or read. This file is located in:

$ ll /opt/gfortransoft/openmpi/openmpi-1.4.5/include/
total 288
drwxr-xr-x 9 root wheel 306B May 17 20:53 .
drwxr-xr-x 7 root wheel 238B May 17 20:52 ..
-rw-r--r-- 1 root wheel 108K May 17 20:53 mpi.h
-rw-r--r--@ 1 root wheel 19K May 17 20:53 mpif-common.h
-rw-r--r-- 1 root wheel 3.6K May 17 20:53 mpif-config.h
-rw-r--r--@ 1 root wheel 3.8K May 17 20:53 mpif-mpi-io.h
-rw-r--r-- 1 root wheel 3.6K May 17 20:53 mpif.h
drwxr-xr-x 3 root wheel 102B May 17 20:53 openmpi
drwxr-xr-x 26 root wheel 884B May 17 20:53 vampirtrace

Do you think I need to add something to ./configure to make it work? I tried to add FC=mpi90 CC=mpicc CXX=mpicc without success for instance:

$ ./configure CXX=mpiCC CC=mpicc FC=mpi90 CPPFLAGS=-I/opt/gfortransoft/openmpi/openmpi-1.4.5/include LDFLAGS=-L/opt/gfortransoft/openmpi/openmpi-1.4.5/lib --prefix=/opt/gfortransoft/openmpi/openmpi-1.4.5
checking whether the C compiler works... no
configure: error: in `/Users/soroush/source_builds/MCT':
configure: error: C compiler cannot create executables
See `config.log' for more details

Any thoughts?

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: MCT error Inlet test case on a Mac

#21 Unread post by kate »

It told you to look in the config.log for details. Was there anything of interest there?

ssorou1
Posts: 10
Joined: Mon Feb 23, 2015 4:29 pm
Location: Louisiana State University

Re: MCT error Inlet test case on a Mac

#22 Unread post by ssorou1 »

I looked into my config.log file. There are some other errors found there as follows:

configure:2898: cc -E -I/opt/gfortransoft/openmpi/openmpi-1.4.5/include conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^
1 error generated.
.
.
.
configure:2957: cc -E -I/opt/gfortransoft/openmpi/openmpi-1.4.5/include conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^
1 error generated.
configure:2957: $? = 1
.
.
.
configure:3323: cc -c -g -O2 -I/opt/gfortransoft/openmpi/openmpi-1.4.5/include conftest.c >&5
conftest.c:26:4: error: use of undeclared identifier 'not'
not big endian
^
1 error generated.
.
.
.
./configure: line 1638: mpi90: command not found
configure:3716: $? = 127
configure: failed program was:
| program main
|
| end
configure:3725: result: unknown
configure:3728: error: Fortran could not compile .F90 files


However, I don't have any clue what to add in my configure to overcome them. :(

Config.log file is also attached.
Attachments
config.log
(14.87 KiB) Downloaded 474 times

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: MCT error Inlet test case on a Mac

#23 Unread post by kate »

Ah, this:

Code: Select all

FC=mpi90
should be:

Code: Select all

FC=mpif90

ssorou1
Posts: 10
Joined: Mon Feb 23, 2015 4:29 pm
Location: Louisiana State University

Re: MCT error Inlet test case on a Mac

#24 Unread post by ssorou1 »

Thank you Kate, I made this change yet error persists as follows:

$ ./configure CXX=mpiCC CC=mpicc FC=mpif90 CPPFLAGS=-I/opt/gfortransoft/openmpi/openmpi-1.4.5/include LDFLAGS=-L/opt/gfortransoft/openmpi/openmpi-1.4.5/lib --prefix=/opt/gfortransoft/openmpi/openmpi-1.4.5
checking whether the C compiler works... no
configure: error: in `/Users/soroush/source_builds/MCT':
configure: error: C compiler cannot create executables
See `config.log' for more details


Now it seems that mpicc is not found since in new config.log file I see the following:

configure:2360: checking for C compiler version
configure:2369: mpicc --version >&5
./configure: line 2371: mpicc: command not found
configure:2380: $? = 127
configure:2369: mpicc -v >&5
./configure: line 2371: mpicc: command not found
configure:2380: $? = 127
configure:2369: mpicc -V >&5
./configure: line 2371: mpicc: command not found
configure:2380: $? = 127
configure:2369: mpicc -qversion >&5
./configure: line 2371: mpicc: command not found
configure:2380: $? = 127
configure:2400: checking whether the C compiler works
configure:2422: mpicc -I/opt/gfortransoft/openmpi/openmpi-1.4.5/include -L/opt/gfortransoft/openmpi/openmpi-1.4.5/lib conftest.c >&5
./configure: line 2424: mpicc: command not found


The config.log file is attached.
Attachments
config.log
(6.11 KiB) Downloaded 467 times

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: MCT error Inlet test case on a Mac

#25 Unread post by kate »

Do you have mpicc? What happens when you type "which mpicc" on the command line?

Code: Select all

chinook01 353% which mpicc
/opt/scyld/openmpi/1.10.2/gnu/bin/mpicc

ssorou1
Posts: 10
Joined: Mon Feb 23, 2015 4:29 pm
Location: Louisiana State University

Re: MCT error Inlet test case on a Mac

#26 Unread post by ssorou1 »

Actually, nothing is reported back. Seems I don't have mpicc. I followed the procedure from https://www.myroms.org/wiki/ROMS_Mac_Snow_Leopard and downloaded and installed opemmpi as stated before. Is there any step that I am missing? How can I adjust mpicc?

soroushs-MacBook:~ soroush$ which mpicc
soroushs-MacBook:~ soroush$


Thanks,

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: MCT error Inlet test case on a Mac

#27 Unread post by kate »

I'm using brew to install things on a Mac and its openmpi comes with mpicc:

Code: Select all

Kates-MacBook-Pro:remapping kate$ which mpicc
/usr/local/bin/mpicc
Kates-MacBook-Pro:remapping kate$ ls -l /usr/local/bin/mpicc
lrwxr-xr-x  1 kate  admin  35 May  2 09:24 /usr/local/bin/mpicc@ -> ../Cellar/open-mpi/1.10.2/bin/mpicc

ssorou1
Posts: 10
Joined: Mon Feb 23, 2015 4:29 pm
Location: Louisiana State University

Re: MCT error Inlet test case on a Mac

#28 Unread post by ssorou1 »

Kate,

Thank you very much for your advice. I re-installed openmpi with macports using:

$ sudo port install openmpi

Now everything is ok. After installation, the location of mpicc and mpif90 should be added to paths. For my case The following line is added to .bash_profile:

export PATH=$PATH:/opt/local/libexec/openmpi-mp

Post Reply