Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29249 Discussions

Realtime Plots, Multiple Console Windows

kulachi
Beginner
999 Views

Hi,

I am running a fairly complex code (IVF console application) on realtime data that generates a lot of analytical output. I have two questions on that:

1. It is of interest to visualize this data output (graphs etc) in realtime. Is there a way to create realtime plots in Fortran? That is, within a console application?
2. My second question is that can I open multiple console windows for my code? I would like to selectively dump the model output in them. For now I am using notepad files for this purpose.

Many Thanks,

Kulachi
0 Kudos
10 Replies
ArturGuzik
Valued Contributor I
999 Views
Hi,

for point (1) -> the solution which was working for me, was gnuplot and pipes (and as gnuplot is working on Win/Linux/Mac as also IVF does, you can get portable application).

A.
0 Kudos
jimdempseyatthecove
Honored Contributor III
999 Views

Kulachi,

I have been very happy using the Intel Array Visualizer (AV). This used to be included with IVF (8.nn) but still is available for free download on Intel's website. It has a relatively steep learning curve bit it is well worth it to integrate into your application.

I too want and use realtime data plots. In my case it is not realtime data as my application is a simulation. But as the results are calculated (periodically) I wish to track the activity with visualization of what is happening in the simulation.

There are a couple of really good design features of AV.

1) Your application calls through an API to express what data and how to present the data. This builds a database of that expression. The display (presentation) of the graphs and charts etc... are performed by a separate process instead of by way of a thread (maybe your only thread) within your application (process). Therefore, this design distributes the workload and is more efficient on a multi-core platform.

2) Because the code in your application only builds the database for use by the AV presentation process you can have multiple of these AV presentation processes running concurrently.

3) If the database contains information that could be graphed, but for lack of forethought or laziness, you have not programmed into application how you want the data presented, you can on-the-fly (while your application is running) create a plot of that data. This is done without modifying your application.

AV does have a steep learning curve, and it is no longer supported. But AV is an excellent presentation tool.

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
999 Views
You want a QuickWin project and the SCIGRAPH sample library. It will do both of the things you ask for. Read about QuickWin in the compiler documentation, and look at the QuickWinSCIGRAPH sample provided on-disk.
0 Kudos
kulachi
Beginner
999 Views
Thank you Jim. AV is indeed very nice. Using its windows interface is very simple. However, my intentions are to visualize evolution of certain quantities over small intervals and for that, I guess, I need to write some code. I hope there are some good examples of using AV in the help file.

-Kulachi
0 Kudos
kulachi
Beginner
999 Views
MADsblionel:
You want a QuickWin project and the SCIGRAPH sample library. It will do both of the things you ask for. Read about QuickWin in the compiler documentation, and look at the QuickWinSCIGRAPH sample provided on-disk.


Steve,
Actually I have to receive/send the data via udp ports. For that I had to write a server in C and then use it in a multi-project solution with my main Fortran code. I think QuickWin would not let me use this setup. I did look at the SCIGRAPH code sample, but I am only using it offline (on the accumulated dataset). Is there a way out? Can I read/write udp ports without using C? The Fortran helpfile does not have anything on it.
0 Kudos
Steven_L_Intel1
Employee
999 Views
There's no problem having a C static library as part of a QuickWin project. Just make sure that the non-DLL multithread library is used by the C project.
0 Kudos
Steven_L_Intel1
Employee
999 Views
You can use AV to "animate" a plot over time. There's even an AV sample that does this.
0 Kudos
kulachi
Beginner
999 Views
MADsblionel:
You can use AV to "animate" a plot over time. There's even an AV sample that does this.


Thanks. That example is perfect. My work is done!

-K
0 Kudos
kulachi
Beginner
999 Views
MADsblionel:
There's no problem having a C static library as part of a QuickWin project. Just make sure that the non-DLL multithread library is used by the C project.


Steve,

Actually, I am using the Fortran project as a static library (sorry for not giving you enough details earlier). Since an event is fired when a data packet hits the port, I have to use the C server as a wrapper for the whole application (i.e. the server receives a data packet, calls the Fortran subroutine (static lib), and if an action-call is generated, Fortran calls a C client to send a packet back). So basically I have three projects in my multi-project solution.

Earlier, I didn't use QuickWin because (I was new to the Fortran, and) the helpfile said:

"Note that Fortran QuickWin and Standard Graphics applications cannot be DLLs, and QuickWin and Standard Graphics cannot be linked with run-time routines that are in DLLs. This means that the /libs:qwin option and the /libs:dll/threads options cannot be used together."
(In: Using QuickWin Overview)

I didn't explore the possibility of using a separate project in the same multi-project solution that could somehow use QuickWin capabilities. Could you suggest a way?

Many Thnaks

-K
0 Kudos
Steven_L_Intel1
Employee
999 Views
In a QuickWin application, the main program MUST be in Fortran. But there's nothing wrong with having a jacket Fortran main that calls C to start the "server". The C code can then call back into Fortran if QuickWin calls are required.

I'll admit that I've never actually done this, and there might be some oddity that poses a problem. In particular, if one creates additional threads, QuickWin MIGHT get confused. I don't know. But since you have the AV solution which works for you, and animation is not a QuickWin strength, there's no need to pursue that.
0 Kudos
Reply