develop3
Developing code using sc in addition to the executables, the scientific computing toolkit libraries and include files can be installed on your machine. this is described in the compiling section of this manual. the sc-config program can be use to obtain the compilers, compiler options, and libraries needed to use the sc toolkit from your program. this utility is discussed below, along with how the sc toolkit must be initialized in your main subroutine. the sc-config program returns information about how sc was compiled and installed. the following information is available: to use the sc-config program to link your executable to sc, use a makefile for gnu make similar to the following: first the execution environment must be initialized using the exenv init member. by default, all output will go to the console stream, cout. to change this, use the following code: mpi is allowed wait until mpi_init is called to fill in argc and argv, so you may have to call mpi_init before you even know that we ready to construct mpimessagegrp. so if an mpimessagegrp is needed, it is up to the developer to call mpi_init to get the argument list for certain mpi implementations. when files are read and written, an extension is added to a basename to construct the file name. the default is 'sc'. to use another basename, make the following call, where basename is a const char *: if your job might run in parallel, then make the following call or the nodes will print redundant information. the myproc argument is the rank of the called node. this segment of code sets up an object object to provide multi-threading: this segment of code sets up the message passing object: this example code illustrates a complete mp2 energy implementation using the sc toolkit. first an mp2 class is declared and the necesary base class member functions are provided. next a classdesc is defined. finally, the member functions are defined. note that no main routine is provided. this is because this file is designed to be used to extend the functionality of the mpqc executable. to generate a new mpqc executable with the new class available for use, see the mp2 implementation example: makefile section. this example makefile demonstrates how to link in a new class to form a new mpqc executable, here named mp2. the code is given in the mp2 implementation example: source section. the sc-config command is used to obtain information about how the sc toolkit was compiled and installed. the library specified with -lmpqc provides the main routine from mpqc. this input file can be used with the program illustrated in the mp2 implementation example: source section. it will compute the mp2 energy using the new mp2 class. note that only the object-oriented input format can be used with user provided classes.