Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-2854

Moderator error when starting libCInterface

    Details

      Description

      In newer builds of GMAT, the libCInterface does not seem to work. The Moderator fails to start when loaded through the interface.

      This broke sometime around the end of 2011 or beginning of 2012. It is known to work in 2011-09-30.

      This is being asked for by folks working OSIRIS and X-Nav.

      I can get more details when needed; I just wanted to make sure this is being tracked.

        Gliffy Diagrams

          Attachments

            Activity

            jjkparker Joel Parker created issue -
            Hide
            gmat_wcs Wendy Shoan added a comment -

            CCB: P1 R2013a

            Show
            gmat_wcs Wendy Shoan added a comment - CCB: P1 R2013a
            gmat_wcs Wendy Shoan made changes -
            Field Original Value New Value
            Priority P2 [ 3 ] P1 [ 1 ]
            Fix Version/s R2013a [ 10201 ]
            shughes Steven Hughes made changes -
            Assignee Steven Hughes [ shughes ] Darrel Conway [ djcinsb ]
            Hide
            shughes Steven Hughes added a comment -

            Regarding: "I can get more details when needed; I just wanted to make sure this is being tracked."

            We need the details. Can you attach something to help duplicate!

            Show
            shughes Steven Hughes added a comment - Regarding: "I can get more details when needed; I just wanted to make sure this is being tracked." We need the details. Can you attach something to help duplicate!
            djcinsb Darrel Conway made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            jjkparker Joel Parker added a comment -

            Here's the link I sent Darrel via email:
            https://sourceforge.net/apps/trac/odtbx/wiki/GmatInterface

            This has a step-by-step set of instructions for running the interface from an ODTBX perspective. The aspects dealing with the startup file are really fragile; that best thing may be to get it working with the 2011-09-30 build, then recreate the setup with the latest.

            I can send the complete 2011-09-30 build, if necessary.

            Show
            jjkparker Joel Parker added a comment - Here's the link I sent Darrel via email: https://sourceforge.net/apps/trac/odtbx/wiki/GmatInterface This has a step-by-step set of instructions for running the interface from an ODTBX perspective. The aspects dealing with the startup file are really fragile; that best thing may be to get it working with the 2011-09-30 build, then recreate the setup with the latest. I can send the complete 2011-09-30 build, if necessary.
            Hide
            djcinsb Darrel Conway added a comment -

            From mail message sent 7/12/12:

            When I build libCInterface, I hear a ding from MATLAB when the interface file is building. If I look at the MATLAB console, I see this information:

             
                This script builds the GMAT interface prototypes by calling
                loadlibrary. The prototype file is placed in
                trunk/application/matlab/libCInterface.
                Warning: File not found or permission denied
                > In loadlibrary>deltempfiles at 636
                  In loadlibrary at 423
                  In prepareInterface at 13
                ??? Error using ==> movefile
                The process cannot access the file because it is being used by another process.
            
            
            
                Error in ==> prepareInterface at 16
                movefile('interfacewrapper.m', matlabdir);
            

            It looks to me like the interface wrapper file is not getting built or at least not getting moved in place. (Are you trying to run new code with a stale wrapper?) Here's what I did to check this hypothesis:

            If I search for a recently built version of the file, I find one in trunk\build\windows-VS2010\libCInterface. If I copy THAT file into place in my test environment (note: it is different from the ODTBX environment, because I have not taken the time to refresh my ODTBX stuff, so I'm rolling this all by hand at the moment), then when I run my typical load checks, I see this correct behavior:

             
                >> cd \TS_Code\GmatDevelopment\application\bin\
                >> [notfound, warnings] = loadlibrary('libCInterface', @InterfaceWrapper)
            
                notfound =
            
                   Empty cell array: 0-by-1
            
            
                warnings =
            
                     ''
            
                >> ode = calllib('libCInterface','StartGmat')
            
                ode =
            
                     0
            
                >> calllib('libCInterface','getLastMessage')
            
                ans =
            
                The Moderator has been initialized
            
                >> 
            

            The Moderator is being initialized correctly for the current code when using an interface file which is also generated from the current code, as far as I can tell.

            Show
            djcinsb Darrel Conway added a comment - From mail message sent 7/12/12: When I build libCInterface, I hear a ding from MATLAB when the interface file is building. If I look at the MATLAB console, I see this information: This script builds the GMAT interface prototypes by calling loadlibrary. The prototype file is placed in trunk/application/matlab/libCInterface. Warning: File not found or permission denied > In loadlibrary>deltempfiles at 636 In loadlibrary at 423 In prepareInterface at 13 ??? Error using ==> movefile The process cannot access the file because it is being used by another process. Error in ==> prepareInterface at 16 movefile('interfacewrapper.m', matlabdir); It looks to me like the interface wrapper file is not getting built or at least not getting moved in place. (Are you trying to run new code with a stale wrapper?) Here's what I did to check this hypothesis: If I search for a recently built version of the file, I find one in trunk\build\windows-VS2010\libCInterface. If I copy THAT file into place in my test environment (note: it is different from the ODTBX environment, because I have not taken the time to refresh my ODTBX stuff, so I'm rolling this all by hand at the moment), then when I run my typical load checks, I see this correct behavior: >> cd \TS_Code\GmatDevelopment\application\bin\ >> [notfound, warnings] = loadlibrary('libCInterface', @InterfaceWrapper) notfound = Empty cell array: 0-by-1 warnings = '' >> ode = calllib('libCInterface','StartGmat') ode = 0 >> calllib('libCInterface','getLastMessage') ans = The Moderator has been initialized >> The Moderator is being initialized correctly for the current code when using an interface file which is also generated from the current code, as far as I can tell.
            Hide
            djcinsb Darrel Conway added a comment -

            Passing the buck – um, I mean reassigning - to Joel to check the interface wrapper part of the build process by building the wrapper by hand and seeing if one built that way cleans up the issue.

            Joel – if this does not fix the issue, please reassign it to me with some notes that tell me how to see the issue. Thanks.

            Show
            djcinsb Darrel Conway added a comment - Passing the buck – um, I mean reassigning - to Joel to check the interface wrapper part of the build process by building the wrapper by hand and seeing if one built that way cleans up the issue. Joel – if this does not fix the issue, please reassign it to me with some notes that tell me how to see the issue. Thanks.
            djcinsb Darrel Conway made changes -
            Assignee Darrel Conway [ djcinsb ] Joel Parker [ jjkparker ]
            Hide
            jjkparker Joel Parker added a comment - - edited

            Darrel, I may be doing something wrong here, but I'm not having the same luck you are. Attached is a script (loadtest.m) that tries the load the interface and start the Moderator. To get around any build problems, it uses the header file directly instead of interfacewrapper.m.

            To run it, change the top two variables in the script to point to the application path and the CInterfacePlugin src path.

            When I point this at the 2011-09-30 build (and follow the startup file peculiarities for that build), this works fine. When I point it at the 2012-07-16 build or my own VS2010 build, I get error -2 when it calls StartGmat.

            This is using MATLAB R2012a 32-bit.

            Show
            jjkparker Joel Parker added a comment - - edited Darrel, I may be doing something wrong here, but I'm not having the same luck you are. Attached is a script (loadtest.m) that tries the load the interface and start the Moderator. To get around any build problems, it uses the header file directly instead of interfacewrapper.m . To run it, change the top two variables in the script to point to the application path and the CInterfacePlugin src path. When I point this at the 2011-09-30 build (and follow the startup file peculiarities for that build), this works fine. When I point it at the 2012-07-16 build or my own VS2010 build, I get error -2 when it calls StartGmat . This is using MATLAB R2012a 32-bit.
            jjkparker Joel Parker made changes -
            Attachment loadtest.m [ 12610 ]
            Hide
            jjkparker Joel Parker added a comment -

            Furthermore, I just found your CInterfaceTester in the SourceForge repo. When I build it and point it at my own VS2010 GMAT build, the Moderator loads successfully.

            It would appear that this is a MATLAB-only or, more likely, a configuration issue.

            Show
            jjkparker Joel Parker added a comment - Furthermore, I just found your CInterfaceTester in the SourceForge repo. When I build it and point it at my own VS2010 GMAT build, the Moderator loads successfully. It would appear that this is a MATLAB-only or, more likely, a configuration issue.
            jjkparker Joel Parker made changes -
            Assignee Joel Parker [ jjkparker ] Darrel Conway [ djcinsb ]
            Hide
            djcinsb Darrel Conway added a comment -

            I found and fixed what I think is the initialization bug. (But then, I've thought that before...) Please check this with a build dated 7/19 or later and let me know.

            Show
            djcinsb Darrel Conway added a comment - I found and fixed what I think is the initialization bug. (But then, I've thought that before...) Please check this with a build dated 7/19 or later and let me know.
            djcinsb Darrel Conway logged work - 18/Jul/12 9:40 PM
            • Time Spent:
              1 day
               
              <No comment>
            djcinsb Darrel Conway made changes -
            Worklog Id 11608 [ 11608 ]
            Time Spent 1 day [ 28800 ]
            Remaining Estimate 0 minutes [ 0 ]
            djcinsb Darrel Conway made changes -
            Resolution Fixed [ 1 ]
            Assignee Darrel Conway [ djcinsb ] Joel Parker [ jjkparker ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            Hide
            jjkparker Joel Parker added a comment -

            I confirmed that it now works in a custom VS2010 build from r10656.

            I was expecting that it would know to look next to libGmatBase.dll for the startup file (due to the fix for GMT-2344), but it's still looking for the startup file in whatever working directory I'm in. But, that's a separate issue that I'll check in elsewhere.

            Waiting to verify until it's in an official build.

            Show
            jjkparker Joel Parker added a comment - I confirmed that it now works in a custom VS2010 build from r10656. I was expecting that it would know to look next to libGmatBase.dll for the startup file (due to the fix for GMT-2344 ), but it's still looking for the startup file in whatever working directory I'm in. But, that's a separate issue that I'll check in elsewhere. Waiting to verify until it's in an official build.
            Hide
            djcinsb Darrel Conway added a comment -

            Actually, it is the "fix" for 2344 that appears to have broken the CInterface code. The default value (with no path) for the startup file was removed with that fix, which then prevented the CInterface from initializing the Moderator.

            Show
            djcinsb Darrel Conway added a comment - Actually, it is the "fix" for 2344 that appears to have broken the CInterface code. The default value (with no path) for the startup file was removed with that fix, which then prevented the CInterface from initializing the Moderator.
            Hide
            jjkparker Joel Parker added a comment -

            I can verify this fix using the 2012-07-19 nightly. I'll close once I get a bug in for the startup file issue.

            Show
            jjkparker Joel Parker added a comment - I can verify this fix using the 2012-07-19 nightly. I'll close once I get a bug in for the startup file issue.
            jjkparker Joel Parker made changes -
            Status Resolved [ 5 ] Verified [ 10002 ]
            Hide
            jjkparker Joel Parker added a comment -

            Created GMT-2944 to track the startup file issue.

            Show
            jjkparker Joel Parker added a comment - Created GMT-2944 to track the startup file issue.
            jjkparker Joel Parker made changes -
            Status Verified [ 10002 ] Closed [ 6 ]

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d