00001 /*************************************************************************** 00002 taskmanager.h - description 00003 ------------------- 00004 begin : Sat Apr 26 2003 00005 copyright : (C) 2003 by Onur Soysal 00006 email : soysal@ceng.metu.edu.tr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef TASKMANAGER_H 00019 #define TASKMANAGER_H 00020 00021 #include "pesslaveinfo.h" 00022 #include "pesnetworkadapter.h" 00023 #include "population.h" 00024 00025 #define MAXPROC 300 00026 #define MAX_STR 200 00027 #define MAX_PESC_ARGS 30 00028 struct pvmhostinfo; 00029 //#define NTASKS p.POP_SIZE 00030 00042 class TaskManager { 00043 public: 00044 TaskManager(char *pesdefFile=NULL, char *resultsFolder=NULL); 00045 virtual ~TaskManager(); 00046 public: // Public attributes 00048 int nproc; 00050 char procHostMachines[MAXPROC][MAX_STR]; 00052 int nhost; 00054 int narch; 00056 int pingtimeout; 00058 int nres; 00060 int TASK_STEPS; 00062 int NROBOTS; 00064 int NTASKS; 00066 int TASK_PER_EVAL; 00068 int MAX_GENERATIONS; 00070 char SLAVENAME[MAX_STR]; 00072 char pesdefFileName[MAX_STR]; 00074 char *pescArgs[MAX_PESC_ARGS]; 00076 char resultsFolderName[MAX_STR]; 00078 int RANDOM_SEED; 00080 pvmhostinfo *hostp; 00082 Population *p; 00084 PESTask *tasks; 00086 PESSlaveInfo slaves[MAXPROC]; ; 00088 PESNetworkAdapter NetAdapter; 00090 FILE * logFile; 00092 virtual void spawnSlaves(); 00094 virtual void generateTasks(); 00096 virtual void errorShutDown(); 00098 void shutDown(); 00100 void assignTask(int who); 00102 void timeOut(int who); 00104 void assignInitialTasks(); 00106 void executeTasks(); 00108 int packetCheck(); 00110 void closeFile(); 00112 void openStatisticsFile(); 00114 void closeStatisticsFile(); 00116 void appendToStatisticsFile(); 00118 FILE * fstat; 00120 FILE * ferror; 00122 void ReadFile(); 00124 int getMachineIndexFromSlave(int who); 00125 /* void static Terminate(int s) 00126 { 00127 printf("\nhello\n"); 00128 fflush(stdout); 00129 shutDown(); 00130 exit(1); 00131 }*/ 00132 }; 00133 00134 #endif
1.2.18