GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
249 stars 51 forks source link

GLVis : Opens duplicate plot windows for each processor #290

Closed cjoycd closed 1 month ago

cjoycd commented 1 month ago

Dear all,

I have recently installed GLVis on Ubuntu 24.04 (LTS) with the gcc version (Ubuntu 13.2.0-23ubuntu4) 13.2.0. The installation is done. However, while plotting outputs (live while running the code), it opens plot windows for each processor separately (duplicates the plot window equal to the number of processors used). Can someone help to fix the problem ?

Thank you in advance --Sijoy

v-dobrev commented 1 month ago

There's difference in the commands that one needs to send to GLVis in serial and in parallel -- make sure you are following one of the parallel examples in MFEM. For example, in serial, ex1 uses

      sol_sock << "solution\n" << mesh << x << flush;

whereas in parallel ex1p uses

      sol_sock << "parallel " << num_procs << " " << myid << "\n";
      sol_sock << "solution\n" << pmesh << x << flush;
cjoycd commented 1 month ago

Dear Dobrev,

Thank you for your reply. This issue happens for all standard "example/miniapp" problems available with the mfem package and also with my own codes (which were working fine previously). All these codes were working fine till I changed to a new OS (Ubuntu 24.04 LTS , gcc version 13.2.0 - 13.2.0-23ubuntu4) and with a fresh installation of [SDL2], [GLEW], [GLM], [Freetype], [Fontconfig] etc. Also, a new version of MFEM is installed (mfem-4.7). Previously it was version 4.6.

The issue is mainly due to improper MPI initialization. After the MPI initiation

Mpi::Init(argc, argv); const int myid = Mpi::WorldRank();

The values assigned/obtained for myid and Mpi::Root() are 0 and 1, respectively for all the processors.

This makes all sections being executed by all processors, irrespective of their rank ..

Regards --Sijoy

cjoycd commented 1 month ago

The issue has been resolved after a fresh MPI (mpich-4.2.2) installation manually. The issue was not related to GLVis or MFEM.

Thanks --Sijoy