Modify

Opened 9 years ago

Closed 9 years ago

#3111 closed Bug (Fixed)

Allow for parallel compilations

Reported by: adrienc@… Owned by: Jos
Milestone: Component: SciTE4AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

Hello,

In my company we have a lot (around 100-150) of AutoIt programs of various size. So first: thank you for your great language!!!

We have a script to compile all our programs. We run it several times a day.
We have tried to speed up the compilation duration by calling AutoItWrapper.exe multiple times (in parallel), in order to benefit from all the CPU cores on our server.

However that caused us big troubles. For example, some executables were mixed or swapped (i.e. programA.exe and programB.exe are both the executable file for programA.au3, and the code in programB.au3 is compiled nowhere).

To reproduce, just try to Run() 3 or 4 AutoItWrapper.exe programs in parallel.

Could you please try to solve this issue, as it would really improve our compilation time ?
Thank you!!!!

Attachments (1)

autoit_3111.zip (4.3 KB) - added by adrienc@… 9 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 9 years ago by BrewManNH

Are you actually running AutoIt3Wrapper, or are you running Aut2Exe? Have you tried compiling multiple scripts using just Aut2Exe and running them simultaneously?

comment:2 Changed 9 years ago by Jos

Build me a replication example and I will have a look, but don't expect me to do the work first to replicate a possible bug.
I have fixed an issue in au3stripper and make sure you use the last setup as that doesn't run autoit3wrapper.exe any more.

Jos

Last edited 9 years ago by Jos (previous) (diff)

comment:3 Changed 9 years ago by Jos

  • Component changed from Aut2Exe to SciTE4AutoIt
  • Owner set to Jos
  • Status changed from new to assigned

Changed 9 years ago by adrienc@…

comment:4 Changed 9 years ago by adrienc@…

Hello,

Here is a replication example, it is supposed to compile 5 programs named Program1.exe, Program2.exe, ..., Program5.exe. Each of these programs show a GUI with its name in a big label ("Program 1" is displayed by Program1.exe, and so on).

On my computer and our servers it does several errors, sometimes some programs are compiled and as you can see when running those compiled programs, they are not the right ones.

For instance Program2.exe will show "Program 5" and have no description on it.

Thank you for your time and your work on AutoIt !!!

comment:5 Changed 9 years ago by Jos

This issue seems to stem from the _tempfile() udf which will generate the same name when ran with a certain timeframe. Things seems to work when I put a sleep between the compile lines:

	StartCompilation("Program1")
	sleep(2000)
	StartCompilation("Program2")
	sleep(2000)
	StartCompilation("Program3")
	sleep(2000)
	StartCompilation("Program4")
	sleep(2000)
	StartCompilation("Program5")

Just a workaround for the moment,while I check how this can be resolved.
Jos

comment:6 Changed 9 years ago by Jos

Please give the current beta a try. also remember I am not supplying compiled scripts any more, so your program should look like this now:

#include <Constants.au3>

If $CmdLine[0] = 0 Then ; Main program
	StartCompilation("Program1")
	StartCompilation("Program2")
	StartCompilation("Program3")
	StartCompilation("Program4")
	StartCompilation("Program5")
Else
	Compile($CmdLine[1])
EndIf

Exit

Func StartCompilation($a)
	Run('"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" ' & @ScriptName & ' ' & $a, @ScriptDir, @SW_HIDE)
EndFunc   ;==>StartCompilation

Func Compile($a)
	Local $iPID = Run('"C:\Program Files (x86)\AutoIt3\autoit3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /in ' & $a & '.au3 /out ' & $a & '.exe /nopack /NoStatus', @ScriptDir, @SW_SHOW, $STDOUT_CHILD)
	Local $sOutput = ""
	While 1
		$sOutput = StdoutRead($iPID)
		If @error Then ExitLoop
		If ($sOutput <> "" And (StringInStr($sOutput, "error:") Or StringInStr($sOutput, "warning:"))) Then
			MsgBox(16, "ERROR - Compilation ABORTED", "When compiling the file " & $a & ".au3, AutoIt Compiler returned (stdout):" & @CRLF & @CRLF & $sOutput)
			Exit
		EndIf
	WEnd
EndFunc   ;==>Compile

Jos

Last edited 9 years ago by Jos (previous) (diff)

comment:7 Changed 9 years ago by adrienc@…

Hello,

I have installed the Beta, but things are still the same.

Quick question: is it me or the Beta did not update the file AutoIt3Wrapper.au3 ?
Maybe this is the reason why the bug is not fixed, and you need to provide me the new AutoIt3Wrapper.au3 file?

Thank you for your time!

comment:8 Changed 9 years ago by Jos

You need to go to the SciTE4AutoIt3 Beta subdirectory, not the Beta AutoIt3 installer.
https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/
Download the AutoI3Wrapper.zu3 from there and replace the current one.
Don't forget to update your SciTE setup as I am not providing any EXE's anymore for scripts.

Jos

comment:9 Changed 9 years ago by adrienc@…

Hello,

Even with the beta version of AutoIt3Wrapper.au3 I still have mixed executable files.

I do not know if this can help you, but here is the error message I get 50% of the time:

Error: EndUpdateResource: Returncode = 0 - LastError:5:Acces denied.

comment:10 Changed 9 years ago by Jos

Are you sure you using the script and new source I provided?
I have tested many times with your provided example and things were working after the modifications I have made.

Jos

Version 0, edited 9 years ago by Jos (next)

comment:11 Changed 9 years ago by adrienc@…

Hello,

I have uninstalled AutoIt3, AutoIt3 Beta and SciTe.
I have then installed, in this order: AutoIt, AutoIt3 Beta, SciTe.
Then I have downloaded the beta AutoIt3Wrapper.au3 and put it in the Beta directory.

The script I am using is this one:

#include <Constants.au3>

If $CmdLine[0] = 0 Then ; Main program
	StartCompilation("Program1")
	StartCompilation("Program2")
	StartCompilation("Program3")
	StartCompilation("Program4")
	StartCompilation("Program5")
Else
	Compile($CmdLine[1])
EndIf

Exit

Func StartCompilation($a)
	Run('"C:\Program Files (x86)\AutoIt3\Beta\AutoIt3.exe" ' & @ScriptName & ' ' & $a, @ScriptDir, @SW_HIDE)
EndFunc   ;==>StartCompilation

Func Compile($a)
	Local $iPID = Run('"C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe" "C:\Program Files (x86)\AutoIt3\Beta\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /in ' & $a & '.au3 /out ' & $a & '.exe /nopack /NoStatus', @ScriptDir, @SW_HIDE, $STDOUT_CHILD)
	Local $sOutput = ""
	While 1
		$sOutput = StdoutRead($iPID)
		If @error Then ExitLoop
		If ($sOutput <> "" And (StringInStr($sOutput, "error:") Or StringInStr($sOutput, "warning:"))) Then
			MsgBox(16, "ERROR - Compilation ABORTED", "When compiling the file " & $a & ".au3, AutoIt Compiler returned (stdout):" & @CRLF & @CRLF & $sOutput)
			Exit
		EndIf
	WEnd
EndFunc   ;==>Compile

Am I doing something wrong? Am I forgetting to do something?
Thank you very much!!

comment:12 Changed 9 years ago by Jos

Looks good to me ... and you still have the same issue?
Any AV installed and do you have the temp directory excluded: "%localappdata%\AutoIt v3" ?

Jos

comment:13 Changed 9 years ago by adrienc@…

Hello,

Sorry, no AV installed, WinDefender disabled...

I always get this error:

Error: EndUpdateResource: Returncode = 0 - LastError:5:Acces denied.

comment:14 Changed 9 years ago by Jos

.. and this is for all 5 when running the batch script and things are working fine when doing one?

Jos

comment:15 Changed 9 years ago by adrienc@…

I get between 1 and 3 errors when running the batch script, and things are working gine when doing one.

comment:17 Changed 9 years ago by Jos

I have ran your example again a couple of times and have no issues any more.

One other question: why do you have Scite in the Beta directory?
"C:\Program Files (x86)\AutoIt3\Beta\SciTE\AutoIt3Wrapper
There is no need for that and never done by the standard installers.

There is not much I can do more at this moment unless I can get it to replicate your problem.
There were several fixes in the code using the same file and also the _tempfile() returned the same name in case it was called within a certain timeframe, but those should all be sorted now.

Jos

comment:18 Changed 9 years ago by Jos

  • Resolution set to Fixed
  • Status changed from assigned to closed

Closing this report.

Jos

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.