Announcement

Collapse
No announcement yet.

Compiling user routine into object file.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compiling user routine into object file.

    Hi All,

    I need to run multiple jobs on different compute nodes of a cluster. For that I need to first compile my user subroutine into an *.o file.

    Has anybody tried compiling a user subroutine into an object file on Linux with out using ABAQUS ?

    I am assuming once I compile the code into an object file I will not the Intel Fortran License for all the nodes. I have only one Intel Fortran license that too not for compute node.

    Regards

  • #2
    Yes, you can compile the code on one computer and then use output on other nodes that do not have a compiler. Note that you should not compile to an object file, though. You should compile it to a shared library, i.e. a so-file.

    You can perform this compilation using the command:
    abaqus make library=[file.f]

    The compilation can also be performed without using Abaqus.

    -Jorgen
    Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

    Comment


    • #3
      Yes, you can compile the code on one computer and then use output on other nodes that do not have a compiler. Note that you should not compile to an object file, though. You should compile it to a shared library, i.e. a so-file.

      You can perform this compilation using the command:
      abaqus make library=[file.f]

      The compilation can also be performed without using Abaqus.

      -Jorgen
      Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

      Comment


      • #4
        re:

        Hi Jorgen,

        I compile it exactly as you told:

        abaqus make library=myumat.f

        and it gives me the following files:

        myumat-std-o
        libstandardU.so

        Then I tried the *.so file on abaqus job command to run the simulation like this:

        (1) abaqus job=myinput input=myinput user=libstandardU.so

        also

        (2) abaqus job=myinput input=myinput user=myumat.f

        (with the above *.so library file in the local directory)

        But neither work out.

        (1) Showed Error: The following file(s) could not be located: libstandardU.f, libstandardU.o

        (2) showed Error: A license for FCompL could not be obtained.


        Am I missing something here?

        Thanks for your reply.

        A

        Comment


        • #5
          Once you have the libstandardU.so file you should copy that file to a location that can be read by each node. Then you need to add the following line your your abaqus_v6.env file on each node:

          usub_lib_dir = 'path to the directory where libstandardU.so is stored'
          Then run abaqus without any "user=..." option.

          - Jorgen
          Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

          Comment


          • #6
            Result Files Missing

            Thanks Jorgen,

            It worked pretty well. However, I am missing the text files I write within my program. I wanted to save those files in the same directory where I run my input file. I could not locate them even in the ABAQUS home directory.

            Alankar

            Comment


            • #7
              Have you tried to provide the full path name when you open the text files?

              -Jorgen
              Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

              Comment


              • #8
                re:

                Jorgen,

                Yes, the full file path always works. Since, I will be using same subroutine library for running many simulations in different directories, I need to keep the path updated accordingly. If using same directory, one way would be to create a file name based on the job start time, to avoid the file I/O conflict and to keep the results distinguished.

                I would like to keep different jobs in different directories, and I do not know how to do that. Should I use CNAME in the input file and subroutine, and use it to create a file name?

                Alankar

                Comment


                • #9
                  I don't know of a simple and elegant solution to your problem. I recommend that you try the solutions that you mentioned and see what works best for you.

                  -Jorgen
                  Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

                  Comment


                  • #10
                    Linking Abaqus and subroutines

                    Hello,
                    I'm having the same problem.
                    I am using the 2016 version of Abaqus but still don't have a Fortran compiler. So the use of "Abaqus make" utility may help me.
                    To my understanding after reading your conversation, if I want to run analysis with a subroutine on my computer (I have only Abaqus 2016, but not any compiler), I need:

                    (1) Having source file abc.for containing any subroutines I want to use.
                    (2) Using "Abaqus make" utility on a computer that has both Abaqus and compiler to create a shared object, as follows:
                    Abaqus make library=abc.for (2a)
                    (3) The command (2a) will give me an object file abc-std.obj and a shared object standardU.so. Right?
                    (4) I copy only the standardU.so to a directory A on my computer and setting usub_lib_dir="path to directory A" in Abaqus environment file, then run analysis using:
                    abaqus job=job-name (without User = ....)

                    Is that a right procedure?

                    Originally posted by alankar View Post
                    Hi Jorgen,

                    I compile it exactly as you told:

                    abaqus make library=myumat.f

                    and it gives me the following files:

                    myumat-std-o
                    libstandardU.so

                    Then I tried the *.so file on abaqus job command to run the simulation like this:

                    (1) abaqus job=myinput input=myinput user=libstandardU.so

                    also

                    (2) abaqus job=myinput input=myinput user=myumat.f

                    (with the above *.so library file in the local directory)

                    But neither work out.

                    (1) Showed Error: The following file(s) could not be located: libstandardU.f, libstandardU.o

                    (2) showed Error: A license for FCompL could not be obtained.


                    Am I missing something here?

                    Thanks for your reply.

                    A
                    Last edited by dacthuongngo; 2016-05-27, 09:00.

                    Comment


                    • #11
                      Sounds great
                      Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

                      Comment


                      • #12
                        Originally posted by Jorgen View Post
                        Sounds great
                        Hi Jorgen,

                        1. If we can use the .dll or .so file so easily without any compiler, then why is there are so many people asking in forums how to link intel fortran with ABAQUS?

                        2. What are the disadvantages of using this instead of using the compilers?

                        Comment


                        • #13
                          If you have a .dll or .so file then you can use it without any compiler. It is nice and easy to use.

                          If you have a user-subroutine (for example in Fortran) then you need to first compile it. For that you need to use appropriate compilers.

                          -Jorgen
                          Jorgen Bergstrom, Ph.D. PolymerFEM Administrator

                          Comment


                          • #14
                            Originally posted by Jorgen View Post
                            If you have a .dll or .so file then you can use it without any compiler. It is nice and easy to use.

                            If you have a user-subroutine (for example in Fortran) then you need to first compile it. For that you need to use appropriate compilers.

                            -Jorgen
                            Hi Jorgen,

                            I still have problems with using.obj file without the Intel Fortran compiler. Let me describe the problems I had in details:

                            Computer A has Windows 7, ABAQUS 6.14-2,Visial Studio 2013, and Intel Fortran composer xe 2013. I can use this system run simulation with user subroutine FILM without any problem.
                            Computer B has Windows 7, ABAQUs 6.14-2 and Visial Studio 2013.
                            The purpose is to run the simulation on Computer B with user subroutine without Intel Fortran.

                            I used the command "ABAQUS make library=Myfilm.for" on Computer A, it gave me standardU.dll and Myfilm-std.obj. Copied files .cae, .dll, .obj to Computer B
                            • Trial 1: Directly use CAE. Put the cae file, Myfilm-std.obj, and standard U.dll under "F:\TEMP". Open CAE=>go to job module=>creat job=>edit job=>under General tab user subroutine file=>select Myfilm.obj.
                              Submit job, I got the error message "Problem during linking - Abaqus/Standard User Subroutines. This error may be due to a mismatch in the Abaqus user subroutine arguments. These arguments sometimes change from release to release, so user subroutines used with a previous release of Abaqus may need to be adjusted."
                              Searched this error message on Google, the conclusion is incorrect installation of VS or Intel Fortran. Since I don't have Intel Fortran installed on Computer B and the versions of ABAQUS on computer A and B are identical, this error message doesn't make any sense. I uninstalled Intel Fortran on Computer A and repeat Trial 1 on Computer A, the same error message. Therefore, in my mind, this error message indicates "no Intel Fortran is installed", nothing to do with ABAQUS or VS.
                            • Trial 2: Copy Myfilm-std.obj and standard U.dll to "C:\User_Subroutine" on Computer B, .CAE under "F:\TEMP". Set usub_lib_dir='C:\User_Subroutine' in abaqus_v6.env.
                              a) In CAE, go to job module => creat job => edit job => under General tab user subroutine file => select Myfilm.obj => Write Input => ABAQUS comment window=> abaqus j=myjob (without user=Myfilm-std.obj)
                              b) In CAE, go to job module => creat job => edit job => under General tab user subroutine file => leave it blank => Write Input => ABAQUS comment window=> abaqus j=myjob (without user=Myfilm-std.obj)
                              Got the same error message in .msg file " ***ERROR: USER SUBROUTINE FILM IS MISSING". It is hard for me to understand that without specifying the name of the subroutine file by using user=, how dose ABAQUS know which subroutine I want to use. I also can't understand "Set usub_lib_dir=... in abaqus_v6.env."
                            • Trial 3: Put .cae, .obj, and .dll under “F:\Temp”.go to job module => creat job => edit job => under General tab user subroutine file => leave it blank => Write Input => ABAQUS comment window=> abaqus j=myjob user=Myfilm-std.obj. No .msg file generated. Found the error message in .log file “Begin Linking Abaqus/Standard User Subroutines
                              'LINK' is not recognized as an internal or external command,
                              operable program or batch file.
                              Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.
                              This error may be due to a mismatch in the Abaqus user subroutine arguments.
                              These arguments sometimes change from release to release, so user subroutines
                              used with a previous release of Abaqus may need to be adjusted.
                              Abaqus/Analysis exited with errors”
                            I'm at a dead end now. Please kindly guide me. I'm sure you successfully did it in Linux and I believe it should work in Windows. Any help will be appreciated.

                            Comment


                            • #15
                              Hi everyone,

                              I'm stuck too (following acthuongngos method).

                              After compilation I receive both output files (mysub-std.o and libstandardU.so) and moved the libstandardU.so to the job directory. I set a local abaqus_v6.env file within the job directory specifying the usub directory.

                              Code:
                              abaqus_v6.env
                              
                              usub_lib_dir="file:\\\c:\\abaqustemp"
                              However, the message file says that the subroutine could not be found.

                              Code:
                              job.msg
                              
                              ***ERROR: USER SUBROUTINE UINTER IS MISSING

                              The directory path within the env files is given in various ways (e.g. custom_v6.env). I've tried both but none is working.

                              Code:
                              custom_v6.env
                              
                              plugin_central_dir="C:\\SIMULIA\\CAE\\plugins\\2017"
                              doc_root="file:///C:/Program Files/Dassault Systemes/SIMULIA2017doc/English"

                              UPDATE

                              I just noticed out that the compiler (Linux) is generating the correct .so file, while my Windows machine probably will search for an .dll file.

                              Abaqus erstellt dabei die dynamische Bibliothek libstandardU.so (MS Windows: libstandardU.dll) und linkt alle statischen Bibliotheken mit dem Muster <lib-path>/*-std.o (MS Windows: <lib-path>/*-std.obj) hinzu.

                              https://wiki.ubuntuusers.de/Abaqus/
                              Yaiks. I'm finished
                              Last edited by Hans.f; 2018-06-06, 02:47.

                              Comment

                              Working...
                              X