Eclipse Scientific reading from standard input txt file parallel application - mpi

I'm trying to set an input file as standard input at run configurations of mpi parallel application, but when I'm using the scanf the father process get stuck. When I'm running the program as regular program and not parallel, it works successfuly..
there's the configurations
Anyone knows how to figure it out?

Related

Using gprof on a multitask ADA source code, I get the analysis of only the main task

I follow all the steps to instrumentalize, run and analyse the obtained output (gmon.out), but the text file obtained shows the analysis of the execution of the main task only.
I've read about similar problems in Linux OS but I'm running on Windows.
Has anyone experience something similar?

QTCreator Memcheck performing analysis without letting me run the actual program?

I am attempting to use QTCreator's Memcheck tool to analyze the memory of a QT project, which is a dynamic library. It uses a QT Gui (QMainWindow) to allow the user to select a file, which is then processed, and then eventually returns to the mainwindow.
However, I cannot seem to use Memcheck properly.
When I select "Memcheck" and hit run, it instantly goes to "Analyzing memory" without ever letting the Gui pop up.
This is problematic. How can I get memcheck to work with this program?
I had two main issues:
1: Valgrind does not seem to play nice with QT Gui applications. It generates logs that are thousands of entries long for all the work QT is doing before it even gets to my application.
I had to make a separate, small non-GUI C++ program that would drive instead of the GUI application.
2: When trying to run from the command line, I needed to set an environment variable by using export. This needs to be the same as LD_LIBRARY_PATHS in QT Creator.
So I ran:
export LD_LIBRARY_PATH=X where X was the exact value I copied from LD_LIBRARY_PATHS in the variable from the QT Project.
Note: Running from the command line may have not be neccesary now that it isn't a GUI Application, memcheck might have passed just fine. Haven't tested since.

Can R cause a file to be opened by another program?

This is a bit of a strange question, but I thought people here might be interested.
Is it possible to have R cause a file to be opened in another program? For example, could you write a command line that would cause a music file to start playing? The potential application would be that after a model is finished running, music would start to play, alerting you to the model's completion.
In addition to system, on Windows at least you can use shell.exec which will open the file using the application specified in the Windows file associations. For example, shell.exec("file.txt") will open a text file in your favourite text editor, shell.exec("file.mp3") will launch a media player, etc.
There is audio package which allow to play wave files:
require(audio)
wave_file <- dir("C:/Windows/Media", pattern="\\.wav$", full.names=TRUE)[1] # some random windows wave file
f <- load.wave(wave_file)
play(f)
You can do this by calling the system() function.

Is there any method or plug in to handle R packages in NetBeans

I have created a NetBean GUI application.In that GUI i have added several menu items and i want to handle several statistical functions when clicking each menu items.For that purpose i need R plug in Netbeans such that I can easily link with R.
Thanks
Depending on your requirements there are different ways to do this, e.g. eval, link, pipe, socket or stub. I will write about these 5 methods here:
EVAL:
You can call R and pass in a script-file, R will evaluate the script and return the result of the statistical computation to the console.
(Please also tell us what operating-system you are running on, in the following I will just assume you are running on Windows)
If you have a file a.txt:
1+2
You can enter in the console cmd.exe:
R.exe -f a.txt
LINK:
You link some C-code to the R-sources: this is probably not very interesting to you because Netbeans is written in Java and linking would be difficult.
PIPE:
This is the possiblity you would choose if you want to also use the R-GUI. The above console-eval-option only produces textual output but with this method you can (eventually) also produce graphics and transmit them to Netbeans. You use named pipes (again, i have to assume you are using Windows) which you can open on the R-side with the function pipe().
SOCKET:
analogues, but with the function socketConnection
STUB:
You write a DLL in e.g. C, load the DLL using dyn.load(), and call functions in it with the function .C(); in that DLL you can use e.g. a pipe or socket to communicate with Java.

Run Batch File from R

I've found a lot of answers on how to run R from a Batch file, but nothing about running a Batch File from R. I know one way to do this is to use system, system2 or shell, but these methods wait for process in the Windows Command Prompt to finish before R accepts another input. I want to run a Batch File which calls a console application that runs indefinitely, and then allow R to do other things. Any help would be greatly appreciated.
The help page ?shell says how to do it. Just run
shell("MyScript.bat", wait=FALSE)

Resources