/** * Method to get experiments of a particular time range * @param $inputs * @return array */ public static function get_experiments_of_time_range($inputs) { $experimentStatistics = AdminUtilities::get_experiment_execution_statistics(strtotime($inputs["from-date"]) * 1000, strtotime($inputs["to-date"]) * 1000); $experiments = array(); if ($inputs["status-type"] == "ALL") { $experiments = $experimentStatistics->allExperiments; } else { if ($inputs["status-type"] == "COMPLETED") { $experiments = $experimentStatistics->completedExperiments; } elseif ($inputs["status-type"] == "FAILED") { $experiments = $experimentStatistics->failedExperiments; } else { if ($inputs["status-type"] == "CANCELED") { $experiments = $experimentStatistics->cancelledExperiments; } } } $expContainer = array(); $expNum = 0; foreach ($experiments as $experiment) { $expValue = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectID), true); $expContainer[$expNum]['experiment'] = $experiment; $expValue["editable"] = false; $expContainer[$expNum]['expValue'] = $expValue; $expNum++; } return $expContainer; }
echo "<p>{$project->description}</p>"; echo '</div>'; $experiments = ProjectUtilities::get_experiments_in_project($project->projectID); echo '<div class="table-responsive">'; echo '<table class="table">'; echo '<tr>'; echo '<th>Name</th>'; echo '<th>Application</th>'; echo '<th>Compute Resource</th>'; echo '<th>Last Modified Time</th>'; echo '<th>Experiment Status</th>'; echo '<th>Job Status</th>'; echo '</tr>'; foreach ($experiments as $experiment) { $expValues = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectId), true); $expValues["jobState"] = ExperimentUtilities::get_job_status($experiment); $applicationInterface = AppUtilities::get_application_interface($experiment->executionId); echo '<tr>'; echo '<td>' . $experiment->experimentName . '</td>'; echo "<td>{$applicationInterface->applicationName}</td>"; echo '<td>'; try { $cr = CRUtilities::get_compute_resource($experiment->userConfigurationData->computationalResourceScheduling->resourceHostId); if (!empty($cr)) { echo $cr->hostName; } } catch (Exception $ex) { //Error while retrieving the CR } echo '</td>'; echo '<td class="time" unix-time="' . $expValues["experimentTimeOfStateChange"] . '"></td>';
public static function apply_changes_to_experiment($experiment, $input) { $experiment->experimentName = $input['experiment-name']; $experiment->description = rtrim($input['experiment-description']); $experiment->projectId = $input['project']; // $experiment->applicationId = $_POST['application']; // $experiment->executionId = $_POST['application']; $userConfigDataUpdated = $experiment->userConfigurationData; $schedulingUpdated = $userConfigDataUpdated->computationalResourceScheduling; $schedulingUpdated->resourceHostId = $input['compute-resource']; $schedulingUpdated->nodeCount = $input['node-count']; $schedulingUpdated->queueName = $_POST['queue-name']; $schedulingUpdated->totalCPUCount = $input['cpu-count']; //$schedulingUpdated->numberOfThreads = $input['threads']; $schedulingUpdated->wallTimeLimit = $input['wall-time']; //$schedulingUpdated->totalPhysicalMemory = $input['memory']; /* switch ($_POST['compute-resource']) { case 'trestles.sdsc.edu': $schedulingUpdated->ComputationalProjectAccount = 'sds128'; break; case 'stampede.tacc.xsede.org': case 'lonestar.tacc.utexas.edu': $schedulingUpdated->ComputationalProjectAccount = 'TG-STA110014S'; break; default: $schedulingUpdated->ComputationalProjectAccount = 'admin'; } */ $userConfigDataUpdated->computationalResourceScheduling = $schedulingUpdated; $userConfigDataUpdated->airavataAutoSchedule = isset($_POST['enable-auto-scheduling']) ? true : false; if (isset($input["userDN"])) { $userConfigDataUpdated->generateCert = 1; $userConfigDataUpdated->userDN = $input["userDN"]; } $experiment->userConfigurationData = $userConfigDataUpdated; $applicationInputs = AppUtilities::get_application_inputs($experiment->executionId); $experimentInputs = $experiment->experimentInputs; // get current inputs //var_dump($experimentInputs); $experimentInputs = ExperimentUtilities::process_inputs($applicationInputs, $experimentInputs); // get new inputs //var_dump($experimentInputs); if ($experimentInputs) { $experiment->experimentInputs = $experimentInputs; //var_dump($experiment); return $experiment; } }
<td><?php echo $experiment->userConfigurationData->computationalResourceScheduling->queueName; ?> </td> </tr> <tr> <td><strong>Inputs</strong></td> <td><?php ExperimentUtilities::list_input_files($experiment); ?> </td> </tr> <tr> <td><strong>Outputs</strong></td> <td><?php ExperimentUtilities::list_output_files($experiment, $expVal["experimentStatusString"]); ?> </td> </tr> @if( $expVal["experimentStatusString"] == "FAILED") <tr> <td><strong>Errors</strong></td> <td> @foreach( (array)$experiment->errors as $error) {{ $error->actualErrorMessage }} @endforeach </td> </tr> @endif </table>
public function getExperimentsOfTimeRange() { if (Request::ajax()) { $inputs = Input::all(); $expContainer = AdminUtilities::get_experiments_of_time_range($inputs); $expStates = ExperimentUtilities::getExpStates(); return View::make("partials/experiment-container", array("expContainer" => $expContainer, "expStates" => $expStates)); } }
public function browseView() { $pageNo = Input::get('pageNo'); $prev = Input::get('prev'); $isSearch = Input::get('search'); if (empty($pageNo) || isset($isSearch)) { $pageNo = 1; } else { if (isset($prev)) { $pageNo -= 1; } else { $pageNo += 1; } } $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(), $this->limit, ($pageNo - 1) * $this->limit); $experimentStates = ExperimentUtilities::getExpStates(); return View::make('experiment/browse', array('input' => Input::all(), 'pageNo' => $pageNo, 'limit' => $this->limit, 'expStates' => $experimentStates, 'expContainer' => $expContainer)); }
<td><?php echo $experiment->userConfigurationData->computationalResourceScheduling->queueName; ?> </td> </tr> <tr> <td><strong>Inputs</strong></td> <td><?php ExperimentUtilities::list_input_files($experiment->experimentInputs); ?> </td> </tr> <tr> <td><strong>Outputs</strong></td> <td><?php ExperimentUtilities::list_output_files($experiment->experimentOutputs, $experiment->experimentStatus->state, false); ?> </td> </tr> <!-- an experiment is editable only when it has not failed. otherwise, show errors. --> @if( $expVal["editable"] == false) <tr> <td><strong>Errors</strong></td> <td> @if( $experiment->errors != null) @foreach( (array)$experiment->errors as $error) {{ $error->actualErrorMessage }} @endforeach @endif </td> </tr>
<div class="container" style="max-width: 80%;"> <form action="{{URL::to('/')}}/experiment/browse" method="post" class="form-inline" role="form"> <div class="panel panel-default"> <div class="panel-heading"> <h3>Search for Experiments</h3> </div> <div class="panel-body"> <div class="form-group"> <label for="search-key">Search by</label> <select class="form-control" name="search-key" id="search-key"> <?php // set up options for select input $values = array('experiment-name', 'experiment-description', 'application', 'creation-time'); $labels = array('Experiment Name', 'Experiment Description', 'Application', 'Creation Time'); $disabled = array('', '', '', ''); ExperimentUtilities::create_options($values, $labels, $disabled); ?> </select> </div> <div class="form-group search-text-block"> <label for="search-value">for</label> <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" value="<?php if (isset($_POST['search-value'])) { echo $_POST['search-value']; } ?> "> </div>
echo '<div class="table-responsive">'; echo '<table class="table">'; echo '<tr>'; echo '<th>Name</th>'; echo '<th>Application</th>'; echo '<th>Compute Resource</th>'; echo '<th>Last Modified Time</th>'; echo '<th>Experiment Status</th>'; // echo '<th>Job Status</th>'; echo '</tr>'; foreach ($experiments as $experiment) { $expValues = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectId), true); // $expValues["jobState"] = ExperimentUtilities::get_job_status($experiment); $applicationInterface = AppUtilities::get_application_interface($experiment->executionId); echo '<tr>'; echo '<td>'. $experiment->experimentName . '</td>'; echo "<td>$applicationInterface->applicationName</td>"; echo '<td>'; try { $cr = CRUtilities::get_compute_resource($experiment->userConfigurationData ->computationalResourceScheduling->resourceHostId); if (!empty($cr)) {