Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 Bib Ind
 Top of Book   Previous Chapter   Next Chapter 

10 Miscellaneous functions
 10.1 simpcomp error handling
  10.1-1 SCErrorBreak

  10.1-2 SCErrorMail
 10.2 Email notification system
  10.2-1 SCMailClearPending

  10.2-2 SCMailIsEnabled

  10.2-3 SCMailIsPending

  10.2-4 SCMailSend

  10.2-5 SCMailSendPending

  10.2-6 SCMailSetAddress

  10.2-7 SCMailSetEnabled

  10.2-8 SCMailSetMinInterval
 10.3 Testing the functionality of simpcomp
  10.3-1 SCRunTest

10 Miscellaneous functions

The bahaviour of simpcomp can be changed by setting global options, functions for which will be described in the following.

10.1 simpcomp error handling

simpcomp can be configured to either enter a break loop when encountering an error or to just log the error and return fail in the called function. Examples for errors would be a computation failing or a SCSimplicialComplex object having an inconsistent internal state

10.1-1 SCErrorBreak
> SCErrorBreak( flag )( function )

Returns: true upon success, fail otherwise.

Sets whether simpcomp enters a break loop when encountering an error or just returns fail in the function called.

 gap> SCErrorBreak(true);
 true
 

10.1-2 SCErrorMail
> SCErrorMail( flag )( function )

Returns: true upon success, fail otherwise.

Sets whether simpcomp should send an email to the address specified by SCMailSetAddress (10.2-6) when encountering an error.

 gap> SCErrorMail(true);
 true
 

10.2 Email notification system

simpcomp comes with an email notification system that can be used for being notified of the progress of lengthy computations (such as reducing a complex via bistellar flips). See below for a descriptions of the mail notification related functions.

10.2-1 SCMailClearPending
> SCMailClearPending( )( function )

Returns: nothing.

Clears a pending mail message.

 gap> SCMailClearPending();
 

10.2-2 SCMailIsEnabled
> SCMailIsEnabled( )( function )

Returns: true or false upon success, fail otherwise.

Returns true when the mail notification system of simpcomp is enabled, false otherwise. Default setting is false.

 gap> SCMailIsEnabled();
 false
 

10.2-3 SCMailIsPending
> SCMailIsPending( )( function )

Returns: true or false upon success, fail otherwise.

Returns true when an email of the simpcomp email notification system is pending, false otherwise.

 gap> SCMailIsPending();
 false
 

10.2-4 SCMailSend
> SCMailSend( message[, starttime][, forcesend] )( function )

Returns: true when the message was sent, false if it was not send, fail upon an error.

Tries to send an email to the address specified by SCMailSetAddress (10.2-6) using the unix program mail. The optional parameter starttime specifies the starting time (as the integer unix timestamp) a calculation was started (then the duration of the calculation is included in the email), the optional boolean parameter forcewrite can be used to force the sending of an email, even if this violates the minimal email sending interval, see SCMailSetMinInterval (10.2-8).

 gap> SCMailIsEnabled();
 true
 gap> SCMailSend("Hello, this is simpcomp.");
 true
 

10.2-5 SCMailSendPending
> SCMailSendPending( )( function )

Returns: true upon success, fail otherwise.

Tries to send a pending email of the simpcomp email notification system. Returns true on success or if there was no mail pending.

 gap> SCMailSendPending();
 true
 

10.2-6 SCMailSetAddress
> SCMailSetAddress( address )( function )

Returns: true upon success, fail otherwise.

Sets the email address that should be used to send notification messages and enables the mail notification system by calling SCMailSetEnabled (10.2-7)(true).

 gap> SCMailSetAddress("johndoe@somehost");
 true
 

10.2-7 SCMailSetEnabled
> SCMailSetEnabled( flag )( function )

Returns: true upon success, fail otherwise.

Enables or disables the mail notification system of simpcomp. By default it is disabled. Returns fail if no email message was previously set with SCMailSetAddress (10.2-6).

 gap> SCMailSetAddress("johndoe@somehost"); #enables mail notification
 true
 gap> SCMailSetEnabled(false);
 true
 

10.2-8 SCMailSetMinInterval
> SCMailSetMinInterval( interval )( function )

Returns: true upon success, fail otherwise.

Sets the minimal time interval in seconds that mail messages can be sent by simpcomp. This prevents a flooding of the specified email address with messages sent by simpcomp. Default is 3600, i.e. one hour.

 gap> SCMailSetMinInterval(7200);
 true
 

10.3 Testing the functionality of simpcomp

simpcomp makes use of the GAP internal testing mechanisms and provides the user with a function to test the functionality of the package.

10.3-1 SCRunTest
> SCRunTest( )( function )

Returns: true upon success, fail otherwise.

Test whether the package simpcomp is functional by calling ReadTest("GAPROOT/pkg/simpcomp/tst/simpcomp.tst");. The returned value of GAP4stones is a measure of your system performance.

 gap> SCRunTest();
 + test simpcomp package, version %%%VERSION%%%
 + GAP4stones: 69988
 true
 
 Top of Book   Previous Chapter   Next Chapter 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 Bib Ind

generated by GAPDoc2HTML