Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7720657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:43:50+00:00 2026-06-01T03:43:50+00:00

I have 2 python scripts https://gist.github.com/2233477 . rsgen.py generates random inputs for use in

  • 0

I have 2 python scripts https://gist.github.com/2233477.

  • rsgen.py generates “random” inputs for use in simulate.py
  • simulate.py does the actual simulation

Thing is, when I start to increase the input size from rsgen.py with the --numReferences param, I get different outputs

# ./rsgen.py --numReferences 1000 > rs.txt; cat rs.txt | xargs ./simulate.py
Number of page faults : 59

# ./rsgen.py --numReferences 100000 > rs.txt; cat rs.txt | xargs ./simulate.py
Number of page faults : 873
Number of page faults : 848
Number of page faults : 823
Number of page faults : 103

./rsgen.py --numReferences 1000000 > rs.txt; cat rs.txt | xargs ./simulate.py
Number of page faults : 866
Number of page faults : 869
Number of page faults : 876
Number of page faults : 907
Number of page faults : 910
Number of page faults : 1001
Number of page faults : 845
...

Notice as I increase numReferences, the python script simulate appears to run more times. Why is that? I am expecting just 1 line of “Number of page faults: …”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:43:52+00:00Added an answer on June 1, 2026 at 3:43 am

    This probably has something to do with xargs‘ ARG_MAX which defines a batch size for how many args to send to an executable; hence why multiple invocations of your script since it is splitting up the args across multiple calls.

    Try the -n (or --max-args) flag of xargs .

    A better way alltogether would be to have simulate.py accept a file argument so you could do something like this:

    ./rsgen.py --numReferences N > rs.txt; 
    ./simulate.py -f rs.txt
    

    It would probably be a lot faster since it avoids the xargs overhead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fair number of Python scripts that contain reusable code that are
I have been using NotePAD++ for editing Python scripts. I recently downloaded the PyDEV
I have a server which executes Python scripts from a certain directory path. Incidently
I currently have a number of Python scripts that help prep a staging area
So I have to run some python scripts on a cluster with machines for
I have a web service to which users upload python scripts that are run
Hey I have a windows server running python CGI scripts and I'm having a
I have written python scripts to list repositories and commits. To create a new
I have the following script in Python. What it does is tries to connect
I have been trying to create a web service out some python scripts, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.