bugGNU Parallel - build and execute command lines from standard input in parallel - Bugs: bug #35568, Calling sysctl on platforms...

 
 

bug #35568: Calling sysctl on platforms without it causes spurious errors

Submitted by:  None
Submitted on:  Sun 19 Feb 2012 05:59:39 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Ole Tange <tange>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 30 Mar 2012 03:14:55 PM UTC, comment #2:

Appears to work perfectly. Thanks!

Anonymous
Mon 27 Feb 2012 12:35:25 AM UTC, comment #1:

Should be fixed in [6f730374] Please test.

Re-open if it is not fixed.

Ole Tange <tange>
Project AdministratorIn charge of this item.
Sun 19 Feb 2012 05:59:39 PM UTC, original submission:

Hello,

While testing parallel on a Solaris machine, I noticed that parallel would generate a lot of 'command not found' errors before successfully running. Digging around, it appears that the way in which the number of CPUs and number of cores is determined is the root cause: a series of OS-specific functions are called and their results evaluated. The Darwin, FreeBSD, and GNU/Linux methods all try to call 'sysctl'; sadly, sysctl doesn't exist on Solaris, so trying to call a command that doesn't exist causes the subshell to emit a 'command not found' error.

To work around this, I've enclosed a patch for your approval. The number_of_cpus() and number_of_cores() functions will now only attempt to call the OS-appropriate function for the running system; Perl's $^O stores the name of the operating system that the Perl binary currently being used was built for.

Also, I added chomp() statements for the results of calling these functions; this eliminates a spurious newline that sometimes appears when calling 'parallel --number-of-cores'. It's trivial, but I'm picky. :-)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #25085:  0001-Call-an-OS-appropriate-function-for-determining-the-.patch added by None (3KiB - application/octet-stream - Related patch.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tange (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 27 Feb 2012 12:35:25 AM UTCtangeStatusNone=>Fixed
      Assigned toNone=>tange
      Open/ClosedOpen=>Closed
    Sun 19 Feb 2012 05:59:40 PM UTCNoneAttached File-=>Added 0001-Call-an-OS-appropriate-function-for-determining-the-.patch, #25085

    Back to the top


    Powered by Savane 3.1-cleanup1