RCCE_FV.c.svn-base 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // Copyright 2010 Intel Corporation
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. #include "RCCE.h"
  17. #include <stdio.h>
  18. void print_dividers(void);
  19. int RCCE_APP(int argc, char **argv){
  20. RCCE_REQUEST req;
  21. int fdiv, fdiv_in, vlevel, ID;
  22. RCCE_init(&argc, &argv);
  23. if (argc==2) fdiv_in=atoi(*++argv);
  24. else return(0);
  25. ID = RCCE_ue();
  26. if (ID==RCCE_power_domain_master()) {
  27. if(RCCE_iset_power(fdiv_in, &req, &fdiv, &vlevel)) {
  28. printf("UE %d failed ISET_POWER %d\n", ID, fdiv_in);
  29. fflush(NULL);
  30. }
  31. else {
  32. printf("Requested fdiv: %d, actual fdiv, vlevel: %d, %d\n",
  33. fdiv_in, fdiv, vlevel);
  34. fflush(NULL);
  35. }
  36. if (RCCE_wait_power(&req)) {
  37. printf("UE %d failed WAIT_POWER %d\n", ID, fdiv_in);
  38. fflush(NULL);
  39. }
  40. }
  41. RCCE_barrier(&RCCE_COMM_WORLD);
  42. if (ID==0)print_dividers();
  43. RCCE_finalize();
  44. return(0);
  45. }