Ignore:
Timestamp:
Nov 26, 2008 2:56:05 PM (14 years ago)
Author:
srkline
Message:

Added poor man's threading to the MonteCarlo? calculation.

My guess is that the ran() function from NR is not thread safe (it is non-reentrant). So I simply duplicated Monte_SANSX to Monte_SANSX2, where each incarnation uses a different random number generator, either ran1() or ran3(). This means that currently only two processors are supported. Not a big deal. At least it works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/XOP_Dev/MonteCarlo/Xcode/MonteCarlo.xcodeproj/project.pbxproj

    r435 r458  
    88 
    99/* Begin PBXBuildFile section */ 
     10                0651C06B0EDDC6E300823BAB /* MonteCarlo2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0651C06A0EDDC6E300823BAB /* MonteCarlo2.c */; }; 
    1011                06C8DC610EA7CB1600E49E7B /* MonteCarlo.c in Sources */ = {isa = PBXBuildFile; fileRef = 06C8DC5F0EA7CB1600E49E7B /* MonteCarlo.c */; }; 
    1112                06C8DC620EA7CB1600E49E7B /* MonteCarlo.h in Headers */ = {isa = PBXBuildFile; fileRef = 06C8DC600EA7CB1600E49E7B /* MonteCarlo.h */; }; 
     
    5657 
    5758/* Begin PBXFileReference section */ 
     59                0651C06A0EDDC6E300823BAB /* MonteCarlo2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = MonteCarlo2.c; path = ../MonteCarlo2.c; sourceTree = SOURCE_ROOT; }; 
    5860                06C8DC5F0EA7CB1600E49E7B /* MonteCarlo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = MonteCarlo.c; path = ../MonteCarlo.c; sourceTree = SOURCE_ROOT; }; 
    5961                06C8DC600EA7CB1600E49E7B /* MonteCarlo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MonteCarlo.h; path = ../MonteCarlo.h; sourceTree = SOURCE_ROOT; }; 
     
    6466                8D01CCD10486CAD60068D4B7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 
    6567                AA53F5630587C7410055F2C1 /* MonteCarlo.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; name = MonteCarlo.r; path = ../MonteCarlo.r; sourceTree = SOURCE_ROOT; }; 
    66                 AA53F56A0587C76D0055F2C1 /* libXOPSupport.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libXOPSupport.a; path = ../../XOPSupport/Xcode/libXOPSupport.a; sourceTree = SOURCE_ROOT; }; 
     68                AA53F56A0587C76D0055F2C1 /* libXOPSupport.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libXOPSupport.a; path = ../../../../XOP_Toolkit_5/IgorXOPs5/XOPSupport/Xcode/libXOPSupport.a; sourceTree = SOURCE_ROOT; }; 
    6769/* End PBXFileReference section */ 
    6870 
     
    115117                                AA53F5630587C7410055F2C1 /* MonteCarlo.r */, 
    116118                                06C8DC5F0EA7CB1600E49E7B /* MonteCarlo.c */, 
     119                                0651C06A0EDDC6E300823BAB /* MonteCarlo2.c */, 
    117120                                06C8DC600EA7CB1600E49E7B /* MonteCarlo.h */, 
    118121                        ); 
     
    241244                        files = ( 
    242245                                06C8DC610EA7CB1600E49E7B /* MonteCarlo.c in Sources */, 
     246                                0651C06B0EDDC6E300823BAB /* MonteCarlo2.c in Sources */, 
    243247                        ); 
    244248                        runOnlyForDeploymentPostprocessing = 0; 
     
    287291                                INFOPLIST_FILE = Info.plist; 
    288292                                INSTALL_PATH = "$(HOME)/Library/Bundles"; 
    289                                 LIBRARY_SEARCH_PATHS = ../../XOPSupport/Xcode; 
     293                                LIBRARY_SEARCH_PATHS = ( 
     294                                        "$(inherited)", 
     295                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 
     296                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_2)", 
     297                                ); 
    290298                                LIBRARY_STYLE = Bundle; 
    291299                                OPTIMIZATION_CFLAGS = "-O0"; 
     
    336344                                INFOPLIST_FILE = Info.plist; 
    337345                                INSTALL_PATH = "$(HOME)/Library/Bundles"; 
    338                                 LIBRARY_SEARCH_PATHS = ../../XOPSupport/Xcode; 
     346                                LIBRARY_SEARCH_PATHS = ( 
     347                                        "$(inherited)", 
     348                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 
     349                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_2)", 
     350                                ); 
    339351                                LIBRARY_STYLE = Bundle; 
    340352                                OTHER_CFLAGS = ""; 
     
    383395                                INFOPLIST_FILE = Info.plist; 
    384396                                INSTALL_PATH = "$(HOME)/Library/Bundles"; 
    385                                 LIBRARY_SEARCH_PATHS = ../../XOPSupport/Xcode; 
     397                                LIBRARY_SEARCH_PATHS = ( 
     398                                        "$(inherited)", 
     399                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 
     400                                        "$(LIBRARY_SEARCH_PATHS_QUOTED_2)", 
     401                                ); 
    386402                                LIBRARY_STYLE = Bundle; 
    387403                                OTHER_CFLAGS = ""; 
     
    407423                        isa = XCBuildConfiguration; 
    408424                        buildSettings = { 
     425                                LIBRARY_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport/Xcode; 
     426                                REZ_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport; 
     427                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
     428                                USER_HEADER_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport; 
    409429                        }; 
    410430                        name = Debug; 
     
    413433                        isa = XCBuildConfiguration; 
    414434                        buildSettings = { 
     435                                LIBRARY_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport/Xcode; 
     436                                REZ_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport; 
     437                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
     438                                USER_HEADER_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport; 
    415439                        }; 
    416440                        name = Release; 
     
    419443                        isa = XCBuildConfiguration; 
    420444                        buildSettings = { 
     445                                LIBRARY_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport/Xcode; 
     446                                REZ_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport; 
     447                                SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 
     448                                USER_HEADER_SEARCH_PATHS = /Users/srkline/IGOR_Programming/XOP_Toolkit_5/IgorXOPs5/XOPSupport; 
    421449                        }; 
    422450                        name = Default; 
     
    433461                        ); 
    434462                        defaultConfigurationIsVisible = 0; 
    435                         defaultConfigurationName = Default; 
     463                        defaultConfigurationName = Release; 
    436464                }; 
    437465                89CFE73C093E73F4002BBDEE /* Build configuration list for PBXProject "MonteCarlo" */ = { 
     
    443471                        ); 
    444472                        defaultConfigurationIsVisible = 0; 
    445                         defaultConfigurationName = Default; 
     473                        defaultConfigurationName = Release; 
    446474                }; 
    447475/* End XCConfigurationList section */ 
Note: See TracChangeset for help on using the changeset viewer.