Unable to launch multiple instances in silent mode through batch script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravindra
    Enthusiast
    • Dec 2018
    • 24

    Unable to launch multiple instances in silent mode through batch script

    HI,
    For every release we have thousands of output put files to compare. Currently it is taking multiple days to complete the comparison.To finish it in single day we created multiple batch files and each file will point to different folders. But when we ran all batch files at a time but looks like it is executing one after the other batch files.

    Is there any work around to achieve this through batch script. Any help is greatly appreciated.

    Thanks,
    Ravindra
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    If you run everything from a single Beyond Compare script, the commands run sequentially.

    Example script:
    Code:
    load c:\folder1 d:\folder1
    expand all
    folder-report layout:side-by-side output-to:out1.txt
    load c:\folder2 d:\folder2
    expand all
    folder-report layout:side-by-side output-to:out2.txt
    To run script commands in parallel, use a separate script for each pair of folders and launch them from a batch file with the start prefix so the batch file doesn't wait for the command to finish.
    Example script:
    Code:
    load "%1" "%2"
    expand all
    folder-report layout:side-by-side output-to:"%3"
    Example batch file:
    Code:
    start bcompare.exe @c:\script.txt "c:\folder1" "d:\folder1" "c:\report1.txt"
    start bcompare.exe @c:\script.txt "c:\folder2" "d:\folder2" "c:\report2.txt"
    Chris K Scooter Software

    Comment

    • ravindra
      Enthusiast
      • Dec 2018
      • 24

      #3
      Thanks Chris for quick reply. Yes I am using multiple files not single file.Below is the mysetup and when I ran two batch files at a time, fist blocked till second file execution completes. AM I missing any thing.

      Batchfile1:
      "C:\Program Files\Beyond Compare 4\BCompare.exe" -silent "X:\bccompare\BCSettings_latest.bcpkg"
      "C:\Program Files\Beyond Compare 4\BCompare.exe" -silent @X:\bccompare\bccompare_tpd.txt

      bccompare_tpd.txt
      load "H:\Parallel_Cycles1" "H:\Parallel_Cycles2"
      expand all
      select all
      compare rules-based
      criteria rules-based ignore-unimportant
      filter "*.txt"
      folder-report layout:side-by-side options:display-all,include-file-links output-to:"x:\bccompare\compare_tpd.html" output-options:html-color

      Second batch file:
      Batchfile1:
      "C:\Program Files\Beyond Compare 4\BCompare.exe" -silent "X:\bccompare\BCSettings_latest.bcpkg"
      "C:\Program Files\Beyond Compare 4\BCompare.exe" -silent @X:\bccompare\bccompare_ag.txt

      bccompare\bccompare_ag.txt

      oad "H:\Parallel_Cycles1\ag" "H:\Parallel_Cycles2\ag"
      expand all
      select all
      compare rules-based
      criteria rules-based ignore-unimportant
      filter "*.txt"
      folder-report layout:side-by-side options:display-all,include-file-links output-to:"x:\bccompare\compare_ag.html" output-options:html-color

      Thanks,
      Ravindra

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16011

        #4
        Hello,

        How are you calling the bat files? Is Windows Task Scheduler configured to call to the tasks sequentially? Does it show that it is running them concurrently? It sounds like the tasks themselves aren't firing; if you right-click and manually run two sample tasks, does that override and have them go at the same time?

        Your script is configured in a way that it is going to run the comparison scan two+ times. Each command is sequential, and the compare and criteria commands both would run the same scan, while the load would also run the default criteria scan. I'd recommend re-ordering things:

        criteria rules-based ignore-unimportant
        filter "*.txt"
        load "H:\Parallel_Cycles1" "H:\Parallel_Cycles2"
        expand all
        folder-report layout:side-by-side options:display-all,include-file-links output-to:"x:\bccompare\compare_tpd.html" output-options:html-color

        By setting the criteria first, you can then perform that scan during the initial load. In general, I recommend removing the -silent tags while troubleshooting to help find these behaviors and verify everything is working as intended. Once things are working, then we add -silent back in and retest.
        Aaron P Scooter Software

        Comment

        • ravindra
          Enthusiast
          • Dec 2018
          • 24

          #5
          Hi Aaron,

          I am running them manually by opening multiple command line interface windows. Within seconds difference I am invoking the run of two batch files.

          Behavior:
          As I said in first thread, when I ran second batch file , first batch execution is paused. Once second execution is completed then first batch execution resumed automatically.

          Thanks,
          Ravindra

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            It might help to output the reports to separate folders. HTML reports with include-file-links output images to the BcImages subfolder and the linked reports to the BcFiles subfolder. It's possible there's a collision in filenames or access to the subfolders, outputting to a separate folder for each report/batch file might be helpful.

            Also, it's possible there's a collision/block when importing settings. If you remove the "bcompare.exe -silent BCSettings.bcpkg" from each batch file, that might help the tasks run in parallel. If that fixes the issue, running the settings import once before any scripts run instead of for each script might work best.
            Chris K Scooter Software

            Comment

            • ravindra
              Enthusiast
              • Dec 2018
              • 24

              #7
              Chris K,

              I have followed your suggestion where separated output folders and ran setting files separately but no luck. Please find the attached screenshot. Is there any other approach for parallel execution where other users have successfully implemented.
              Attached Files

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16011

                #8
                Hello,

                If you remove all instances of importing settings, and run a series of test scripts where each line is calling bcompare @scriptfile, does this run concurrently or simultaneously in your setup? If concurrently, could we get more information on how you set up the overall task to call to each .exe from Task Scheduler?
                Aaron P Scooter Software

                Comment

                • ravindra
                  Enthusiast
                  • Dec 2018
                  • 24

                  #9
                  Aaron,

                  I am not using importing setting any more through script. I am running it standalone and once it is completed then I am running multiple batch compare files. I have not tried task schedule yet.

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 16011

                    #10
                    Could we get a full layout of how exactly you are executing the tasks? The individual script calls are working, so to troubleshoot we need to see the overarching setup. You could post here or email us privately at [email protected] (with a link back to this forum thread for our reference).
                    Aaron P Scooter Software

                    Comment

                    • ravindra
                      Enthusiast
                      • Dec 2018
                      • 24

                      #11
                      My Apologies for late reply..

                      My setup is simple bat file and text file as below..

                      batch_compare.bat:
                      "C:\Program Files\Beyond Compare 4\BCompare.exe" -silent @H:\Automation\filecomparesolution\batch1.txt "V:\2008server\SST\NIC" "U:\2016server\SST\NYLIC" "V:\2016server\SST\Results\NIC\SST_NIC_RESULT.html "
                      "C:\Program Files\Beyond Compare 4\BCompare.exe" -silent @H:\Automation\filecomparesolution\batch1.txt "V:\2008server\AAR\NIC" "U:\2016server\AAR\NIC" "V:\2016server\AAR\Results\NIC\AAR_NIC_RESULT.html "


                      batch1.txt:
                      compare rules-based
                      criteria rules-based ignore-unimportant
                      load "%1" "%2"
                      expand all
                      select all
                      filter "*.txt"
                      folder-report layout:side-by-side options:display-all,include-file-links output-to:"%3" output-options:html-color


                      Once folder paths are updated, I used to run batch_compare.bat by double clicking it..


                      Thanks,
                      Ravindra




                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 16011

                        #12
                        Hello,

                        Temporarily remove any "-silent" while troubleshooting so you can see any errors that might appear. Then run your batch_compare.bat from the Windows Command line as a logged in user and only that one bat file. Does this simple test scenario work?

                        Also, your batch1.txt script has a couple of redundant or out of order commands in it. We can clean it up a little by:
                        criteria rules-based ignore-unimportant
                        filter "*.txt"
                        load "%1" "%2"
                        expand all
                        folder-report layout:side-by-side options:display-all,include-file-links output-to:"%3" output-options:html-color

                        By setting the criteria and filter before the load, the load command itself will run the comparison faster by applying them during the load. The compare command is not needed (and only works on a selection after a load if you needed to scan a subset of files differently, which I don't think you do.)
                        Aaron P Scooter Software

                        Comment

                        • ravindra
                          Enthusiast
                          • Dec 2018
                          • 24

                          #13
                          No luck so far to run parallel comparison by initiating multiple instances in same machine. It always runs in sequential and it is taking more then day to finish entire comparison. Is any of the customers have success in running parallel compare? My goal is to complete entire comparison in half day.

                          Comment

                          Working...