Ignore:
Timestamp:
Nov 2, 2009 10:55:37 AM (13 years ago)
Author:
srkline
Message:

Added conditional compile instructions to some reduction procedure files that have only minor facility-specific changes. These changes are not significant enough to merit a separate facility file that must be maintained with essentially duplicate functions.

#define SYMBOL was attempted, but did not work since the symbols weren't actually defined until after the compile... and I couldn't figure out how to define - then compile. in additon, the table is static until Igor is quit - so multiple symbols could be defined, and compiling would fail.

So... the method now that appears to work is to put a dummy function for each facility in its facility specific "Includes" file. Then the conditional compilation checks for exists("function").

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf

    r583 r588  
    102102         
    103103//      nthreads = 1 
    104          
    105         variable mt= ThreadGroupCreate(nthreads) 
     104        NVAR mt=root:myGlobals:gThreadGroupID 
     105        mt = ThreadGroupCreate(nthreads) 
    106106        NVAR gInitTime = root:Packages:NIST:SAS:gRanDateTime            //time that SASCALC was started 
    107  
     107        Print "thread group ID = ",mt 
    108108         
    109109        inputWave[0] = NNeutron/nthreads                //split up the number of neutrons 
     
    153153        while( tgs != 0 ) 
    154154        variable dummy= ThreadGroupRelease(mt) 
     155        mt=0 
    155156        Print "done with all threads" 
    156157 
     
    11041105        NVAR doMonteCarlo = root:Packages:NIST:SAS:gDoMonteCarlo                // == 1 if 2D MonteCarlo set by hidden flag 
    11051106        WAVE rw=root:Packages:NIST:SAS:realsRead 
     1107         
     1108// Try to nicely exit from a threading error, if possible 
     1109        Variable err=0 
     1110        if(!exists("root:myGlobals:gThreadGroupID")) 
     1111                Variable/G root:myGlobals:gThreadGroupID=0 
     1112        endif 
     1113        NVAR mt=root:myGlobals:gThreadGroupID 
     1114 
     1115        if(mt!=0)       //there was an error with the stopping of the threads, possibly user abort 
     1116                err = ThreadGroupRelease(mt) 
     1117                Print "threading err = ",err 
     1118                if(err == 0) 
     1119                        // all *should* be OK 
     1120                else 
     1121                        return(0) 
     1122                endif 
     1123        endif 
    11061124 
    11071125        NVAR imon = root:Packages:NIST:SAS:gImon 
Note: See TracChangeset for help on using the changeset viewer.