Output pics with view.h on supercomputer

337 views
Skip to first unread message

HUI WANG

unread,
Sep 17, 2020, 10:49:03 AM9/17/20
to basilisk-fr
Hello all,

I am running basilisk code on supercomputer. Now I would like to output pics using view.h, but it does not work properly on my side. 
For example, i use the following script to output pics of vof
event pics ( i += 10)
{
char name[80];
view (camera = "front", width = 1024, height = 1024);
clear();
draw_vof("f");
sprintf (name, "vof-%05g.png", t);
save (name);  
}
It works fine at first, but after serveral  timesteps, the job is killed and i received the errors that says can not read the image. The same error happens when i output pics of cells() on supercomputer. The full error message as following:
convert: unable to read image data `-' @ error/pnm.c/ReadPNMImage/899.
convert: no images defined `vof-0.0776514.png' @ error/convert.c/ConvertImageCommand/3046.
convert: unable to read image data `-' @ error/pnm.c/ReadPNMImage/899.
convert: no images defined `vof-0.10196.png' @ error/convert.c/ConvertImageCommand/3046.
srun: error: ca027: task 0: Broken pipe
srun: Terminating job step 441571.0
slurmstepd: error: *** STEP 441571.0 ON ca027 CANCELLED AT 2020-09-17T08:55:40 ***
srun: error: ca027: task 15: Terminated
srun: error: ca068: tasks 77,86,92: Terminated
srun: error: ca027: tasks 9-10: Terminated
srun: error: ca064: tasks 39,46: Terminated
srun: error: ca195: tasks 96-127: Terminated
srun: error: ca196: tasks 128-159: Terminated
srun: error: ca027: tasks 1-8,11-14,16-31: Terminated
srun: error: ca064: tasks 32-38,40-45,47-63: Terminated
srun: error: ca068: tasks 64-76,78-85,87-91,93-95: Terminated
srun: Force Terminated job step 441571.0

On the other hand, the movies could always be outputted properly with view.h using for example:
event movies (i++)
{
view (camera = "front", width = 1024, height = 1024, fov = 20); 
clear();                                                                       
draw_vof("f");                                                 
save ("front.mp4");
}

Did Anyone encounter this problem?  That would be great if anyone could give me a possible solution about this.

Thanks a lot
Hui

alessandr...@gmail.com

unread,
Jan 28, 2021, 8:38:43 AM1/28/21
to basilisk-fr
Dear Hui,
I think I have a very similar issue.
I can successfully generate .png images with output.ppm, e.g.:

 output_ppm (f, file = "f.png", linear = true, box = {{0.0,-my_L/2},{my_L,my_L/2}},min=0,max=1,n=n1);

but when i try to use the view function (including view.h in the script), e.g:

view (camera = "iso",
        fov = 35, tx = -0.418, ty = 0.288,
        width = 800, height = 800);
  clear();
  draw_vof ("f");
  save ("f.png");

the run abrupts and the following error message appears:

convert: unable to read image data `-' @ error/pnm.c/ReadPNMImage/899.
convert: no images defined `f.png' @ error/convert.c/ConvertImageCommand/3046.

Does anyone have suggestions?

Thanks a lot,
Alessandro

HUI WANG

unread,
Jan 28, 2021, 8:54:59 AM1/28/21
to basilisk-fr
Hello Alessandro,

The pictures are outputted in .ppm format by default. If you want to convert it to .png,  you need to load the relevant modules like ImageMagick and ffmpeg. I am loading the following modules while using HPC. Note some prepackages may need to be loaded before loading ImageMagick and ffmpeg, and the old version of software may also cause errors.

.......
module load yasm/1.3
module load nasm/2.13
module load x264/7.5.2020
module load fdk-aac/1.0
module load lame/3.99.5
module load ImageMagick/7.0.10
module load ffmpeg/4.2.3
.....

Hope this helps
Hui

Stephane Popinet

unread,
Jan 28, 2021, 12:58:06 PM1/28/21
to basil...@googlegroups.com

> The pictures are outputted in .ppm format by default. If you want to
> convert it to .png,  you need to load the relevant modules like
> ImageMagick and ffmpeg.

This is not Alessandro's problem since the error he gets comes from
ImageMagick ('convert' is part of ImageMagick).

Alessandro you should still try to output a .ppm file directly and see
what it contains.

cheers

Stephane


alessandr...@gmail.com

unread,
Jan 29, 2021, 4:09:34 AM1/29/21
to basilisk-fr
Dear Stephane,
thanks a lot for your reply.
If I try to output a .ppm file with:

view (camera = "iso",
        fov = 35, tx = -0.418, ty = 0.288,
        width = 800, height = 800);
  clear();
  draw_vof ("f");
  save ("f.ppm");

I obtain a f.ppm file with a fragmented reconstruction of the interface.Thinking of the bug in OSMesa "gallium" implementation, I tried to solve on the cluster with:

cd $BASILISK/gl
rm -f fb_osmesa.o
CFLAGS=-DGALLIUM=1 make libfb_osmesa.a

and I did not obtain any error, but unfortunately the problem did not fix and the .ppm image still appears fragmented.
However, the output of a .png image works fine for 2D simulations if realized with output_ppm() function, e.g.:

output_ppm (f, file = "f.png", linear = true, box = {{0.0,-my_L/2},{my_L,my_L/2}},min=0,max=1,n=n1);

Maybe something went wrong in the installation of Basilisk view servers on the cluster?
Thanks again for your support.
Best Regards,
Alessandro



alessandr...@gmail.com

unread,
Jan 29, 2021, 4:13:33 AM1/29/21
to basilisk-fr
Dear Hui,
thanks a lot also to you.
Unfortunately, as Stephane was suggesting, I do not think that the problem is in .ppm to .png file conversion,
because the procedure works fine with output_ppm() function.

I really appreciate your help.
Cheers,
Alessandro

HUI WANG

unread,
Jan 29, 2021, 4:44:01 AM1/29/21
to basilisk-fr
Hello Alessandro,

Your problem looks exactly the same I met before, that output_ppm always works fine with .png or .ppm while bview.h appears with 'unable to read image data' error in the middle of running. Sorry now I don't actually remember how i solved this problem, cause it's been a while. But for solving this problem, I think I've done the following things for your reference. View.h works fine after that for me.

1) fix the bug OSMesa "gallium" implementation as you did
2) contact the supercomputer to update ImageMagick and ffmpeg/or install lastest version myself, because there was a time the received errors disappeared after the updates (if I remember correctly)
3) load the lastest version module explicitly in the running bash, because in my HPC system the default modules are the old version

Cheers
Hui

alessandr...@gmail.com

unread,
Jan 29, 2021, 10:24:20 AM1/29/21
to basilisk-fr
Dear Hui,
thanks a lot for your suggestions.
I will follow the steps and try to solve the problem as you did.

Cheers,
Alessandro

yi liu

unread,
Mar 9, 2021, 1:34:33 AM3/9/21
to basilisk-fr
Dear All
I met the exact the same problem here on my local machine.  what is the problem and what is  the solution?

Cheer
Yi

Reply all
Reply to author
Forward
0 new messages