Running a fortran file multiple times simultaneously on Windows - windows

I'm working with Windows.
I have a program in a fortran 90 file ..\my_folder\my_file.f90 that yields an output file ..\my_folder\output.dat.
I'd like to run this file many times simultaneously (to get statistics from multiple stochastic simulations). But this cannot be done in one folder. I get the error message : cannot open output file a.exe: Permission denied collect2.exe: error: ld returned 1 exit status.
And I don't want to copy-past it to different folders ..\my_folder\new_folder0\my_file.f90,..\my_folder\new_folder1\my_file.f90... since this is not convenient if I want to modify a line inside the fortran file.
I would like to know what tool I can use to make one fortran file run from different folders ?
And how is it possible to make it run but with different parameters please, so that in each folder the fortran file is run with different parameters ?
From the error message it seems also that if there was different .exe files and not only a.exe it would be ok. Is there a way that each time I compile the fortran file it would give a different .exe program to run ?

Related

Windows Command Line errors that can't find file

I don't know much about the command line but have been using it a lot lately. I was experiencing errors in a C application when trying to copy a file which didn't make sense; so, I tried using the the command line to make sure the code should work and get an error I don't understand.
copy "AH/Copy testing/media.enc" "AH/Copy testing/new_name.enc" returns the system cannot find the specified file. So, I tried type "AH/Copy testing/media.enc" and get the same error.
However, if change the directory to "AH/Copy testing", then type media.enc it works.
I tried the same statements on different files of the same and different extensions and they all work. For example, type "AH/Copy testing/fileName.enc" works.
Why would media.enc not be found unless the directory is set to its own first? If I copy media.enc to other locations, I get the same error unless the directory is first changed.
Thank you.

VB script sometimes return certain missing file? Extracting of files takes too long?

I have this VB script which I later compiled it together with some dll files using IExpress. Sometimes when a user run this script it will return an error message stating that certain dll file is not found.
From what I under is, the installer which is created when using IExpress will extract the files into a temporary folder at %temp%\IXP000.TMP. I am suspecting that sometimes the script does not run long enough to allow all the dll files to be extract to the temporary folder before executing the script.
Are there any ways to ensure all the files are extracted before running the script in the installer?
Thanks for the help in advance!

MinGW Make throwing "The system cannot find the path specified." error

I'm trying to generate a c++ project using cmake on Windows 7. Before it actually makes the project though it looks cmake does a quick test of your toolchain (I'm using MinGW) and that's where my problem. Cmake triggers a make build which ultimately fails with the response "The system cannot find the path specified."
I ran the particular makefile that was failing in dry run mode (-n) and manually executed all the commands:
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
echo Building C object CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj
C:\PROGRA~2\CODEBL~1\MinGW\bin\gcc.exe -o CMakeFiles\cmTryCompileExec306416588.dir\testCCompiler.c.obj -c C:\SFML\CMakeFiles\ CMakeTmp\testCCompiler.c
echo Linking C executable cmTryCompileExec306416588.exe
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTryCompileExec306416588.dir\link.txt --verbose=1
And they all executed without error leaving me with a functional .exe file as expected. However when run through make I return the error:
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
The system cannot find the path specified.
mingw32-make.exe: *** [CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj] Error 1
I then experimented with replacing all of the commands with something simple like "dir" and noticed that when run through make is returned "The system cannort find the path specified" again before printing out the dir information and exiting with an error.
My next step, and about as far as I've gotten, is to run make with the -d flag; the interesting bit being:
Creating temporary batch file C:\Users\CJ\AppData\Local\Temp\make8664-1.bat
Batch file contents:
#echo off
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
CreateProcess(C:\Users\CJ\AppData\Local\Temp\make8664 1.bat,C:\Users\CJ\AppData\Local\Temp\make8664-1.bat,...)
Putting child 00490378 (CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj) PID 4730176 on the chain.
Live child 00490378 (CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj) PID 4730176
Main thread handle = 00000074
The system cannot find the path specified.
Reaping losing child 00490378 PID 4730176
Cleaning up temp batch file C:\Users\CJ\AppData\Local\Temp\make8664-1.bat
mingw32-make.exe: *** [CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj] Error 1
I don't really know too much about the inner workings of make but from what I can tell from this output it looks like it has something to do with the temporary batch file that make is making. I looked at this stackoverflow post What causes GNU Make to shell out and it looks like what triggers a temporary file to be made is pretty vague. I was able to find a command that executed without the creation of a temporary batch file ("ls" from the windows Git bin) and sure enough it executed via make without returning the "The system cannot find the path specified" response like the "dir" command did ("dir" caused make to generate that temp file).
I feel like I've kind of hit a wall with my debugging abilities and am turning to you guys to see if you can offer any advice. Does it seem like I'm making the right assumptions? Do you have any insights into what may be manifesting the problem?
It looks like I was able to figure out the problem on my own so sorry for bothering with the post. It turns out that the problem wasn't with Make but instead with cmd itself (which would explain the error whenever make tried to run a batch file). It looks like somehow (possibly through some kind of malware that snuck onto my system or maybe some kind of misguided windows update) the Command Processor's registry key was set to something like "C:\Users\CJ\AppData\Roaming\Microsoft\Windows\IEUpdate\RMActivate_ssp.exe" which I recall specifically wiping from my computer not too long ago, hence the "The system cannot find the path specified." message whenever a cmd process was spawned by make (I guess I just totally missed it when I opened up the root cmd process). In any case, this was a simple fix following the instructions at https://superuser.com/questions/727316/error-in-command-line-the-system-cannot-find-the-path-specified, after which I was able to run the make, and subsequently cmake, build without any problems.
The keys in question are
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
Also this error can occur if you picked MSYS toolset in Cmake, but running it under a normal shell. In this case make tries to compile something like /c/source/build/stuff.cpp and normal Windows ABI rejects this path.
A great diagnostic method for this issue is --debug-trycompile flag for Cmake. If something has gone bad, you can re-run the failed command manually or peek into generated files to find the cause.

Trying to combine two files in Windows OS

I'm trying to combine two files using Windows command. However I keep getting the error:
The system cannot find the file specified.
The two files I'm trying to combine are .txt if that helps.
Edit: Another error popped up in addition to the original error, which said
Error occurred while processing filename

gprof output not being generated when executed in bash script

I've compiled and linked my application with -pg, and when running the application I get the correct gmon.out file and can analysis it with gprof. I am running a number of scripts under different situations to discover a speed issue between two versions of our software.
When I run the application I do produce the gmon.out output.
Since I have to do this for a number of different scripts, I piled them into a scrip to run so I can take a nap. It's not complicated. I'm also running this script at the same time in another directory with the other version of the application.
./test test1.script
gprof test > test1.ver1.stats
rm -f gmon.out
./test test2.script
gprof test > test2.ver1.stats
rm -f gmon.out
These do not produce the gmon.out file. Is there any explanation to this behavior? Also, running the script without the analysis of the other version running (eg, concatenate the scripts instead of running them in parallel), also produces the same behavior.
The scripts I am using to test the application change directories to get a large data-set. This affected the gmon.out location so when the application exited it was written to that far off directory. As the GNU GProf manual says,
The gmon.out file is written in the program's current working
directory at the time it exits. This means that if your program calls
chdir, the gmon.out file will be left in the last directory your
program chdir'd to. If you don't have permission to write in this
directory, the file is not written, and you will get an error message.
Last night I had the scripts running like,
GMON_OUT_PREFIX=test1.ver1.out ./test test1.script
GMON_OUT_PREFIX=test2.ver1.out ./test test2.script
GMON_OUT_PREFIX=test3.ver1.out ./test test3.script
And although, I couldn't find the files in my working directory, I did eventually find the files in the data folder. In the above, it is not important to specify different names for the output since they are proceeded by their process id (like, GMON_OUT_PREFIX.PID), but was necessary in my case to distinguish the tests.

Resources