Quantcast
Channel: Fortran
Viewing all 3108 articles
Browse latest View live

deallocate linked list

$
0
0

Dear all,

I have a question. Is there any fast way to deallocate a linked list or I have to to it manually?

A sort of DEALLOCATE(linkedlistname)

Thanks a lot


DCOPY Fortran Subroutine

$
0
0

Hello,

Does DCOPY have some lenght limit? In my fortran code I copy a 65000x2000 matrix using this subroutine, and I think that it is generating some problems in my results.

Thanks!

using integers as booleans

$
0
0

The legacy application that I am porting from g77 to Intel Fortran has many tests of the form:

IF (INTEGER_VAR)

and, since the FORTRAN is generated by RATFOR, many more tests of the form

IF (.NOT.(INTEGER_VAR)) CONTINUE . . .

I would like to detect these with a compiler warning, but even '-warn all' does not flag these.  Is there a flag that I can use?

Side note:  g77 detects these by default, but not when the -fugly flag is used.  And when you use that flag, it looks like some of the tests are executed incorrectly.

Thanks,
Jay

Fortran derived type arguments in DLL subroutines

$
0
0

I'm upgrading an application to allow for dynamically-loaded DLLs created by the user.  (I'm basing it on the DynamicLoad Intel example).  For my case, one of the arguments to the main subroutine that will be required in the DLL is a derived type.  A dumbed-down example is below:

type :: mytype
  integer :: i = 0
  character(len=:),allocatable :: name
  type(mytype),pointer :: next => null()
end type mytype

Note that it contains an allocatable character string, which is not interoperable with C, based on my understanding.  It also contains pointers that are used to construct a linked list.  The mytype dummy argument for the DLL routine is also a pointer.  My questions are:

1. Is it OK to have DLLs on Windows with derived types arguments that contain variables that aren't C-interoperable?

2. Should I include a SEQUENCE statement in this type?  It seems to work with or without it.

3. I presume the DLL can only be written in Fortran, unless I were to refactor the type to use interoperable character arrays and c_ptr's?  As it is now, would it work with any Fortran compiler, or would it have to be Intel?

4. Is it enough to publish the mytype declaration, and have the user declare it themselves within their DLL?  Is that a problem that the type is defined twice (once in my main program and once in their DLL)?  Does SEQUENCE make this OK?  Or, would BIND(C) make this OK?

Any help  would be appreciated!  Thanks in advance!

INTERFACE and combining several F90 files

$
0
0

Hi,

1) I'm relative new to Fortran and I have a series of questions to fortran that may
seem very simple to your experts. I'm aware that this line of questions may seem
inappropiate for this forum in the meaning "too simple". If you believe this is true,
can you guide me to another forum where I can ask this line of questions?

2) If I'm calling a subroutine or a Function within another subroutine or function; should
I then make an interface/End interface section in each subroutine/function from which I'm
calling a another subroutine/function?

3) I have made a simple .F90 file with a number of functions and subroutines. Is it possible to have
several .F90 files and then call these subroutines/functions from the different .F90 files? For instance,
to call FunctionB in file2.F90 from FunctionA in file1.F90 ?

Help with terminating a process

$
0
0

Hi,

I am trying to create a routine that launches an application from within my
code. However, in certain conditions (unfortunately not all of them avoidable),
the external application goes non-responsive and I'm having problems in
terminating it.

I appologise for any over-simplified or incorrect terminology, but I'm not
a programmer, I'm an engineer, more comfortable with equations and numbers than
codes, and I'm learning Fortran on the go, only as the necessity appears :)

I'll explain a bit what I'm trying to do.

The external application (XFOIL.exe) is launched in batch mode. I've set the
path to the batch file in a CHARACTER variable:

CHAR = 'C:\WingOptim\xfoilrun.bat'

Next, I create the new process for the XFOIL executable:

STARTUPINFO = T_STARTUPINFO(SIZEOF(STARTUPINFO), &
              0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

RET = CREATEPROCESS (CHAR, &
   '"'//CHAR//'" -CHILD'C, &
   NULL_SECURITY_ATTRIBUTES, &
   NULL_SECURITY_ATTRIBUTES, &
   FALSE, &
   0, &
   NULL, &
   NULL_CHARACTER, &
   STARTUPINFO, &
   PROCESSINFO)

Finally, after a time that should be more than enough for normal execution,
I close the process and the associated handles.

RET = WAITFORSINGLEOBJECT (PROCESSINFO%HPROCESS, &
      20000)
RET = CLOSEHANDLE (PROCESSINFO%HTHREAD)
RET = CLOSEHANDLE (PROCESSINFO%HPROCESS)
RET = TERMINATEPROCESS (PROCESSINFO%HPROCESS, &
      JM_EXIT_CODE)

However, there are certain situations when the XFOIL application goes non-
responsive, as I've already mentioned.

The problem that I have is that when this happens, even though control is
transfered back to my main code and its execution continues, a certain
"residual" image of the XFOIL.EXE process remains open in my Windows task list.

If the non-responsive scenario happens several times, each time a new residual
process is created, and slowly my CPU load increases to the point where the
execution of my code becomes impossible (each XFOIL.exe residual eating 25%
of CPU maximum load).

I've also tried to forcefully close XFOIL.exe by passing the taskkill command
to the system. While my XFOIL process is open, i get its ID:

PID = PROCESSINFO%DWPROCESSID

Then, I pass the command to the system:

WRITE (STRING,110) PID
110 FORMAT ('TASKKILL /F /PID ', I5)
RESULT = SYSTEM(STRING)

However, this has no extra effect, and residuals keep building up.

The only way I found to close the residual processes is to manually force them
to close from the task list of the Windows Task Manager. However, this is not
feasible because the execution time of my code is long (a couple of days).

Can anyone point me in the right direction?

Thanks,

Oliviu

Diagnostic 15543: loop was not vectorized: loop with function call not considered an optimization candidate. (Fortran)

$
0
0

 

Cause:

A function call inside the loop is preventing auto-vectorization.

Example:

Program foo
    implicit none
    integer, parameter  :: nx = 100000000
    real(8)             :: x, xp, sumx
    integer             :: i
    interface
       real(8) function bar(x, xp)
          real(8), intent(in) :: x, xp
       end
    end interface

    sumx = 0.
    xp   = 1.

    do i = 1,nx
       x = 1.D-8*real(i,8)
       sumx = sumx + bar(x,xp)
    enddo

    print *, 'Sum =',sumx

end


real(8) function bar(x, xp)
  implicit none
  real(8), intent(in) :: x, xp

  bar = 1. - 2.*(x-xp) + 3.*(x-xp)**2 - 1.5*(x-xp)**3  + 0.2*(x-xp)**4
  bar = bar / sqrt(x**2 + xp**2)

end  
> ifort -qopt-report-phase=vec -qopt-report-file=stderr  bar.f90 foo.f90
(  ifort /Qopt-report-phase:vec /Qopt-report-file:stderr  bar.f90 foo.f90  on  Windows*)
 
Non-optimizable loops:
 

LOOP BEGIN at foo.f90(18,5)
   remark #15543: loop was not vectorized: loop with function call not considered an optimization candidate.   [ foo.f90(17,22) ]
LOOP END

 

Resolution:

The loop and function call can be vectorized using the explicit vector programming capabilities of OpenMP 4.0 or Intel® Cilk™ Plus.
For example, adding an OpenMP DECLARE SIMD directive to the function bar() and compiling with -qopenmp-simd allows the compiler to generate a SIMD (vectorized) version of  bar() as well as a scalar version.  The same OpenMP directive must be added to the interface block for bar() inside program foo. The UNIFORM clause specifies that xp is a non-varying argument, i.e., it has the same value for each iteration of the loop in the caller that is being vectorized; thus x is the only vector argument. Without UNIFORM, the compiler would have to take account that xp could also be a vector argument.
 
real(8) function bar(x, xp)
!$OMP DECLARE SIMD (bar) UNIFORM(xp)
  implicit none
  real(8), intent(in) :: x, xp

  bar = 1. - 2.*(x-xp) + 3.*(x-xp)**2 - 1.5*(x-xp)**3  + 0.2*(x-xp)**4
  bar = bar / sqrt(x**2 + xp**2)

end

> ifort -qopenmp-simd -qopt-report-phase=vec -qopt-report-file=stderr bar.f90 foo.f90
...

remark #15301: FUNCTION WAS VECTORIZED   [ bar.f90(1,18) ]

Begin optimization report for: FOO
...
LOOP BEGIN at foo.f90(16,5)

   remark #15344: loop was not vectorized: vector dependence prevents vectorization. First dependence is shown below. Use level 5 report for details
   remark #15346: vector dependence: assumed OUTPUT dependence between  line 17 and  line 18
LOOP END

A vectorized version (actually, two) of function bar() has been generated; however, the loop inside foo has still not been vectorized. This is because the compiler sees dependencies between loop iterations carried by both x and sumx. The compiler could figure out unaided how to autovectorize a loop with just these dependencies, or a loop with just the function call, but not everything at once. We can instruct the compiler to vectorize the loop by providing a SIMD directive that specifies the properties of x and sumx:
 
Program foo
    implicit none
    integer, parameter  :: nx = 100000000
    real(8)             :: x, xp, sumx
    integer             :: i

    interface
       real(8) function bar(x, xp)
       !$OMP DECLARE SIMD (bar) UNIFORM(xp)
          real(8), intent(in) :: x, xp
       end
    end interface

    sumx = 0.
    xp   = 1.

    !$OMP SIMD  private(x)  reduction(+:sumx)
    do i = 1,nx
       x = 1.D-8*real(i,8)
       sumx = sumx + bar(x,xp)
    enddo

    print *, 'Sum =',sumx

end  
> ifort -qopenmp-simd -qopt-report-phase=vec -qopt-report-file=stderr bar.f90 foo.f90
...
remark #15301: FUNCTION WAS VECTORIZED   [ bar.f90(1,18) ]
...

LOOP BEGIN at foo.f90(17,5)
   remark #15301: OpenMP SIMD LOOP WAS VECTORIZED
LOOP END

The loop is now vectorized successfully; running and timing the program shows a speedup.

Note that if the DECLARE SIMD directive is omitted, the !$OMP SIMD directive will still cause the remaining parts of the loop in foo to be vectorized, but the call to bar() will be serialized, so any performance gain is likely to be small. In either case, the private and reduction clauses of this directive are mandatory; without them, the compiler will assume no loop-carried dependencies and results may be incorrect.

For small functions such as bar(), inlining may be a simpler and more efficient way to achieve vectorization of loops containing function calls. When the caller and callee are in separate source files, as above, the application should be built with interprocedural optimization (-ipo or /Qipo). When caller and callee are in the same source file, inlining of small functions is enabled by default at optimization levels of -O2 and above.
 
ifort -ipo -qopt-report-phase=vec -qopt-report-file=stderr  bar.f90 foo.f90
...
LOOP BEGIN at foo.f90(17,5)
   remark #15300: LOOP WAS VECTORIZED
LOOP END
 
 

Back to the list of vectorization diagnostics for Intel Fortran

  • Développeurs
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • Fortran
  • Intel® Composer XE
  • Compilateur Intel® Fortran
  • Intel® Parallel Studio XE
  • Outils de développement
  • Optimisation
  • Vectorisation
  • URL
  • Zone des thèmes: 

    IDZone

    optimization with debug symbols. is that "-g -O3" or "-O3 -g" ?

    $
    0
    0

     

    Just wanted to verify what the precedence order is on compiler flags for the intel compilers is.

    is the precedence that the last flag specified on the command line the one that wins?

    I simply want to generate a binary that optimization level 3 "-O3" but that also includes debug symbols. "-g"

    Will "-g -O3" do the trick?

    Thanks

    Rene

     

     

     

     

     

     

     

     


    Different FORTRAN versions for Different Visual Studio Versions

    $
    0
    0

     

    I currently have Microsoft Visual Studio 2008 installed with Intel FORTRAN 11.1 and have projects with that setup.  I am setting up Microsoft Visual Studio 2013 with Visual FORTRAN Composer XE 2013.  The FORTRAN installer seems to indicate that it will add the new FORTRAN to Visual Studio 2008 which I do not want.  How do I keep my old configuration for Visual Studio 2008 and only add the new FORTRAN to Visual Studio 2013?

    Any assistance would be greatly appreciated.

    F90sql supports java or not

    $
    0
    0

    Dear Sir/Madam,

    I would like to know whether can I extract data from f90sql using java? If yes what should i need to do please suggest me. Thanks in advance.

    Regards,

    Neha

    build _fftpack failed

    $
    0
    0

    with below command to build part of scipy failed:

    "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\link.exe" /DLL  /LIBPATH:S:\sc\EEsofTools\Windows\vs2012\win32_64\python\2.7.3\win32_64\release\python\PCbuild\amd64 /LIBPATH:S:\sc\EEsofTools\Windows\vs2012\win32_64\python\2.7.3\win32_64\release\python\libs  /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2015\compiler\lib\intel64" /LIBPATH:S:\sc\EEsofTools\Windows\vs2012\win32_64\scipy\scipy-0.11.0\build\temp.win-amd64-2.7 dfftpack.lib fftpack.lib /EXPORT:init_fftpack build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpackmodule.obj build\temp.win-amd64-2.7\Release\scipy\fftpack\src\zfft.obj build\temp.win-amd64-2.7\Release\scipy\fftpack\src\drfft.obj build\temp.win-amd64-2.7\Release\scipy\fftpack\src\zrfft.obj build\temp.win-amd64-2.7\Release\scipy\fftpack\src\zfftnd.obj build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\src\dct.obj build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\src\dst.obj build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\fortranobject.obj /OUT:build\lib.win-amd64-2.7\scipy\fftpack\_fftpack.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpack.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpack.pyd.manifest

    Error Message:

    _fftpackmodule.obj : warning LNK4197: export 'init_fftpack' specified multiple times; using first specificatio
    n
       Creating library build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpack.lib and ob
    ject build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpack.exp
    zfft.obj : error LNK2019: unresolved external symbol zfftf_ referenced in function zfft
    zfft.obj : error LNK2019: unresolved external symbol zfftb_ referenced in function zfft
    zfft.obj : error LNK2019: unresolved external symbol zffti_ referenced in function get_cache_id_zfft
    zfft.obj : error LNK2019: unresolved external symbol cfftf_ referenced in function cfft
    zfft.obj : error LNK2019: unresolved external symbol cfftb_ referenced in function cfft
    zfft.obj : error LNK2019: unresolved external symbol cffti_ referenced in function get_cache_id_cfft
    drfft.obj : error LNK2019: unresolved external symbol dfftf_ referenced in function drfft
    drfft.obj : error LNK2019: unresolved external symbol dfftb_ referenced in function drfft
    drfft.obj : error LNK2019: unresolved external symbol dffti_ referenced in function get_cache_id_drfft
    drfft.obj : error LNK2019: unresolved external symbol rfftf_ referenced in function rfft
    drfft.obj : error LNK2019: unresolved external symbol rfftb_ referenced in function rfft
    drfft.obj : error LNK2019: unresolved external symbol rffti_ referenced in function get_cache_id_rfft
    dct.obj : error LNK2019: unresolved external symbol costi_ referenced in function get_cache_id_dct1
    dct.obj : error LNK2019: unresolved external symbol cost_ referenced in function dct1
    dct.obj : error LNK2019: unresolved external symbol cosqi_ referenced in function get_cache_id_dct2
    dct.obj : error LNK2019: unresolved external symbol cosqb_ referenced in function dct2
    dct.obj : error LNK2019: unresolved external symbol cosqf_ referenced in function dct3
    dct.obj : error LNK2019: unresolved external symbol dcosti_ referenced in function get_cache_id_ddct1
    dct.obj : error LNK2019: unresolved external symbol dcost_ referenced in function ddct1
    dct.obj : error LNK2019: unresolved external symbol dcosqi_ referenced in function get_cache_id_ddct2
    dct.obj : error LNK2019: unresolved external symbol dcosqb_ referenced in function ddct2
    dct.obj : error LNK2019: unresolved external symbol dcosqf_ referenced in function ddct3
    dst.obj : error LNK2019: unresolved external symbol sinti_ referenced in function get_cache_id_dst1
    dst.obj : error LNK2019: unresolved external symbol sint_ referenced in function dst1
    dst.obj : error LNK2019: unresolved external symbol sinqi_ referenced in function get_cache_id_dst2
    dst.obj : error LNK2019: unresolved external symbol sinqb_ referenced in function dst2
    dst.obj : error LNK2019: unresolved external symbol sinqf_ referenced in function dst3
    dst.obj : error LNK2019: unresolved external symbol dsinti_ referenced in function get_cache_id_ddst1
    dst.obj : error LNK2019: unresolved external symbol dsint_ referenced in function ddst1
    dst.obj : error LNK2019: unresolved external symbol dsinqi_ referenced in function get_cache_id_ddst2
    dst.obj : error LNK2019: unresolved external symbol dsinqb_ referenced in function ddst2
    dst.obj : error LNK2019: unresolved external symbol dsinqf_ referenced in function ddst3
    build\lib.win-amd64-2.7\scipy\fftpack\_fftpack.pyd : fatal error LNK1120: 32 unresolved externals
     

     

     

    How to solve it?  

    Thanks for your suggestion. 

    Build Scipy With MKL failed

    $
    0
    0

    I use command to build numpy first:

    python %MYPWD%/%NUMPY_VER%/setup.py config  --compiler=msvc build_clib --compiler=msvc  build_ext

    the site.cfg content is:

    [mkl]
    library_dirs = C:\Program Files (x86)\Intel\Composer XE 2015\mkl\lib\intel64
    include_dirs = C:\Program Files (x86)\Intel\Composer XE 2015\mkl\include
    mkl_libs = mkl_rt
    lapack_libs = 

    Then I build scipy with command:

    python %MYPWD%/%SCIPY_VER%/setup.py config  --compiler=msvc build_clib --compiler=msvc  build_ext

     

    It failed with message:

    _fftpackmodule.obj : warning LNK4197: export 'init_fftpack' specified multiple times; using first specificatio
    n
       Creating library build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpack.lib and ob
    ject build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\scipy\fftpack\_fftpack.exp
    zfft.obj : error LNK2019: unresolved external symbol zfftf_ referenced in function zfft
    zfft.obj : error LNK2019: unresolved external symbol zfftb_ referenced in function zfft
    zfft.obj : error LNK2019: unresolved external symbol zffti_ referenced in function get_cache_id_zfft
    zfft.obj : error LNK2019: unresolved external symbol cfftf_ referenced in function cfft
    zfft.obj : error LNK2019: unresolved external symbol cfftb_ referenced in function cfft
    zfft.obj : error LNK2019: unresolved external symbol cffti_ referenced in function get_cache_id_cfft
    drfft.obj : error LNK2019: unresolved external symbol dfftf_ referenced in function drfft
    drfft.obj : error LNK2019: unresolved external symbol dfftb_ referenced in function drfft
    drfft.obj : error LNK2019: unresolved external symbol dffti_ referenced in function get_cache_id_drfft
    drfft.obj : error LNK2019: unresolved external symbol rfftf_ referenced in function rfft
    drfft.obj : error LNK2019: unresolved external symbol rfftb_ referenced in function rfft
    drfft.obj : error LNK2019: unresolved external symbol rffti_ referenced in function get_cache_id_rfft
    dct.obj : error LNK2019: unresolved external symbol costi_ referenced in function get_cache_id_dct1
    dct.obj : error LNK2019: unresolved external symbol cost_ referenced in function dct1
    dct.obj : error LNK2019: unresolved external symbol cosqi_ referenced in function get_cache_id_dct2
    dct.obj : error LNK2019: unresolved external symbol cosqb_ referenced in function dct2
    dct.obj : error LNK2019: unresolved external symbol cosqf_ referenced in function dct3
    dct.obj : error LNK2019: unresolved external symbol dcosti_ referenced in function get_cache_id_ddct1
    dct.obj : error LNK2019: unresolved external symbol dcost_ referenced in function ddct1
    dct.obj : error LNK2019: unresolved external symbol dcosqi_ referenced in function get_cache_id_ddct2
    dct.obj : error LNK2019: unresolved external symbol dcosqb_ referenced in function ddct2
    dct.obj : error LNK2019: unresolved external symbol dcosqf_ referenced in function ddct3
    dst.obj : error LNK2019: unresolved external symbol sinti_ referenced in function get_cache_id_dst1
    dst.obj : error LNK2019: unresolved external symbol sint_ referenced in function dst1
    dst.obj : error LNK2019: unresolved external symbol sinqi_ referenced in function get_cache_id_dst2
    dst.obj : error LNK2019: unresolved external symbol sinqb_ referenced in function dst2
    dst.obj : error LNK2019: unresolved external symbol sinqf_ referenced in function dst3
    dst.obj : error LNK2019: unresolved external symbol dsinti_ referenced in function get_cache_id_ddst1
    dst.obj : error LNK2019: unresolved external symbol dsint_ referenced in function ddst1
    dst.obj : error LNK2019: unresolved external symbol dsinqi_ referenced in function get_cache_id_ddst2
    dst.obj : error LNK2019: unresolved external symbol dsinqb_ referenced in function ddst2
    dst.obj : error LNK2019: unresolved external symbol dsinqf_ referenced in function ddst3
    build\lib.win-amd64-2.7\scipy\fftpack\_fftpack.pyd : fatal error LNK1120: 32 unresolved externals

     

    Please give me your suggestion if you have experience about this. Thanks

     

    Fortran Dynamic Allocation Array

    $
    0
    0

    Hi

    the problem is that How can i increase a (Fortran) allocated array size in a program?

    in program like this:

    ...
    real(8), allocatable, dimension(:) :: x
    ...
    ! programs body
    N=100
    allocate(x(N))
    ...
    N=150
    allocate(x(N)) ! but this is an error

    there is two approach

    First: using move_alloc

    Second: using x=[x,(x(1),i=1,j-size(x))]

    but x can be a class type array in bellow program you can see usage of two approaches in two loops.

    I compare every approach for time cost and see second takes more time.

    as Steve point that: in 2nd approach because x is used on both sides of the assignment, the compiler has to create a temporary for the array constructor before assigning to the left side, thus two copies. I don't see any good way to avoid a copy as it's very unlikely that the space after the existing array is unallocated. You can avoid making two copies, though, with suitable use of MOVE_ALLOC and initializing only the expanded elements.

    !$ cat
    program realloc
    use iso_fortran_env, only : real64
    implicit none
    integer :: i,N,j
    integer, parameter :: wp=real64
    
    type math
        real(wp) :: x1
        real(wp) :: y1
    end type
    
    type(math), allocatable, dimension(:) :: h, temp
    
    N=10
    allocate(h(N))
    h(:)%x1 = 1.
    h(:)%y1 = 2.
    
    do j=N, 100000 ! this loop takes 110 s (using GNU FORTRAN)
        allocate(temp(j))
        temp(1:size(h)) = h
        call move_alloc(temp, h)
    
        h(:)%x1 = 1.
        h(:)%y1 = 2.
        !print *,"size(h)=",size(h)
    end do
    
    do j=N, 100000 ! this loop takes 160 s (using GNU FORTRAN)
        h = [h,(h(1),i=1,j-size(h))]
    
        h(:)%x1 = 1.
        h(:)%y1 = 2.
        !print *,"size(h)=",size(h)
    end do
    
    end program

    so question: Intel(R) Visual Fortran Compiler XE 13.1.0.149 can run second approach but the dimension does not increase without any error.

    and second approach is not really suitable? is really  move_alloc the best way? does it works using pointer and somethings?

    Thanks

    Compilation error ; breakpoint 0*7c90120e

    $
    0
    0

    Hi everyone,

    I've received a program that seems to work correctly on  windows 7 (code block+fortran)

    I've ran it on windows xp (vitrual machine),  i've got these errors.

    1)  forrt1: severe 29: file not found, unit 50

    I've made some changes in the  OPEN instruction, then  I've got that  new error message

    2)forrt1: severe 24: end -of-file during read, unit 50

    I've tried to use  debugger and now the error message i get is " user  break point from code at 0*7c90120e"

    I've n idea how to fix it;  can anyone help me.

    I've installed a virtual windows xp machine  on my windows 7. And i work with developer studio. My code was written  in f90.

     

    Thank u 

    Conditional Shared/Private in OpenMP parallel region?

    $
    0
    0

    Steve, Colleagues:

    For an OpenMP parallel-do loop, I would like an array to be either private or shared, depending on a determination that includes an assessment of its size and the computational work required to  determine its values. If the amount of work involved is large, I want to determine the array contents before I drop into the parallelized loop. In other circumstances, it's better to have a private copy of the array, and do the work in each loop iteration. Is there a way to make OpenMP clauses conditional?   I could duplicate the code of the entire loop in two if-clauses, the branching depending on the assessment of the array in question, but it seems like poor craftsmanship.

    David


    OpenMP crash with derived type

    $
    0
    0

    I am using Fortran Compiler XE 15.0.1.148 .

    When I compile and run the following simple program in Debug mode, it runs fine without any errors or warnings.  However, it crashes if I compile it in optimized Release mode.  I can prevent it from crashing if I disable the /Qopenmp option.  My guess is that the problem has something to do with having a derived type variable declared as private in OpenMP loop.

    program test_derived_type
    implicit none
    
    type T
       integer,allocatable:: a(:)
    end type T
    
    type(T):: b
    integer i, s
    
    s = 0
    
    !$OMP parallel do default(none), schedule(dynamic), &
    !$OMP&         private(i,b), reduction(+:s)
    do i = 1, 100
       print*, i
    
       allocate( b%a(i) )
       b%a = 1
    
       s = s + sum(b%a)
    
       deallocate(b%a)
    end do  ! i
    !$OMP end parallel do
    
    write(*,*) 's =', s
    stop
    end program test_derived_type

     

    Where did it put the output files? Bogus location - -

    $
    0
    0

    I moved some source code to a folder on my desktop, and did a project build using those.

    It did the build OK, but after searching for an hour, I could not find out where it put the output files.

    I am referring to the compiled obj files, the project file VFPROJ,  EXE and the SLN file, and buildlog.

    It tells me where they are, but I cant find them anywhere using Windows Explorer.

    None of those files are anywhere near where I stored the source code.

    It TELLS me that they are at D:\users\desktop, but that is NOT where my desktop is -

    My desktop is under my USER NAME under users. So it appears that the location is

    where I cant reference it.

     

    The reason I need to find that is : I need to put the input data file where the default directory is,

    and apparently that is not accessible to me. apparently it is accessible to VS, but thats not any help here.

    Apparently that users\desktop is a BOGUS location, how would I get to it?

    Debugging -debug:minimal code with VS2013

    $
    0
    0

    When using VS2013 Update 4, for Fortran source files compiled with -debug:minimal we lost the ability to set breakpoints or have the source file automatically opened in the IDE with Break All. The breakpoints appear as hollow circles with a warning sign, and the tooltip reads "The breakpoint will not currently be hit. Unexpected symbol reader error while processing hello.exe". The Modules window shows "Symbols loaded." in the Symbol Status column for hello.exe.

    We're using Compiler 15 Update 1.

    To reproduce, attach to the following .exe, built with ifort -debug:minimal hello.f90

    program hello
     print *, "Press Enter to continue..."
     read (*, *)
     print *, "Hello World!"
    end

     

    There are no issues when using -debug:full, but that generates different code when combined with optimizations (-Ox).

    The -debug:minimal code can be debugged with VS2010 SP1, both for setting up breakpoints and associating the source with the current code location when breaking the execution.

    Using DwmEnableComposition

    $
    0
    0

    I have a Fortran application with an embedded OpenGL window. I need to call DwmEnableComposition to turn off Aero so that the buttons refresh correctly but I can't work out how to do it. I've added Dwmapi.lib to the linker line but still get

    unresolved external symbol dwmiscompositionenabled referenced in function WinMain

    My interface is

            integer(LRESULT) function DwmEnableComposition(c) bind(c)
                import
                integer(UINT), value :: c
            end function DwmEnableComposition

    and my calling sequence is

             lret = DwmIsCompositionEnabled(compositionEnabled)
             if (compositionEnabled) then
                 DWM_EC_DISABLECOMPOSITION = 0
                 lret = DwmEnableComposition(DWM_EC_DISABLECOMPOSITION)
             else
                 compositionEnabled = .false.
             end if

    Any ideas greatly appreciated.

     

    stack overflow in write-stmt with 2d-array

    $
    0
    0

    Dear developers,

    I observed a bug under Win7(64-bit) with  Intel-12.1.2  Fortran-compiler :

    In a write-stmt  the Intel-compiler uses the stack, where it is not necessary, and then (certainly) aborts with a stack overflow, if the stack is too small.

    Here are example stmts:

     

         real, allocatable :: realarray(:,:)

         ndim=500000

         allocate(  realarray(ndim,3) )

         realarray = 0.0 

         open(100, form='unformatted')

        write(100)   realarray( :, 2 )                      ! --> this works

        write(100)   realarray( :ndim, 2 )              ! --> this should be exacly the same, but results in a stack overflow

        write(100)   realarray( :ndim-100, 2 )       ! --> results also in a stack overflow

    I remember darkly, that this kind of bug  already appeared with the good old COMPAQ-Ftn-compiler.

    Note, that this bug with the 2d-array does not occur for a 1d-array.

       Greetings     Michael R.

     

     

     

     

    Viewing all 3108 articles
    Browse latest View live


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