Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesh_partitioner version does not support med format from v104 to v106 #1189

Closed
Trophime opened this issue Jun 27, 2018 · 18 comments
Closed

Comments

@Trophime
Copy link
Member

singularity exec -B $HOME/feel:/feel $HOME/singularity_images/hifimagnet-stretch.simg feelpp_mesh_partitioner --ifile HL-31-coarse-NEW.med  --ofile tralala --nochdir --part 6
[ Starting Feel++ ] application mesh_partitioner version 0.104.0-alpha.30 date 2018-Jun-27
run partioner with shape Simplex_3_1_3
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0627 15:01:33.319635 42561 environment.cpp:1503] File /home/mso4sc/HL-31/tmp/HL-31-coarse-NEW.med found
[loadMesh] Loading Gmsh compatible mesh: "/home/mso4sc/HL-31/tmp/HL-31-coarse-NEW.med"
I0627 15:01:33.319882 42561 environment.cpp:1503] File /home/mso4sc/HL-31/tmp/HL-31-coarse-NEW.med found
I0627 15:01:36.100499 42561 importergmsh.hpp:656] Reading Msh from memory 
  +- number of vertices: 0
  +- number of elements: 0
I0627 15:01:36.100667 42561 importergmsh.hpp:773] Reading Msh from memory done
   [read msh from memory] Time : 0.000187162s
[loadMesh] Loading Gmsh compatible mesh: "/home/mso4sc/HL-31/tmp/HL-31-coarse-NEW.med" done
      number of elements in memory : 0
      number of faces in memory : 0
      number of edges in memory : 0
      number of points  in memory : 0

but works as a charm for msh

@prudhomm
Copy link
Member

prudhomm commented Jul 1, 2018

@Trophime why are you using this version and not 0.104.1 or 0.105 ?

@prudhomm
Copy link
Member

prudhomm commented Jul 1, 2018

moreover, the mesh format reader factory needs to be verified.
Maybe something is going wrong between reading the file and partitioning it.

@Trophime
Copy link
Member Author

Trophime commented Jul 2, 2018

this is or at least was the version reported by feelpp_mesh_partitioner shipped with hifimagnet singularity image. The only to be build with med support to my knowledge...

And I still cannot get feelpp running on debian.

@prudhomm
Copy link
Member

@Trophime Feel++ is compiling and running on Debian now. At least unstable

@Trophime
Copy link
Member Author

Trophime commented Oct 1, 2018

For information, I've checked that med was working with 0.103.20 and not for 0.104.0-alpha.30.
See results bellow:

[ Starting Feel++ ] application mesh_partitioner version 0.104.0-alpha.30 date 2018-Oct-01
 . mesh_partitioner files are stored in .
 .. exports :./exports
 .. logfiles :./logs
run partioner with shape Simplex_3_1_3
[loadMesh] Loading Gmsh compatible mesh: "/home/LNCMI-G/trophime/MSO4SC/HiFiMagnet/demos/HL-dble/HL-31_H1.med"
  +- number of vertices: 0
  +- number of elements: 0
   [read msh from memory] Time : 0.000235339s
[loadMesh] Loading Gmsh compatible mesh: "/home/LNCMI-G/trophime/MSO4SC/HiFiMagnet/demos/HL-dble/HL-31_H1.med" done
      number of elements in memory : 0
      number of faces in memory : 0
      number of edges in memory : 0
      number of points  in memory : 0
start mesh partitioning and save on disk : /home/LNCMI-G/trophime/MSO4SC/HiFiMagnet/demos/HL-dble/HL-31_H1_p2.json
[env] Time : 2.72083s
[ Stopping Feel++ ] application mesh_partitioner execution time 2.72083s
trophime@stokes:~/MSO4SC/HiFiMagnet/demos/HL-dble$ /home/LNCMI-G/trophime/feelpp_build/Json/applications/mesh/feelpp_mesh_partitioner  --ifile HL-31_H1.med --part 2
[ Starting Feel++ ] application mesh_partitioner version 0.103.20 date 2018-Oct-01
 . mesh_partitioner files are stored in .
 .. exports :./exports
 .. logfiles :./logs
run partioner with shape Simplex_3_1_3
[loadMesh] Loading Gmsh compatible mesh: "/home/LNCMIG/trophime/MSO4SC/HiFiMagnet/demos/HL-dble/HL-31_H1.med"
  +- number of physicals: 9
  +- number of vertices: 767593
  +- number of elements: 4565797
   [read msh from memory] Time : 31.0829s
[loadMesh] Loading Gmsh compatible mesh: "/home/LNCMI-G/trophime/MSO4SC/HiFiMagnet/demos/HL-dble/HL-31_H1.med" done
      number of elements in memory : 4079183
      number of faces in memory : 463446
      number of edges in memory : 0
      number of points  in memory : 767593
      number of marked faces Interface with tag 9 : 88796
      number of marked faces Rext with tag 3 : 200962
      number of marked faces Rint with tag 4 : 158582
      number of marked faces V0 with tag 6 : 1487
      number of marked faces V1 with tag 5 : 1487
      number of marked faces iRext with tag 7 : 6774
      number of marked faces iRint with tag 8 : 5358
start mesh partitioning and save on disk : /home/LNCMI-G/trophime/MSO4SC/HiFiMagnet/demos/HL-dble/HL-31_H1_p2.json
[env] Time : 102.736s
[ Stopping Feel++ ] application mesh_partitioner execution time 102.736s

@prudhomm
Copy link
Member

prudhomm commented Oct 1, 2018

what changed? did we introduce the mesh readers in 103 or 104?
you are the only using the med format, we should be able to understand what happened ;)

@Trophime
Copy link
Member Author

Trophime commented Oct 1, 2018

From my side, the only diff is feelpp version.
I'm compiling both with med support (3.2 versions)
In the prospect of MOR_DICUS there will be more med users...

@prudhomm
Copy link
Member

prudhomm commented Oct 1, 2018

From my side, the only diff is feelpp version.
I'm compiling both with med support (3.2 versions)

that's weird. openmpi and hdf5 didn't change either, neither gmsh I think. we depend solely on gmsh here for med support.

In the prospect of MOR_DICUS there will be more med users...

sure but we try to understand the difference between 103 and 104

@Trophime
Copy link
Member Author

Trophime commented Oct 2, 2018

I think I've found the error (my bad) in feelfilters/importergmsh.cpp.
I'm checking the fix as soon as I can have vpn access to the lab..
The wifi here in Arles at EMFL Days is not really functionnal :(

@prudhomm
Copy link
Member

prudhomm commented Oct 2, 2018

@Trophime I checked cmake and MED support is disabled by default that would explain a few things ;)

@prudhomm
Copy link
Member

prudhomm commented Oct 2, 2018

I will clean this for v106. A patch should be easy enough for 104 and 105 if necessary

@prudhomm prudhomm self-assigned this Oct 2, 2018
@prudhomm prudhomm changed the title mesh_partitioner version 0.104.0-alpha.30 does not support med format mesh_partitioner version does not support med format from v104 to v106 Oct 2, 2018
@prudhomm
Copy link
Member

prudhomm commented Oct 2, 2018

@Trophime regarding med support, I have fixed it but I get this message:

13: MEDversionedApi3C.c [50] : Cette bibliothèque MED n'est pas capable de lire un fichier MED dont le mineur de la versionexcède celui de la bibliothèque.
13: MEDversionedApi3C.c [51] : La version demandée est :
13: MEDversionedApi3C.c [51] : _fversionMMR = 320
13: MEDversionedApi3C.c [116] : Impossible d'obtenir une implémentation de : 
13: MEDversionedApi3C.c [117] : key = "_MEDmeshInfoByName"
13: MEDversionedApi3C.c [118] : en version :
13: MEDversionedApi3C.c [119] : _fversionMMR = 320
13: MEDversionedApi3C.c [120] : Vérifiez votre fichier .med
13: MEDmeshInfo.c [83] : Erreur d'appel de l'API 
13: MEDmeshInfo.c [83] : du maillage 
13: MEDmeshInfo.c [84] : meshname = "Mesh_1"
13: MEDmeshInfo.c [84] : _meshpath = "/ENS_MAA/Mesh_1"
13: MEDmeshInfo.c [84] : "MEDmeshInfoByName" = "MEDmeshInfoByName"

it is on a machine with hdf5 1.10, I guess that is the problem no ?

prudhomm added a commit that referenced this issue Oct 2, 2018
@Trophime I will check that on a machine with hdf5 1.8, it fails with 1.10
@prudhomm
Copy link
Member

prudhomm commented Oct 2, 2018

@Trophime there is FEELPP_ENABLE_MED and FEELPP_HAS_GMSH_HAS_MED, the second needed to check med libraries to get set and it was disabled. In fact we do not need the latter but only the former to set FEELPP_HAS_GMSH_HAS_MED which is the c preprocessor var that enables the MED reader in ImporterGmsh

@prudhomm
Copy link
Member

prudhomm commented Oct 2, 2018

@Trophime good news, here is the result of feelpp_test_med in the testsuite, it was not run before and not MED support not enabled

 ctest -R test_med
Test project /home/user/build/testsuite/feelfilters
    Start 13: feelpp_test_med-np-1
1/1 Test #13: feelpp_test_med-np-1 .............   Passed    1.62 sec

100% tests passed, 0 tests failed out of 1

Label Time Summary:
testfilters    =   1.62 sec*proc (1 test)

Total Test time (real) =   1.63 sec

@prudhomm
Copy link
Member

prudhomm commented Oct 2, 2018

@Trophime now cmake process shows if you have MED support enabled:
check it out here:
https://buildkite.com/feelpp/feelpp-testsuite/builds/46#21e84ea1-0262-446a-913e-8abc9e112d4f/135-212

@Trophime
Copy link
Member Author

Trophime commented Oct 5, 2018

Here is the patch for med:

--- feel++-0.103.3+20180220.git39e19fdb7.orig/feel/feelfilters/importergmsh.cpp
+++ feel++-0.103.3+20180220.git39e19fdb7/feel/feelfilters/importergmsh.cpp
@@ -30,13 +30,15 @@ namespace Feel
 const auto med = GmshReaderFactory::instance().emplace( ".med",
                                                         []( std::string fname )
                                                         {
-                                                            auto m = boost::make_shared<GModel>();
+                                                            GModel *gm = new GModel();
                                                             int status = 1;
 #ifdef FEELPP_HAS_GMSH_HAS_MED
-                                                            status = m->readMED(fname);
+                                                            status = GModel::readMED(fname);
+                                                            gm = GModel::current();
 #else
                                                             throw std::logic_error("Gmsh MED support is not available. Cannot load MED file");
 #endif
+                                                            auto m = boost::make_shared<GModel>( *gm );
                                                             return std::make_pair( status, m );
                                                         });
 // Medit inria format

@Trophime
Copy link
Member Author

Trophime commented Oct 5, 2018

@Trophime regarding med support, I have fixed it but I get this message:

13: MEDversionedApi3C.c [50] : Cette bibliothèque MED n'est pas capable de lire un fichier MED dont le mineur de la versionexcède celui de la bibliothèque.
13: MEDversionedApi3C.c [51] : La version demandée est :
13: MEDversionedApi3C.c [51] : _fversionMMR = 320
13: MEDversionedApi3C.c [116] : Impossible d'obtenir une implémentation de : 
13: MEDversionedApi3C.c [117] : key = "_MEDmeshInfoByName"
13: MEDversionedApi3C.c [118] : en version :
13: MEDversionedApi3C.c [119] : _fversionMMR = 320
13: MEDversionedApi3C.c [120] : Vérifiez votre fichier .med
13: MEDmeshInfo.c [83] : Erreur d'appel de l'API 
13: MEDmeshInfo.c [83] : du maillage 
13: MEDmeshInfo.c [84] : meshname = "Mesh_1"
13: MEDmeshInfo.c [84] : _meshpath = "/ENS_MAA/Mesh_1"
13: MEDmeshInfo.c [84] : "MEDmeshInfoByName" = "MEDmeshInfoByName"

it is on a machine with hdf5 1.10, I guess that is the problem no ?

in which configuration do you have this error?
On Xenial med-fichier is compiled with hdf5 1.8
and to my knowledge med-fichier shall be patched to support hdf5 .10 (see debian package)

@Trophime
Copy link
Member Author

Trophime commented Oct 5, 2018

@prudhomm the above patch has been tested succesfully:

 mso4sc@stokes:~/H1H4$ singularity exec ${HOME}/singularity_images/hifimagnet-cesga-new.simg feelpp_mesh_partitioner --ifile HL-31-H1H2H3H4-Leads.med --ofile tutu --part 3
[ Starting Feel++ ] application mesh_partitioner version 0.104.0-alpha.30 date 2018-Oct-05
 . mesh_partitioner files are stored in .
 .. exports :./exports
 .. logfiles :./logs
run partioner with shape Simplex_3_1_3
[loadMesh] Loading Gmsh compatible mesh: "/home/mso4sc/H1H4/HL-31-H1H2H3H4-Leads.med"
  +- number of physicals: 75
  +- number of vertices: 1510726
  +- number of elements: 9628693
   [read msh from memory] Time : 60.163s
[loadMesh] Loading Gmsh compatible mesh: "/home/mso4sc/H1H4/HL-31-H1H2H3H4-Leads.med" done
      number of elements in memory : 7845087
      number of faces in memory : 1632493
      number of edges in memory : 0
      number of points  in memory : 1510726
      number of marked faces BP_R0 with tag 30 : 281
      number of marked faces BP_R2 with tag 34 : 326
      number of marked faces Cooling_Slits_R0 with tag 29 : 1272
      number of marked faces Cooling_Slits_R1 with tag 31 : 1578
      number of marked faces Cooling_Slits_R2 with tag 33 : 1726
      number of marked faces HP_R1 with tag 32 : 287
      number of marked faces Interface0_1_H0 with tag 74 : 14998
      number of marked faces Interface0_1_H1 with tag 7 : 106772
      number of marked faces Interface0_1_H2 with tag 15 : 124125
      number of marked faces Interface0_1_H3 with tag 23 : 157677
      number of marked faces Interface0_2_H0 with tag 75 : 15062
      number of marked faces Interface0_2_H1 with tag 8 : 106754
      number of marked faces Interface0_2_H2 with tag 16 : 124171
      number of marked faces Interface0_2_H3 with tag 24 : 157673
      number of marked faces R0n_R0 with tag 37 : 605
      number of marked faces R0n_R1 with tag 39 : 741
      number of marked faces R0n_R2 with tag 41 : 826
      number of marked faces R1n_R0 with tag 38 : 953
      number of marked faces R1n_R1 with tag 40 : 1128
      number of marked faces R1n_R2 with tag 42 : 1197
      number of marked faces Rext_H0 with tag 72 : 41590
      number of marked faces Rext_H1 with tag 6 : 73255
      number of marked faces Rext_H2 with tag 14 : 88002
      number of marked faces Rext_H3 with tag 22 : 93712
      number of marked faces Rint_H0 with tag 61 : 34667
      number of marked faces Rint_H1 with tag 5 : 66585
      number of marked faces Rint_H2 with tag 13 : 65516
      number of marked faces Rint_H3 with tag 21 : 83523
      number of marked faces V00 with tag 36 : 501
      number of marked faces V11 with tag 35 : 150
      number of marked faces iRext1_H0 with tag 2 : 1438
      number of marked faces iRext1_H1 with tag 10 : 5924
      number of marked faces iRext1_H2 with tag 18 : 7305
      number of marked faces iRext1_H3 with tag 26 : 8572
      number of marked faces iRext2_H0 with tag 4 : 1436
      number of marked faces iRext2_H1 with tag 12 : 5922
      number of marked faces iRext2_H2 with tag 20 : 7303
      number of marked faces iRext2_H3 with tag 28 : 8572
      number of marked faces iRint1_H0 with tag 1 : 1346
      number of marked faces iRint1_H1 with tag 9 : 5176
      number of marked faces iRint1_H2 with tag 17 : 5690
      number of marked faces iRint1_H3 with tag 25 : 7609
      number of marked faces iRint2_H0 with tag 3 : 1344
      number of marked faces iRint2_H1 with tag 11 : 5180
      number of marked faces iRint2_H2 with tag 19 : 5688
      number of marked faces iRint2_H3 with tag 27 : 7609
start mesh partitioning and save on disk : /home/mso4sc/H1H4/tutu.json
[env] Time : 149.442s
[ Stopping Feel++ ] application mesh_partitioner execution time 149.442s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants