Knowledge Base

32 downloads 3563 Views 71KB Size Report
Nov 10, 2014 - option to the Abaqus c ompile and link parameters. ... Insert an articial breakpoint in the user subroutine which can be used t o hang the ...
Knowledge Base Information

Under Revision

Portfolio / Domain: Product:

SIMULIA Abaqus Unified FEA / SIMULIA Abaqus Unified FEA n/a

QUESTION

Is there a way to use a debugger with my user subr outine or post pr ocessing program?

ANSWER

(The following applies t o Abaqus V ersion 6. 5 and later.)

QA Ar ticle: Applicable Level: Last Update Date: Rating: Views:

QA00000007986 Nov 10, 2014 Not rated yet 476 views

Support Information Status: Visibility:

Validated Customer End User

Abaqus provides a debugging utility to help troubleshoot is sues with user subr outines. The utility is designed to work with the following debuggers: Microsoft Visual Studio .NET 2003 (msdev) Microsoft Visual Studio 2005 (devenv)

Available Languages

Windows Debugger (windbg) Etnus Totalview (totalview)) GNU Debugger (gdb) DBX Debugger (dbx) GNU DDD: The Data Display Debugger (ddd) Intel Debugger (idb) Workshop Debugger (cvd) HP-UX Debugger (wdb) Note: The Data Display Debugger works only as a gr aphical front-end for the Intel debugger. 1. Verify that the debugger that you intend to use is functional AND ac cessible from the c ommand line. For example, if using Totalview debugger, the c ommand totalview (without the path) should star t the debugger. 2. Review the debug utility usage syntax by running the debug command: (Please note that this utility is maintained for internal use; ther efore, all debugging options may not be available) d:\temp>abq6141 debug help= Error: must use "‐" syntax.  For example: USAGE:     abq debug  [] ‐job c1 ...     abq debug cae [ ‐exe ker|gui ] ...     abq debug [ ‐exe   [ ‐core  ]] OPTIONS:     ‐db debugger    ‐‐ Debugger to launch     ‐exe executable ‐‐ Executable to debug     ‐stop function  ‐‐ Function to stop at     ‐wait           ‐‐ Wait for license (if unavailable)     ‐dbscript  ‐‐ Load custom debugger script at startup     ‐dbargs "..."   ‐‐ Pass arguments to the debugger EXAMPLES ‐‐ SOLVERS     abq debug ‐pre       dbx  ‐job c1  ...     abq debug ‐standard  cvd  ‐job c1  ...     abq debug ‐standard  gdb  ‐job c1  ‐stop step_     abq debug ‐explicit       ‐job x1     abq debug ‐explicit       ‐job x1  ‐double     abq debug ‐explicit       ‐job x1  ‐recover EXAMPLES ‐‐ CAE     abq debug cae ‐exe ker ...     abq debug cae ‐exe gui ... EXAMPLES ‐‐ TEST PROGRAMS     abq debug test cowT_String Default debugger on this platform is:  devenv Recognized executables:    pre,package,standard,explicit,select,state,Calculator,Extrapolator,ker,gui,cse Recognized debuggers:    devenv,msdev,msdev10,windbg,totalview,tvbeta,tvold,gdb,gdb64,dbx,cvd,wdb,ddd,idb 3. Copy the attached debug.env c ode to a local dir ect ory abaqus_v6.env file to add the appropriate c ompiler debug option to the Abaqus c ompile and link parameters. C ompiler performance options will also be r emoved. 4. Run the job with the user subr outine according to the examples above:

English

MY FAVORITE CONTENT

Debugging user subroutines and post processing programs

abaqus –j job –user user –debug –standard 5. When the debugger starts, open the sour ce of the user subr outine, add wat chpoints, br eakpoints, etc . and star t the run. Note: Some debuggers like CVD will not work by f ollowing the method described above as they do not r ecognize the way Abaqus spa wns a pr oc ess. However t here is an indirect way of getting ar ound this problem. First launch the CVD debugger. Insert an ar ticial breakpoint in the user subr outine which can be used t o hang the proc ess. This can be achieved in two ways. One is t o prompt the user f or a value in the user subr outine. Alternatively, you can have an infinite loop in the user subr outine by inserting something like: do while(JFLAG .ne. 999) JFLAG = 1 end do Run the Abaqus job the usual way: abaqus ‐j job ‐user user Attach the analysis pr oc ess (the proc ess spa wned by the Abaqus job) t o CVD . You may see mor e than one proc ess. Attach the one that shows the CPU time incr easing. Onc e you attach t o the proc ess CVD will show the subr outine and the program c ounter will hang in the artificially inserted break point. If you are using the infinite loop as a br eak point then the value of JFLAG can be changed. In CVD you can use View → Variable Browser

Debugging post-proc essing routines: 1. Copy the attached debug.env c ode to a local dir ect ory abaqus_v6.env file to add the appropriate c ompiler debug option to the Abaqus c ompile and link parameters. C ompiler performance options will also be r emoved. 2. Build the program using the abaqus make proc edure. abaqus make ‐j prog 3. In some cir cumstances, you may need t o e xec ute the postpr oc essing program without the driver. In this case, the appropriate library sear ch path must be setup . Run the attached Python script t o determine the appropriate environment setting you will need to apply. abaqus python getLibPath.py 4. Launch your debugger and load the exec utable. Note: the debugger may report a warning that the sour ce c ode for "main" was not f ound.  You can just ignor e this message. Open your c ode in the debugger, set br eakpoints, and star t the run. For additional information: Making user-defined exec utables and subr outines Section 3.2.17 of the Abaqus 6.12 Analysis User's Guide Section 3.2.16 of the Abaqus 6.13 Analysis User's Guide Flushing output buffers f or user subr outine development Writing Abaqus/Standard user subr outines in C++

KEYWORDS

ATTACHMENT

debugger, debug, MSDev, MS Development Studio, CVD, totalview, user subr outines, subr outine, make, l

debug.env

getLibPath.py

SUBSCRIBE TO CHANGES RATING

On a scale of 1-5, how would you r ate the technical c ontent of the ar ticle? Please r ate this ar ticle...

MY FAVORITE CONTENT

to set it t o 999. Set a br eak point in the subroutine and continue debugging.