Comments (5)
These files are in /src directory and were used to setup and test the wrappers.
lg_example.cpp lg_example_fortran.f90
The routines can be called by using user_sub.f and compiling.
Attached is an example.
user_sub.f.txt
from lagrit.
See code on branch tam-debug
The code flow of msgtty and dotask makes debug more difficult. The error of losing the first word actually happens when msgtty is called a second time from the command stack routines. At this point the first word or "command" has already been parsed and the second call has the command missing. The error has happened already, in passing parameters to dotask() which should not have called msgtty in efforts to solve the commands.
I added dotask_test() and associated c-fortran wrappers and files to enable testing of the c-fortran wrappers.
This code is same as dotask, but avoids the command routines and does nothing except report what dotask
has received from fortran or cpp routines that call it.
Running this new wrapper shows there is a size error in the parameter passed from cpp to fortran dotask_test()
parameter err is declared as int_ptrsize which dotask expects as integer 8.
But in cpp sizeof(err) shows 4
This is fixed by adding type_sizes.h which defines int_ptrsize as size as null which is 8.
This is sometimes corrected by compilers, but in some newer compilers it is not.
Inside C wrapper lg_dotask_test
received string: 123456789
string length: 9
sizeof strlen: 8
sizeof err: 4
sizeof hidden length: 8
sending parameters to FORTRAN dotask_test
send string: 123456789; finish
string length: 17
Begin FORTRAN dotask_test
parameter integer size: 8
received string: 123456789;
length: 10
from lagrit.
The files added and modified for dotask c-fortran testing include:
new fortran dotask_test.f - dotask_test copy of dotask without global commands
lg_c_wrappers.cpp - DOTASK_TEST wrapper to fortran dotask_test
lg_c_interface.h - declare C lg_dotask_test
lg_f_interface.h: - declare fortran extern void DOTASK_TEST
CMakeLists.txt - add DOTASK_TEST to symbols for name mangling in fc_mangle.h
from lagrit.
The following commands have been added to msgtty for testing during execution.
test (no second word) - easy test using createpts to check executable
test list - list available options
cpp - call dotask and c-fortran wrappers using get_info calls to get pointers from fortran
fortran - call dotask and get_info pointers used by cpp
dotask - call dotask_test which avoids global commands and just tests dotask parameters
from lagrit.
Update files to include:
#include "type_sizes.h"
For any file that use int_ptrsize. This allowed dotask to correctly interpret the int_ptrsize as being 8.
from lagrit.
Related Issues (20)
- Pylagrit: Error when running example "ideas_mesh" HOT 3
- compile error for writinit.f HOT 1
- cmake compile errors using -m64 flag
- runtests.py arguments not working HOT 2
- read gocad
- level01 tests needed
- install-exodus.sh fails to install HOT 1
- Precision differences in test/level01/pflotran_stor HOT 1
- Python test scripts
- documentation page width too wide HOT 1
- remove directory /examples
- cmo/addatt/volume seg fault for prisms
- Packaging of `lagrit` with `nix`
- error: type specifier missing on macbook pro arm64 machine HOT 2
- dump exodus memory error while reading faceset files HOT 2
- Type annotations for PyLaGriT
- How can I create a 3D surface from point cloud data? HOT 1
- Error while running tutorial
- GOCAD TSurf .ts surface has 0 index in connectivity HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lagrit.