56 static int GroupDim = 10;
61 cout <<
"Setting group dimension to "<< GroupDim << endl;
70 if(GroupDim % 2 == 0) a =
true;
101 b0 =
bb(startid +
"1");
102 b0 -=
bbt(startid +
"1");
103 string constpart0 =
"*e_(" + startid +
"1";
105 if( (
getDim()/2) % 2 == 0) constpart =
"1/";
106 else constpart =
"i_/";
108 for(
int i = 2; i <=
getDim()/2; i++){
118 if( (
getDim()/2) % 4 == 0 || (
getDim()/2) % 4 == 3) b0 = b0 * constpart;
119 else b0 = -b0 * constpart;
138 for(
int i = 2; i <=
getDim()/2; i++){
144 if( (
getDim()/2) % 2 == 0) constpart =
"1";
145 else constpart =
"i_";
146 if( (
getDim()/2) % 4 == 0 || (
getDim()/2) % 4 == 3) b0 = b0 * constpart;
147 else b0 = -b0 * constpart;
163 out<<
"DEBUG_VERBOSE";
199 #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
201 #include <sys/resource.h>
203 #if defined(__APPLE__) && defined(__MACH__)
204 #include <mach/mach.h>
206 #elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
210 #elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
216 #error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
232 PROCESS_MEMORY_COUNTERS info;
233 GetProcessMemoryInfo( GetCurrentProcess( ), &info,
sizeof(info) );
234 return (
size_t)info.PeakWorkingSetSize;
236 #elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
238 struct psinfo psinfo;
240 if ( (fd = open(
"/proc/self/psinfo", O_RDONLY )) == -1 )
242 if ( read( fd, &psinfo,
sizeof(psinfo) ) !=
sizeof(psinfo) )
248 return (
size_t)(psinfo.pr_rssize * 1024L);
250 #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
252 struct rusage rusage;
253 getrusage( RUSAGE_SELF, &rusage );
254 #if defined(__APPLE__) && defined(__MACH__)
255 return (
size_t)rusage.ru_maxrss;
257 return (
size_t)(rusage.ru_maxrss * 1024L);
278 PROCESS_MEMORY_COUNTERS info;
279 GetProcessMemoryInfo( GetCurrentProcess( ), &info,
sizeof(info) );
280 return (
size_t)info.WorkingSetSize;
282 #elif defined(__APPLE__) && defined(__MACH__)
284 struct mach_task_basic_info info;
285 mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
286 if ( task_info( mach_task_self( ), MACH_TASK_BASIC_INFO,
287 (task_info_t)&info, &infoCount ) != KERN_SUCCESS )
289 return (
size_t)info.resident_size;
291 #elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
295 if ( (fp = fopen(
"/proc/self/statm",
"r" )) == NULL )
297 if ( fscanf( fp,
"%*s%ld", &rss ) != 1 )
303 return (
size_t)rss * (size_t)sysconf( _SC_PAGESIZE);
317 cout <<
"===============================================================" << endl;
318 cout <<
"RSS: " <<
getCurrentRSS( )/(1024.*1024.) <<
" (MB); RSS_Peak: " <<
getPeakRSS()/(1024.*1024.) <<
" (MB)" << endl;
319 cout <<
"===============================================================" << endl;
ostream & operator<<(ostream &out, const Verbosity &a)
Return current ostream verbosity level.
int getDim()
Get the group dimension.
Verbosity getVerbosity()
Return current verbosity level.
void CleanGlobalDecl()
Clean all indexes and function declarations.
template string ToString< int >(int number)
size_t getCurrentRSS()
Gets current resident set size (RSS) - physical memory use.
void setVerbosity(Verbosity verb)
Set verbosity level.
bool GroupEven()
Return Group parity.
#define bbt(a)
C++ Macro for DList b\dagger operator.
Main Sospin header file. Includes C++ macros, to simplify expression writing, B operator, Verbosity level and memory usage.
vector< string > tabids
Vector container of the indexes.
Braket BopIdnum()
Operator B, charge conjugation matrix for SO(2N) spinor representations.
void setDim(int n)
Set the group dimension.
Braket Bop(string startid)
Operator B, "charge conjugation" matrix for SO(2N) spinor representations.
enum Verbosity_s Verbosity
size_t getPeakRSS()
Gets highest (peak) value so far for resident set size (RSS) - physical memory use.
void print_process_mem_usage()
Prints memory stats (current and peak resident set size) in MB.
#define bb(a)
C++ Macro for DList b operator.