Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort parameters and debugging

Ahmad_Falahatpisheh
1,644 Views
Hi,

1. I am wondering how I can retrieve information from the command ifort /debug:all. What kind of information creates when I use /debug?


2. I am using Abaqus user subroutine. When I change the integer variable definitions to INTEGER*8 it stops working and it works only for INTEGER and INTEGER*4. Therefore, I used ifort /4i8 but it didnt work. Could you tell me what the problem is? Doesn't /4i8 override the variable definitions of INTEGER and INTEGER*4?


3. Since Abaqus runs STANDARD.EXE which it calls ifort to compile the fortran code of the user subroutine, how can I use "Intel Debugger for Applications running on Intel 64"? Is there any way so that I can debug each line of the code and watch the values of the variables when Abaqus calls the code and runs it (like the debugger of Microsoft Visual Studio)?

Thank you,
Ahmad


Also, I dont know if I use ifort /4i8 does it override the variable definitions of INTEGER and INTEGER*8?
0 Kudos
9 Replies
Ahmad_Falahatpisheh
1,644 Views
I should add that I am running ifort on a x64 machine. Does it change the INTEGER*4 automatically to INTEGER*8?

Thanks.
0 Kudos
TimP
Honored Contributor III
1,644 Views
No, if you specify a specific KIND, not even the command line options to change the default data type sizes will alter it. In fact ifort doesn't change any default data types according to OS, other than the iso_c_binding types C_LONG (but not on Windows), C_SIZE_T, C_INTPTR_T.
0 Kudos
Steven_L_Intel1
Employee
1,644 Views
1. When you use /debug, the compiler adds information that can be used by the Visual Studio debugger. You can't access this information any other way. If you want to view the values of PARAMETER constants, add /debug-parameters .

2. You can't arbitrarily change the datatype of routine arguments without making sure that the caller is also using the new type. /4i8 is an obsolete option - /integer_size:64 is the recommended spelling. It does change the meaning of INTEGER but not that of INTEGER*4.

3. I am not familiar with how ABAQUS works to be able to advise you here.
0 Kudos
Ahmad_Falahatpisheh
1,644 Views
I used /integer_size:64 but it didnt work too. I am wondering why it works when I change the code from INTEGER*8 to INTEGER*4 or INTEGER. What can be wrong? (I am following FORTRAN77 standards.)

Thank you,
Ahmad
0 Kudos
Steven_L_Intel1
Employee
1,644 Views
As I wrote above, you can't just decide on your own to change an argument size from INTEGER*4 to INTEGER*8 - any such change has to also be reflected in the caller of your procedure. If Abaqus is passing a 4-byte integer, you must accept it as a 4-byte integer.
0 Kudos
Ahmad_Falahatpisheh
1,644 Views
Abaqus doesn't pass anything to my subroutine. I have to reads from a file and counts the number of elements. This number is like 1,000,000.

Thank you,
Ahmad
0 Kudos
Steven_L_Intel1
Employee
1,644 Views
Please show the source of your subroutine and explain what doesn't work.

1,000,000 is fine in an INTEGER*4.
0 Kudos
Ahmad_Falahatpisheh
1,644 Views
SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,
1 RPL,DDSDDT,DRPLDE,DRPLDT,
2 STRAN,DSTRAN,TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,CMNAME,
3 NDI,NSHR,NTENS,NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,
4 CELENT,DFGRD0,DFGRD1,NOEL,NPT,LAYER,KSPT,KSTEP,KINC)
C
C
INCLUDE 'ABA_PARAM.INC'
C
C
CHARACTER*80 CMNAME
DIMENSION STRESS(NTENS),STATEV(NSTATV),
1 DDSDDE(NTENS,NTENS),DDSDDT(NTENS),DRPLDE(NTENS),
2 STRAN(NTENS),DSTRAN(NTENS),TIME(2),PREDEF(1),DPRED(1),
3 PROPS(NPROPS),COORDS(3),DROT(3,3),DFGRD0(3,3),DFGRD1(3,3)
C
STATIC INI_FLAG
LOGICAL INI_FLAG /.FALSE./
C
C ICOUNTER:
INTEGER*8 ICOUNTER
C
INTEGER*8 NMAX
PARAMETER (NMAX=1000000)
C
C
C NODAL VARIABLES
C -----------------------------
INTEGER*8 NODEID(NMAX)
DOUBLE PRECISION X(NMAX),Y(NMAX),Z(NMAX)
C
C
IF (INI_FLAG.EQ..FALSE.) THEN
C
C READING THE NODES FIRST FROM THE FILE.
C --------------------------------------
OPEN(UNIT=63,FILE='C:\TEMP\NODES.TXT');
ICOUNTER=1
DO WHILE (.NOT.EOF(63))
READ(63,*) NODEID(ICOUNTER),
1 X(ICOUNTER),Y(ICOUNTER),Z(ICOUNTER)
ICOUNTER=ICOUNTER+1
ENDDO
CLOSE(63)
C
WRITE(6,*) 'TOTAL NUMBER OF NODES IN THE DOMAIN=',ICOUNTER-1
C
C NOW TURN ON INI_FLAG
INI_FLAG = .TRUE.
C
C END OF INITIALIZATION
ENDIF
C
RETURN
END

**********************************************
**********************************************
**********************************************
**********************************************
**********************************************
In NODES.TXT, I have integer numbers which can be very big (like 10,000,000). They are the number of nodes in Finite Element Analysis.

Abaqus uses IFORT with these parameters:

compile_fortran=['ifort', '/c','/DABQ_WIN86_64',
'/recursive', '/Qauto-scalar', '/QxW', '/nologo', '/Od', '/include:%I']

to create library standardU.lib and object standardU.exp. There is no error in compiling the user subroutine. Then Abaqus links the above user subroutine (UMAT). Finally, STANDARD.EXE, which is the solver of ABAQUS, calls UMAT. I get error when it comes to this step and actually ICOUNTER has exceeded the limit.

I should add that ABA_PARAM.INC is an internal file which includes one of the following in the user subroutine based on the fact that the solver is SINGLE or DOUBLE PRECISION:

parameter (nprecd=1)

or

implicit real*8(a-h,o-z)
parameter (nprecd=2)




0 Kudos
Ahmad_Falahatpisheh
1,644 Views
Steve,

When I run the following simple code it implies that 1,000,000 is fine in my machine (as you said)

program test_integer_4
integer*4 icounter
icounter=1
do while (1.eq.1)
print*,icounter
icounter=icounter*2
enddo
end

icounter can go like 1,073,741,824. I think I know now what my problem is. I tried to decrease NMAX in PARAMETER (NMAX=1000000) in UMAT. First, I ran my user subroutine with NMAX=32767 but it didnt work.It works perfectly until NMAX is less than 25000 (I dont have the exact number but I tried 25000 and it failed and tried 20000 and it worked).
0 Kudos
Reply