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

  • Home
  • SEARCH
  • 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 7641419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:55:06+00:00 2026-05-31T08:55:06+00:00

I am conducting a simulation study using snowfall package on Windows 7. I like

  • 0

I am conducting a simulation study using snowfall package on Windows 7.

I like to print out a message for every 10 runs to main R console to monitor the progress, but it fails to do so. ie. nothing is printed

Any help will be much appreciated.

runsim = function(nsim,n,mean,var){
cov = 0
for(i in 1:nsim){
if ( i %% 10==0) 
cat("\n Running simulation",i)
dat = function1(n,mean,var)

cov = ...
}
cov / nsim
}
sfExport("function1","runsim")
sfLibrary(library1)

wrapper = function(n){
runsim(100,n,0.5,0.25)
}

Out<-sfLapply(1:100,wrapper)
  • 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-05-31T08:55:07+00:00Added an answer on May 31, 2026 at 8:55 am

    Check ?sfCat and find the line where it says:

    sfCat is a debugging function printing a message on all slaves (which appear in the logfiles).

    This tells us that we need to enable logging in the call to sfInit (argument slaveOutfile). Then, each call to sfCat() will dump stuff to the log file you specified. It took me a while to figure that out as well 😉

    Code Example

    if (!require("snowfall")) {
        install.packages("snowfall")
        require("snowfall")
    }
    
    sfInit(parallel=TRUE, cpus=4, slaveOutfile="test.txt")
    sfLibrary("snowfall", character.only=TRUE)
    
    res <- sfClusterApplyLB(1:100, function(x) {
        sfCat(paste("Iteration ", x), sep="\n")
    })
    sfStop()
    

    Output of ./test.txt

    [...]
    
    Calling a snowfall function without calling 'sfInit' first or after sfStop().
    'sfInit()' is called now.
    snowfall 1.84 initialized: sequential execution, one CPU.
    
    Iteration  4
    Type: EXEC 
    Iteration  92
    Type: EXEC 
    Iteration  94
    Type: EXEC 
    Iteration  96
    Type: EXEC 
    Iteration  98
    Type: EXEC 
    Iteration  100
    ype: EXEC 
    Iteration  29
    Type: EXEC 
    Iteration  31
    Type: EXEC 
    Iteration  33
    Type: EXEC 
    Iteration  35
    Type: EXEC 
    Iteration  37
    Type: EXEC 
    Iteration  39
    Type: EXEC 
    Iteration  41
    Type: EXEC 
    Iteration  43
    Type: EXEC 
    Iteration  45
    Type: EXEC 
    Iteration  47
    Type: EXEC 
    Iteration  49
    Type: EXEC 
    Iteration  51
    Type: EXEC 
    Iteration  53
    Type: EXEC 
    Iteration  55
    Type: EXEC 
    Iteration  57
    Type: EXEC 
    Iteration  59
    Type: EXEC 
    Iteration  61
    Type: EXEC 
    Iteration  63
    Type: EXEC 
    Iteration  65
    Type: EXEC 
    Iteration  67
    Type: EXEC 
    Iteration  69
    Type: EXEC 
    Iteration  71
    Type: EXEC 
    Iteration  73
    Type: EXEC 
    Iteration  75
    Type: EXEC 
    Iteration  77
    Type: EXEC 
    Iteration  79
    Type: EXEC 
    Iteration  81
    Type: EXEC 
    Iteration  83
    Type: EXEC 
    Iteration  85
    Type: EXEC 
    Iteration  87
    Type: EXEC 
    Iteration  89
    Type: EXEC 
    Iteration  91
    Type: EXEC 
    Iteration  93
    Type: EXEC 
    Iteration  95
    Type: EXEC 
    Iteration  97
    Type: EXEC 
    Iteration  99
     EXEC 
    Iteration  74
    Type: EXEC 
    Iteration  76
    Type: EXEC 
    Iteration  78
    Type: EXEC 
    Iteration  80
    Type: EXEC 
    Iteration  82
    Type: EXEC 
    Iteration  84
    Type: EXEC 
    Iteration  86
    Type: EXEC 
    Iteration  88
    Type: EXEC 
    Iteration  90
    

    Own question

    Does anyone have a clue how to “control” the specific things that go to the log file?
    E.g., what would be nice is to include information about which worker finished which job etc.

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

Sidebar

Related Questions

Added : I am conducting a study for a new system we're going to
I am conducting a usability study of medical content delivery systems and I was
I am connecting to a MS-Access 2007 database using VB 2010 and OLEDB. Conducting
I'm conducting experiments regarding e-mail spam. One of these experiments require sending mail thru
I am conducting some throughput testing. My application has to read from JMS do
I am conducting stress tests on my database, which is hosted on SQL Server
i connecting to a access database with php and adodb. Strings with characters like
I have someone connecting to my repository using the url (substituted the IP address):
I am having trouble connecting Redmine to a locally hosted subversion repository using SSL.
I have little issue with detecting internet connection while using static IP on device.

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.