コード例 #1
0
ファイル: system.cpp プロジェクト: bakanahito/RetRot
	unsigned int __stdcall GameProcessLoop(void*)
	{
		FpsControl fc;

		do
		{
			if (fc.OkGo())
			{
				MainProcess();
			}
			else
			{
				Sleep(1);
			}

			if (endFlag)
			{
				return 0;
			}
		} while (true);

		return 0;
	}
コード例 #2
0
ファイル: main.cpp プロジェクト: elfmz/far2l
int MainProcessSEH(FARString& strEditName,FARString& strViewName,FARString& DestName1,FARString& DestName2,int StartLine,int StartChar)
{
	int Result=0;
	Result=MainProcess(strEditName,strViewName,DestName1,DestName2,StartLine,StartChar);
	return Result;
}
コード例 #3
0
ファイル: main.c プロジェクト: mhelal/mmDST
/* =============================================================================
	The main function:
		Initialize MPI, 
		Process arguments (processArguments)
		Initialize output debugging files (init_output)
		call MainProcess function, 
		and finalizes MPI.

============================================================================= */
int main(int argc, char **argv) {
    MPI_Group orig_group;	
    char * * sequences = NULL;/*, ufilename[SHORT_MESSAGE_SIZE];*/
    char * * seqName = NULL;
    long partitionSize;
    MOATypeDimn seqNum;
    MOATypeShape * seqLen = NULL;
    int stype;
    long ID1;
#ifndef NDEBUG
    char msg[SHORT_MESSAGE_SIZE];
#endif			
    /* MPI Initiliaztion ==================================================*/
    MPI_Init(&argc, &argv);
    /* Get my Rank in myProcid*/
    MPI_Comm_rank(MPI_COMM_WORLD, &myProcid);
    /* Get the number of processes running in the ClusterSize*/
    MPI_Comm_size(MPI_COMM_WORLD, &ClusterSize);
    /* Get the group associated with the communicator ===============*/
    MPI_Comm_group (MPI_COMM_WORLD, &orig_group);
    MPI_Comm_create(MPI_COMM_WORLD, orig_group, &MOAMSA_COMM_WORLD);
    /* ============================================ end MPI initialization*/
    TBFlag = 0;
    /* 1. Process Arguments, Sequences, lengths, scoring type, partition Size, output prefix, ... etc*/
    processArguments(argc, argv, &seqNum, &sequences, &seqName, &seqLen, &stype, &partitionSize);
    /*  Thought I can run the same program in Distributed and Sequential Mode, but only now the Distributed one is being tested, so ignore this one*/

    /* Initialize output debugging files*/
    strcpy (outPrefix, "c");
    if (init_output() == 0) {
        /* Initialize timing variables, previous Time (prevNow) and Current Time  (currNow)*/
        prevNow = NULL;
        prevNow = mmalloc ((MOATypeInd) sizeof *prevNow);
        currNow = NULL;
        //currNow = mmalloc ((MOATypeInd) sizeof *currNow);
        currNow = getTime();
        if (currNow == NULL) {
            printf ("Could not read current time. Exiting.\n");
            return -1;
        }
        ID1 = getpid();

        printf("[%d]>PID = %ld Started at time (%d, %d, %d, %d)\n", myProcid, ID1, currNow->tm_yday, currNow->tm_hour, currNow->tm_min, currNow->tm_sec);
#ifndef NDEBUG
        sprintf(msg, "[%d]>Started at time (%d, %d, %d, %d)\n", myProcid, currNow->tm_yday, currNow->tm_hour, currNow->tm_min, currNow->tm_sec);	
        mprintf(0, msg, 1);
#endif
        cpTime (currNow, &prevNow);

        /* Calling the main process ==========================================*/
        MainProcess(seqNum, sequences, seqName, seqLen, stype, partitionSize);
        currNow = getTime();
if (myProcid == 0) {
        printf("[%d]>Finalized at time (%d, %d, %d, %d)\n", myProcid, currNow->tm_yday, currNow->tm_hour, currNow->tm_min, currNow->tm_sec);
}
#ifndef NDEBUG
        sprintf(msg, "[%d]>Finalized at time (%d, %d, %d, %d)\n", myProcid, currNow->tm_yday, currNow->tm_hour, currNow->tm_min, currNow->tm_sec);	
        mprintf(0, msg, 1);
#endif
        if (prevNow != NULL)
            free (prevNow);
    }
    if (close_output () != 0) 
        printf ("[%d] Error closing output files\n", myProcid);
    /* Finalize MPI ==================================================*/
    MPI_Finalize();

    return 0;
} /* of main */