Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all 5691 articles
Browse latest View live

parallel_studio_xe_2018_cluster_edition_online_setup not working

$
0
0

Hi.

I tried several times without success to install parallel_studio_xe_2018_cluster_edition_online_setup on my DELL Inspiron 14 5000 on Windows 8.1. It's always reboot about half-way with the error message kmode exception not handled (vtss.sys). I removed  the vtss.sys but the problem remains.

Any way out?

Thank you.

Sindur P. Mangkoesoebroto, Ph.D.


How to link ARPACK .lib and .dll files to intel fortran

$
0
0

Hi,

I'm trying to use the library ARPACK in the intel visual fortran complier(VS2008). At first, compling of ARPACK using MinGW was successful and I got arpack_x64.dll and arpack_x64.lib (object file library) files. However, now I'm stuck in liking those files to my fortran project.

My ARPACK directory is 'D:\1_STUDY\ARPACK', and following is the procedure that I have made to link the library (actually I'm not sure this is correct).

(1) Linker>Input>Additional Dependencies : D:\1_STUDY\ARPACK\arpack_x64.lib

(2) Tools>Option>Intel(R) Visual Fortran>Compilers:

- Platform-->x64

- Add to Libraries: D:\1_STUDY\ARPACK\arpack_x64.lib

- Add to Includes: D:\1_STUDY\ARPACK\arpack_x64.dll

=============================================================================

<Main.f source code>

      PROGRAM TEST
     
      integer maxn
      integer maxnev
      integer maxncv
      integer ldv
                 
      DOUBLE PRECISION A(2,2)
      CHARACTER*1 BMAT
      INTEGER n
      CHARACTER*2 which ! Hermitian or non-Hermitian
      INTEGER nev ! # of eigvalues to be computed
      DOUBLE PRECISION tol   ! tolerances
      INTEGER IPARAM(11)
      INTEGER ido  ! reverse communication flag
      INTEGER ncv ! # of Lanczos basis vectors to use
      double precision, allocatable :: resid(:)
      integer, allocatable :: workl(:),workd(:),v(:,:)
     
      maxn = 256
      maxnev = 10
      maxncv = 25
      ldv = maxn
     
      allocate(resid(maxn),workl(maxncv*(maxncv+8)),v(ldv,maxncv)
     & ,workd(3*maxn))
           
      A = 0.D0
      A(1,1) = 10.D0
      A(1,2) = 11.D0
      A(2,1) = 11.D0
      A(2,2) = 20.D0
     
      PRINT *, A
      READ(*,*)
     
      which = 'LM'   ! eigvalues largest in magnitude
      bmat = 'I'   ! standard eigvalue problem
      n=2    ! dimension of the problem
      nev = 2  ! # of eigvalues to be computed
      tol = 1.d-10
      IPARAM(1) = 1 ! default exact-shift strategy
      IPARAM(3) = 100   ! max. # of implicit restarts allowed
      IPARAM(7) = 1   ! regular mode
      ido = 0
      ncv = 5  ! at least nev+1 (setting ncv>2*nev is recommended)
      CALL dsaupd(ido,bmat,n,'LM',nev,tol,resid,ncv,v,ldv,iparam
     & ,ipntr,workd,workl,lworkl,info)
                   
      END

<Error messages#1>

LINK : fatal error LNK1181: 'D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib'  (cannot be opened).

So, I added the arpack_x64.lib and arpack_x64.dll files to the same directory with the main.f file. Then, the above error disappeared, but the following error occurred.

<Error messages#2>

1>MAIN.obj : error LNK2019: DSAUPD (unresolved external symbol)

Then, to curcumvent this trouble, I added include 'arpack_x64.lib'  just before the executable section. However, the following error occurred.

<Error messages#3>

1>D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib(2): error #5149: Illegal character in statement label field  [/]
1>D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib(2): error #5078: Unrecognized token '`' skipped
1>D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib(2): error #5082: Syntax error, found INTEGER_CONSTANT '151140550408617' when expecting one of: <END-OF-STATEMENT> ; <LABEL> BLOCK BLOCKDATA PROGRAM MODULE TYPE COMPLEX BYTE ...
1>D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib(2): error #6904: This label has too many digits; a label has a maximum of a 4 digit integer.   [151140550408617]
1>D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib(2): error #6321: An unterminated block exists.
1>D:\1_STUDY\1_MATERIALS\00_ARPACK\test\test\arpack_x64.lib(2): error #6323: This label is not defined in this scoping unit.   [151140550408617]

=============================================================================

I want to save the .dll and .lib files to a canonical place and use them instead of copying the files into the local directory every time.

I'm really not sure that the procedure I followed was in right direction since I'm a novice on this library installation.

So any helps or comments are welcome.

Thanks.

 

 

WAMIT dll doesn't work when recompiled with new compiler in Windows

$
0
0

Hi,

I am trying to modify a dll file that is used within a commercial software called WAMIT. The instruction manual for WAMIT states:

"WAMIT Version 7 is compiled with Intel Visual Fortran (Version 12.1). The previous Version 6.4PC was compiled with Intel Visual Fortran (Version 10.1) and earlier versions were compiled with Compaq Visual Fortran. Any of these Fortran compilers can be used to compile modified versions of the files geomxact.dll and newmodes.dll for use with a single processor (NCPU=1), using the following procedure:
• Open a new project ‘geomxact’ as a Fortran Dynamic Link Library
• Add geomxact.f to the project
• Build a release version of geomxact.dll
• Copy the new version of geomxact.dll to the working directory for WAMIT ....

...It may be possible to use other FORTRAN compilers to build the DLL files, but certain conventions in calling subroutines must be consistent with those of Intel Visual Fortran."

I have not been able to find any of these 3 old compilers, so have instead tried to rebuild the dll from the fortran file using Intel Visual Fortran Compiler 18.0 (from Intel® Parallel Studio XE Cluster Edition for Windows* 2018) together with Microsoft Visual Studio Enterprise 2015 (currently on a 30 day trial period). I am running on a 64 bit computer with Windows 10.

I have followed the above instructions from the WAMIT manual, however there is something different about the dll that is built, as WAMIT is unable to see the file, giving the error "The system cannot find the file specified".

I have asked the WAMIT developers, and they have told me that they do not understand Visual Basic so I should contact you, as they apparently did the last time that they changed compilers.

Please can you help me to troubleshoot this? Perhaps there are some options that I can add to the fortran project which will make the dll the same as when compiled by Intel Visual Fortran 12.1?

Many thanks in advance,

Sarah

 

anyone tried animate_open in a dialogue panel.

$
0
0

trying to load an .avi clip into the animation control for first time.

linker fails to recognise the animate_open API function.  Any ideas ?

use user32

use ifwin

 

TYPE (dialog) dlg

integer(HANDLE) hDlg, hwin_an1 

integer(HANDLE) hDlgProc

INCLUDE 'RESOURCE.FD'

LOGICAL retlog

!

hdlg=dlg%hWnd ! Get the handle to the dialog window

hDlgProc=SetWindowLongPtr(hdlg, DWL_DLGPROC, LOC(MyDlgProc))

! get animation handles

hwin_an1= GetDlgItem(hdlg, IDC_ANIMATE2)

! initially load it and show it

retlog=Animate_Open(hwin_an1, "C:\Users\Videos\toy_plane_liftoff.avi")

retlog=showwindow(hwin_an1,sw_show)

code coverage: Execution count for all lines in program

$
0
0

In the gfortran compiler gcov allows the developer to determine how many times each line has executed in a program. For instance if i have a do loop, the instrumented code run shows me how many times the lines within the loop have been executed.

Is it possible to do the same in ifort? I get the color coded coverage and that's nice, but I need quantitative information about how many times all my lines have run, and then I'd like to sift through them to see which ones are running the most times.

Also, is it possible to instrument code such that I can query it after a run? I've heard code coverage outputs html and xml files. Is it possible to query, for instance, the xml file to do some proper reflection/instrospection/code analysis? Like for example returning all derived types in my code, all global variables, lines which have run above a certain number of times etc.

forte (39): error during read unit 0, file conout$

$
0
0

Hi,

​I'm working on a code developed in Visual Studio. If I run the cose in debug mode the code works. If I run the code in release mode there is an error:

 forrtl: The handle is invalid

 forte (39): error during read unit 0, file conout$

How can I fix it?

Intel Fortran Compiler License Expired?

$
0
0

Hi

It appears that the license file for our named user Intel Fortran compiler has "expired". Are these not perpetual licenses (composer edition)?

When I look into our license file it does have the date November 17 2017 in it, which is when the problems started, so the license file does in fact appear to be expired, but is there a way to obtain a current license file for the perpetual license? I've tried registering the serial number, but it says that it's already registered and when I try the "forgot my username" for all 4 of the emails that were likely used to buy the product 4-5 years ago it can't find any record of any of them. It's a small company, and 3 of those 4 email addresses no longer work anymore anyways (people don't work here anymore), the 4th is me. I know that this one computer is the only place that this license is used, so there must be some error in the registration system, or perhaps some purchasing person tied it to their email all those years ago. Is there a way to find out what email address is linked to a given serial number? I presume I only need to download a current license file from the registration center in order to keep using our perpetual license?

Thanks

link abaqus to fortran

$
0
0

Dear all,

i try to link abaqus 6.14-5 with visual studio 2013 and intel parallel 2016

when i run in abaqus command abq6145 -user_verify, i obptain this error:

LINK : fatal error LNK1171: unable to load mspdbst.dll (error code: 126)

Can you help me?

thanks a lot


Preventing Frame Window from Appearing at the Start of Execution

$
0
0

I am using legacy Fortran on Compaq Visual Fortran. I create an executable (femanalysis.exe) using either QuickWin or as a Console Application. I then use it within a Matlab code spring.m which calls it recurrently (hundreds of times) and it's working well except for one problem. Although I directed all output from femanalysis.exe to a file (away from the screen), the femanalysis.exe still pops up an empty frame windows at the start of each execution. Given that the program is called repeatedly by spring.m, I end up with empty frame windows appearing continuously on my screen while the Matlab program is running, hence preventing other usage of my computer. How to prevent the windows from appearing at all? Thanks.

Cos, Sin, Pow Already defined in libucrtd.lib

$
0
0

Hi everyone,

I'm new in the Visual Fortran world and need your help. So here's the point :

I have to upgrade an old Vs6/Fortran PowerStation code base to vs2017/Visual Fortran.
I've already setup vs2017, Intel Parallel Studio 2018, recompile the sources etc ...
My Project is basically a win MFC app which link with a huge Visual Fortran static lib (.vfproj)

All runtime are properly set :
RELEASE config : c/c++ runtime = Multithread /MT - Fortran runtime : MultiThreaded
DEBUG config : c/c++ runtime = Debug Multithread /MTd - Fortran runtime : Debug Multithreaded 

In the final linking step, i encounter several error link LNK2005 xxxxx already defined in libmmt.lib

In RELEASE configuration, to fix the Linking error (cos, sin, pow already defined) i used the solution provided by Steve Lionel (last answer)
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-fo...

So i put libmmt.lib first in my additionals dependencies and everything goes fine.

In DEBUG configuration this solution is no longer working i get the following errors :

1>libucrtd.lib(acos.obj) : error LNK2005: _acos déjà défini(e) dans libmmt.lib(acos_iface_c99.obj)
1>libucrtd.lib(acos.obj) : error LNK2005: __CIacos déjà défini(e) dans libmmt.lib(acos_iface_c99.obj)
1>libucrtd.lib(cos.obj) : error LNK2005: _cos déjà défini(e) dans libmmt.lib(cos_iface_c99.obj)
1>libucrtd.lib(cos.obj) : error LNK2005: __CIcos déjà défini(e) dans libmmt.lib(cos_iface_c99.obj)
1>libucrtd.lib(sin.obj) : error LNK2005: _sin déjà défini(e) dans libmmt.lib(sin_iface_c99.obj)
1>libucrtd.lib(sin.obj) : error LNK2005: __CIsin déjà défini(e) dans libmmt.lib(sin_iface_c99.obj)
1>libucrtd.lib(pow.obj) : error LNK2005: _pow déjà défini(e) dans libmmt.lib(pow_iface_c99.obj)
1>libucrtd.lib(pow.obj) : error LNK2005: __CIpow déjà défini(e) dans libmmt.lib(pow_iface_c99.obj)
1>LINK : warning LNK4098: conflit entre la bibliothèque par défaut 'LIBCMT' et les autres bibliothèques ; utilisez /NODEFAULTLIB:library

How to fix it ?

Best regards 

Coarrays ATOMIC_REF: unexpected "forrtl: severe (157): Program Exception - access violation" error with a COINDEXED OBJECT

$
0
0

Fyi on an incident submitted at the Intel OSC:

   use, intrinsic :: iso_fortran_env, only : AI => atomic_int_kind

   type :: t
      integer(kind=AI) :: i
   end type

   integer(kind=AI) :: vali
   type(t), save :: foo[*]

   call atomic_define( atom=foo[1]%i, value=42 )

   sync memory

   call atomic_ref( value=vali, atom=foo[1]%i )

end

Build step:

xxx>ifort /standard-semantics /Qcoarray /warn:all /stand /debug /traceback p.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R
) 64, Version 18.0.1.156 Build 20171018
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.11.25508.2
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:p.exe
-debug
-pdb:p.pdb
-subsystem:console
-incremental:no
p.obj

Upon execution,

xxx>p.exe
forrtl: severe (157): Program Exception - access violation
In coarray image 2
Image              PC                Routine            Line        Source

impimt.dll         000007FEBF891D77  Unknown               Unknown  Unknown
impimt.dll         000007FEBF892FD0  Unknown               Unknown  Unknown
impimt.dll         000007FEBF892EA4  Unknown               Unknown  Unknown
impimt.dll         000007FEBF6F5F9D  Unknown               Unknown  Unknown
libicaf.dll        000007FEF9C64364  Unknown               Unknown  Unknown
p.exe              000000013F33122D  MAIN__                     14  p.f90
p.exe              000000013F3C5752  Unknown               Unknown  Unknown
p.exe              000000013F3C6059  Unknown               Unknown  Unknown
kernel32.dll       00000000771259CD  Unknown               Unknown  Unknown
ntdll.dll          000000007725A561  Unknown               Unknown  Unknown

application called MPI_Abort(comm=0x84000002, 3) - process 1

I believe the above code is standard-conforming and the build output should execute without the run-time exception.

Pass char* from C to Fortran

$
0
0

 

Hello,

I'm upgrading a huge C/Fortran project from VS6/Fortran PowerStation to vs2017/Intel Visual Fortran.
As i'm a total newbie with Fortran, I need your help to pass string data from a C function call to a Fortran subroutine.

I read a lot about this but there's so many way to achieve this so i prefer create a new post.

Until now C code call Fortran subroutine with string arg this way :

// C Side

extern void		FORTRAN BOUTON(float*,float*,float*,float*,char*,UINT,ENTIER*,ENTIER*,char*,UINT);

void BarresIcons_Bouton(float x, float y, float dx, float dy, char *texte, char *icone, ENTIER id, char *AideFR, char *AideUS)
{
	ENTIER	iCoul	= 16;
	ENTIER	iDesTex	= 0;
	char	*Aide;

	BOUTON(&x, &y, &dx, &dy, texte, &iCoul, &iDesTex, icone);

	// ...
}

// FORTRAN Side

SUBROUTINE bouton (x1,y1,a,b,texte,icoul,icout,icon)

	INCLUDE 'xxxxxxxx'
	INCLUDE 'xxxxxxxx'

	DIMENSION	x(10),y(10)
	DIMENSION	windo(4)
	CHARACTER*(*) texte
	CHARACTER*(*) icon

c      // etc ....

END SUBROUTINE

With C passing some hidden args to compute char * length
Note bouton subroutine own 8 args but extern "C" declaration has 10

Now i would know the best way to deal with char * of any size from C to Fortran because actually I can't just recompile the source code :
- calling convention has changed from __stdcall to __cdecl
- when C call Fortran subroutine, the call stack crash because args num mismatch
- it seems ther's no more char * "hidden args" passed
 

Best regards
Julien
 

ps : i read those topics before but there so many question about Bind(C), ISO_C_BINDING & the new fortran syntaxe. All the existing code is written in Fortran 77

IMSL with IVF Compiler - license error

$
0
0

Hi, 

I recently installed ISML with a student license to use with IVF. I did everything as explained in these two links:

-https://software.intel.com/en-us/articles/installing-and-using-the-imsl-...

-http://docs.roguewave.com/imsl/fortran/7.1/pdf/imslfnl7-1_gettingstarted...

However, when I build the project I obtain the following errors:

Error error LNK2019: unresolved external symbol sprintf referenced in function l_open_license_file imsls_err.lib(check_license.obj)

Error error LNK2019: unresolved external symbol __iob_func referenced in function l_open_license_file imsls_err.lib(check_license.obj)

 

Any hints on how to solve it?

Thanks

Question about fp:source vs fp:precise vs fp:consistent

$
0
0

Hi,

So I have been doing some research into the floating point model options and based on the various bits of documentation, I am very confused about what combinations are really recommended.  For example:

Looking at the following document:

https://software.intel.com/sites/default/files/managed/de/a1/FP_Consiste...

It says on page 19:

"Use /fp:precise /fp:source (Windows) or -fpmodel precise -fp-model source (Linux or OS X) to improve the consistency and reproducibility of floating-point results while limiting the impact on performance"

Then in a parenthetical remark, it says that fp:source implies fp:precise.

So my question is this:  if using fp:source also gets you the behavior of setting fp:precise, then why is the recommendation to use both of those settings on the command line?  Isn't it enough to just set fp:source and be done with it?

Similarly, the document says:

"The geomean of the performance reduction due to -fp-model consistent -fp-model source was about 12%"

but later on says that engaging fp:consistent sets "all of the above options", which presumably includes fp:source.  So if that is indeed true, then why does the document go to the trouble of mentioning that both -fp-model consistent and -fp-model source were used together?  This makes me question whether fp:source is adding some extra behavior beyond what fp:consistent gives you.

One additional question:  to maximize consistency between platforms/chip architectures is the current recommendation to simply set /fp:consistent for Intel 17 and Intel 18 compilers or are there additional settings I should also be looking at?

Any insight would be greatly appreciated.

Chris

 

Problem with OpenMP in Fortran

$
0
0

Dear all,

I recently encountered a problem with parallel do loop with OpenMP in Fortran.  The following code can reproduce what I saw.  I would appreciate any suggestions.  I use Visual Studio 2017 + Intel Parallel Studio XE 2018 Update 1.

program Rang_Test
    !$ use omp_lib
    implicit none
    integer, parameter :: ni = 10
    real :: rnd(8), fnl(ni)
    integer :: i, j
    real, allocatable :: rtmp


    allocate(rtmp)
    rtmp = 1.

    !$omp parallel default(none) private(i, rnd) firstprivate(rtmp) shared(fnl)
    !$omp master
    write(*, *) 'Initial values'
    !$omp end master
    write(*, '(*(g0))') 'Core=', omp_get_thread_num(), '    rTmp=', rtmp
    !$omp barrier
    !$omp master
    write(*, *) 'Inside the loop'
    !$omp end master
    !$omp do
    do i = 1, 10
        call RANDOM_NUMBER(rnd)
        rtmp = rnd(1)
        fnl(i) = rtmp
        !$omp critical
        write(*, '(*(g0))') 'i=',i,'    rnd(1)=', rnd(1), '    rTmp=', rtmp
        !$omp end critical
    end do
    !$omp end do
    !$omp end parallel
    write(*, *) 'After omp region'
    do i = 1, 10
        write(*, '(*(g0))') 'i=', i, '    fnl(i)=', fnl(i)
    end do

end program Rang_Test

In the example above, in each iteration, some calculations are done first (call random_number(rnd)), then the results are assigned to a firstprivate variable (rtmp), and some more calculations are done in the same iteration (fnl(i) = rTmp).  In this sample code, inside the loop, the values of rTmp should always equal to rnd(1).  However, I found that the values written to the screen were not what I expected.  The following are the execution results on my computer:

 Initial values
Core=2    rTmp=1.000000
Core=0    rTmp=1.000000
Core=3    rTmp=1.000000
Core=5    rTmp=1.000000
Core=4    rTmp=1.000000
Core=7    rTmp=1.000000
Core=6    rTmp=1.000000
Core=1    rTmp=1.000000
 Inside the loop
i=6    rnd(1)=.3001758    rTmp=.7522959
i=8    rnd(1)=.7958636    rTmp=.7522959
i=5    rnd(1)=.1966502E-01    rTmp=.7522959
i=3    rnd(1)=.3920868E-06    rTmp=.7522959
i=9    rnd(1)=.8392264    rTmp=.1941571
i=7    rnd(1)=.4387013    rTmp=.1941571
i=1    rnd(1)=.7522959    rTmp=.1941571
i=10    rnd(1)=.7564077E-01    rTmp=.2656559
i=4    rnd(1)=.1941571    rTmp=.2656559
i=2    rnd(1)=.2656559    rTmp=.2656559
 After omp region
i=1    fnl(i)=.7522959
i=2    fnl(i)=.2656559
i=3    fnl(i)=.3920868E-06
i=4    fnl(i)=.1941571
i=5    fnl(i)=.1966502E-01
i=6    fnl(i)=.3001758
i=7    fnl(i)=.4387013
i=8    fnl(i)=.7958636
i=9    fnl(i)=.8392264
i=10    fnl(i)=.7564077E-01

As you can see, the final values (fnl) are fine, but the values of rTmp are problematic.  I have tried a few other things and found:

  1. If rTmp is a regular nonallocatable variable, then the program works fine.
  2. Or, if rTmp is allocated to be an array, and only the first value is used (that is, use rTmp(1) = rnd(1)), then it works fine.
  3. I tried to compile the same code with gfortran, and it worked fine.

I would appreciate if anyone could give any suggestions.  Thanks.


Can Intel Fortran run on AMD CPU

$
0
0

Am thinking about upgrading my old computer which I've held off for several years.  I'm considering an AMD Threadripper, can the Intel VS Fortran 1017 support one of those chips.

submodules

$
0
0

There is a compilation issue occured when circular reference is employed. See the codes:

module test1
    implicit none

    integer, parameter :: a = 5

    interface
        module subroutine sub1()
        end subroutine sub1
    end interface

end module test1

submodule(test1) submodule1
    use test2
    implicit none

    contains

    module procedure sub1
        implicit none
        print*, b
    end procedure sub1

end submodule submodule1

module test2
    implicit none

    integer, parameter :: b = 4

    interface
        module subroutine sub2()
        end subroutine sub2
    end interface

end module test2

submodule(test2) submodule2
    use test1
    implicit none

    contains

    module procedure sub2
        implicit none
        print*, a
    end procedure sub2

end submodule submodule2

program main
    use test1
    use test2

    !TO DO.

end program main

The use association in submodules are permitted by the standard. An error shows up when compile for the first time:

error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [TEST2]

If then we compile it again without cleanning-up, the target assembly will be created successfully. So is it a compiler mistake ? Or how should I do to solve it ?

Compiler mistakenly reads loop condition as array, not scalar

$
0
0

When I try to start a loop as

do while (t_iter .LT. time(ubound(time)))

I get the following compiler error:

-------------- Build: Debug in NewIntegrateSEFromProfiles (compiler: Intel Fortran Compiler for Windows)---------------

ifort.exe /nologo /warn:all  /debug:full  /fpp /free /QxHost /O2    /module:obj\Debug\ /c main.f90 /object:obj\Debug\main.obj
ifort.exe /nologo  /exe:bin\Debug\NewIntegrateSEFromProfiles.exe  obj\Debug\main.obj  
ifort: command line remark #10382: option '/QxHOST' setting '/QxCORE-AVX2'
main.f90(32): error #6512: A scalar-valued expression is required in this context.
    do while (t_iter .LT. time(ubound(time)))

If I switch ubound() to size(), however, it works fine. Both of these functions return the same value (since the array is 1-indexed), and the first iteration returns a single boolean True, not an array. This error seems like unexpected behaviour to me.

(platform = windows 7 64 bit, ifort 18 update 1 in CodeBeans IDE)

Doubt about IMSL and Intel Parallel Studio

$
0
0

I acquired a student licence for Intel Parallel Studio 2018 to run a code written based on IMSL. I'm using Microsoft Visual Studio 2017 and when I try to build the project, it shows me the mesage "error #5102: Cannot open include file 'link_fnl_shared.h'".
I'm not sure if only installing the Parallel Studio I will have acess for IMSL library.

 

AttachmentSize
Downloadimage/png8.png346.42 KB

A component cannot be an array if the encompassing structure is an array.

$
0
0

I have the following problem:

I need to create an datasets array which size is not known at first. It is an composition of different subarrays. 
For example the first subdataset has 4 elements, the second 10, and a third 8. Because this sizes are  not known at the start of the programm I can not do somethin like:

 

INTEGER(4), ALLOCATE :: datasets(:)

ALLOCATE(datasets(1:4+10+8))

The sizes of each subdataset is evaluated one after each other. Because there is no such thing like appending an array to an array I would have to reallocate the datasets size after each subdataset to manually expend the array. But this always involves a copy process which I definetly have to avoid.

So I tried to use an array of pointers in which every pointer points to an allocatable array. This works.

P1  | P2  | P3
1   |   2  |  3
1   |   2  |  3
1   |   2  |  3
1   |   2  |  3
    |   2  |  3
    |   2  |  3
    |   2  |  3
    |   2  |  3
    |   2  |
    |   2  |  

Its getting tricky now, because I have a subroutine  (sub1) which needs one array. Is there any possibility to pass the data inside the subroutine without copying it?

1  | 1  | 1  | 1  | 2  |  2  |  2  |  2  |  2  |  2  |  2  |  2  |  2  |  2  |  3  |  3  |  3  |  3  |  3  |  3  |  3  |  3  | 
MODULE TEST_MOD
	IMPLICIT NONE

	PRIVATE

	! Type
	TYPE :: TYPE_TESTDATA
		INTEGER(4), ALLOCATABLE :: data(:)
	END TYPE TYPE_TESTDATA

	TYPE :: TYPE_TEST_PTR
		TYPE(TYPE_TESTDATA), POINTER :: p
	END TYPE TYPE_TEST_PTR

	CONTAINS

	! Subroutines
	SUBROUTINE sub1(array)
		IMPLICIT NONE
		INTEGER(4), ALLOCATABLE, INTENT(IN) :: array( : )

		! do smth with array

	END SUBROUTINE sub1


	SUBROUTINE sub2()
		IMPLICIT NONE

		INTEGER(4)							:: size_data1, size_data2, size_data3
		INTEGER(4)							:: num_datasets
		TYPE(TYPE_TEST_PTR), ALLOCATABLE	:: datasets(:)

		num_datasets = 3
		size_data1 = 4
		size_data2 = 10
		size_data3 = 8

		! allocate
		ALLOCATE(datasets(1:num_datasets))
		ALLOCATE(datasets(1)%p%data(1:size_data1))
		ALLOCATE(datasets(2)%p%data(1:size_data2))
		ALLOCATE(datasets(3)%p%data(1:size_data3))

		datasets(1)%p%data = 1
		datasets(2)%p%data = 2
		datasets(3)%p%data = 3

		CALL sub1(datasets(:)%p%data)

	END SUBROUTINE sub2
END MODULE TEST_MOD

I hope I have described the problem quite understandably. Thanks for your help in advance.

Viewing all 5691 articles
Browse latest View live


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