Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all 2746 articles
Browse latest View live

Automatic vectorization of a simple loop nest

$
0
0

Hi, everyone.

I have a problem using automatic vectorization in ifort (Version 17.0.4.196 Build 20170411, comes with Parallel Studio XE release 2017.4). I have this simple module with two functions:

  • test1 gets an inout 2D matrix, assumes it is 64-byte aligned, and doubles the entries
  • test2 gets an in 2D matrix, assumes it is 64-byte aligned, allocates a 64-byte aligned second matrix, and copies the entries from the argument to the newly allocated array

The source (attached) uses assume_aligned and align directives. AFAIK, this should in both cases result in aligned memory access. This is the report I get for test1:

      remark #15388: vectorization support: reference fsm(i,j) has aligned access   [ loops.f90(20,11) ]
      remark #15388: vectorization support: reference fsm(i,j) has aligned access   [ loops.f90(20,22) ]
      remark #15305: vectorization support: vector length 8
      remark #15399: vectorization support: unroll factor set to 2
      remark #15309: vectorization support: normalized vectorization overhead 1.000
      remark #15300: LOOP WAS VECTORIZED
      remark #15442: entire loop may be executed in remainder
      remark #15448: unmasked aligned unit stride loads: 1
      remark #15449: unmasked aligned unit stride stores: 1
      remark #15475: --- begin vector cost summary ---
      remark #15476: scalar cost: 6
      remark #15477: vector cost: 0.620
      remark #15478: estimated potential speedup: 6.870
      remark #15488: --- end vector cost summary ---

And this is the report for test2:

      remark #15388: vectorization support: reference F(i,j) has aligned access   [ loops.f90(39,11) ]
      remark #15389: vectorization support: reference fsm(i,j) has unaligned access   [ loops.f90(39,11) ]
      remark #15381: vectorization support: unaligned access used inside loop body
      remark #15305: vectorization support: vector length 8
      remark #15309: vectorization support: normalized vectorization overhead 1.444
      remark #15300: LOOP WAS VECTORIZED
      remark #15442: entire loop may be executed in remainder
      remark #15449: unmasked aligned unit stride stores: 1
      remark #15450: unmasked unaligned unit stride loads: 1
      remark #15475: --- begin vector cost summary ---
      remark #15476: scalar cost: 4
      remark #15477: vector cost: 1.120
      remark #15478: estimated potential speedup: 3.110
      remark #15488: --- end vector cost summary ---

In the second loop the argument matrix reports unaligned access, which I think is wrong. Moreover, the report is the same whether or not I include the assume_aligned and align directives - they don't seem to have any impact. What am I missing here?

FYI, I compile with

ifort -O3 -mavx -fopenmp -qopt-report-phase=vec,loop -qopt-report=5 -qopt-streaming-stores never -mcmodel=medium -c loops.f90

And the code follows:

module loops

  public :: test1, test2

contains

  subroutine test1(fsm, im, jm)
    implicit none
    real, dimension(:,:), intent(inout) :: fsm
    integer, intent(in) :: im, jm
    integer i, j

    !dir$ assume_aligned fsm:64
    do j = 1,jm
       do i = 1,im
          fsm(i,j) = fsm(i,j)*2
       end do
    end do
  end subroutine test1

  subroutine test2(fsm, im, jm)
    implicit none
    real, dimension(:,:), intent(in) :: fsm
    integer, intent(in) :: im, jm
    integer i, j
    real, dimension(:,:), allocatable :: f

    !dir$ assume_aligned fsm:64
    !dir$ attributes align: 64:: f
    allocate(f(im, jm))

    do j = 1,jm
       do i = 1,im
          f(i,j) = fsm(i,j)
       end do
    end do
  end subroutine test2

end module loops

Could anyone shed some light on this?

Thanks a lot!

Marcin


Memory Problem in OpenMP with MPI

$
0
0

Dear Community; 

I am using an hybrid formulation (MPI + OpenMP). When I use MPI with any number of process the computation goes very good and the output subroutine (where I print all my data) goes very well too. I use a collection of gather form my Output/Writing, not very efficient, I know.!!

However, when I use the OpenMP + MPI, the output task of my code stops working with the message (OOM Out of Memory). No matter if I set       setnv OMP_NUM_THREAD = 1 the problem persists. 

I have also used setnv OMP_NUM_THREAD = 2 and inside the code I have tried changing the number of threads using OMP_SET_NUM_THREAD before starting the Output subroutine but still I did not work.  

I was wondering if is there an option or instruction to free the memory from the Threds. I see that even using OMP_SET_NUM_THREADS(1) did not workout. 

What do you recommend me. 

 

problem with create make file with parallel ifort

$
0
0

hi, 

I want to create make file for NICOLE code with ifort 

./create_makefile.py  --compiler=mpif90  --otherflags='-O3 -r8 -xhost -heap-arrays 1600 -ipo'

but this message appears

Autodetected cswitch: -c
Autodetected modsuf: .mod
Autodetected modpath: -I 
**** Using mpif90 ****

Testing system byte order (endianness)
Found little endian system

Testing compiler and flags with Hello World program
Command: mpif90 -O3 -r8 -xhost -heap-arrays 1600 -ipo test.f90
*** ERROR! Your compiler did not produce a suitable executable!

I want help

Version 2011.3.174

$
0
0

One of my clients requires access an older Intel Fortran Compiler: 2011.3.174. It is a stated prerequisite for Linux platform which is required for implementation of a specialized application on Red Hat AS 5 Update 3.

I have found this old thread which states that you can request this version from Intel Premier Support. Is this still accurate?

https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux...

 

implementing LOG1P

$
0
0

Hi,

As everyone knows, log(1+dx) suffers heavily on cancellation errors when dx gets sufficient small. The solution is, as in most other programming languages already implemented, the use of the log1p() function. One common way to implement a workaround DIY is the rewriting of log(1+dx) as:

log1p=log(1+dx)*dx/((1-dx)-1)

The problem with this now is, that most compilers probably optimize it simply back to log(1+dx). Therefore I'd like to ask if there is a safe way to tell the compiler to just not touch this line of code?

Thanks for any advice!

Compatibility of Intel with the classe destroyer and with pointers

$
0
0

I am currently using an open-source code called bspline and available here : https://github.com/jacobwilliams/bspline-fortran.

This code is compiled with GFortran. When I try to compile it with Intel Fortran (2015 version) I got some troubles with the compatibility of the destroyer class.

Is it available in the 2017 version or will it be available soon ?

 

Moreover, the use of pointer in Intel Fortran does not seem to work, for example with the "source":

   type typHOSSurf2Vol

        !!- HOS NWT surf2Vol Type
        type(typHOSNWT)             :: hosNWTSurf2Vol_

        !!- HOS Ocean surf2Vol Type
        type(typHOSOcean)           :: hosOceanSurf2Vol_

        !!- HOS Mesh Pointer
        class(typHOSMesh),allocatable :: ptrHOSMesh_

    end type

      if (this%HOSSolver_.eq."NWT") then
                allocate(this%ptrHOSMesh_), source =this%hosNWTSurf2Vol_%hosMesh_)
            else if (this%HOSSolver_.eq."Ocean") then
                allocate(this%ptrHOSMesh_), source =this%hosOceanSurf2Vol_%hosMesh_)
            endif

where "this" is a class defined elsewhere.

 

Will it be available in a future version ?

Thanks a lot,

 

Maïté

Boundary Run-Time Check Failure for variable

$
0
0

Hi all,

We are investigating a bug in our software and we are getting the following message from the intel fortran compiler:

" Boundary Run-Time Check Failure for variable 'var$1825.0.6'"

A similar issue has already been treated in this forum at https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux... but our problem is somewhat different, so that we could not draw use of the answer there that solved the problem. 

We would like to analyse the variable 'var$1825.0.6 but we do not know how to do it. This seems to be an automatically created variable. How are such variables getting created? Is it possible to evaluate them in for instance in gdb?

Thanks for your help in advance,

Timo

 

 

 

how to run coarray programs with SLURM

$
0
0

I'm trying to port old (working) PBS scripts to SLURM, but not succeeding.

Can anybody share a working SLURM subscription script for coarray distributed memory please.

The best I can do is:

#!/bin/bash

#SBATCH --nodes=2
#SBATCH --tasks-per-node=28
#SBATCH --time=00:30:00
#SBATCH -p test

EXE=testABW.x
export I_MPI_COLL_INTRANODE=pt2pt
module load intel/2017.01
cd $SLURM_SUBMIT_DIR
echo -genvall -genv -np ${SLURM_NTASKS} ./$EXE > xx14.conf
srun -N ${SLURM_NNODES} --nodelist=${SLURM_NODELIST} /bin/hostname > nodes
./$EXE

 

which gives me:

Lmod has detected the following error: The following module(s) are unknown:"languages/intel/2017.01"

Please check the spelling or version number. Also try "module spider ..."

Error in system call pthread_mutex_unlock: Operation not permitted
    ../../src/mpid/ch3/channels/nemesis/netmod/tmi/tmi_poll.c:629
Error in system call pthread_mutex_unlock: Operation not permitted
    ../../src/mpid/ch3/channels/nemesis/netmod/tmi/tmi_poll.c:629
Error in system call pthread_mutex_unlock: Operation not permitted
    ../../src/mpid/ch3/channels/nemesis/netmod/tmi/tmi_poll.c:629
Error in system call pthread_mutex_unlock: Operation not permitted
    ../../src/mpid/ch3/channels/nemesis/netmod/tmi/tmi_poll.c:629

 

Thanks!


LAMMPS 2017 compilation with intel parallel studio XE 2015

$
0
0

Dear users and developers,

Recently, I tried to compile and install LAMMPS-latest release on Ubuntu 16.04 and I exactly followed the instruction given in:
https://linuxcluster.wordpress.com/2016/06/14/compiling-lammps-14may16-w...

I have installed intel parallel studio 2015 XE and I've edited my .bashrc file to include mpiiifort, mpiicc and mpiicpc as my default compilers. Also, I used the following command to compile lammps with intel Makefile:

make intel_cpu_intelmpi -j 8

but unfortunately, during final steps of compilation I face with this particular error given at the end of this email. I googled to find out what was the problem and it seems that there is a conflict between Linux default mpicxx wrapper and the one provided by intel mpicpc. In another community (GPAW), it was suggested that all the links that include openmp should be deleted in Makefile so this conflict never happens. But as I searched in .../Makefile & .../MAKE/OPTIONS/Makefile.intel_cpu, I couldn't find the specific lines pointing to shared libraries that cause this conflict. Can you help me solve this problem?
Also, I've succefully installed several other unix-based packages such as VASP, Quantum Espresso, Prophet and ... with my current OS, so I believe my compilers are okay.

---- error part of compilation

mpiicpc -g -qopenmp -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -L../../lib/reax -L../../lib/poems -L../../lib/meam -L/opt/intel/fce/10.0.023/lib pair_lj_gromacs_coul_gromacs_omp.o nstencil_half_bin_3d_newtoff.o dihedral_opls_intel.o npair_half_size_nsq_newtoff.o pppm_disp_intel.o pair_buck.o fix_controller.o fix_drag.o pair_adp.o fix_nph_body.o pair_resquared_omp.o pair_lj_cut_coul_dsf_omp.o pair_buck_coul_cut_omp.o pair_rebo.o fix_temp_csvr.o npair_full_multi.o lattice.o fix_rigid_nve.o displace_atoms.o npair_full_nsq.o pair_lj_cut_omp.o pppm_cg_omp.o molecule.o pair_buck_coul_long.o pair_tip4p_long_omp.o compute_angle_local.o region_plane.o fix_srd.o dihedral_opls.o npair_half_respa_nsq_newtoff_omp.o fix_append_atoms.o pair_born_coul_long_cs.o create_box.o bond_quartic_omp.o compute_com.o output.o angle_harmonic.o compute_temp_sphere.o nstencil_half_ghost_bin_2d_newtoff.o update.o angle_harmonic_omp.o pair_coul_cut_omp.o image.o bond.o fix_npt_asphere.o fix_bond_create.o pair_tersoff_mod_c_omp.o fix_wall.o fix_omp.o pair_gw_zbl.o pair_beck.o pair_lj_cubic_omp.o pair_nm_cut_coul_cut.o fix_rigid_nh_small.o fix_nphug_omp.o pair_lj_charmm_coul_charmm_implicit.o pppm_cg.o random_mars.o improper_cvff_omp.o npair_half_size_bin_newton_tri_omp.o npair_half_respa_bin_newton_tri_omp.o npair_half_nsq_newtoff.o memory.o fix_ave_time.o fix_nve.o pair_lj_class2_coul_cut.o pair_gw.o comm_brick.o pair_lj_charmm_coul_long_intel.o timer.o pair_vashishta_table_omp.o npair_full_bin_atomonly.o dump.o compute_temp_cs.o pair_lj_cut_tip4p_long_opt.o compute_erotate_asphere.o angle_cosine_omp.o nstencil_half_ghost_bin_3d_newtoff.o min_quickmin.o dihedral_charmm.o dump_xtc.o compute_rigid_local.o improper_zero.o compute_contact_atom.o bond_nonlinear_omp.o region_sphere.o pair_lubricateU_poly.o region_intersect.o fix_restrain.o fix_langevin.o finish.o compute_angmom_chunk.o body.o dihedral.o bond_nonlinear.o fix_evaporate.o fix.o fix_nph_asphere_omp.o neigh_list.o fix_ave_correlate.o compute_msd_chunk.o compute_sna_atom.o npair_full_bin.o compute_dilatation_atom.o pppm_tip4p_omp.o fix_rigid_nvt_omp.o npair_half_size_bin_newtoff_omp.o npair_half_respa_bin_newtoff_omp.o compute_reduce.o fix_rigid_npt_small.o region.o improper.o fix_store_state.o fix_nvt_intel.o pair_lj96_cut.o compute_plasticity_atom.o pair_nm_cut_coul_long.o nstencil_half_bin_2d_newton.o pair_tersoff_intel.o compute_cna_atom.o improper_hybrid.o npair_half_respa_nsq_newton.o create_bonds.o fix_temp_rescale.o pair_lubricateU.o neighbor.o fix_spring_rg.o dump_custom_mpiio.o pair_tersoff_mod_c.o fix_rigid_nph_small.o pair_polymorphic.o write_restart.o fix_vector.o fix_nve_asphere_noforce.o dihedral_multi_harmonic.o nbin.o write_coeff.o fix_nph_asphere.o min_cg.o fix_halt.o pppm_omp.o procmap.o compute_gyration.o pppm_tip4p.o npair_half_size_bin_newtoff.o npair_half_respa_bin_newtoff.o pair_lj_cut_coul_long_intel.o bond_table_omp.o fix_orient_bcc.o dihedral_class2_omp.o pair_lj_long_dipole_long.o compute_erotate_sphere.o dihedral_opls_omp.o compute_temp_profile.o npair_half_bin_newton_intel.o math_special.o angle_harmonic_intel.o pair_resquared.o ntopo_dihedral_template.o pair_eam_alloy_omp.o pair_rebo_omp.o npair_half_bin_newtoff_omp.o compute_vacf.o fix_rigid_nve_omp.o fix_ave_histo.o npair_full_nsq_omp.o fix_rigid_nvt.o reader_xyz.o pair_buck_coul_long_omp.o improper_harmonic_intel.o npair_full_bin_atomonly_omp.o npair_full_bin_ghost.o npair_halffull_newton_omp.o pair_dsmc.o angle_cosine.o pair_lj_cut_dipole_cut_omp.o fix_deform.o pair_lj_charmm_coul_charmm.o dump_cfg_mpiio.o atom.o thr_omp.o nstencil_half_multi_2d_newton.o pair_born_coul_long_omp.o fix_wall_harmonic.o pair_lj_expand_omp.o ewald_disp.o pair_lj_cut_dipole_long.o compute_chunk_atom.o compute_ke_atom.o pppm_intel.o math_extra.o compute_ke_rigid.o tad.o pair_gauss.o fix_rigid_nve_small.o pair_soft.o pair_eam_omp.o nstencil_full_multi_3d.o pair_gran_hertz_history_omp.o fix_poems.o fix_atom_swap.o library.o npair_half_size_bin_newton_omp.o npair_half_respa_bin_newton_omp.o bond_fene_omp.o fix_rigid_nh.o compute_temp_body.o pair_lj_long_coul_long_omp.o fix_spring_self.o dihedral_multi_harmonic_omp.o fix_nve_noforce.o pair_hybrid.o npair_half_multi_newtoff_omp.o pair_lj_charmm_coul_msm_omp.o angle_hybrid.o compute_angle.o fix_shear_history.o fix_planeforce.o pair_lj_cut_coul_cut_omp.o npair_half_nsq_newtoff_omp.o compute_pressure.o fix_gcmc.o nstencil_half_multi_3d_newton.o npair_skip_size_off2on.o min_hftn.o improper_class2.o fix_nvt_asphere_omp.o pair_zero.o compute_temp_region.o pair_vashishta_omp.o fix_qeq_comb.o fix_wall_srd.o fix_nh_omp.o fix_event_prd.o pair_buck_intel.o pair_mie_cut.o fix_nve_limit.o atom_vec.o dihedral_harmonic_omp.o pair_tersoff_zbl.o bond_hybrid.o pair_lj_long_coul_long.o improper_umbrella_omp.o compute_stress_atom.o fix_respa.o integrate.o angle_cosine_delta_omp.o fix_cmap.o pair_coul_msm_omp.o pair_eam.o npair_halffull_newtoff_omp.o angle_class2_omp.o fix_shake.o dump_image.o pair_tip4p_cut_omp.o npair_half_respa_bin_newton.o pair_buck_coul_long_intel.o compute_property_atom.o npair_half_bin_newton_tri_omp.o compute_temp.o compute_temp_asphere.o pair_buck_omp.o atom_vec_line.o pair_lj_cut_coul_long_cs.o msm_cg.o npair_half_multi_newtoff.o pair_tip4p_long.o fix_ttm.o pair_nm_cut_omp.o delete_atoms.o ntopo_dihedral_partial.o pair_sw.o npair_half_multi_newton_tri.o pair_lj_long_tip4p_long_omp.o compute_dihedral.o fix_python.o dihedral_charmmfsw.o fix_nvt_asphere.o pair_tersoff_zbl_omp.o npair_half_bin_newtoff_ghost.o compute_event_displace.o compute_body_local.o compute_improper_local.o prd.o compute_msd_nongauss.o sna.o fix_gld.o compute_ke.o npair_half_respa_bin_newton_tri.o npair_half_size_nsq_newton_omp.o compute_group_group.o atom_vec_molecular.o angle_cosine_squared.o fix_group.o pair_buck_coul_cut_intel.o angle_zero.o fix_dt_reset.o fix_qeq_point.o pair_lj_class2.o atom_vec_angle.o angle_class2.o pair_lj_charmm_coul_charmm_omp.o pair_airebo.o pair_snap.o pair_hbond_dreiding_morse.o npair_half_bin_newton_tri.o pair_lj_class2_coul_cut_omp.o dump_local.o fix_event.o pair_coul_wolf_omp.o pair_coul_long.o pair_gauss_omp.o write_data.o pair_lj_class2_coul_long.o fix_ave_histo_weight.o bond_harmonic_intel.o fix_nvt_sphere_omp.o pair_gran_hooke_history_omp.o improper_harmonic_omp.o pppm_disp_tip4p_omp.o universe.o npair_full_bin_ghost_omp.o fix_external.o compute_vcm_chunk.o compute_property_chunk.o pair_python.o pair_nm_cut.o special.o npair_half_respa_nsq_newton_omp.o compute_reduce_region.o ntopo_bond_all.o improper_umbrella.o domain.o fix_intel.o dump_atom_gz.o npair_copy.o pair_lj_cut_tip4p_long_omp.o verlet_lrt_intel.o ntopo_angle_partial.o npair_intel.o fix_qeq_fire.o nbin_standard.o pair_lj_expand.o improper_cvff_intel.o fix_wall_piston.o pair_tri_lj.o bond_quartic.o imbalance_var.o ntopo_improper_all.o pair_peri_eps.o fix_nve_tri.o compute_dihedral_local.o fix_oneway.o fix_wall_colloid.o change_box.o pair_born_omp.o region_prism.o nstencil_half_bin_3d_newton.o pair_coul_streitz.o fix_spring_chunk.o angle_cosine_squared_omp.o pppm_disp_tip4p.o improper_class2_omp.o pair_lj_smooth.o atom_vec_bond.o pair_lj_long_tip4p_long.o nstencil_full_multi_2d.o pair_lj_long_coul_long_intel.o comm_tiled.o pair_hybrid_overlay.o comm.o compute_damage_atom.o pair_lj_cut.o fix_minimize.o read_dump.o thermo.o run.o group.o fix_nve_sphere_omp.o pair_lj_charmm_coul_long.o bond_harmonic_omp.o fix_balance.o ntopo_angle_template.o fix_nvt.o pair_coul_wolf.o fix_wall_gran_omp.o fix_heat.o pair_lj_cut_coul_msm_omp.o fix_adapt.o dump_atom_mpiio.o pair_nm_cut_coul_long_omp.o pair_lj_cut_intel.o pair_lj_cut_tip4p_cut_omp.o fix_temp_berendsen.o fix_rigid_small_omp.o fix_rattle.o fix_npt_omp.o pair_born.o pair_buck_coul_msm_omp.o pair_lj_cut_tip4p_long.o nstencil_full_bin_2d.o fix_ave_chunk.o pair_lj_cut_coul_debye_omp.o compute_msd.o fix_nve_omp.o fix_nve_body.o pair_gayberne_intel.o fix_viscosity.o dihedral_class2.o fix_qeq_dynamic.o fix_viscous.o pair_morse_opt.o fix_wall_region.o pppm_disp.o min_fire.o pair_born_coul_long.o fix_qeq_comb_omp.o pair_vashishta.o pair_gayberne.o npair_full_nsq_ghost.o fix_move.o fix_nve_sphere.o bond_harmonic.o remap.o region_cone.o dump_custom_gz.o pair_dpd_tstat_omp.o npair_full_bin_intel.o fix_nve_asphere.o fix_wall_gran.o pair_peri_pmb.o pair_lj_cut_coul_msm.o fix_bond_break.o pair_coul_long_omp.o dump_cfg_gz.o pair_coul_msm.o fix_rigid_small.o npair_full_nsq_ghost_omp.o create_atoms.o pppm.o imbalance_neigh.o neb.o dump_xyz.o write_dump.o ntopo.o gridcomm.o atom_map.o replicate.o ntopo_angle_all.o pair_lj_charmm_coul_msm.o angle_cosine_periodic_omp.o imbalance_store.o pair_comb_omp.o fix_indent.o fix_rigid_nph_omp.o angle_charmm_omp.o fix_deposit.o modify.o pair_buck_long_coul_long_omp.o fix_spring.o angle_cosine_delta.o fix_nvt_sllod_intel.o compute_erotate_sphere_atom.o pair_sw_omp.o input.o rcb.o balance.o fix_npt_sphere_omp.o fix_pour.o fix_property_atom.o msm_cg_omp.o pair_lj_cut_coul_dsf.o compute_global_atom.o pair_lj_gromacs_omp.o pair_eam_opt.o fix_nve_line.o atom_vec_charge.o npair_full_multi_omp.o remap_wrap.o error.o pair_lj_cubic.o fix_nvt_omp.o compute_displace_atom.o npair.o pair_body.o compute_snad_atom.o npair_half_bin_newton.o pair_coul_debye_omp.o verlet_split.o main.o improper_cvff.o nstencil_half_multi_3d_newtoff.o velocity.o nstencil_full_bin_3d.o pair_airebo_morse_omp.o region_union.o pair_peri_lps_omp.o angle_charmm.o citeme.o fix_npt.o fix_npt_asphere_omp.o fix_orient_fcc.o compute_inertia_chunk.o pair_buck_long_coul_long.o fix_nh_sphere_omp.o npair_half_multi_newton_tri_omp.o fix_addforce.o fix_bond_swap.o pair_gayberne_omp.o random_park.o set.o pair_hbond_dreiding_lj.o fix_npt_sphere.o region_cylinder.o compute_rdf.o pair_brownian_poly_omp.o compute_erotate_rigid.o npair_full_bin_omp.o pair_lj_gromacs.o compute_bond.o pair_lj_charmmfsw_coul_long.o pair_morse_omp.o fix_lineforce.o pair_hbond_dreiding_morse_omp.o restart_mpiio.o intel_buffers.o pair_eam_intel.o pair_eam_fs_omp.o python_impl.o compute_torque_chunk.o pair.o bond_fene_intel.o angle.o fix_nh_asphere_omp.o pair_colloid_omp.o fix_freeze.o nstencil_half_bin_3d_newton_tri.o compute_improper.o fix_nph_sphere.o pair_born_coul_msm_omp.o nstencil_half_bin_2d_newtoff.o pair_airebo_morse.o pair_peri_lps.o pair_sw_intel.o pair_lj_charmm_coul_charmm_implicit_omp.o ewald_omp.o pair_yukawa_omp.o fix_qeq.o pair_brownian_omp.o pppm_disp_omp.o pair_comb3.o npair_half_multi_newton_omp.o compute.o pair_lj_cut_coul_debye.o npair_half_nsq_newton_omp.o fix_peri_neigh.o atom_vec_sphere.o dihedral_helix_omp.o fix_nph_omp.o dump_dcd.o npair_half_bin_atomonly_newton_omp.o fix_nph_sphere_omp.o fix_nh_intel.o verlet.o compute_centro_atom.o pair_lj96_cut_omp.o pair_eam_fs.o min_sd.o pair_adp_omp.o pair_lj_charmm_coul_long_opt.o compute_ti.o kspace.o compute_temp_chunk.o atom_vec_ellipsoid.o npair_half_bin_newton_tri_intel.o pair_born_coul_dsf.o pair_colloid.o pair_coul_cut.o pair_born_coul_msm.o fix_rigid_nph.o fix_rigid_omp.o compute_temp_com.o atom_vec_full.o fix_event_tad.o pair_reax.o pair_yukawa.o compute_temp_ramp.o imbalance_time.o pair_eim_omp.o pair_yukawa_colloid_omp.o nstencil_full_ghost_bin_3d.o pair_brownian.o pair_eam_alloy_opt.o msm_omp.o rerun.o npair_half_multi_newton.o fix_neb.o pair_buck_coul_long_cs.o pair_lj_gromacs_coul_gromacs.o atom_vec_atomic.o pair_brownian_poly.o npair_half_nsq_newton.o pair_tersoff_omp.o dihedral_helix.o npair_half_bin_newtoff_ghost_omp.o compute_cluster_atom.o dihedral_hybrid.o pair_comb.o npair_half_bin_atomonly_newton.o dump_atom.o fix_deprecated.o compute_orientorder_atom.o bond_zero.o pair_lj_class2_coul_long_omp.o pair_born_coul_wolf_omp.o pair_dpd_tstat.o fix_nve_asphere_intel.o atom_vec_peri.o pair_lj_cut_dipole_cut.o compute_temp_partial.o dump_cfg.o pair_coul_debye.o force.o fix_qeq_shielded.o pair_coul_dsf_omp.o dihedral_zero.o compute_slice.o pair_vashishta_table.o atom_vec_dipole.o python.o pair_eam_fs_opt.o fix_ave_atom.o bond_class2_omp.o fix_wall_lj126.o fix_nvt_sphere.o info.o npair_half_bin_newton_omp.o compute_pe_atom.o atom_vec_tri.o fix_temp_csld.o compute_gyration_chunk.o pair_lj_cut_coul_long_omp.o pair_yukawa_colloid.o dump_xyz_gz.o fix_nh_body.o fix_gravity.o irregular.o fix_rigid_npt_omp.o xdr_compat.o npair_half_size_bin_newton_tri.o npair_half_respa_nsq_newtoff.o fix_thermal_conductivity.o npair_skip_size_off2on_oneside.o fix_tfmc.o fft3d_wrap.o fix_setforce.o pair_gran_hooke_omp.o thr_data.o dihedral_charmm_omp.o min.o nstencil_half_multi_2d_newtoff.o pppm_stagger.o domain_omp.o fix_tune_kspace.o pair_lj_smooth_omp.o minimize.o fix_nh_sphere.o variable.o fix_recenter.o fix_nvt_body.o fix_wall_lj93.o fix_msst.o npair_skip.o reader.o pair_coul_dsf.o temper.o fix_box_relax.o respa_omp.o read_restart.o pair_zbl_omp.o imbalance.o bond_class2.o reader_native.o pair_nm_cut_coul_cut_omp.o pair_born_coul_wolf.o fix_wall_lj1043.o pair_nb3b_harmonic_omp.o compute_dipole_chunk.o compute_pair.o fix_npt_body.o pair_lubricate_poly_omp.o pair_lj_cut_coul_long.o fix_nh.o pair_morse.o dihedral_harmonic.o dihedral_harmonic_intel.o pair_lj_charmm_coul_long_omp.o compute_hexorder_atom.o fix_rigid_npt.o bond_morse_omp.o pair_peri_pmb_omp.o fix_aveforce.o npair_halffull_newtoff.o pair_meam.o nstencil_half_bin_2d_newton_tri.o pair_lj_smooth_linear_omp.o pair_gran_hooke.o atom_vec_body.o fix_npt_intel.o neigh_request.o compute_snav_atom.o pair_zbl.o pair_lj_class2_omp.o fix_wall_gran_region.o pair_table_omp.o improper_harmonic.o pair_lj_long_coul_long_opt.o read_data.o angle_table_omp.o compute_pair_local.o fix_enforce2d.o compute_temp_deform.o lammps.o body_nparticle.o respa.o pair_tersoff_mod_omp.o pair_nb3b_harmonic.o fix_rigid.o dump_custom.o npair_half_size_nsq_newton.o bond_fene_expand_omp.o fix_nve_intel.o fft3d.o compute_pe.o pair_lj_cut_opt.o msm.o fix_read_restart.o imbalance_group.o nstencil.o pair_tersoff.o bond_morse.o npair_skip_size.o npair_half_bin_newtoff.o bond_fene.o pair_lj_cut_tip4p_cut.o fix_nph.o pair_lj_smooth_linear.o npair_half_nsq_newtoff_ghost_omp.o compute_heat_flux.o pair_lj_cut_coul_long_opt.o dihedral_charmm_intel.o pair_coul_long_cs.o pair_lubricate_omp.o pair_eim.o pair_table.o pair_born_coul_dsf_cs.o compute_omega_chunk.o pair_lubricate_poly.o angle_table.o pair_beck_omp.o dump_xyz_mpiio.o npair_halffull_newton.o fix_ehex.o nstencil_full_ghost_bin_2d.o angle_charmm_intel.o delete_bonds.o bond_table.o pair_tersoff_mod.o pair_dpd_omp.o pair_line_lj.o fix_nphug.o region_block.o fix_rigid_nvt_small.o fix_gravity_omp.o pair_bop.o bond_fene_expand.o pair_buck_coul_cut.o fix_nvt_sllod_omp.o ntopo_improper_partial.o npair_half_nsq_newtoff_ghost.o compute_bond_local.o ewald.o compute_com_chunk.o pair_buck_coul_msm.o min_linesearch.o pair_airebo_omp.o atom_vec_hybrid.o pair_peri_ves.o nbin_intel.o pair_gran_hooke_history.o fix_press_berendsen.o fix_peri_neigh_omp.o pair_soft_omp.o pair_lj_charmmfsw_coul_charmmfsh.o fix_qeq_slater.o compute_coord_atom.o fix_reax_bonds.o fix_efield.o fix_print.o pair_lubricate.o atom_vec_template.o fix_rigid_nh_omp.o fix_wall_reflect.o nstencil_half_multi_3d_newton_tri.o ntopo_bond_template.o fix_shear_history_omp.o npair_skip_respa.o pair_lcbop.o pair_dpd.o npair_half_size_bin_newton.o pair_tip4p_cut.o pair_lj_cut_coul_cut.o dump_movie.o nstencil_half_multi_2d_newton_tri.o pair_eam_alloy.o fix_nvt_sllod.o ntopo_dihedral_all.o ntopo_improper_template.o pair_hbond_dreiding_lj_omp.o fix_tmd.o compute_property_local.o fix_momentum.o fix_nh_asphere.o pair_gran_hertz_history.o fix_store_force.o angle_cosine_periodic.o ntopo_bond_partial.o npair_half_size_nsq_newtoff_omp.o fix_store.o -lreax -lpoems -lmeam -L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64/ -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lifcore -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -lifcore -lsvml -lompstub -limf -lz -ltbbmalloc -o ../lmp_intel_cpu_intelmpi
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `PMPIX_Comm_group_failed'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Datatype_builtin'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Type_contiguous'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Type_free_impl'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Grequest_set_lang_f77'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Wtime_todouble'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_CommGetAttr_fort'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_WinGetAttr'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIU_Handle_get_ptr_indirect'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpicxx.so: undefined reference to `MPIR_Op_set_cxx'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpicxx.so: undefined reference to `MPIR_Keyval_set_proxy'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Type_commit'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Wtick'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPI_WEIGHTS_EMPTY'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_TypeSetAttr'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Err_create_code'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Err_preOrPostInit'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_TypeGetAttr'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Datatype_direct'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_WinSetAttr'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_b_use_gettimeofday'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_CommSetAttr'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Datatype_mem'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Process'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPI_UNWEIGHTED'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `PMPIX_Comm_reenable_anysource'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPID_Datatype_set_contents'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Add_finalize'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `PMPIX_Comm_remote_group_failed'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpifort.so: undefined reference to `MPIR_Err_return_comm'
/opt/intel//impi/5.0.1.035/intel64/lib/libmpicxx.so: undefined reference to `MPIR_Errhandler_set_cxx'
size ../lmp_intel_cpu_intelmpi
size: '../lmp_intel_cpu_intelmpi': No such file
Makefile:92: recipe for target '../lmp_intel_cpu_intelmpi' failed
make[1]: *** [../lmp_intel_cpu_intelmpi] Error 1
make[1]: Leaving directory '/home/koma/software/lammps-2017/compile/lammps-11Aug17/src/Obj_intel_cpu_intelmpi'
Makefile:158: recipe for target 'intel_cpu_intelmpi' failed
make: *** [intel_cpu_intelmpi] Error 2

intel MPI codes fails with more than 1 node

$
0
0

For a simple mpi program compiled with Intel compiler studio 2016 and 2017, with intel compiler and mpi, the jobs fail with the following debug errors. The code will run extremely slowly, and get stuck for about 30 seconds at one stage if run on 2 or more nodes. It runs smoothly without any problems on a single node. The same code compiled with gcc and openmpi runs smoothly without any problem on any number of nodes.

Do you know what might be the problem? Thanks.

AttachmentSize
Downloadapplication/octet-streamerror.log35.2 KB

polymorphic variables: assignment "poly = a" and "a = poly"

$
0
0

Hello, I'm discovering the pleasures of the OOP and I'm faced with a problem depending on the compiler (ifort vs gfortran).  Consider this first simple module:

module typedefs
   implicit none

   type base_t
      integer :: i = 0
   end type base_t

   type, extends(base_t) :: ext1_t
      integer :: j = 0
   contains
      procedure :: ext1EqCl
      generic :: assignment(=) => ext1EqCl
   end type ext1_t

   interface assignment(=)
      module procedure generic_assign
   end interface

contains

   subroutine generic_assign (lhs, rhs)
      class(base_t), intent(in )              :: rhs
      class(base_t), intent(out), allocatable :: lhs
      print*,'--> generic_assign'
      allocate (lhs, source=rhs)
   end subroutine generic_assign

   subroutine ext1EqCl (lhs, rhs)
      class(base_t), intent(in ) :: rhs
      class(ext1_t), intent(out) :: lhs
      print*,'--> ext1EqCl'
      select type(rhs)
         type is (ext1_t)
            lhs%i = rhs%i ; lhs%j = rhs%j
      end select
   end subroutine ext1EqCl

end module typedefs

program test

   use typedefs
   implicit none
   class(base_t), allocatable :: p
   type(ext1_t) :: a1

   print '(/,a)','*** do : a1 = ext1_t (1,2) ***'
   a1 = ext1_t (1,2)

   print '(/,a)','***  do : p = a1 ***'
   p = a1

   print '(/,a)','*** do : a1 = p ***'
   a1 = p ; print*,'a1 =',a1

end program test

It compiles and works well with ifort, producing the obvious outputs:

*** do : a1 = ext1_t (1,2) ***

 --> ext1EqCl

 

***  do : p = a1 ***

 --> generic_assign

 

*** do : a1 = p ***

 --> ext1EqCl

 a1 =           1           2

 

But it doesn't compile with gfortran, producing the error: Ambiguous interfaces in intrinsic assignment operator for « generic_assign » at (1) and « ext1eqcl » at (2).

If I remove the generic assignment from ext1 and I add the procedure ext1EqCl in the assignment interface as in the following version of typedefs module:

module typedefs
   implicit none

   type base_t
      integer :: i = 0
   end type base_t

   type, extends(base_t) :: ext1_t
      integer :: j = 0
   end type ext1_t

   interface assignment(=)
      module procedure generic_assign
      module procedure ext1EqCl
   end interface

contains

   subroutine generic_assign (lhs, rhs)
      class(base_t), intent(in )              :: rhs
      class(base_t), intent(out), allocatable :: lhs
      print*,'--> generic_assign'
      allocate (lhs, source=rhs)
   end subroutine generic_assign

   subroutine ext1EqCl (lhs, rhs)
      class(base_t), intent(in ) :: rhs
      type (ext1_t), intent(out) :: lhs
      print*,'--> ext1EqCl'
      select type(rhs)
         type is (ext1_t)
            lhs%i = rhs%i ; lhs%j = rhs%j
      end select
   end subroutine ext1EqCl

end module typedefs

it compiles and works well with gfortran but not with ifort ( error #6745: The type/rank signature for the arguments of this specific subroutine matches another specific subroutine that shares the same defined ASSIGNMENT.   [EXT1EQCL]).

Thank you very much for your time.

ps: ifort --version:  ifort (IFORT) 15.0.3 20150408     gfortran --version: GNU Fortran (GCC) 6.3.0

 

 

 

A little problem

$
0
0

Hi, everyone. Is there a way to control the name of compiled .mod files ? we can use -o option to set the name of object file, so is there a similar way for module files then ? Thanks.

segfault when printing string component

$
0
0

The following "minimal example" causes a segfault if compiled with ifort 17.0.4 20170411 on 64-bit Linux (Ubuntu 16.04)

goerz@mlhpc2:~> uname -a
Linux mlhpc2 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

This is on a machine with 80 cores, the CPU information on the highest core is

processor : 79
vendor_id : GenuineIntel
cpu family : 6
model : 47
model name : Intel(R) Xeon(R) CPU E7- 4870 @ 2.40GHz
stepping : 2
microcode : 0x37
cpu MHz : 1064.000
cache size : 30720 KB
physical id : 7
siblings : 10
core id : 9
cpu cores : 10
apicid : 242
initial apicid : 242
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm epb tpr_shadow vnmi flexpriority ept vpid dtherm ida arat
bugs : clflush_monitor
bogomips : 4788.04
clflush size : 64
cache_alignment : 64
address sizes : 44 bits physical, 48 bits virtual

The program (see also attachment) reads as follows:

program test
implicit none

integer, parameter :: sparsity_model_l = 10
integer, parameter :: op_subspace_l = 5
!integer, parameter :: op_subspace_l = 10 ! This works

type op_matrix_t
character(len=sparsity_model_l) :: sparsity_model
character(len=op_subspace_l) :: subspace
end type op_matrix_t

type(op_matrix_t) :: obs

call debug_op_matrix_t(obs) ! works (but not needed)
obs%sparsity_model = '' ! commenting out either one ...
obs%subspace = '' ! ... of these lines makes it work
call debug_op_matrix_t(obs) ! crashes when printing subspace

contains

subroutine debug_op_matrix_t(var)
type(op_matrix_t), intent(in) :: var
write(*,'("obs = {")')
write(*,'(A,A,A)') ' sparsity_model', ' = ', "'"//trim(var%sparsity_model)//"'"
write(*,'(A,A,A)') ' subspace ', ' = ', "'"//trim(var%subspace)//"'"
write(*,'("}")')
end subroutine debug_op_matrix_t

end program test

The program was compiled with `ifort test.f90` and run as `./a.out`. In order to try to get slightly more information, I also compiled with `ifort -O0 -g -warn all -check all -debug all -traceback test.f90`, without any change in behavior. An example output is in the attachment, out1.txt

The crash occurs after initializing the `subspace` component with the empty string, and then printing out the data structure. The problem disappears when setting `op_subspace_l` to 10 instead of 5. It also works with other compilers, or other versions of ifort (I tried ifort 11). Is this a compiler bug?

Occasionally, the crash message changes. One message that was particularly concise was

goerz@mlhpc2:~> ./a.out
obs = {
subspace = ''
}
obs = {
a.out: malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)

AttachmentSize
Downloadapplication/octet-streamtest.f90948 bytes
Downloadtext/plainout1.txt5.17 KB

Syntax error. found END-OF-FILE when expecting one of:

$
0
0

I am porting Fortran 77 to Fortran 90.   I am getting the following syntax error:

source.i(4): error #5082: Syntax error, found END-OF-FILE when expecting one of: <LABEL> <END-OF-STATEMENT> ; TYPE INTEGER REAL COMPLEX BYTE CHARACTER CLASS DOUBLE ...
        end structure
---------------------^
compilation aborted for source.i (code 1)
make: *** [contempt28] Error 1
 

Here is the code in the source.i file:

structure /arg_struct/
            integer length
            character*256 arg
end structure

There are only four lines to the source.i file.  
The rest of the code that pertains to the source.i is in the source.f file shown here:

if (iargc() .ne. arg_count) then
            print *,'usage: contempt28_tu steamtable HPGLfile PGD RXI'
      1      //' RXO HXO HXI axisfile scratchdir'
          call exit (1)
      end if

c
c  Get the arguments from the command line.
c  Note that the use of the argument array is parameterized for
c  easy changes, if not easy reading.
c
      do i=1,arg_count
          call getarg (i, args(i).arg)
          args(i).length = lnblnk (args(i).arg)
      end do

      scratch = args(arg_scratch).arg
      scratch_length = args(arg_scratch).length

c
c  Open the files.  If there's trouble, let the f77 run-time library report
c  the error.
c
      ! Open the steam table file (Use the logical name).  This was   ! jmj
      ! added to allow multiple executions.                           ! jmj
                                                                        ! jmj
      OPEN ( UNIT = 15, FILE =
      1      args(arg_steam).arg(:args(arg_steam).length),
      1      STATUS = 'OLD', READONLY, FORM = 'UNFORMATTED')         ! jmj

      open (50, file=args(arg_hpgl).arg(:args(arg_hpgl).length),
      1      status='unknown')                              !HPGL
      open (51, file=args(arg_pgd).arg(:args(arg_pgd).length),
      1      status='unknown', form='unformatted')!output for plotting program
      open (10, file=args(arg_rxi).arg(:args(arg_rxi).length),
      1      status='old', readonly)                              !DRXE1
      open (11, file=args(arg_rxo).arg(:args(arg_rxo).length),
      1      status='unknown')                              !RXO
      open (7, file=args(arg_hxo).arg(:args(arg_hxo).length),
      1      status='unknown')                              !HXO
      open (3, file=args(arg_hxi).arg(:args(arg_hxi).length),
      1      status='old', readonly)                              !HX1
      open (53, file=args(arg_axis).arg(:args(arg_axis).length),
      1      status='old', dispose='delete')                        !axis

I followed the advice of this website with no luck
https://gcc.gnu.org/onlinedocs/gcc-4.4.1/gfortran/STRUCTURE-and-RECORD.html
Here is the new source.i file based on what I read in the link above.

TYPE arg_struct
            integer length
            character*256 arg
 END TYPE
 

I am still getting the syntax error.
I modified the rest of the source code per the information I read in the link:

if (iargc() .ne. arg_count) then
            print *,'usage: contempt28_tu steamtable HPGLfile PGD RXI'
      1      //' RXO HXO HXI axisfile scratchdir'
          call exit (1)
      end if

c
c  Get the arguments from the command line.
c  Note that the use of the argument array is parameterized for
c  easy changes, if not easy reading.
c
      do i=1,arg_count
          call getarg (i, args(i)%arg)
          args(i)%length = lnblnk (args(i)%arg)
      end do

      scratch = args(arg_scratch)%arg
      scratch_length = args(arg_scratch)%length

c
c  Open the files.  If there's trouble, let the f77 run-time library report
c  the error.
c
        ! Open the steam table file (Use the logical name).  This was   ! jmj
        ! added to allow multiple executions.                           ! jmj
                                                                        ! jmj
      OPEN ( UNIT = 15, FILE =
     1 args(arg_steam)%arg(:args(arg_steam)%length),
     1 STATUS = 'OLD', READONLY, FORM = 'UNFORMATTED')                  ! jmj

      open (50, file=args(arg_hpgl)%arg(:args(arg_hpgl)%length),
     1 status='unknown')                                                !HPGL
      open (51, file=args(arg_pgd)%arg(:args(arg_pgd)%length),
     1 status='unknown', form='unformatted')!output for plotting program
      open (10, file=args(arg_rxi)%arg(:args(arg_rxi)%length),
     1 status='old', readonly)                                          !DRXE1
      open (11, file=args(arg_rxo)%arg(:args(arg_rxo)%length),
     1 status='unknown')                                                !RXO
      open (7, file=args(arg_hxo)%arg(:args(arg_hxo)%length),
     1 status='unknown')                                                !HXO
      open (3, file=args(arg_hxi)%arg(:args(arg_hxi)%length),
     1 status='old', readonly)                                          !HX1
      open (53, file=args(arg_axis)%arg(:args(arg_axis)%length),
     1 status='old', dispose='delete')                                  !axis

Thank you in advance for your time!

Fortran: multiple definition of `date_'

$
0
0

When running Makefile, I am getting the error shown below:

/opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libifport.a(idate.o): In function `date_':
idate.c:(.text+0x1b0): multiple definition of `date_'

Is there a compile option that will fix this?  It looks to me that I have a function in local_lib that is the same as one in the compiler lib.

Here is the Makefile I am using:

FC=/opt/intel/bin/ifort
SHLIB=/rxe/source/shlib/v21_cp03/v2.1.cp03
OBJS=contempt28_tu.o inp_routines.o ftb_routines.o con_try.o drxe1.o hx1.o spray1.o local_lib.o
FFLAGS=-debug -align dcommons -real-size 64 -warn nouncalled -warn nousage

all: contempt28_tu.o inp_routines.o ftb_routines.o \
 con_try.o drxe1.o hx1.o spray1.o local_lib.o  \
 ${SHLIB}/hpgl_routines.so contempt28

contempt28: $(OBJS) ${SHLIB}/hpgl_routines.so
 $(FC) $(FFLAGS) -o contempt28 $(OBJS) ${SHLIB}/hpgl_routines.so
 
contempt28_tu.o : contempt28_tu.f
 $(FC) $(FFLAGS) -c contempt28_tu.f
 
inp_routines.o : inp_routines.f
 $(FC) $(FFLAGS) -c inp_routines.f
 
ftb_routines.o : ftb_routines.f
 $(FC) $(FFLAGS) -c ftb_routines.f

con_try.o: con_try.f
 $(FC) $(FFLAGS) -c con_try.f
 
drxe1.o : drxe1.f
 $(FC) $(FFLAGS) -c drxe1.f
 
hx1.o : hx1.f
 $(FC) $(FFLAGS) -c hx1.f
 
spray1.o : spray1.f
 $(FC) $(FFLAGS) -c spray1.f
 
local_lib.o : local_lib.f
 $(FC) $(FFLAGS) -c local_lib.f

 

Warnings/Error:

/opt/intel/bin/ifort -debug -align dcommons -real-size 64 -warn nouncalled -warn nousage -c drxe1.f
/opt/intel/bin/ifort -debug -align dcommons -real-size 64 -warn nouncalled -warn nousage -c hx1.f
/opt/intel/bin/ifort -debug -align dcommons -real-size 64 -warn nouncalled -warn nousage -c spray1.f
/opt/intel/bin/ifort -debug -align dcommons -real-size 64 -warn nouncalled -warn nousage -c local_lib.f
/opt/intel/bin/ifort -debug -align dcommons -real-size 64 -warn nouncalled -warn nousage -o contempt28 contempt28_tu.o inp_routines.o ftb_routines.o con_try.o drxe1.o hx1.o spray1.o local_lib.o /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so
ld: Warning: size of symbol `contrl_' changed from 120 in contempt28_tu.o to 1292 in hx1.o
/opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libifport.a(idate.o): In function `date_':
idate.c:(.text+0x1b0): multiple definition of `date_'
local_lib.o:/rxe/source/contempt28/v21_cp03/v2.1.cp03/local_lib.f:38: first defined here
ld: warning: libifport.so.5, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
ld: warning: libifcoremt.so.5, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
ld: warning: libimf.so, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
ld: warning: libsvml.so, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
ld: warning: libintlc.so.5, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
make: *** [contempt28] Error 1
 

 

 


Still about generic interface from external procedures

$
0
0

I would like to put a question to those that work with the J3 and other committees that determine the standard.

Related to this thread:

https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux...

If I define a generic interface such as below:

module create_gen_int
implicit none
interface fun_gen
   real function fun_int(n)
   integer, intent(in) :: n
   end function fun_int
!***
   real function fun_real(x)
   real, intent(in) :: x
   end function fun_real
end interface fun_gen
end module create_gen_int

The code compiles without any problems.

However, if I move the interfaces to a separate block inside the same module and use "module procedure" in the generic, such as:

module create_gen_int2
implicit none
interface
   real function fun_int(n)
   integer, intent(in) :: n
   end function fun_int
!***
   real function fun_real(x)
   real, intent(in) :: x
   end function fun_real
end interface
!
interface fun_gen
   module procedure fun_int
   module procedure fun_real
end interface fun_gen
end module create_gen_int2

This is not accepted by the standard.  Ifort V. 16.0.3.210 generates the error:

create_gen_int2.f90(4): error #7950: Procedure name in MODULE PROCEDURE statement must be the name of accessible module procedure.   [FUN_INT]
   real function fun_int(n)

Gfortran also complains with an error message.

OTOH, if I move the interfaces to a separate module, such as:

module create_ints
implicit none
interface
   real function fun_int(n)
   integer, intent(in) :: n
   end function fun_int
!***
   real function fun_real(x)
   real, intent(in) :: x
   end function fun_real
end interface
end module create_ints
!*********************************
module create_gen_int3
use create_ints
implicit none
interface fun_gen
   module procedure fun_int
   module procedure fun_real
end interface fun_gen
end module create_gen_int3

This is also not valid according to the standard.  Ifort now issues the error:

create_gen_int3.f90(18): error #7950: Procedure name in MODULE PROCEDURE statement must be the name of accessible module procedure.   [FUN_INT]
   module procedure fun_int

My question is, why don't the standard accept the last two examples?  Since all of them do essentially the same thing?

 

Fortran preprocessor stripping off 2 sets of quotes

$
0
0

I am trying to compile a source file which contains the statement

compiled =
& COMPILATION_DATE

with the command

mpif90 -save-temps -i8 -g -I. -I/projects/chch5350/Packages/nwchem-6.6/src/include -I/projects/chch5350/Packages/nwchem-6.6/src/tools/install/include -DEXT_INT -DLINUX -DLINUX64 -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/projects/chch5350/Packages/nwchem-6.6'" -DNWCHEM_BRANCH="'6.6'" -c -o nwchem.o nwchem.F

This produces an error,

nwchem.F(471): error #5082: Syntax error, found ':' when expecting one of: ;

& Fri_Sep_01_16:24:30_2017
--------------------^

nwchem.F(471): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: , )
& Fri_Sep_01_16:24:30_2017
-------------------------------^

nwchem.F(471): error #6404: This name does not have a type, and must have an explicit type. [FRI_SEP_01_16]
& Fri_Sep_01_16:24:30_2017

etc.

Not surprisingly, the intermediate file nwchem.i shows

compiled =
& Fri_Sep_01_16:26:18_2017

where the inner quotes that are supposed to be retained in the substitution during preprocessing are being stripped off, so the compiler is interpreting the date string as Fortran syntax.

How can I stop that from happening? fpp alone leaves them on, so they are getting stripped off after that.

-bash-4.2$ mpif90 --version
ifort (IFORT) 17.0.4 20170411

Copyright (C) 1985-2017 Intel Corporation. All rights reserved.

-bash-4.2$ uname -a
Linux shas0136 3.10.0-327.36.3.el7.x86_64 #1 SMP Thu Oct 20 04:56:07 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Thanks,

Chris

final procedure problem

$
0
0

here is my code

module vector_class
implicit none
! Type definition
type,public :: vector
   private 
   real, dimension(:), POINTER :: v
   logical :: v_allocated = .false.

contains
    procedure,public :: set_vector=>set_vector_sub
    procedure,public :: get_vector=>get_vector_sub
!    procedure,public :: clear_vector=>clear_vector_sub
   FINAL :: clear_vector 
end type vector

private :: set_vector_sub,get_vector_sub,clear_vector_sub

contains

subroutine set_vector_sub(this,array)
   implicit none
   class(vector) :: this
   real,dimension(:),intent(in) :: array
   integer istat
   if(this%v_allocated) then
      deallocate(this%v,stat=istat)
   endif

   allocate(this%v(size(array,1)),stat=istat)
   this%v = array
   this%v_allocated = .true.

end subroutine set_vector_sub

subroutine get_vector_sub(this, array)
   implicit none
   class(vector) :: this
   real,dimension(:),intent(out) :: array

   integer array_length
   integer data_length
   integer istat

   if(this%v_allocated) then
      array_length = size(array,1)
      data_length  = size(this%v,1)
      if(array_length > data_length) then
         array(1:data_length) = this%v
         array(data_length+1:array_length) = 0
      else if(array_length == data_length) then
         array = this%v
      else
         array = this%v(1:array_length)
      endif
   else
     array = 0
   endif
end subroutine get_vector_sub

subroutine clear_vector_sub(self)
   implicit none
   class(vector) :: self
   integer istat

   write(*,*) 'in finalizer .....'
   if(self%v_allocated) then
      deallocate(self%v,stat=istat)
   endif

end subroutine clear_vector_sub

end module vector_class

 

 

 program test_vector
 use vector_class
 implicit none
 type(vector) :: aa
 

 

 end program test_vector

following is compiler error :

vectorclass.f90(13): error #8338: A final subroutine name must be the name of a module procedure with exactly one dummy argument.   [CLEAR_VECTOR]
   FINAL :: clear_vector
------------^
compilation aborted for vectorclass.f90 (code 1)

i not kown why is IT error ?

 

class(*) intrinsic assignment

$
0
0

When trying to compile a module to assign class(*) to an integer I get the following error:

stl.f90(10): error #6762: The type for the arguments of this specific subroutine for a defined ASSIGNMENT redefines intrinsic assignment operations.   [ASSIGN_CLASS_STAR_TO_INT]

 

module stl
implicit none

interface assignment(=)
    module procedure assign_class_star_to_int
end interface

contains

subroutine assign_class_star_to_int(a, b)
implicit none
integer, intent(out) :: a
class(*), intent(in) :: b

select type(b)
    type is (integer)
        a = b
end select

end subroutine assign_class_star_to_int

end module stl

This would suggest that I can use a built-in intrinsic to assign a class(*) to an integer. If I try to compile the following program, I get the error:

test.f90(22): error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands.

module foo_m

contains

function foo() result(f)
implicit none
integer :: i
class(*), allocatable :: f

i=10
allocate(f, source=i)

end function foo

end module foo_m

program main
use foo_m
implicit none
integer :: i

i = foo()

end program main

 

 

What am I missing here?

Thanks for your help.

There is no fortran serial number for mac os for Free Tools for Students?

$
0
0

hi

    I'm a student of wuhan university. when i need to update my serial number of ifort , i find a problem that there is no link for  me to apply for a serial number via my education email, i can only find the link for 'icc' , that's why ? no free for 'ifort' any more ? 

the steps i do :

step 1: https://software.intel.com/en-us/qualify-for-free-software/student  ; click button "mac os*"

step 2:  only find link for 'icc' : Thank you for your interest in Intel® Parallel Studio XE Composer Edition for C++ macOS* title. not for  'ifort' 

Viewing all 2746 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>