While working on K6ROT, I decided to run a simple Femap 2x2 flat plate model on MYSTRAN.
This triggers a nondeterministic crash: half of the runs yield a segfault, the other half finish with a fatal error when calling the SuperLU matrix factorization subroutine.
Of course, these decks were auto-generated by Femap, so they're nowhere near hand-crafted quality. Still, no deck, no matter how corrupt, should trigger an illegal memory access.
Attached are two version of the deck: the one exported from Femap as-is, and another with some slight changes to make it more affable to MYSTRAN (to no avail).
Something in this deck is causing MYSTRAN to pass bad data to SuperLU. I'm looking into what, how, and a fix -- but any input is appreciated.
Does anyone have experience converting an MSC or NX Nastran input deck to a format NASTRAN-95 can read?
Here are some of the things I've done and I think it has got me most of the way there:
-insert lines from "INCLUDE"-ed files
-added an "ID" card at the top
-changed SOL 101 to SOL 1
-replaced CBEAM and PBEAM cards with CBAR and PBAR cards (luckily my model doesn't use advanced CBEAM functionality)
-replaced CBUSH and PBUSH with a set of CELAS1 and PELAS elements
-made sure my coordsys ID numbers on the CQUAD4 and CTRIA3 elements are < 1,000,000 (NASTRAN-95 manual specifies this)
-converted all my line continuations to labeled line continuations with a unique label for each one
-changed the names of my RBE2 and RBE3 elements to CRBE2 and CRBE3
Now the CRBE3 elements seem to be giving me trouble. I am getting singular columns in the stiffness matrix, and for of my RBE3 reference gridpoints, it says "EXTERNAL GRID PT. .... NOT CONNECTED".
The only way these grid points are intended to be connected to the model is through the RBE3 elements. They are used to distribute a point-force (applied at the RBE3 reference grid point) to other nodes. Does NASTRAN-95 not allow this?
A. USING Visual Studio Windows
Steps :
1. Compile SuperLu.Lib in SRC superlu with c_fortran_dgsvv.c with
Code:
icl -c *.c /O3 /Qpar
with modified Slu_cnames.h for creating obj, then
Code:
xilib /out:superlu.lib *.obj
compile with optimization like /QaxCORE-AVX2 for intel or /QxCORE-AVX2 for AMD may improve the speed, and /Qpar for parallel run
2. Create the StandardConsole / Quickwin Fortran project
3. Drag all fortran subroutine excluding the "Source\Modules\LAPACK\Unresolved_Externals_Problem" since we will use Openblas / MKL AND *.H files in include folder
to the Solution Explorer - Source Files
4. Edit GET_MYSTRAN_DIR.f90
Hope this call get_environment_variable is used in the next mystran, since it used also in gcc.
5. For mkl --> in Solution --> right click Properties » Configuration properties » Fortran » Use Intel MKL » Sequential or Parallel --> if /Qpar then Parallel
For OpenBlas drag Openblas.dll.a and with all *.h to the Solution Explorer - Source Files
compile with optimization like /QaxCORE-AVX2 for Intel or /QxCORE-AVX2 for AMD may improve the speed
6. For big problems, it could catch stack overflow, move all stack to heap.
in Solution --> Properties » Fortran » Configuration properties » Optimization » Heap Arrays » 0
7. You will get the exe file.
B. Using command line Intel compiler x64 enviroment
a. Get mystran latest source code put in d:\mystran --> d:\mystran\mystran-main\
a. Get superLu latest, put on SRC folder with FORTRAN d_fortran_dgssv.c and modified SLU_Cnames.h on SuperLu folder d:\mystran\mystran-main\superlu
b. Get into CMD command lines intel x64 Compiler
c. Get 2 Batch file to run in d:\mystran
compile_mystran_superlu_with_mkl_AVX2_Parallel.bat https://controlc.com/f266943f
mystran.rsp https://controlc.com/32578204
d. Get mystran.exe inside x64/Release
Questions
1. SuperLu-MT cant be used here, right?
2. Can i get the built MingW GCC makefile? that compiled in msys or mingw, so i can changed to be compiled in the equations mingw compiler
NOTE: Modified SLU_Cnames.h inside SRC SuperLU dir for Visual Fortran
Question: Do you have any general plan for modernization of the code? I noticed that in the bandit module there are some features that were already considered obsolete in ISO/IEC 1539-1:1997 (https://gcc.gnu.org/wiki/GFortranStandards#Fortran_90) and later, as is the case with statement GOTO.
Initial Response:
Bandit is an odd one. A couple years ago we had problems with it so afaik we just removed it in essence. It’s a routine that is only used when you enact the banded solver and even then it only helps to optimize the matrix setup so the solution is faster and uses less memory. But that was far more important in the 70s/80s and not such a big deal now. For large problems, we use the superlu sparse solver anyway (so bandit would never come into play). We could totally remove anything to do with bandit and I would be ok with that. I think we may tried, but there were some loose ends so it sort of artificially resides in the program. But it would be nice to totally strip it out clean IMO.
There may be some issues with compiling MYSTRAN in Windows. While it appears to be resolvable, can we make this either (a) more bullet-proof or (b) provide some instructions in the trouble shooting section of the build MD here: https://github.com/MYSTRANsolver/MYSTRAN...n/BUILD.md
As suggested I tried building via MSYS2 (or rather MinGW-w64). That failed because despite a message that CMake 3.23 would be installed, I am stuck with CMake 3.17.
Instead, I switched to Cygwin, which does have an up-to-date version on my machine.
The configuration step started, but then I got a complaint that submodules had not been downloaded. No indication of what submodules are to be downloaded. There is no indication in the BUILD.md file either.
A quick check of the MakeLists.txt file showed a few packages are needed, but there is no information that I can see about where to get the various packages.
I was also surprised to see f2c - is that really necessary?
The information in BUILD.md suggests though the script will do it. Is that outdated information?
Side note: I find a fairly recent version of CMake in the installation but it does not do much (no output, stops immediately - missing DLLs?). In the MinGW-w64 console a different version is invoked that actually works.
Posted by: Admin - 10-14-2022, 02:19 AM - Forum: MYSTRAN
- No Replies
While the forums may still be used (for more complex inquiries), the majority of discussions have moved to our Discord server: https://discord.gg/9k76SkHpHM
CHANGE LOG:
Add all changes here (code, compiling, documentation, benchmark, etc.,). Some of this information is later filtered to the appropriate documents after an official release. But this is the MASTER log for developers to add notes to. https://github.com/MYSTRANsolver/MYSTRAN...angeLog.md